|
@@ -3206,7 +3206,7 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- List<Grp_DelegationInfo> grp_Delegations = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(a => a.IsDel == 0).OrderBy(a => a.Id, OrderByType.Desc).ToListAsync();
|
|
|
+ List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(a => a.IsDel == 0).OrderBy(a => a.Id, OrderByType.Desc).ToList();
|
|
|
List<Crm_DeleClient> crm_Deles = new List<Crm_DeleClient>();
|
|
|
if (dto.DiId == 0)
|
|
|
{
|
|
@@ -3238,17 +3238,37 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> invitationLetter(DecreasePaymentsListDto dto)
|
|
|
{
|
|
|
+ #region 参数验证
|
|
|
+
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, "请传入有效的DiId参数!"));
|
|
|
+ #endregion
|
|
|
+
|
|
|
try
|
|
|
{
|
|
|
Dictionary<string, string> transDic = new Dictionary<string, string>();
|
|
|
- List<Crm_DeleClient> crm_DeleClients = await _sqlSugar.Queryable<Crm_DeleClient>().Where(a => a.DiId == dto.DiId && a.IsDel == 0).ToListAsync();
|
|
|
+
|
|
|
+ string sql = string.Format(@"Select tcl.Id,tcl.DiId,temp.*,tcl.ShippingSpaceTypeId,tcl.ShippingSpaceSpecialNeeds,
|
|
|
+ tcl.HotelSpecialNeeds,tcl.MealSpecialNeeds,tcl.Remark
|
|
|
+ From Grp_TourClientList tcl
|
|
|
+ Left Join
|
|
|
+ (Select dc.Id As DcId,dc.LastName,dc.FirstName,dc.Pinyin,dc.Sex,ccom.CompanyFullName,dc.Job,
|
|
|
+ cc1.CertNo As IDCardNo,dc.Phone,dc.BirthDay,cc2.PassportType,cc2.CertNo As PassportNo,cc2.Country,
|
|
|
+ cc2.Area,cc2.IssueDt,cc2.ExpiryDt
|
|
|
+ From Crm_DeleClient dc
|
|
|
+ Left Join Crm_CustomerCompany ccom On dc.CrmCompanyId = ccom.Id And ccom.IsDel = 0
|
|
|
+ Left Join Crm_CustomerCert cc1 On dc.Id = cc1.DcId And cc1.SdId = 773 And cc1.IsDel = 0
|
|
|
+ Left Join Crm_CustomerCert cc2 On dc.Id = cc2.DcId And cc2.SdId = 774 And cc2.IsDel = 0
|
|
|
+ Where dc.IsDel = 0) temp
|
|
|
+ On temp.DcId =tcl.ClientId
|
|
|
+ Where tcl.IsDel = 0 And tcl.DiId = {0}", dto.DiId);
|
|
|
+ var datas = _sqlSugar.SqlQueryable<TourClientListDetailsView>(sql).ToList();
|
|
|
+
|
|
|
List<string> texts = new List<string>();
|
|
|
- if (crm_DeleClients.Count != 0)
|
|
|
+ if (datas.Count != 0)
|
|
|
{
|
|
|
-
|
|
|
- foreach (Crm_DeleClient item in crm_DeleClients)
|
|
|
+ foreach (TourClientListDetailsView item in datas)
|
|
|
{
|
|
|
-
|
|
|
if (!string.IsNullOrWhiteSpace(item.Pinyin))
|
|
|
{
|
|
|
transDic.Add(item.LastName + item.FirstName, item.Pinyin);
|
|
@@ -3266,13 +3286,9 @@ namespace OASystem.API.Controllers
|
|
|
texts.Add(item.Job);
|
|
|
}
|
|
|
}
|
|
|
- if (item.CrmCompanyId != 0)
|
|
|
+ if (!string.IsNullOrEmpty(item.CompanyFullName))
|
|
|
{
|
|
|
- Crm_CustomerCompany crm_Customer = await _sqlSugar.Queryable<Crm_CustomerCompany>().FirstAsync(a => a.Id == item.CrmCompanyId && a.IsDel == 0);
|
|
|
- if (!transDic.ContainsKey(crm_Customer.CompanyFullName))
|
|
|
- {
|
|
|
- texts.Add(crm_Customer.CompanyFullName);
|
|
|
- }
|
|
|
+ texts.Add(item.CompanyFullName);
|
|
|
}
|
|
|
}
|
|
|
List<TranslateResult> transData = _airTicketResRep.ReTransBatch(texts, "en");
|
|
@@ -3287,10 +3303,10 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<guestList> list = new List<guestList>();
|
|
|
- foreach (Crm_DeleClient dele in crm_DeleClients)
|
|
|
+ List<GuestList> list = new List<GuestList>();
|
|
|
+ foreach (TourClientListDetailsView dele in datas)
|
|
|
{
|
|
|
- guestList guestList = new guestList();
|
|
|
+ GuestList guestList = new GuestList();
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dele.Pinyin))
|
|
|
{
|
|
@@ -3310,10 +3326,11 @@ namespace OASystem.API.Controllers
|
|
|
guestList.Sex = "Female";
|
|
|
}
|
|
|
guestList.DOB = dele.BirthDay.Replace('-', '.');
|
|
|
- Crm_CustomerCompany crm_Customer = await _sqlSugar.Queryable<Crm_CustomerCompany>().FirstAsync(a => a.Id == dele.CrmCompanyId && a.IsDel == 0);
|
|
|
- string jobName = transDic.Where(s => s.Key == crm_Customer.CompanyFullName).FirstOrDefault().Value + " " + transDic.Where(s => s.Key == dele.Job).FirstOrDefault().Value;
|
|
|
+ if (!string.IsNullOrEmpty(dele.Job))
|
|
|
+ {
|
|
|
+ guestList.Job = dele.Job;
|
|
|
+ }
|
|
|
|
|
|
- guestList.Job = jobName;
|
|
|
list.Add(guestList);
|
|
|
}
|
|
|
|
|
@@ -3345,7 +3362,6 @@ namespace OASystem.API.Controllers
|
|
|
builder.Write(list[i].Job.ToString());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//删除多余行
|
|
|
while (tableOne.Rows.Count > list.Count + 1)
|
|
|
{
|
|
@@ -3356,17 +3372,17 @@ namespace OASystem.API.Controllers
|
|
|
string filePath = fileDir + $@"商邀相关文件/{fileName}";
|
|
|
doc.Save(filePath);
|
|
|
string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/GrpFile/商邀相关文件" + fileName;
|
|
|
- return Ok(JsonView(true, "成功!", Url));
|
|
|
+ return Ok(JsonView(true, "操作成功!", Url));
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return Ok(JsonView(false, "失败,该团组没有客户名单!"));
|
|
|
+ return Ok(JsonView(false, "该团组客户名单暂未录入!"));
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- return Ok(JsonView(false, "程序错误!"));
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
throw;
|
|
|
}
|
|
|
}
|
|
@@ -6847,19 +6863,19 @@ namespace OASystem.API.Controllers
|
|
|
_ModuleSubPromptInfo.AddRange(
|
|
|
_GroupCostsTypeData.Select(it => new
|
|
|
{
|
|
|
- Date = it.Date,
|
|
|
- CarFee = (it.CarCost + it.CFM + it.CFOF) * _rate * _scale,
|
|
|
- GuideFee = (it.TGS + it.TGOF + it.TGM+ it.TGA + it.TGTF + it.TGEF) * _rate * _scale,
|
|
|
- MealFee = (it.B + it.L + it.D) * _rate * _scale,
|
|
|
- TicketFee = it.EF * _rate * _scale,
|
|
|
- TipFee = (it.TGTips + it.DRVTips) * _rate * _scale,
|
|
|
+ Date = it.Date, //日期
|
|
|
+ CarFee = (it.CarCost + it.CFM + it.CFOF) * _rate * _scale, //车费用
|
|
|
+ GuideFee = (it.TGS + it.TGOF + it.TGM+ it.TGA + it.TGTF + it.TGEF) * _rate * _scale, //导游费用
|
|
|
+ MealFee = (it.B + it.L + it.D) * _rate * _scale, //餐食费
|
|
|
+ TicketFee = it.EF * _rate * _scale, //门票费
|
|
|
+ TipFee = (it.TGTips + it.DRVTips) * _rate * _scale, //小费
|
|
|
AirportTransferFee = 0.00M,
|
|
|
- DrinksSnacksFruitFee = it.B_R_F * _rate * _scale,
|
|
|
- TravelSupplies = it.TE * _rate * _scale,
|
|
|
- LeadersFee = it.TLF * _rate * _scale,
|
|
|
+ DrinksSnacksFruitFee = it.B_R_F * _rate * _scale, //饮料零食水果
|
|
|
+ TravelSupplies = it.TE * _rate * _scale, //出行物资
|
|
|
+ LeadersFee = it.TLF * _rate * _scale, //领队费
|
|
|
CarFee1 = it.CarCost * _rate * _scale,
|
|
|
- CarType = it.CarType,
|
|
|
- SpentCash = it.PC * _rate * _scale,
|
|
|
+ CarType = it.CarType, //车型
|
|
|
+ SpentCash = it.PC * _rate * _scale, //零用金
|
|
|
})
|
|
|
);
|
|
|
|