|
|
@@ -2708,7 +2708,7 @@ FROM
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 团组合同下载(1.付款80% 2.付全款)
|
|
|
+ /// 团组合同下载(1.付款80% 2.付全款 政府团 ---- 3.企业团-出访前结算合同 4.政府团-预付款及尾款结算 5.政府团-归国后结算 6.政府团-出访前结算)
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
@@ -2814,7 +2814,8 @@ FROM
|
|
|
.Where(x => x.DiId == dto.GroupId && x.IsDel == 0)
|
|
|
.ToListAsync();
|
|
|
|
|
|
- if (!blackCodeList.Any())
|
|
|
+ var blackType = new List<int>() { 1, 2 };
|
|
|
+ if (!blackCodeList.Any() && blackType.Contains(dto.FileType))
|
|
|
{
|
|
|
jw.Msg = "该团无机票行程代码!";
|
|
|
return Ok(jw);
|
|
|
@@ -2933,7 +2934,7 @@ FROM
|
|
|
|
|
|
Document doc = null;
|
|
|
var percentage = 0.8M;
|
|
|
- var fileNameadd = "预付";
|
|
|
+ var fileNameadd = "预付版本合同文件";
|
|
|
|
|
|
if (dto.FileType == 1)
|
|
|
{
|
|
|
@@ -2943,7 +2944,31 @@ FROM
|
|
|
{
|
|
|
doc = new Document($"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Template/团组合同全款无表格.doc");
|
|
|
percentage = 1;
|
|
|
- fileNameadd = "全款";
|
|
|
+ fileNameadd = "全款版本合同文件";
|
|
|
+ }
|
|
|
+ else if (dto.FileType == 3)
|
|
|
+ {
|
|
|
+ doc = new Document($"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Template/企业合同模板.doc");
|
|
|
+ percentage = 1;
|
|
|
+ fileNameadd = "企业团-出访前结算合同";
|
|
|
+ }
|
|
|
+ else if (dto.FileType == 4)
|
|
|
+ {
|
|
|
+ doc = new Document($"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Template/出访考察协议模版-预付款及尾款结算.doc");
|
|
|
+ percentage = 0.85M;
|
|
|
+ fileNameadd = "政府团-预付款及尾款结算合同";
|
|
|
+ }
|
|
|
+ else if (dto.FileType == 5)
|
|
|
+ {
|
|
|
+ doc = new Document($"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Template/出访考察协议模版-归国后结算.doc");
|
|
|
+ percentage = 1M;
|
|
|
+ fileNameadd = "政府团-归国后结算合同";
|
|
|
+ }
|
|
|
+ else if (dto.FileType == 6)
|
|
|
+ {
|
|
|
+ doc = new Document($"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Template/出访考察协议模板(出访前结算).doc");
|
|
|
+ percentage = 1M;
|
|
|
+ fileNameadd = "政府团-出访前结算合同";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -3029,6 +3054,7 @@ FROM
|
|
|
bookMarkDic.Add("TotalPrice", (totalPrice).ToString("#0.00"));
|
|
|
bookMarkDic.Add("TotalPrice1", (totalPrice * percentage).ToString("#0.00"));
|
|
|
bookMarkDic.Add("TotalPriceChinese", decimal.Parse((totalPrice * percentage).ToString("#0.00")).ConvertCNYUpper());
|
|
|
+ bookMarkDic.Add("TotalPriceUp", decimal.Parse((totalPrice * percentage).ToString("#0.00")).ConvertCNYUpper());
|
|
|
|
|
|
//--合同表格部分
|
|
|
bookMarkDic.Add("TimeNowDate", DateTime.Now.ToString("yyyy年MM月dd日"));
|
|
|
@@ -3348,7 +3374,7 @@ FROM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- string savePaht = $"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Export/{di.TeamName}_{fileNameadd}版本合同文件.doc";
|
|
|
+ string savePaht = $"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Export/{di.TeamName}_{fileNameadd}.doc";
|
|
|
doc.Save(savePaht);
|
|
|
|
|
|
jw.Msg = "生成成功!";
|
|
|
@@ -3357,6 +3383,87 @@ FROM
|
|
|
return Ok(jw);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 会务团
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public async Task<IActionResult> DownGroupContractConferenceFile(DownGroupContractFileDto dto)
|
|
|
+ {
|
|
|
+ var jw = JsonView(false);
|
|
|
+
|
|
|
+ var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.Id == dto.GroupId)
|
|
|
+ .FirstAsync();
|
|
|
+ if (groupInfo == null)
|
|
|
+ {
|
|
|
+ jw.Msg = "团组信息不存在!";
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ var GroupPrice = 0.00M;
|
|
|
+ string VisitCountry = Regex.Replace(groupInfo.VisitCountry, @"[|-]", "、"); ;
|
|
|
+
|
|
|
+ GroupPrice = _sqlSugar.Queryable<Grp_ConferenceAffairsCost>()
|
|
|
+ .First(x => x.Diid == dto.GroupId && x.IsDel == 0)?.BaoJiaAll ?? 0.00M;
|
|
|
+
|
|
|
+ Dictionary<string, string> bookMarkDic = new Dictionary<string, string>();
|
|
|
+ bookMarkDic.Add("UpGroupPrice", GeneralMethod.ConvertCNYUpper(GroupPrice.ToString("F2").ObjToDecimal()));
|
|
|
+ bookMarkDic.Add("ClientUnit", groupInfo.ClientUnit);
|
|
|
+ bookMarkDic.Add("GroupPrice", GroupPrice.ToString("F2"));
|
|
|
+ bookMarkDic.Add("VisitCountry", VisitCountry);
|
|
|
+ bookMarkDic.Add("VisitPNumber", groupInfo.VisitPNumber.ToString());
|
|
|
+ bookMarkDic.Add("VisitStartDate", groupInfo.VisitStartDate.ToString("yyyy年MM月dd日"));
|
|
|
+ bookMarkDic.Add("StartYear", groupInfo.VisitStartDate.Year.ToString());
|
|
|
+ bookMarkDic.Add("EndYear", groupInfo.VisitEndDate.Year.ToString());
|
|
|
+ bookMarkDic.Add("StartMonth", groupInfo.VisitStartDate.Month.ToString());
|
|
|
+ bookMarkDic.Add("EndMonth", groupInfo.VisitEndDate.Month.ToString());
|
|
|
+ bookMarkDic.Add("StartDay", groupInfo.VisitStartDate.Day.ToString());
|
|
|
+ bookMarkDic.Add("EndDay", groupInfo.VisitEndDate.Day.ToString());
|
|
|
+ bookMarkDic.Add("GroupPrice1", (GroupPrice * 0.80M).ToString("F2"));
|
|
|
+ bookMarkDic.Add("GroupPrice2", (GroupPrice * 0.20M).ToString("F2"));
|
|
|
+ bookMarkDic.Add("UpGroupPrice1", GeneralMethod.ConvertCNYUpper((GroupPrice * 0.80M).ToString("F2").ObjToDecimal()));
|
|
|
+ bookMarkDic.Add("UpGroupPrice2", GeneralMethod.ConvertCNYUpper((GroupPrice * 0.20M).ToString("F2").ObjToDecimal()));
|
|
|
+
|
|
|
+ var underlineFont = new List<String>{
|
|
|
+ "ClientUnit",
|
|
|
+ "VisitStartDate"
|
|
|
+ };
|
|
|
+
|
|
|
+ var doc = new Document($"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Template/会务合同模板.doc");
|
|
|
+ var builder = new DocumentBuilder(doc);
|
|
|
+ foreach (var bookmarkName in bookMarkDic.Keys)
|
|
|
+ {
|
|
|
+ Bookmark bookmark = doc.Range.Bookmarks[bookmarkName];
|
|
|
+ if (bookmark == null)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ builder.MoveTo(bookmark.BookmarkStart);
|
|
|
+ if (underlineFont.Contains(bookmarkName))
|
|
|
+ {
|
|
|
+ builder.Font.Underline = Aspose.Words.Underline.Single;
|
|
|
+ }
|
|
|
+
|
|
|
+ builder.Write(bookMarkDic[bookmarkName]);
|
|
|
+ if (underlineFont.Contains(bookmarkName))
|
|
|
+ {
|
|
|
+ builder.Font.ClearFormatting();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ string savePaht = $"{AppSettingsHelper.Get("WordBasePath")}GroupContractFile/Export/{groupInfo.TeamName}_会务服务合同.doc";
|
|
|
+ doc.Save(savePaht);
|
|
|
+
|
|
|
+ jw.Msg = "生成成功!";
|
|
|
+ jw.Code = 200;
|
|
|
+ jw.Data = new { Url = AppSettingsHelper.Get("WordBaseUrl") + savePaht.Replace(AppSettingsHelper.Get("WordBasePath"), AppSettingsHelper.Get("WordFtpPath")) };
|
|
|
+
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
static int FindMergeStartRowIndex(Table table, int rowIndex)
|
|
|
{
|
|
|
int index = rowIndex;
|