|
@@ -29,7 +29,7 @@ using Aspose.Words.Tables;
|
|
|
using Aspose.Words;
|
|
|
using System.Reflection;
|
|
|
|
|
|
-namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
+namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
public class AirTicketResRepository : BaseRepository<Grp_AirTicketReservations, Grp_AirTicketReservations>
|
|
|
{
|
|
@@ -44,7 +44,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
try
|
|
|
{
|
|
|
- Grp_AirTicketReservations grp_AirTicket = _sqlSugar.Queryable<Grp_AirTicketReservations>().First(a=>a.Id==dto.Id && a.IsDel==0);
|
|
|
+ Grp_AirTicketReservations grp_AirTicket = _sqlSugar.Queryable<Grp_AirTicketReservations>().First(a => a.Id == dto.Id && a.IsDel == 0);
|
|
|
if (grp_AirTicket == null)
|
|
|
{
|
|
|
return result = new Result() { Code = -1, Msg = "暂无数据" };
|
|
@@ -53,11 +53,15 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
{
|
|
|
Grp_CreditCardPayment grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == grp_AirTicket.Id && a.IsDel == 0);
|
|
|
if (grp_CreditCard == null) { return result = new Result() { Code = -1, Msg = "暂无数据" }; }
|
|
|
- return result = new Result() { Code = 0, Msg = "查询成功!",Data=new
|
|
|
+ return result = new Result()
|
|
|
{
|
|
|
- AirTicket= grp_AirTicket,
|
|
|
- CreditCard= grp_CreditCard,
|
|
|
- }
|
|
|
+ Code = 0,
|
|
|
+ Msg = "查询成功!",
|
|
|
+ Data = new
|
|
|
+ {
|
|
|
+ AirTicket = grp_AirTicket,
|
|
|
+ CreditCard = grp_CreditCard,
|
|
|
+ }
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -235,7 +239,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
{
|
|
|
#region 团组下拉框
|
|
|
|
|
|
-
|
|
|
+
|
|
|
List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 85).ToList();
|
|
|
|
|
|
string DiId = "";
|
|
@@ -262,7 +266,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
|
|
|
#region 其他下拉框查询
|
|
|
//舱位类型
|
|
|
- List<Sys_SetData> TicketClass = _sqlSugar.Queryable<Sys_SetData>().Where(a=>a.STid==44 && a.IsDel==0).ToList();
|
|
|
+ List<Sys_SetData> TicketClass = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 44 && a.IsDel == 0).ToList();
|
|
|
List<SetDataInfoView> _TicketClassa = _mapper.Map<List<SetDataInfoView>>(TicketClass);
|
|
|
//支付方式
|
|
|
List<Sys_SetData> Payment = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 14 && a.IsDel == 0).ToList();
|
|
@@ -271,7 +275,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
List<Sys_SetData> CardType = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 15 && a.IsDel == 0).ToList();
|
|
|
List<SetDataInfoView> _CardType = _mapper.Map<List<SetDataInfoView>>(CardType);
|
|
|
//合作方资料
|
|
|
- List<Res_AirTicketAgent> _AirTicketAgents = _sqlSugar.Queryable<Res_AirTicketAgent>().Where(a=>a.IsDel == 0).ToList();
|
|
|
+ List<Res_AirTicketAgent> _AirTicketAgents = _sqlSugar.Queryable<Res_AirTicketAgent>().Where(a => a.IsDel == 0).ToList();
|
|
|
|
|
|
#endregion
|
|
|
var data = new
|
|
@@ -280,9 +284,9 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
Payment = _Payment,
|
|
|
CardType = _CardType,
|
|
|
GroupName = grp_NameView,
|
|
|
- AirTicketAgents= _AirTicketAgents
|
|
|
+ AirTicketAgents = _AirTicketAgents
|
|
|
};
|
|
|
- return result = new Result() { Code = 0, Msg = "查询成功!", Data=data };
|
|
|
+ return result = new Result() { Code = 0, Msg = "查询成功!", Data = data };
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -299,7 +303,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
BeginTran();
|
|
|
int id = 0;
|
|
|
Grp_AirTicketReservations grp_AirTicket = _mapper.Map<Grp_AirTicketReservations>(dto.AirTicketResOpData);
|
|
|
- if (dto.Status==1)
|
|
|
+ if (dto.Status == 1)
|
|
|
{
|
|
|
string selectSql = string.Format(@"select * from Grp_AirTicketReservations where ClientName='{0}' and IsDel={1}"
|
|
|
, dto.AirTicketResOpData.ClientName, 0);
|
|
@@ -310,7 +314,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
}
|
|
|
else//不存在,可添加
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
id = await AddAsyncReturnId(grp_AirTicket);
|
|
|
if (id == 0)
|
|
|
{
|
|
@@ -321,14 +325,14 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
{
|
|
|
result = new Result() { Code = 0, Msg = "添加成功!" };
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
- if (result.Code==0)
|
|
|
+ if (result.Code == 0)
|
|
|
{
|
|
|
Grp_CreditCardPayment grp_CreditCard = _mapper.Map<Grp_CreditCardPayment>(dto.CardPaymentOpData);
|
|
|
//换算
|
|
|
- Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == grp_AirTicket.DIId && a.IsDel == 0 && a.CTable==85);
|
|
|
- if (_TeamRate!=null)
|
|
|
+ Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == grp_AirTicket.DIId && a.IsDel == 0 && a.CTable == 85);
|
|
|
+ if (_TeamRate != null)
|
|
|
{
|
|
|
if (grp_CreditCard.PaymentCurrency == 49)
|
|
|
{
|
|
@@ -353,18 +357,18 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
grp_CreditCard.DayRate = "1";
|
|
|
grp_CreditCard.RMBPrice = grp_CreditCard.PayMoney;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//判断是否超出成本
|
|
|
- Grp_GroupCostParameter _GroupCostParameter = _sqlSugar.Queryable<Grp_GroupCostParameter>().First(a => a.DiId == grp_AirTicket.DIId && a.IsDel==0);
|
|
|
- if (grp_AirTicket.CType==460)//经济舱
|
|
|
+ Grp_GroupCostParameter _GroupCostParameter = _sqlSugar.Queryable<Grp_GroupCostParameter>().First(a => a.DiId == grp_AirTicket.DIId && a.IsDel == 0);
|
|
|
+ if (grp_AirTicket.CType == 460)//经济舱
|
|
|
{
|
|
|
- if((Convert.ToDecimal(_GroupCostParameter.JJCCB)* Convert.ToDecimal(grp_AirTicket.ClientNum))> grp_CreditCard.RMBPrice)
|
|
|
+ if (Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
{
|
|
|
grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 3;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 0;
|
|
|
- grp_CreditCard.AuditGMDate = DateTime.Now;
|
|
|
- grp_CreditCard.IsPay = 1;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -373,20 +377,20 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
grp_CreditCard.ExceedBudget = b;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 21;
|
|
|
- grp_CreditCard.AuditGMDate =new DateTime();
|
|
|
- grp_CreditCard.IsPay = 1;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
- else if(grp_AirTicket.CType==458)
|
|
|
+ else if (grp_AirTicket.CType == 458)
|
|
|
{
|
|
|
- if ((Convert.ToDecimal(_GroupCostParameter.GWCB) * Convert.ToDecimal(grp_AirTicket.ClientNum)) > grp_CreditCard.RMBPrice)
|
|
|
+ if (Convert.ToDecimal(_GroupCostParameter.GWCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
{
|
|
|
grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 3;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 21;
|
|
|
- grp_CreditCard.AuditGMDate = DateTime.Now;
|
|
|
- grp_CreditCard.IsPay = 1;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -395,17 +399,17 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
grp_CreditCard.ExceedBudget = b;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 21;
|
|
|
- grp_CreditCard.AuditGMDate = new DateTime();
|
|
|
- grp_CreditCard.IsPay = 1;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
grp_CreditCard.CId = id;
|
|
|
grp_CreditCard.CTable = 85;
|
|
|
grp_CreditCard.PayPercentage = 100;
|
|
|
//查询上一次付款信息
|
|
|
- Grp_CreditCardPayment _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().OrderByDescending(x=>x.CreateUserId).First(a => a.DIId == grp_AirTicket.DIId && a.IsDel == 0 && a.IsPay==1);
|
|
|
+ Grp_CreditCardPayment _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().OrderByDescending(x => x.CreateUserId).First(a => a.DIId == grp_AirTicket.DIId && a.IsDel == 0 && a.IsPay == 1);
|
|
|
if (_CreditCardPayment != null)
|
|
|
{
|
|
|
grp_CreditCard.PayPercentageOld = _CreditCardPayment.PayPercentageOld;// 上次付款百分比 查询并计算最近一次
|
|
@@ -414,17 +418,17 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- grp_CreditCard.PayPercentageOld =0;// 上次付款百分比 查询并计算最近一次
|
|
|
- grp_CreditCard.PayThenMoneyOld =0;// 上次付款金额 查询上一次
|
|
|
- grp_CreditCard.UpdateDate =new DateTime();// 上次付款时间 查询上一次
|
|
|
+ grp_CreditCard.PayPercentageOld = 0;// 上次付款百分比 查询并计算最近一次
|
|
|
+ grp_CreditCard.PayThenMoneyOld = 0;// 上次付款金额 查询上一次
|
|
|
+ grp_CreditCard.UpdateDate = "";// 上次付款时间 查询上一次
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
id = await _sqlSugar.Insertable(grp_CreditCard).ExecuteReturnIdentityAsync();
|
|
|
if (id == 0)
|
|
|
{
|
|
|
RollbackTran();
|
|
|
return result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
CommitTran();
|
|
|
return result = new Result() { Code = 0, Msg = "添加成功!" };
|
|
@@ -434,10 +438,10 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
{
|
|
|
RollbackTran();
|
|
|
return result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
- else if (dto.Status==2)
|
|
|
+ else if (dto.Status == 2)
|
|
|
{
|
|
|
id = dto.AirTicketResOpData.Id;
|
|
|
|
|
@@ -461,13 +465,10 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
PriceDescription = dto.AirTicketResOpData.PriceDescription,
|
|
|
Remark = dto.AirTicketResOpData.Remark,
|
|
|
});
|
|
|
- if (!res)
|
|
|
- {
|
|
|
- result = new Result() { Code = -1, Msg = "修改失败!" };
|
|
|
- }
|
|
|
+ if (!res){result = new Result() { Code = -1, Msg = "修改失败!" }; }
|
|
|
else { result = new Result() { Code = 0, Msg = "修改成功!" }; }
|
|
|
-
|
|
|
- if (result.Code==0)
|
|
|
+
|
|
|
+ if (result.Code == 0)
|
|
|
{
|
|
|
//C表操作
|
|
|
Grp_CreditCardPayment grp_CreditCard = _mapper.Map<Grp_CreditCardPayment>(dto.CardPaymentOpData);
|
|
@@ -504,12 +505,12 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
Grp_GroupCostParameter _GroupCostParameter = _sqlSugar.Queryable<Grp_GroupCostParameter>().First(a => a.DiId == grp_AirTicket.DIId && a.IsDel == 0);
|
|
|
if (grp_AirTicket.CType == 460)//经济舱
|
|
|
{
|
|
|
- if ((Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum)) > grp_CreditCard.RMBPrice)
|
|
|
+ if (Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
{
|
|
|
grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 3;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 0;
|
|
|
- grp_CreditCard.AuditGMDate = DateTime.Now;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
grp_CreditCard.IsPay = 1;
|
|
|
}
|
|
|
else
|
|
@@ -519,19 +520,19 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
grp_CreditCard.ExceedBudget = b;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 21;
|
|
|
- grp_CreditCard.AuditGMDate = new DateTime();
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
grp_CreditCard.IsPay = 1;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
else if (grp_AirTicket.CType == 458)
|
|
|
{
|
|
|
- if ((Convert.ToDecimal(_GroupCostParameter.GWCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum)) > grp_CreditCard.RMBPrice)
|
|
|
+ if (Convert.ToDecimal(_GroupCostParameter.GWCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
{
|
|
|
grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 3;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 21;
|
|
|
- grp_CreditCard.AuditGMDate = DateTime.Now;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
grp_CreditCard.IsPay = 1;
|
|
|
}
|
|
|
else
|
|
@@ -541,7 +542,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
grp_CreditCard.ExceedBudget = b;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 21;
|
|
|
- grp_CreditCard.AuditGMDate = new DateTime();
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
grp_CreditCard.IsPay = 1;
|
|
|
}
|
|
|
}
|
|
@@ -562,9 +563,9 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
{
|
|
|
grp_CreditCard.PayPercentageOld = 0;// 上次付款百分比 查询并计算最近一次
|
|
|
grp_CreditCard.PayThenMoneyOld = 0;// 上次付款金额 查询上一次
|
|
|
- grp_CreditCard.UpdateDate = new DateTime();// 上次付款时间 查询上一次
|
|
|
+ grp_CreditCard.UpdateDate = "";// 上次付款时间 查询上一次
|
|
|
}
|
|
|
- int CTable=await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.Id == dto.CardPaymentOpData.Id).SetColumns(a => new Grp_CreditCardPayment
|
|
|
+ int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.Id == dto.CardPaymentOpData.Id).SetColumns(a => new Grp_CreditCardPayment
|
|
|
{
|
|
|
PayDId = grp_CreditCard.PayDId,
|
|
|
ConsumptionPatterns = grp_CreditCard.ConsumptionPatterns,
|
|
@@ -638,12 +639,12 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
c.Payee,a.PriceDescription,(select Name from Sys_SetData where Id=a.Currency) as 'CurrencyStr',(select Name from Sys_SetData where Id=c.CTDId) as BankType
|
|
|
from Grp_AirTicketReservations a,Grp_CreditCardPayment c ,Grp_DelegationInfo d where a.id=c.CId and d.Id=a.DIId and a.isdel=0
|
|
|
and a.DIId={0} Order By a.CreateTime desc", dto.DiId, 0);
|
|
|
- List<AirTicketReservationsPayView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsPayView>(sql).ToList();
|
|
|
+ List<AirTicketReservationsPayView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsPayView>(sql).ToList();
|
|
|
if (_AirTicketReservations.Count != 0)
|
|
|
{
|
|
|
- Grp_DelegationInfo grp_Delegation =_sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id ==dto.DiId && a.IsDel==0);
|
|
|
- Sys_Users _Users= _sqlSugar.Queryable<Sys_Users>().First(a => a.Id ==dto.UserId && a.IsDel == 0);
|
|
|
- return result = new Result() { Code = 0, Msg = "成功", Data = new { Delegation = grp_Delegation, AirTicketRes = _AirTicketReservations, Users=_Users } };
|
|
|
+ Grp_DelegationInfo grp_Delegation = _sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id == dto.DiId && a.IsDel == 0);
|
|
|
+ Sys_Users _Users = _sqlSugar.Queryable<Sys_Users>().First(a => a.Id == dto.UserId && a.IsDel == 0);
|
|
|
+ return result = new Result() { Code = 0, Msg = "成功", Data = new { Delegation = grp_Delegation, AirTicketRes = _AirTicketReservations, Users = _Users } };
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -666,7 +667,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
as 'CurrencyStr' from Grp_AirTicketReservations a,Grp_CreditCardPayment c where a.id=c.CId and a.isdel={1}
|
|
|
and a.DIId={0} Order By a.CreateTime desc", dto.DiId, 0);
|
|
|
List<AirTicketReservationsView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsView>(sql).ToList();
|
|
|
- if (_AirTicketReservations.Count==0)
|
|
|
+ if (_AirTicketReservations.Count == 0)
|
|
|
{
|
|
|
return result = new Result() { Code = -1, Msg = "暂无数据", Data = null };
|
|
|
}
|
|
@@ -705,7 +706,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
Qtext = Qtext.Substring(0, Qtext.Length - 1);
|
|
|
}
|
|
|
|
|
|
- Dictionary<String, String> dic = new Dictionary<String, String>();
|
|
|
+ Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
|
|
|
string url = "https://openapi.youdao.com/v2/api";
|
|
|
|
|
@@ -776,7 +777,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
- protected string TransSync(string url, Dictionary<String, String> dic)
|
|
|
+ protected string TransSync(string url, Dictionary<string, string> dic)
|
|
|
{
|
|
|
string result = "";
|
|
|
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
|
@@ -833,7 +834,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
{
|
|
|
if (File.Exists(FilePath))
|
|
|
File.Delete(FilePath);
|
|
|
- Stream outStream =File.Create(FilePath);
|
|
|
+ Stream outStream = File.Create(FilePath);
|
|
|
Stream inStream = response.GetResponseStream();
|
|
|
|
|
|
int l;
|
|
@@ -856,8 +857,8 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
}
|
|
|
protected static string ComputeHash(string input, HashAlgorithm algorithm)
|
|
|
{
|
|
|
- Byte[] inputBytes = Encoding.UTF8.GetBytes(input);
|
|
|
- Byte[] hashedBytes = algorithm.ComputeHash(inputBytes);
|
|
|
+ byte[] inputBytes = Encoding.UTF8.GetBytes(input);
|
|
|
+ byte[] hashedBytes = algorithm.ComputeHash(inputBytes);
|
|
|
return BitConverter.ToString(hashedBytes).Replace("-", "");
|
|
|
}
|
|
|
protected static string Truncate(string q)
|
|
@@ -867,7 +868,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
return null;
|
|
|
}
|
|
|
int len = q.Length;
|
|
|
- return len <= 20 ? q : (q.Substring(0, 10) + len + q.Substring(len - 10, 10));
|
|
|
+ return len <= 20 ? q : q.Substring(0, 10) + len + q.Substring(len - 10, 10);
|
|
|
}
|
|
|
public static DateTime GetBeijingTime()
|
|
|
{
|
|
@@ -912,6 +913,9 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public class TranslateResult
|
|
|
{
|
|
|
public string Query { get; set; }
|
|
@@ -921,7 +925,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
public string Type { get; set; }
|
|
|
|
|
|
public string VerifyResult { get; set; }
|
|
|
-
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|