|
@@ -4232,18 +4232,20 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
//总计
|
|
|
decimal allPrice = dac1totalPrice + dac2totalPrice + _EnterExitCosts.Visa + _EnterExitCosts.Safe + _EnterExitCosts.Ticket;
|
|
|
-
|
|
|
+
|
|
|
//国际旅费
|
|
|
|
|
|
string outsideJJ = "";
|
|
|
string allPriceJJ = "";
|
|
|
- if (_EnterExitCosts.SumJJC == 1) {
|
|
|
+ if (_EnterExitCosts.SumJJC == 1)
|
|
|
+ {
|
|
|
outsideJJ = string.Format(@"经济舱:{0} 元/人", _EnterExitCosts.OutsideJJPay.ToString("#0.00"));
|
|
|
allPriceJJ = string.Format(@"经济舱:{0} 元/人", (allPrice + _EnterExitCosts.OutsideJJPay).ToString("#0.00"));
|
|
|
}
|
|
|
string outsideGW = "";
|
|
|
string allPriceGW = "";
|
|
|
- if (_EnterExitCosts.SumGWC == 1) {
|
|
|
+ if (_EnterExitCosts.SumGWC == 1)
|
|
|
+ {
|
|
|
outsideGW = string.Format(@"公务舱:{0} 元/人", _EnterExitCosts.OutsaideGWPay.ToString("#0.00"));
|
|
|
allPriceGW = string.Format(@"公务舱:{0} 元/人", (allPrice + _EnterExitCosts.OutsaideGWPay).ToString("#0.00"));
|
|
|
}
|
|
@@ -4493,6 +4495,181 @@ namespace OASystem.API.Controllers
|
|
|
string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
|
|
|
return Ok(JsonView(true, "成功", new { Url = url }));
|
|
|
}
|
|
|
+ else if (dto.SubTypeId == 1066) //成都市因公临时出国任务和预算审批意见表(外专培训团专用)
|
|
|
+ {
|
|
|
+ //获取模板
|
|
|
+ string tempPath = (AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/Temp/成都市因公临时出国任务和预算审批意见表.docx");
|
|
|
+ //载入模板
|
|
|
+ Document doc = new Document(tempPath);
|
|
|
+
|
|
|
+ DocumentBuilder builder = new DocumentBuilder(doc);
|
|
|
+
|
|
|
+ Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
+
|
|
|
+ dic.Add("GroupName", _DelegationInfo.TeamName);
|
|
|
+ dic.Add("ClientUnit", _DelegationInfo.ClientUnit);
|
|
|
+
|
|
|
+ string missionLeader = ""; //团负责人默认接团客户名单第一个人
|
|
|
+ string missionLeaderJob = "";//负责人job
|
|
|
+ int groupNumber = 0; //团人数
|
|
|
+ if (DeleClientList.Count > 0)
|
|
|
+ {
|
|
|
+ missionLeader = DeleClientList[0]?.Name ?? "";
|
|
|
+ missionLeaderJob = DeleClientList[0]?.Job ?? "";
|
|
|
+ }
|
|
|
+ dic.Add("MissionLeader", missionLeader); //团负责人
|
|
|
+ dic.Add("MissionLeaderJob", missionLeaderJob); //团负责人job
|
|
|
+ dic.Add("GroupNumber", _DelegationInfo.VisitPNumber.ToString()); //团人数
|
|
|
+
|
|
|
+ if (blackCode != null && !string.IsNullOrWhiteSpace(blackCode.BlackCode))
|
|
|
+ {
|
|
|
+ List<string> list = new List<string>();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var spilitArr = Regex.Split(blackCode.BlackCode, "\r\n");
|
|
|
+ foreach (var item in spilitArr)
|
|
|
+ {
|
|
|
+ var spDotandEmpty = item.Split('.')[1].Split(' ').Where(x => !string.IsNullOrEmpty(x)).ToList();
|
|
|
+ var depCode = spDotandEmpty[2].Substring(0, 3);
|
|
|
+ var arrCode = spDotandEmpty[2].Substring(3, 3);
|
|
|
+ string depName = threeCodes.Find(it => it.Three.Equals(depCode)).City,
|
|
|
+ arrName = threeCodes.Find(it => it.Three.Equals(arrCode)).City;
|
|
|
+
|
|
|
+ list.Add(depName);
|
|
|
+ list.Add(arrName);
|
|
|
+ }
|
|
|
+
|
|
|
+ list = list.Distinct().ToList();
|
|
|
+ dic.Add("ReturnCode", string.Join("-", list).TrimEnd('-'));
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ dic.Add("ReturnCode", "行程录入不正确!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dic.Add("ReturnCode", "未录入行程!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //dic.Add("ReturnCodeAir", dic["ReturnCode"]);
|
|
|
+ //dic.Add("VisitStartDate", _DelegationInfo.VisitStartDate.ToString("yyyy年MM月dd日"));
|
|
|
+ //dic.Add("VisitEndDate", _DelegationInfo.VisitEndDate.ToString("yyyy年MM月dd日"));
|
|
|
+
|
|
|
+ if (dic.ContainsKey("VisitStartDate") && dic.ContainsKey("VisitEndDate"))
|
|
|
+ {
|
|
|
+ TimeSpan sp = _DelegationInfo.VisitEndDate.Subtract(_DelegationInfo.VisitStartDate);
|
|
|
+ dic.Add("Day", sp.Days.ToString());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ dic.Add("CultivateDay", dac4.Count.ToString()); //培训天数
|
|
|
+ // dic.Add("VisitCountry", _DelegationInfo.VisitCountry);
|
|
|
+
|
|
|
+ NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
|
|
|
+ Aspose.Words.Tables.Table table1 = allTables[0] as Aspose.Words.Tables.Table;
|
|
|
+
|
|
|
+ //培训人员名单
|
|
|
+ int cultivateRowIndex = 7;
|
|
|
+ foreach (var item in DeleClientList)
|
|
|
+ {
|
|
|
+ builder.MoveToCell(0, cultivateRowIndex, 0, 0);
|
|
|
+ builder.Write(item.Name);
|
|
|
+ builder.MoveToCell(0, cultivateRowIndex, 1, 0);
|
|
|
+ builder.Write(item.Sex == 0 ? "男" : item.Sex == 1 ? "女" : "");
|
|
|
+
|
|
|
+ builder.MoveToCell(0, cultivateRowIndex, 2, 0);
|
|
|
+
|
|
|
+ string birthDay = "";
|
|
|
+ if (!string.IsNullOrEmpty(item.Birthday))
|
|
|
+ {
|
|
|
+ var isDt = DateTime.TryParse(item.Birthday, out DateTime dt);
|
|
|
+ if (isDt)
|
|
|
+ {
|
|
|
+ birthDay = $"{dt.Year}.{dt.Month}";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ builder.Write(birthDay);
|
|
|
+
|
|
|
+ builder.MoveToCell(0, cultivateRowIndex, 3, 0);
|
|
|
+ builder.Write(item.Company);
|
|
|
+
|
|
|
+ builder.MoveToCell(0, cultivateRowIndex, 4, 0);
|
|
|
+ builder.Write(item.Job);
|
|
|
+
|
|
|
+ cultivateRowIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+ //删除多余行
|
|
|
+ //cultivateRowIndex -= 2;
|
|
|
+ int delRows = 10 + 7 - cultivateRowIndex;
|
|
|
+ if (delRows > 0)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < delRows; i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ table1.Rows.RemoveAt(cultivateRowIndex);
|
|
|
+ //cultivateRowIndex++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ decimal hotelFeeTotal = dac1.Sum(it => it.SubTotal);//住宿费
|
|
|
+ dic.Add("HotelFeeTotal", hotelFeeTotal.ToString("#0.00"));
|
|
|
+ decimal mealsFeeTotal = dac2.Sum(it => it.SubTotal);//伙食费
|
|
|
+ dic.Add("MealsFeeTotal", mealsFeeTotal.ToString("#0.00"));
|
|
|
+ decimal miscellaneousFeeTotal = dac3.Sum(it => it.SubTotal);//公杂费
|
|
|
+ dic.Add("MiscellaneousFeeTotal", miscellaneousFeeTotal.ToString("#0.00"));
|
|
|
+ decimal trainingFeeTotal = dac4.Sum(it => it.SubTotal);//培训费
|
|
|
+ dic.Add("TrainingFeeTotal", trainingFeeTotal.ToString("#0.00"));
|
|
|
+ decimal cityTranfficFeeToatal = _EnterExitCosts.CityTranffic; //城市区间交通费
|
|
|
+ dic.Add("CityTranfficFeeToatal", cityTranfficFeeToatal.ToString("#0.00"));//
|
|
|
+ //其他费用
|
|
|
+ decimal otherFeeTotal = _EnterExitCosts.Visa + _EnterExitCosts.Safe + _EnterExitCosts.Ticket + _EnterExitCosts.YiMiao + _EnterExitCosts.HeSuan+ _EnterExitCosts.Service;
|
|
|
+ dic.Add("OtherFeeTotal", otherFeeTotal.ToString("#0.00"));
|
|
|
+
|
|
|
+ //其他费用合计
|
|
|
+ decimal _otherFeeTotal = hotelFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + trainingFeeTotal + cityTranfficFeeToatal + otherFeeTotal;
|
|
|
+
|
|
|
+ decimal _jjcFeeToatal = _EnterExitCosts.AirJJ + _otherFeeTotal; //经济舱
|
|
|
+ decimal _gwcFeeToatal = _EnterExitCosts.AirGW + _otherFeeTotal; //公务舱
|
|
|
+
|
|
|
+ //公务舱合计
|
|
|
+
|
|
|
+ //国际旅费
|
|
|
+
|
|
|
+ string outsideJJ = "";
|
|
|
+ string allPriceJJ = "";
|
|
|
+ if (_EnterExitCosts.SumJJC == 1 && _EnterExitCosts.SumGWC == 0)
|
|
|
+ {
|
|
|
+ dic.Add("AirFeeTotal", _EnterExitCosts.AirJJ.ToString("#0.00"));
|
|
|
+ dic.Add("FeeTotal", _jjcFeeToatal.ToString("#0.00"));
|
|
|
+ }
|
|
|
+ if (_EnterExitCosts.SumGWC == 1 && _EnterExitCosts.SumJJC == 0)
|
|
|
+ {
|
|
|
+ dic.Add("AirFeeTotal", _EnterExitCosts.AirGW.ToString("#0.00"));
|
|
|
+ dic.Add("FeeTotal", _gwcFeeToatal.ToString("#0.00"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_EnterExitCosts.SumJJC == 1 && _EnterExitCosts.SumGWC == 1)
|
|
|
+ {
|
|
|
+ string airFeeTotalStr = string.Format(@$"经济舱:{_EnterExitCosts.AirJJ.ToString("#0.00")} 公务舱:{_EnterExitCosts.AirGW.ToString("#0.00")}");
|
|
|
+ dic.Add("AirFeeTotal", airFeeTotalStr);
|
|
|
+ string feeTotalStr = string.Format(@$"经济舱:{_jjcFeeToatal.ToString("#0.00")} 公务舱:{_gwcFeeToatal.ToString("#0.00")}");
|
|
|
+ dic.Add("FeeTotal", feeTotalStr);
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (var key in dic.Keys)
|
|
|
+ {
|
|
|
+ builder.MoveToBookmark(key);
|
|
|
+ builder.Write(dic[key]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //模板文件名
|
|
|
+ string strFileName = $"{_DelegationInfo.TeamName}成都市因公临时出国任务和预算审批意见表(外专培训团专用).docx";
|
|
|
+ doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
|
|
|
+ string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
|
|
|
+ return Ok(JsonView(true, "成功", new { Url = url }));
|
|
|
+ }
|
|
|
}
|
|
|
else if (dto.ExportType == 2) //表格
|
|
|
{
|