|
|
@@ -121,6 +121,7 @@ namespace OASystem.API.Controllers
|
|
|
private readonly List<CurrencyInfo> _currencyInit;
|
|
|
private readonly List<int> _portTypeData;
|
|
|
private readonly TableOperationRecordRepository _tableorRep;
|
|
|
+ private readonly EnterExitCostDraftRepository _enterExitCostDraftRep;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 构造函数
|
|
|
@@ -198,7 +199,8 @@ namespace OASystem.API.Controllers
|
|
|
VisaCommissionRepository visaCommissionRep,
|
|
|
ForeignReceivablesRepository ffrRep,
|
|
|
OpinionaireRepository opinionaireRep,
|
|
|
- TableOperationRecordRepository tableorRep
|
|
|
+ TableOperationRecordRepository tableorRep,
|
|
|
+ EnterExitCostDraftRepository enterExitCostDraftRep
|
|
|
)
|
|
|
{
|
|
|
_logger = logger;
|
|
|
@@ -253,6 +255,7 @@ namespace OASystem.API.Controllers
|
|
|
};
|
|
|
_portTypeData = new List<int>() { 2, 3 };
|
|
|
_tableorRep = tableorRep;
|
|
|
+ _enterExitCostDraftRep = enterExitCostDraftRep;
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -7183,6 +7186,1279 @@ FROM
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region 团组经理模块 出入境费用-草稿
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-草稿 - 基础数据源(团组名称/币种类型)
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> EnterExitCostDraftDataSource(PortDtoBase dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var draftNameDatas = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>()
|
|
|
+ .Where(x => x.IsDel == 0)
|
|
|
+ .OrderByDescending(x => x.CreateTime)
|
|
|
+ .Select(x => new { x.Id, x.DraftName })
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ string sql = string.Format("Select * From Sys_SetData Where IsDel = 0");
|
|
|
+ //SetDataInfoView
|
|
|
+ var dataSource = await _sqlSugar.SqlQueryable<Sys_SetData>(sql).ToListAsync();
|
|
|
+
|
|
|
+ var currencyData = dataSource.Where(it => it.STid == 66).ToList(); //所有币种
|
|
|
+ var _CurrencyData = _mapper.Map<List<SetDataInfoView>>(currencyData);
|
|
|
+
|
|
|
+ var wordTypeData = dataSource.Where(it => it.STid == 72).ToList(); //三公费用-Word明细类型
|
|
|
+ var _WordTypeData = _mapper.Map<List<SetDataInfoView>>(wordTypeData);
|
|
|
+
|
|
|
+ var excelTypeData = dataSource.Where(it => it.STid == 73).ToList(); //三公费用-Excel明细类型
|
|
|
+ var _ExcelTypeData = _mapper.Map<List<SetDataInfoView>>(excelTypeData);
|
|
|
+
|
|
|
+ //默认币种显示
|
|
|
+ List<CurrencyInfo> _currencyInfos = new List<CurrencyInfo>()
|
|
|
+ {
|
|
|
+ new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 7.5000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 8.0000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 9.5000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0500M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.9500M },
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
|
|
|
+ if (_currencyRate.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var item in _currencyInfos)
|
|
|
+ {
|
|
|
+ var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
|
|
|
+ if (rateInfo != null)
|
|
|
+ {
|
|
|
+ decimal rate1 = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
|
|
|
+ rate1 *= 1.035M;
|
|
|
+
|
|
|
+ item.Rate = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "查询成功!", new
|
|
|
+ {
|
|
|
+ DraftNameDatas = draftNameDatas,
|
|
|
+ CurrencyData = _CurrencyData,
|
|
|
+ WordTypeData = _WordTypeData,
|
|
|
+ ExcelTypeData = _ExcelTypeData,
|
|
|
+ CurrencyInit = _currencyInfos
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-草稿
|
|
|
+ /// 实时汇率 tips
|
|
|
+ /// 签证费用 tips
|
|
|
+ /// 机票费用 tips
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> EnterExitCostDraftCorrelationTips(EnterExitCostDraftCorrelationTipsDto dto)
|
|
|
+ {
|
|
|
+ //var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(it => it.Id == dto.DiId && it.IsDel == 0);
|
|
|
+
|
|
|
+ //默认币种显示
|
|
|
+ var _currencyInfos = _currencyInit;
|
|
|
+
|
|
|
+ var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
|
|
|
+ List<dynamic> reteInfos = new List<dynamic>();
|
|
|
+ if (_currencyRate.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var item in _currencyInfos)
|
|
|
+ {
|
|
|
+ var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
|
|
|
+ if (rateInfo != null)
|
|
|
+ {
|
|
|
+ item.Rate = Convert.ToDecimal((Convert.ToDecimal(rateInfo.FSellPri == null ? 0.00M : rateInfo.FSellPri) / 100.00M).ToString("#0.0000"));
|
|
|
+
|
|
|
+ decimal rate1 = item.Rate;
|
|
|
+ rate1 *= 1.03M;
|
|
|
+
|
|
|
+ decimal rate2 = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
|
|
|
+
|
|
|
+ reteInfos.Add(new
|
|
|
+ {
|
|
|
+ currCode = item.CurrencyCode,
|
|
|
+ currName = item.CurrencyName,
|
|
|
+ rate = rate2,
|
|
|
+ lastUpdateDt = rateInfo.Date + " " + rateInfo.Time
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //var visaData = await _visaFeeInfoRep.EntryAndExitTips(dto.DiId);
|
|
|
+ //var airData = await _ticketBlackCodeRep.EntryAndExitTips(dto.DiId);
|
|
|
+ return Ok(JsonView(true, "查询成功!", new
|
|
|
+ {
|
|
|
+ //GroupNameData = groupNameData.Data,
|
|
|
+ //visaData = visaData.Data,
|
|
|
+ //airData = airData.Data,
|
|
|
+ reteInfos = reteInfos
|
|
|
+ }));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-草稿 - Info
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> EnterExitCostDraftInfobyDiId(EnterExitCostDraftInfobyDiIdDto dto)
|
|
|
+ {
|
|
|
+ return Ok(await _enterExitCostDraftRep.EnterExitCostDraftInfoById(dto));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-草稿 - Add And Update
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> EnterExitCostDraftOp(EnterExitCostDraftOpDto dto)
|
|
|
+ {
|
|
|
+ var data = await _enterExitCostDraftRep.EnterExitCostDraftOp(dto);
|
|
|
+
|
|
|
+ if (data.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, data.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ int sign = (int)data.Data.GetType().GetProperty("sign").GetValue(data.Data, null);
|
|
|
+ //汇率信息记录
|
|
|
+ await GeneralMethod.RateRecordSave(dto.UserId, sign, "出入境费用");
|
|
|
+
|
|
|
+ return Ok(JsonView(true, data.Msg, data.Data));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-草稿 - File downlaod
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> EnterExitCostDraftDownload(EnterExitCostDraftDownloadDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var id = dto.Id;
|
|
|
+
|
|
|
+ if (id < 1) return Ok(JsonView(400, "请传入有效的DiId参数;", ""));
|
|
|
+ if (dto.ExportType < 1) return Ok(JsonView(400, "请传入有效的ExportType参数; 1 明细表 2 表格", ""));
|
|
|
+ if (dto.SubTypeId < 1) return Ok(JsonView(400, @"请传入有效的SubTypeId参数;
|
|
|
+ 1 明细表 --> 1005(默认明细表) 1006(因公出国(境)经费测算明细表) 1007(四川省商务厅出国经费财政先行审核表)
|
|
|
+ 2 表格 --> 1008(派员单位出(境)任务和预算审批意见表) 1009(省级单位出(境)经费报销单)
|
|
|
+ 3 团组成员名单 1 团组成员名单", ""));
|
|
|
+
|
|
|
+ var _EnterExitCosts = _sqlSugar.Queryable<Grp_EnterExitCostDraft>().Where(it => it.IsDel == 0 && it.Id == id).OrderByDescending(x => x.CreateTime).First();
|
|
|
+ if (_EnterExitCosts == null) return Ok(JsonView(400, "未填写出入境费用-草稿;", ""));
|
|
|
+ var _DayAndCosts = _sqlSugar.Queryable<Grp_DayAndCostDraft>().Where(it => it.IsDel == 0 && it.ParentId == id).ToList();
|
|
|
+ var countryIds = _DayAndCosts.Select(x => x.NationalTravelFeeId).ToList();
|
|
|
+ var nationalTravelFeeData = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(it => it.IsDel == 0 && countryIds.Contains(it.Id)).ToList();
|
|
|
+
|
|
|
+ //数据源
|
|
|
+ var dac1 = _DayAndCosts.Where(it => it.Type == 1).ToList(); //住宿费
|
|
|
+ var dac2 = _DayAndCosts.Where(it => it.Type == 2).ToList(); //伙食费
|
|
|
+ var dac3 = _DayAndCosts.Where(it => it.Type == 3).ToList(); //公杂费
|
|
|
+ var dac4 = _DayAndCosts.Where(it => it.Type == 4).ToList(); //培训费
|
|
|
+ var dac5 = _sqlSugar.Queryable<Grp_DayOtherPriceDraft>()
|
|
|
+ .LeftJoin<Sys_SetData>((x, a) => a.IsDel == 0 && a.Id == x.SetDataId)
|
|
|
+ .LeftJoin<Sys_SetData>((x, a, b) => b.IsDel == 0 && b.Id == x.Currency)
|
|
|
+ .Where((x, a, b) => x.IsDel == 0 && x.ParentId == id)
|
|
|
+ .Select((x, a, b) => new
|
|
|
+ {
|
|
|
+ x.Index,
|
|
|
+ itemName = a.Name,
|
|
|
+ CurrencyStr = b.Name,
|
|
|
+ x.Cost,
|
|
|
+ x.SubTotal,
|
|
|
+ x.Remark
|
|
|
+ })
|
|
|
+ .OrderBy((x) => x.Index)
|
|
|
+ .ToList(); //其他款项费用
|
|
|
+
|
|
|
+ var _CurrDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0 && it.STid == 66).ToList();
|
|
|
+
|
|
|
+ var threeCodes = _sqlSugar.Queryable<Res_ThreeCode>().Where(it => it.IsDel == 0).ToList();
|
|
|
+ var placeData = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(it => it.IsDel == 0).ToList();
|
|
|
+ var rateDatas = await _EnterExitCosts.CurrencyRemark.SplitExchangeRate();
|
|
|
+
|
|
|
+ if (dto.ExportType == 1) //明细表
|
|
|
+ {
|
|
|
+ if (dto.SubTypeId == 1005) //1005(默认明细表)
|
|
|
+ {
|
|
|
+ //获取模板
|
|
|
+ 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>();
|
|
|
+
|
|
|
+ decimal stayFeeTotal = _EnterExitCosts.ChoiceThree == 1 ? _DayAndCosts.Where(it => it.Type == 1).Sum(it => it.SubTotal) : 0.00M; // 住宿费
|
|
|
+ decimal mealsFeeTotal = _EnterExitCosts.ChoiceFour == 1 ? _DayAndCosts.Where(it => it.Type == 2).Sum(it => it.SubTotal) : 0.00M; // 伙食费费
|
|
|
+ decimal miscellaneousFeeTotal = _EnterExitCosts.ChoiceFive == 1 ? _DayAndCosts.Where(it => it.Type == 3).Sum(it => it.SubTotal) : 0.00M; // 公杂费
|
|
|
+ decimal tainFeeTotal = _EnterExitCosts.ChoiceSix == 1 ? _DayAndCosts.Where(it => it.Type == 4).Sum(it => it.SubTotal) : 0.00M; // 培训费
|
|
|
+ decimal otherPriceTotal = _EnterExitCosts.OtherExpenses_Checked == 1 ? dac5.Sum(x => x.SubTotal) : 0.00M; //其他费用
|
|
|
+ decimal insidePayTotal = _EnterExitCosts.ChoiceOne == 1 ? _EnterExitCosts.InsidePay : 0.00M;
|
|
|
+
|
|
|
+ //境内费用(其他费用)
|
|
|
+ if (_EnterExitCosts.ChoiceOne == 1)
|
|
|
+ {
|
|
|
+ string row1_1 = "";
|
|
|
+ if (_EnterExitCosts.Visa > 0)
|
|
|
+ {
|
|
|
+ //insidePayTotal += _EnterExitCosts.Visa;
|
|
|
+ row1_1 = $"签证费: {_EnterExitCosts.Visa.ToString("#0.00")} 人民币/人";
|
|
|
+ if (!string.IsNullOrEmpty(_EnterExitCosts.VisaRemark))
|
|
|
+ {
|
|
|
+ row1_1 += $"\t签证费用描述: : {_EnterExitCosts.VisaRemark} 人民币/人";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ string row1_2 = "";
|
|
|
+ if (_EnterExitCosts.YiMiao > 0)
|
|
|
+ {
|
|
|
+ //insidePayTotal += _EnterExitCosts.YiMiao;
|
|
|
+ row1_2 += $"疫苗费:{_EnterExitCosts.YiMiao.ToString("#0.00")} 人民币/人";
|
|
|
+ }
|
|
|
+ if (_EnterExitCosts.HeSuan > 0)
|
|
|
+ {
|
|
|
+ //insidePayTotal += _EnterExitCosts.HeSuan;
|
|
|
+ row1_2 += $"核酸检测费:{_EnterExitCosts.HeSuan.ToString("#0.00")} 人民币/人";
|
|
|
+ }
|
|
|
+ if (_EnterExitCosts.Service > 0)
|
|
|
+ {
|
|
|
+ //insidePayTotal += _EnterExitCosts.Service;
|
|
|
+ row1_2 += $"服务费:{_EnterExitCosts.Service.ToString("#0.00")} 人民币/人";
|
|
|
+ }
|
|
|
+
|
|
|
+ string row1_3 = "";
|
|
|
+ if (_EnterExitCosts.Safe > 0)
|
|
|
+ {
|
|
|
+ //insidePayTotal += _EnterExitCosts.Safe;
|
|
|
+ row1_3 += $"保险费:{_EnterExitCosts.Safe.ToString("#0.00")} 人民币/人";
|
|
|
+ }
|
|
|
+ if (_EnterExitCosts.Ticket > 0)
|
|
|
+ {
|
|
|
+ //insidePayTotal += _EnterExitCosts.Ticket;
|
|
|
+ row1_3 += $"参展门票:{_EnterExitCosts.Ticket.ToString("#0.00")} 人民币/人";
|
|
|
+ }
|
|
|
+
|
|
|
+ string row1 = "";
|
|
|
+ if (!string.IsNullOrEmpty(row1_1)) row1 += $"{row1_1}\r\n";
|
|
|
+ if (!string.IsNullOrEmpty(row1_2)) row1 += $"{row1_2}\r\n";
|
|
|
+ if (!string.IsNullOrEmpty(row1_3)) row1 += $"{row1_3}\r\n";
|
|
|
+ row1 += $"备注:{_EnterExitCosts.Remark}";
|
|
|
+
|
|
|
+ dic.Add("InsidePay", insidePayTotal.ToString("#0.00"));
|
|
|
+ dic.Add("Row1Str", row1);
|
|
|
+ }
|
|
|
+
|
|
|
+ string airTotalStr = string.Empty,
|
|
|
+ airPriceStr = string.Empty;
|
|
|
+ //经济舱
|
|
|
+ if (_EnterExitCosts.SumJJC == 1)
|
|
|
+ {
|
|
|
+ airTotalStr += $"{_EnterExitCosts.OutsideJJPay.ToString("#0.00")}元/人(经济舱)";
|
|
|
+ airPriceStr += $"{_EnterExitCosts.AirJJ.ToString("#0.00")}元/人(经济舱)";
|
|
|
+ }
|
|
|
+ //公务舱
|
|
|
+ if (_EnterExitCosts.SumGWC == 1)
|
|
|
+ {
|
|
|
+ airTotalStr += $" {_EnterExitCosts.OutsideGWPay.ToString("#0.00")} 元/人(公务舱)";
|
|
|
+ airPriceStr += $" {_EnterExitCosts.AirGW.ToString("#0.00")} 元/人(公务舱)";
|
|
|
+ }
|
|
|
+ //头等舱
|
|
|
+ if (_EnterExitCosts.SumTDC == 1)
|
|
|
+ {
|
|
|
+ airTotalStr += $" {_EnterExitCosts.OutsideTDPay.ToString("#0.00")} 元/人(头等舱)";
|
|
|
+ airPriceStr += $" {_EnterExitCosts.AirTD.ToString("#0.00")} 元/人(头等舱)";
|
|
|
+ }
|
|
|
+
|
|
|
+ dic.Add("AirTotalStr", airTotalStr);
|
|
|
+ dic.Add("AirPriceStr", airPriceStr);
|
|
|
+ dic.Add("CityTranffic", _EnterExitCosts.CityTranffic.ToString("#0.00"));
|
|
|
+
|
|
|
+ NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
|
|
|
+ Aspose.Words.Tables.Table table1 = allTables[0] as Aspose.Words.Tables.Table;
|
|
|
+ int table1Row = 0,
|
|
|
+ table2Row = 0,
|
|
|
+ table3Row = 0,
|
|
|
+ table4Row = 0,
|
|
|
+ table5Row = 0;
|
|
|
+
|
|
|
+ //住宿费
|
|
|
+ if (_EnterExitCosts.ChoiceThree == 1)
|
|
|
+ {
|
|
|
+ dic.Add("SubZS", stayFeeTotal.ToString("#0.00"));
|
|
|
+ table1Row = dac1.Count;
|
|
|
+ #region 填充word表格内容
|
|
|
+ for (int i = 0; i < dac1.Count; i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ var dac = dac1[i];
|
|
|
+ if (dac == null) continue;
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i, 0, 0);
|
|
|
+ builder.Write("第" + dac.Days.ToString() + "晚:");
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i, 1, 0);
|
|
|
+ //builder.Write(placeData.Find(it => it.Id == dac.NationalTravelFeeId)?.Country ?? "Unknown");
|
|
|
+ //builder.Write(dac.Place == null ? "" : dac.Place);
|
|
|
+ builder.Write(GetEnterExitCostDraftExportCity(placeData, dac.NationalTravelFeeId));
|
|
|
+
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i, 2, 0);
|
|
|
+ builder.Write("费用标准:");
|
|
|
+
|
|
|
+ string curr = "";
|
|
|
+ var currData = _CurrDatas.Where(it => it.Id == dac.Currency).FirstOrDefault();
|
|
|
+ if (currData != null)
|
|
|
+ {
|
|
|
+ curr = currData.Name;
|
|
|
+ }
|
|
|
+ builder.MoveToCell(0, i, 3, 0);
|
|
|
+ builder.Write(dac.Cost.ToString("#0.00") + curr);
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i, 4, 0);
|
|
|
+ builder.Write("费用小计:");
|
|
|
+
|
|
|
+ builder.MoveToCell(0, i, 5, 0);
|
|
|
+ builder.Write(dac.SubTotal.ToString("#0.00") + "CNY");
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ else dic.Add("SubZS", "0.00");
|
|
|
+ //删除多余行
|
|
|
+ while (table1.Rows.Count > table1Row)
|
|
|
+ {
|
|
|
+ table1.Rows.RemoveAt(table1Row);
|
|
|
+ }
|
|
|
+
|
|
|
+ //伙食费
|
|
|
+ Aspose.Words.Tables.Table table2 = allTables[1] as Aspose.Words.Tables.Table;
|
|
|
+ if (_EnterExitCosts.ChoiceFour == 1)
|
|
|
+ {
|
|
|
+ dic.Add("SubHS", mealsFeeTotal.ToString("#0.00"));
|
|
|
+ table2Row = dac2.Count;
|
|
|
+ #region 填充word表格内容
|
|
|
+
|
|
|
+ for (int i = 0; i < dac2.Count; i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ var dac = dac2[i];
|
|
|
+ if (dac == null) continue;
|
|
|
+
|
|
|
+ builder.MoveToCell(1, i, 0, 0);
|
|
|
+ builder.Write("第" + dac.Days.ToString() + "天:");
|
|
|
+
|
|
|
+ builder.MoveToCell(1, i, 1, 0);
|
|
|
+ builder.Write(GetEnterExitCostDraftExportCity(placeData, dac.NationalTravelFeeId));
|
|
|
+
|
|
|
+ builder.MoveToCell(1, i, 2, 0);
|
|
|
+ builder.Write("费用标准:");
|
|
|
+
|
|
|
+ string curr = "";
|
|
|
+ var currData = _CurrDatas.Where(it => it.Id == dac.Currency).FirstOrDefault();
|
|
|
+ if (currData != null)
|
|
|
+ {
|
|
|
+ curr = currData.Name;
|
|
|
+ }
|
|
|
+ builder.MoveToCell(1, i, 3, 0);
|
|
|
+ builder.Write(dac.Cost.ToString("#0.00") + curr);
|
|
|
+
|
|
|
+ builder.MoveToCell(1, i, 4, 0);
|
|
|
+ builder.Write("费用小计:");
|
|
|
+
|
|
|
+ builder.MoveToCell(1, i, 5, 0);
|
|
|
+ builder.Write(dac.SubTotal.ToString("#0.00") + "CNY");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ else dic.Add("SubHS", "0.00");
|
|
|
+
|
|
|
+ //删除多余行
|
|
|
+ while (table2.Rows.Count > table2Row)
|
|
|
+ {
|
|
|
+ table2.Rows.RemoveAt(table2Row);
|
|
|
+ }
|
|
|
+
|
|
|
+ //公杂费
|
|
|
+ Aspose.Words.Tables.Table table3 = allTables[2] as Aspose.Words.Tables.Table;
|
|
|
+ if (_EnterExitCosts.ChoiceFive == 1)
|
|
|
+ {
|
|
|
+ dic.Add("SubGZF", miscellaneousFeeTotal.ToString("#0.00"));
|
|
|
+ table3Row = dac3.Count;
|
|
|
+ #region 填充word表格内容
|
|
|
+
|
|
|
+ for (int i = 0; i < dac3.Count; i++)
|
|
|
+ {
|
|
|
+ var dac = dac3[i];
|
|
|
+ if (dac == null) continue;
|
|
|
+
|
|
|
+ builder.MoveToCell(2, i, 0, 0);
|
|
|
+ builder.Write("第" + dac.Days.ToString() + "天:");
|
|
|
+
|
|
|
+ builder.MoveToCell(2, i, 1, 0);
|
|
|
+
|
|
|
+ builder.Write(GetEnterExitCostDraftExportCity(placeData, dac.NationalTravelFeeId));
|
|
|
+
|
|
|
+ builder.MoveToCell(2, i, 2, 0);
|
|
|
+ builder.Write("费用标准:");
|
|
|
+
|
|
|
+ string curr = "";
|
|
|
+ var currData = _CurrDatas.Where(it => it.Id == dac.Currency).FirstOrDefault();
|
|
|
+ if (currData != null)
|
|
|
+ {
|
|
|
+ curr = currData.Name;
|
|
|
+ }
|
|
|
+ builder.MoveToCell(2, i, 3, 0);
|
|
|
+ builder.Write(dac.Cost.ToString("#0.00") + curr);
|
|
|
+
|
|
|
+ builder.MoveToCell(2, i, 4, 0);
|
|
|
+ builder.Write("费用小计:");
|
|
|
+
|
|
|
+ builder.MoveToCell(2, i, 5, 0);
|
|
|
+ builder.Write(dac.SubTotal.ToString("#0.00") + "CNY");
|
|
|
+
|
|
|
+ }
|
|
|
+ //删除多余行
|
|
|
+ while (table3.Rows.Count > table3Row)
|
|
|
+ {
|
|
|
+ table3.Rows.RemoveAt(table3Row);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ else dic.Add("SubGZF", "0.00");
|
|
|
+
|
|
|
+ //删除多余行
|
|
|
+ while (table3.Rows.Count > table3Row)
|
|
|
+ {
|
|
|
+ table3.Rows.RemoveAt(table3Row);
|
|
|
+ }
|
|
|
+
|
|
|
+ //培训费
|
|
|
+ Aspose.Words.Tables.Table table4 = allTables[3] as Aspose.Words.Tables.Table;
|
|
|
+ if (_EnterExitCosts.ChoiceSix == 1)
|
|
|
+ {
|
|
|
+ string pxStr = $"六、培训费合计: {tainFeeTotal.ToString("#0.00")} 元/人";
|
|
|
+ dic.Add("SubPX", pxStr);
|
|
|
+
|
|
|
+ table4Row = dac4.Count;
|
|
|
+ #region 填充word表格内容
|
|
|
+
|
|
|
+ for (int i = 0; i < dac4.Count; i++)
|
|
|
+ {
|
|
|
+ var dac = dac4[i];
|
|
|
+ if (dac == null) continue;
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 0, 0);
|
|
|
+ builder.Write("第" + dac.Days.ToString() + "天:");
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 1, 0);
|
|
|
+
|
|
|
+ builder.Write(GetEnterExitCostDraftExportCity(placeData, dac.NationalTravelFeeId));
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 2, 0);
|
|
|
+ builder.Write("费用标准:");
|
|
|
+
|
|
|
+ string curr = "";
|
|
|
+ var currData = _CurrDatas.Where(it => it.Id == dac.Currency).FirstOrDefault();
|
|
|
+ if (currData != null)
|
|
|
+ {
|
|
|
+ curr = currData.Name;
|
|
|
+ }
|
|
|
+ builder.MoveToCell(3, i, 3, 0);
|
|
|
+ builder.Write(dac.Cost.ToString("#0.00") + curr);
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 4, 0);
|
|
|
+ builder.Write("费用小计:");
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 5, 0);
|
|
|
+ builder.Write(dac.SubTotal.ToString("#0.00") + "CNY");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ else dic.Add("SubPX", $"六、培训费合计: 0 元/人");
|
|
|
+ //删除多余行
|
|
|
+ while (table4.Rows.Count > table4Row)
|
|
|
+ {
|
|
|
+ table4.Rows.RemoveAt(table4Row);
|
|
|
+ }
|
|
|
+
|
|
|
+ //其他费用
|
|
|
+ Aspose.Words.Tables.Table table5 = allTables[4] as Aspose.Words.Tables.Table;
|
|
|
+ if (_EnterExitCosts.OtherExpenses_Checked == 1)
|
|
|
+ {
|
|
|
+ string qtStr = $"七、其他费用合计: {otherPriceTotal.ToString("#0.00")} 元/人";
|
|
|
+ dic.Add("titleQi", qtStr);
|
|
|
+
|
|
|
+ table5Row = dac5.Count;
|
|
|
+ #region 填充word表格内容
|
|
|
+
|
|
|
+ for (int i = 0; i < dac5.Count; i++)
|
|
|
+ {
|
|
|
+ var dac = dac5[i];
|
|
|
+ if (dac == null) continue;
|
|
|
+
|
|
|
+ builder.MoveToCell(4, i, 0, 0);
|
|
|
+ builder.Write("第" + dac.Index.ToString() + "项:");
|
|
|
+
|
|
|
+ builder.MoveToCell(4, i, 1, 0);
|
|
|
+
|
|
|
+ builder.Write(dac.itemName);
|
|
|
+
|
|
|
+ builder.MoveToCell(4, i, 2, 0);
|
|
|
+ builder.Write("费用标准:");
|
|
|
+
|
|
|
+ builder.MoveToCell(4, i, 3, 0);
|
|
|
+ builder.Write(dac.Cost.ToString("#0.00") + dac.CurrencyStr);
|
|
|
+
|
|
|
+ builder.MoveToCell(4, i, 4, 0);
|
|
|
+ builder.Write("费用小计:");
|
|
|
+
|
|
|
+ builder.MoveToCell(4, i, 5, 0);
|
|
|
+ builder.Write(dac.SubTotal.ToString("#0.00") + "CNY");
|
|
|
+
|
|
|
+ builder.MoveToCell(4, i, 6, 0);
|
|
|
+ builder.Write("备注:");
|
|
|
+
|
|
|
+ builder.MoveToCell(4, i, 7, 0);
|
|
|
+ builder.Write(dac.Remark);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ else dic.Add("SubQT", "七、其他费用合计: 0 元/人");
|
|
|
+ //删除多余行
|
|
|
+ while (table5.Rows.Count > table5Row)
|
|
|
+ {
|
|
|
+ table5.Rows.RemoveAt(table5Row);
|
|
|
+ }
|
|
|
+
|
|
|
+ //加上其他费用
|
|
|
+ decimal otherFeeTotal = insidePayTotal + stayFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + tainFeeTotal + otherPriceTotal;
|
|
|
+
|
|
|
+ decimal subJJC = 0.00M,
|
|
|
+ subGWC = 0.00M,
|
|
|
+ subTDC = 0.00M;
|
|
|
+
|
|
|
+ //经济舱
|
|
|
+ if (_EnterExitCosts.SumJJC == 1) subJJC = otherFeeTotal + _EnterExitCosts.OutsideJJPay;
|
|
|
+ //公务舱
|
|
|
+ if (_EnterExitCosts.SumGWC == 1) subGWC = otherFeeTotal + _EnterExitCosts.OutsideGWPay;
|
|
|
+ //头等舱
|
|
|
+ if (_EnterExitCosts.SumTDC == 1) subTDC = otherFeeTotal + _EnterExitCosts.OutsideTDPay;
|
|
|
+
|
|
|
+ dic.Add("SubJJC", subJJC.ToString("#0.00"));
|
|
|
+ dic.Add("SubGWC", subGWC.ToString("#0.00"));
|
|
|
+ dic.Add("SubTDC", subTDC.ToString("#0.00"));
|
|
|
+
|
|
|
+ #region 填充word模板书签内容
|
|
|
+ foreach (var key in dic.Keys)
|
|
|
+ {
|
|
|
+ Bookmark bookmark = doc.Range.Bookmarks[key];
|
|
|
+ if (bookmark != null)
|
|
|
+ {
|
|
|
+ builder.MoveToBookmark(key);
|
|
|
+ builder.Write(dic[key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ //文件名
|
|
|
+ string strFileName = $"{_EnterExitCosts.DraftName}出入境费用-草稿{Guid.NewGuid().ToString()}.docx";
|
|
|
+ AsposeHelper.removewatermark_v2180();
|
|
|
+ doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
|
|
|
+ string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
|
|
|
+
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
|
|
|
+ else if (dto.PortType == 2) return Ok(JsonView(true, "成功", url));
|
|
|
+ }
|
|
|
+ else if (dto.SubTypeId == 1006)//1006(因公出国(境)经费测算明细表)
|
|
|
+ {
|
|
|
+ //获取模板
|
|
|
+ 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>();
|
|
|
+
|
|
|
+ string returnCodeLabel = string.Empty;
|
|
|
+ if (nationalTravelFeeData.Any())
|
|
|
+ {
|
|
|
+ List<string> list = new List<string>();
|
|
|
+
|
|
|
+ foreach (var item in nationalTravelFeeData)
|
|
|
+ {
|
|
|
+ list.Add($"{item.Country}({item.City})");
|
|
|
+ }
|
|
|
+
|
|
|
+ list = list.Distinct().ToList();
|
|
|
+ returnCodeLabel = string.Join("-", list).TrimEnd('-');
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ var countryLabel = string.Empty;
|
|
|
+ var countryData = nationalTravelFeeData.Select(x => x.Country).Distinct().ToList();
|
|
|
+ if (countryData.Any())
|
|
|
+ {
|
|
|
+ countryLabel = string.Join("、", countryData);
|
|
|
+ }
|
|
|
+
|
|
|
+ dic.Add("ReturnCodeAir", returnCodeLabel);
|
|
|
+ dic.Add("VisitStartDate", "-");
|
|
|
+ dic.Add("VisitEndDate", "-");
|
|
|
+ dic.Add("Day", "-");
|
|
|
+ dic.Add("VisitCountry", countryLabel);
|
|
|
+ dic.Add("ClientUnit", "-");
|
|
|
+
|
|
|
+ //var Names = string.Join("、", DeleClientList.Select(it => it.Name).ToList()).TrimEnd('、');
|
|
|
+ //dic.Add("Names", Names);
|
|
|
+
|
|
|
+
|
|
|
+ NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
|
|
|
+ Aspose.Words.Tables.Table table1 = allTables[0] as Aspose.Words.Tables.Table;
|
|
|
+
|
|
|
+ decimal dac1totalPrice = 0.00M;
|
|
|
+ int accommodationStartIndex = 6, foodandotherStartIndex = 22;
|
|
|
+ foreach (var dac in dac1)
|
|
|
+ {
|
|
|
+ if (dac.SubTotal == 0.00M)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ //builder.MoveToCell(0, accommodationStartIndex, 0, 0);
|
|
|
+ //builder.Write(DeleClientList[i].LastName + DeleClientList[i].Name);
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 1, 0);
|
|
|
+
|
|
|
+ builder.Write(GetEnterExitCostExportCity(placeData, dac.NationalTravelFeeId));
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 2, 0);
|
|
|
+
|
|
|
+ string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Remark ?? "Unknown";
|
|
|
+ builder.Write(currency);//币种
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 3, 0);
|
|
|
+ builder.Write(dac.Cost.ToString("#0.00"));//标准
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 4, 0);
|
|
|
+ builder.Write("");//人数
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 5, 0);
|
|
|
+ builder.Write("");//天数
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 6, 0);
|
|
|
+ builder.Write(dac.SubTotal.ToString("#0.00"));//小计
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 7, 0);
|
|
|
+
|
|
|
+ decimal rate = 0.00M;
|
|
|
+ rate = rateDatas.Find(it => it.CurrencyName.Equals(currency))?.Rate ?? 0.00M;
|
|
|
+
|
|
|
+ builder.Write(rate.ToString("#0.0000"));//汇率
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 8, 0);
|
|
|
+
|
|
|
+ decimal rbmPrice = dac.SubTotal;
|
|
|
+ builder.Write(rbmPrice.ToString("#0.00"));//折合人民币
|
|
|
+ accommodationStartIndex++;
|
|
|
+ dac1totalPrice += Convert.ToDecimal(rbmPrice.ToString("#0.00"));
|
|
|
+ }
|
|
|
+
|
|
|
+ dic.Add("dac1totalPrice", dac1totalPrice.ToString("#0.00"));
|
|
|
+
|
|
|
+ for (int i = 21; i > (dac1.Count == 0 ? 1 : dac1.Count) + 6; i--)
|
|
|
+ {
|
|
|
+ table1.Rows.RemoveAt(i - 1);
|
|
|
+ foodandotherStartIndex--;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (dac2.Count == dac3.Count)//国家 币种 金额
|
|
|
+ {
|
|
|
+ for (int i = 0; i < dac2.Count; i++)
|
|
|
+ {
|
|
|
+ dac2[i].SubTotal = dac2[i].SubTotal + dac3[i].SubTotal; //小计
|
|
|
+ dac2[i].Cost = dac3[i].Cost + dac2[i].Cost; //标准
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ decimal dac2totalPrice = 0.00M;
|
|
|
+
|
|
|
+ foreach (var dac in dac2)
|
|
|
+ {
|
|
|
+ if (dac.SubTotal == 0)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ builder.MoveToCell(0, foodandotherStartIndex, 1, 0);
|
|
|
+
|
|
|
+ builder.Write(GetEnterExitCostExportCity(placeData, dac.NationalTravelFeeId));
|
|
|
+ builder.MoveToCell(0, foodandotherStartIndex, 2, 0);
|
|
|
+ string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Remark ?? "Unknown";
|
|
|
+ builder.Write(currency);//币种
|
|
|
+ builder.MoveToCell(0, foodandotherStartIndex, 3, 0);
|
|
|
+ builder.Write(dac.Cost.ToString("#0.00"));//标准
|
|
|
+ builder.MoveToCell(0, foodandotherStartIndex, 4, 0);
|
|
|
+ builder.Write("");//人数
|
|
|
+ builder.MoveToCell(0, foodandotherStartIndex, 5, 0);
|
|
|
+ builder.Write("");//天数
|
|
|
+ builder.MoveToCell(0, foodandotherStartIndex, 6, 0);
|
|
|
+ builder.Write(dac.SubTotal.ToString("#0.00"));//小计
|
|
|
+ builder.MoveToCell(0, foodandotherStartIndex, 7, 0);
|
|
|
+
|
|
|
+ decimal rate = 0.00M;
|
|
|
+ rate = rateDatas.Find(it => it.CurrencyName.Equals(currency))?.Rate ?? 0.00M;
|
|
|
+
|
|
|
+ builder.Write(rate.ToString("#0.0000"));//汇率
|
|
|
+
|
|
|
+ builder.MoveToCell(0, foodandotherStartIndex, 8, 0);
|
|
|
+ decimal rbmPrice = dac.SubTotal;
|
|
|
+ builder.Write(rbmPrice.ToString("#0.00"));//折合人民币
|
|
|
+ foodandotherStartIndex++;
|
|
|
+ dac2totalPrice += Convert.ToDecimal(rbmPrice.ToString("#0.00"));
|
|
|
+ }
|
|
|
+
|
|
|
+ dic.Add("dac2totalPrice", dac2totalPrice.ToString("#0.00"));
|
|
|
+
|
|
|
+ for (int i = foodandotherStartIndex + (15 - dac2.Count); i > (dac2.Count == 0 ? 1 : 0) + foodandotherStartIndex; i--)
|
|
|
+ {
|
|
|
+ table1.Rows.RemoveAt(i - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ dic.Add("CityTranffic", _EnterExitCosts.CityTranffic.ToString("#0.00"));
|
|
|
+
|
|
|
+ string otherFeeStr = "";
|
|
|
+ if (_EnterExitCosts.Visa > 0) otherFeeStr += $"签证费: {_EnterExitCosts.Visa.ToString("#0.00")} 元,";
|
|
|
+ if (_EnterExitCosts.Safe > 0) otherFeeStr += $"保险费: {_EnterExitCosts.Safe.ToString("#0.00")} 元,";
|
|
|
+ if (_EnterExitCosts.Ticket > 0) otherFeeStr += $"参展门票费: {_EnterExitCosts.Ticket.ToString("#0.00")} 元,";
|
|
|
+
|
|
|
+ #region 其他款项费用 增加位置:模板第6项其他费用字符串追加
|
|
|
+
|
|
|
+ foreach (var otherInfo in dac5)
|
|
|
+ {
|
|
|
+ otherFeeStr += $"{otherInfo.itemName}:{otherInfo.SubTotal.ToString("#0.00")} 元,";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ if (otherFeeStr.Length > 0)
|
|
|
+ {
|
|
|
+ otherFeeStr = otherFeeStr.Substring(0, otherFeeStr.Length - 1);
|
|
|
+ otherFeeStr = $"({otherFeeStr})";
|
|
|
+
|
|
|
+ dic.Add("OtherFeeStr", otherFeeStr);
|
|
|
+ }
|
|
|
+
|
|
|
+ //总计
|
|
|
+ decimal allPrice = dac1totalPrice + dac2totalPrice + _EnterExitCosts.Visa + _EnterExitCosts.Safe + _EnterExitCosts.Ticket;
|
|
|
+
|
|
|
+ //国际旅费
|
|
|
+ string outsideAir = string.Empty;
|
|
|
+ string allPriceAir = string.Empty;
|
|
|
+ if (_EnterExitCosts.SumJJC == 1)
|
|
|
+ {
|
|
|
+ outsideAir += string.Format(@"经济舱:{0} 元/人;", _EnterExitCosts.AirJJ.ToString("#0.00"));
|
|
|
+ allPriceAir += string.Format(@"经济舱:{0} 元/人;", (allPrice + _EnterExitCosts.OutsideJJPay).ToString("#0.00"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_EnterExitCosts.SumGWC == 1)
|
|
|
+ {
|
|
|
+ outsideAir += string.Format(@"公务舱:{0} 元/人;", _EnterExitCosts.AirGW.ToString("#0.00"));
|
|
|
+ allPriceAir += string.Format(@"公务舱:{0} 元/人;", (allPrice + _EnterExitCosts.OutsideGWPay).ToString("#0.00"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_EnterExitCosts.SumTDC == 1)
|
|
|
+ {
|
|
|
+ outsideAir += string.Format(@"头等舱:{0} 元/人;", _EnterExitCosts.AirTD.ToString("#0.00"));
|
|
|
+ allPriceAir += string.Format(@"头等舱:{0} 元/人;", (allPrice + _EnterExitCosts.OutsideTDPay).ToString("#0.00"));
|
|
|
+ }
|
|
|
+
|
|
|
+ dic.Add("InTravelPrice", $"({outsideAir})");
|
|
|
+
|
|
|
+ dic.Add("FinalSumPrice", $"({allPriceAir})");
|
|
|
+
|
|
|
+
|
|
|
+ //dic.Add("VisaPay", _EnterExitCosts.Visa.ToString("#0.00"));
|
|
|
+ //dic.Add("SafePay", _EnterExitCosts.Safe.ToString("#0.00"));
|
|
|
+ //dic.Add("YiMiao", _EnterExitCosts.YiMiao.ToString("#0.00"));
|
|
|
+
|
|
|
+ foreach (var key in dic.Keys)
|
|
|
+ {
|
|
|
+ builder.MoveToBookmark(key);
|
|
|
+ builder.Write(dic[key]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //模板文件名
|
|
|
+ string strFileName = $"草稿_{_EnterExitCosts.DraftName}因公出国(境)经费测算明细表{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.docx";
|
|
|
+ doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
|
|
|
+ string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
|
|
|
+
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
|
|
|
+ else if (dto.PortType == 2) return Ok(JsonView(true, "成功", url));
|
|
|
+ }
|
|
|
+ else if (dto.SubTypeId == 1007) //1007(四川省商务厅出国经费财政先行审核表)
|
|
|
+ {
|
|
|
+ //获取模板
|
|
|
+ string tempPath = (AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/Temp/四川省商务厅出国经费财政先行审核表.xls");
|
|
|
+ //载入模板
|
|
|
+ WorkbookDesigner designer = new WorkbookDesigner();
|
|
|
+ designer.Workbook = new Workbook(tempPath);
|
|
|
+
|
|
|
+ Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
+
|
|
|
+ string returnCodeLabel = string.Empty;
|
|
|
+ if (nationalTravelFeeData.Any())
|
|
|
+ {
|
|
|
+ List<string> list = new List<string>();
|
|
|
+
|
|
|
+ foreach (var item in nationalTravelFeeData)
|
|
|
+ {
|
|
|
+ list.Add($"{item.Country}({item.City})");
|
|
|
+ }
|
|
|
+
|
|
|
+ list = list.Distinct().ToList();
|
|
|
+ returnCodeLabel = string.Join("-", list).TrimEnd('-');
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ var countryLabel = string.Empty;
|
|
|
+ var countryData = nationalTravelFeeData.Select(x => x.Country).Distinct().ToList();
|
|
|
+ if (countryData.Any())
|
|
|
+ {
|
|
|
+ countryLabel = string.Join("、", countryData);
|
|
|
+ }
|
|
|
+
|
|
|
+ dic.Add("ReturnCodeAir", returnCodeLabel);
|
|
|
+ dic.Add("VisitStartDate", "-");
|
|
|
+ dic.Add("VisitEndDate", "-");
|
|
|
+
|
|
|
+ dic.Add("Day", "0");
|
|
|
+ dic.Add("VisitCountry", countryLabel);
|
|
|
+ dic.Add("ClientUnit", "-");
|
|
|
+ designer.SetDataSource("ClientUnit", "-");
|
|
|
+ designer.SetDataSource("VisitCountry", countryLabel);
|
|
|
+ designer.SetDataSource("Group", "-");
|
|
|
+ designer.SetDataSource("ClientUnitTitle", "-");
|
|
|
+ designer.SetDataSource("Name", "-");
|
|
|
+ designer.SetDataSource("VisitStartDate", "-" );
|
|
|
+ designer.SetDataSource("Day", "0");
|
|
|
+ designer.SetDataSource("ReturnCode", returnCodeLabel);
|
|
|
+ designer.SetDataSource("ReturnCodeAir", "-");
|
|
|
+
|
|
|
+ int startIndex = 10;
|
|
|
+ const int startIndexcopy = 10;
|
|
|
+
|
|
|
+ if (dac2.Count == dac3.Count)//国家 币种 金额
|
|
|
+ {
|
|
|
+ for (int i = 0; i < dac2.Count; i++)
|
|
|
+ {
|
|
|
+ dac2[i].SubTotal = dac2[i].SubTotal + dac3[i].SubTotal; //小计
|
|
|
+ dac2[i].Cost = dac3[i].Cost + dac2[i].Cost; //标准
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DataTable dtdac1 = new DataTable();
|
|
|
+ List<string> place = new List<string>();
|
|
|
+ dtdac1.Columns.AddRange(new DataColumn[] {
|
|
|
+ new DataColumn(){ ColumnName = "city"},
|
|
|
+ new DataColumn(){ ColumnName = "curr"},
|
|
|
+ new DataColumn(){ ColumnName = "criterion"},
|
|
|
+ new DataColumn(){ ColumnName = "number",DataType = typeof(int)},
|
|
|
+ new DataColumn(){ ColumnName = "day",DataType = typeof(int)},
|
|
|
+ new DataColumn(){ ColumnName = "cost", DataType = typeof(decimal)},
|
|
|
+ new DataColumn(){ ColumnName = "rate", DataType = typeof(decimal) },
|
|
|
+ new DataColumn(){ ColumnName = "costRMB", DataType = typeof(decimal) },
|
|
|
+ });
|
|
|
+ DataTable dtdac2 = new DataTable();
|
|
|
+ dtdac2.Columns.AddRange(new DataColumn[] {
|
|
|
+ new DataColumn(){ ColumnName = "city"},
|
|
|
+ new DataColumn(){ ColumnName = "curr"},
|
|
|
+ new DataColumn(){ ColumnName = "criterion"},
|
|
|
+ new DataColumn(){ ColumnName = "number",DataType = typeof(int)},
|
|
|
+ new DataColumn(){ ColumnName = "day",DataType = typeof(int)},
|
|
|
+ new DataColumn(){ ColumnName = "cost", DataType = typeof(decimal)},
|
|
|
+ new DataColumn(){ ColumnName = "rate", DataType = typeof(decimal) },
|
|
|
+ new DataColumn(){ ColumnName = "costRMB",DataType = typeof(decimal)},
|
|
|
+ });
|
|
|
+ dtdac1.TableName = "tb1";
|
|
|
+ dtdac2.TableName = "tb2";
|
|
|
+ decimal dac1totalPrice = 0.00M, dac2totalPrice = 0.00M;
|
|
|
+ foreach (var item in dac1)
|
|
|
+ {
|
|
|
+ item.Place = GetEnterExitCostDraftExportCity(placeData, item.NationalTravelFeeId);
|
|
|
+ if (place.Contains(item.Place))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ DataRow row = dtdac1.NewRow();
|
|
|
+
|
|
|
+ row["city"] = item.Place;
|
|
|
+
|
|
|
+ string currency = _CurrDatas.Find(it => it.Id == item.Currency)?.Remark ?? "Unknwon";
|
|
|
+ decimal rate = rateDatas.Find(it => it.CurrencyName == currency)?.Rate ?? 0.00M;
|
|
|
+ row["curr"] = currency;
|
|
|
+ row["rate"] = rate.ToString("#0.0000");
|
|
|
+ row["criterion"] = item.Cost.ToString("#0.00");
|
|
|
+ row["number"] = 1;
|
|
|
+ row["day"] = dac1.FindAll(x => x.NationalTravelFeeId == item.NationalTravelFeeId).Count;
|
|
|
+
|
|
|
+ //row["costRMB"] = rbmPrice;
|
|
|
+
|
|
|
+ dtdac1.Rows.Add(row);
|
|
|
+ place.Add(item.Place);
|
|
|
+ }
|
|
|
+
|
|
|
+ place = new List<string>();
|
|
|
+ foreach (var item in dac2)
|
|
|
+ {
|
|
|
+ item.Place = GetEnterExitCostDraftExportCity(placeData, item.NationalTravelFeeId);
|
|
|
+ if (place.Contains(item.Place))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ DataRow row = dtdac2.NewRow();
|
|
|
+ row["city"] = item.Place;
|
|
|
+ string currency = _CurrDatas.Find(it => it.Id == item.Currency)?.Remark ?? "Unknwon";
|
|
|
+ decimal rate = rateDatas.Find(it => it.CurrencyName == currency)?.Rate ?? 0.00M;
|
|
|
+ row["curr"] = currency;
|
|
|
+ row["rate"] = rate.ToString("#0.0000");
|
|
|
+ row["criterion"] = item.Cost.ToString("#0.00");
|
|
|
+ row["number"] = 1;
|
|
|
+ row["day"] = dac2.FindAll(x => x.NationalTravelFeeId == item.NationalTravelFeeId).Count;
|
|
|
+ //row["cost"] = item.SubTotal;
|
|
|
+
|
|
|
+ //row["costRMB"] = rbmPrice;
|
|
|
+
|
|
|
+ dtdac2.Rows.Add(row);
|
|
|
+ place.Add(item.Place);
|
|
|
+ //dac2totalPrice += rbmPrice;
|
|
|
+ }
|
|
|
+
|
|
|
+ dac1totalPrice = dac1.Sum(it => it.SubTotal);
|
|
|
+ dac2totalPrice = dac2.Sum(it => it.SubTotal);
|
|
|
+
|
|
|
+ designer.SetDataSource("dac1totalPrice", dac1totalPrice.ToString("#0.00"));
|
|
|
+ designer.SetDataSource("dac2totalPrice", dac2totalPrice);
|
|
|
+ designer.SetDataSource("cityTranffic", @$"其中:国外城市间机票费: {_EnterExitCosts.CityTranffic.ToString("#0.00")} 元");
|
|
|
+ designer.SetDataSource("sumCityTranffic", @$"{_EnterExitCosts.CityTranffic.ToString("#0.00")} ");
|
|
|
+
|
|
|
+ string cell4Str1 = string.Empty;
|
|
|
+ if (_EnterExitCosts.SumJJC == 1) cell4Str1 += $"经济舱:{_EnterExitCosts.AirJJ.ToString("#0.00")} 元/人;";
|
|
|
+ if (_EnterExitCosts.SumGWC == 1) cell4Str1 += $"公务舱:{_EnterExitCosts.AirGW.ToString("#0.00")} 元/人;";
|
|
|
+ if (_EnterExitCosts.SumTDC == 1) cell4Str1 += $"公务舱:{_EnterExitCosts.AirTD.ToString("#0.00")} 元/人;";
|
|
|
+ string cell4Str = $" 4.国际旅费:{cell4Str1}";
|
|
|
+
|
|
|
+ string cellStr = $" 5.其他费用(";
|
|
|
+ if (_EnterExitCosts.Visa > 0) cellStr += $"签证费:{_EnterExitCosts.Visa.ToString("#0.00")}元,";
|
|
|
+ if (_EnterExitCosts.YiMiao > 0) cellStr += $"疫苗费:{_EnterExitCosts.YiMiao.ToString("#0.00")}元,";
|
|
|
+ if (_EnterExitCosts.HeSuan > 0) cellStr += $"核酸费:{_EnterExitCosts.HeSuan.ToString("#0.00")}元,";
|
|
|
+ if (_EnterExitCosts.Safe > 0) cellStr += $"保险费:{_EnterExitCosts.Safe.ToString("#0.00")}元,";
|
|
|
+ if (_EnterExitCosts.Ticket > 0) cellStr += $"参展门票费:{_EnterExitCosts.Ticket.ToString("#0.00")}元,";
|
|
|
+ if (_EnterExitCosts.Service > 0) cellStr += $"服务费:{_EnterExitCosts.Service.ToString("#0.00")}元,";
|
|
|
+
|
|
|
+ #region 其他款项费用 增加位置:模板第5项其他费用字符串追加
|
|
|
+
|
|
|
+ var otherPriceTotal = dac5.Sum(x => x.SubTotal);
|
|
|
+ foreach (var otherInfo in dac5)
|
|
|
+ {
|
|
|
+ cellStr += $"{otherInfo.itemName}:{otherInfo.SubTotal.ToString("#0.00")} 元,";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ if (cellStr.Length > 8)
|
|
|
+ {
|
|
|
+ cellStr = cellStr.Substring(0, cellStr.Length - 1);
|
|
|
+ }
|
|
|
+ cellStr += ")";
|
|
|
+
|
|
|
+
|
|
|
+ decimal otherFee = _EnterExitCosts.Visa + _EnterExitCosts.YiMiao + _EnterExitCosts.HeSuan + _EnterExitCosts.Safe + _EnterExitCosts.Ticket + _EnterExitCosts.Service + otherPriceTotal;
|
|
|
+ decimal s = dac1totalPrice + dac2totalPrice + _EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsideGWPay + otherFee;
|
|
|
+
|
|
|
+ decimal pxFee = dac4.Sum(it => it.Cost);
|
|
|
+ decimal glvFee = _EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsideGWPay;
|
|
|
+ string celllastStr1 = "";
|
|
|
+ if (dac1totalPrice > 0) celllastStr1 += $"住宿费 {dac1totalPrice.ToString("#0.00")} 元";
|
|
|
+ if (dac2totalPrice > 0) celllastStr1 += $",伙食费和公杂费 {dac2totalPrice.ToString("#0.00")} 元";
|
|
|
+ if (pxFee > 0) celllastStr1 += $",培训费 {pxFee.ToString("#0.00")} 元";
|
|
|
+ celllastStr1 += $",国际旅费 元";
|
|
|
+ if (otherFee > 0) celllastStr1 += $",其他费用 {otherFee.ToString("#0.00")} 元";
|
|
|
+
|
|
|
+ string celllastStr = $" 经审核,{celllastStr1},本次出国经费预算合计为 元。其中:市本级安排 。";
|
|
|
+
|
|
|
+ designer.SetDataSource("cell4Str", cell4Str);
|
|
|
+ designer.SetDataSource("cellStr", cellStr);
|
|
|
+ designer.SetDataSource("cellSum", otherFee.ToString("#0.00"));
|
|
|
+ designer.SetDataSource("cellSum4", (_EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsideGWPay).ToString("#0.00"));
|
|
|
+ designer.SetDataSource("celllastStr", celllastStr);
|
|
|
+
|
|
|
+ Workbook wb = designer.Workbook;
|
|
|
+ var sheet = wb.Worksheets[0];
|
|
|
+
|
|
|
+ //绑定datatable数据集
|
|
|
+ designer.SetDataSource(dtdac1);
|
|
|
+ designer.SetDataSource(dtdac2);
|
|
|
+ designer.Process();
|
|
|
+
|
|
|
+ var rowStart = dtdac1.Rows.Count;
|
|
|
+ while (rowStart > 0)
|
|
|
+ {
|
|
|
+ sheet.Cells[startIndex, 8].Formula = $"=G{startIndex + 1} * H{startIndex + 1}";
|
|
|
+ sheet.Cells[startIndex, 6].Formula = $"=E{startIndex + 1} * F{startIndex + 1} * D{startIndex + 1}";
|
|
|
+ startIndex++;
|
|
|
+ rowStart--;
|
|
|
+ }
|
|
|
+
|
|
|
+ sheet.Cells[startIndex, 8].Formula = $"=SUM(I{startIndexcopy + 1}: I{startIndex})";
|
|
|
+ startIndex += 1; //总计行
|
|
|
+
|
|
|
+ rowStart = dtdac2.Rows.Count;
|
|
|
+ while (rowStart > 0)
|
|
|
+ {
|
|
|
+ sheet.Cells[startIndex, 8].Formula = $"= G{startIndex + 1} * H{startIndex + 1}";
|
|
|
+ sheet.Cells[startIndex, 6].Formula = $"= E{startIndex + 1} * F{startIndex + 1} * D{startIndex + 1}";
|
|
|
+ startIndex++;
|
|
|
+ rowStart--;
|
|
|
+ }
|
|
|
+
|
|
|
+ sheet.Cells[startIndex, 8].Formula = $"=SUM(I{startIndexcopy + dtdac1.Rows.Count + 2}: I{startIndex})";
|
|
|
+
|
|
|
+ wb.CalculateFormula(true);
|
|
|
+
|
|
|
+ //模板文件名
|
|
|
+ string strFileName = $"草稿_{_EnterExitCosts.DraftName}-四川省商务厅出国经费财政先行审核表{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
|
|
|
+ designer.Workbook.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
|
|
|
+ string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
|
|
|
+ else if (dto.PortType == 2) return Ok(JsonView(true, "成功", 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", "-");
|
|
|
+ dic.Add("ClientUnit", "-");
|
|
|
+
|
|
|
+ string missionLeader = ""; //团负责人默认接团客户名单第一个人
|
|
|
+ string missionLeaderJob = "";//负责人job
|
|
|
+ int groupNumber = 0; //团人数
|
|
|
+
|
|
|
+ dic.Add("MissionLeader", "-"); //团负责人
|
|
|
+ dic.Add("MissionLeaderJob", "-"); //团负责人job
|
|
|
+ dic.Add("GroupNumber", "0"); //团人数
|
|
|
+
|
|
|
+ dic.Add("Day", "0");
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+
|
|
|
+ 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 + dac5.Sum(x => x.SubTotal);
|
|
|
+ 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 = $"草稿_{_EnterExitCosts.DraftName}-成都市因公临时出国任务和预算审批意见表(外专培训团专用).docx";
|
|
|
+ doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
|
|
|
+ string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
|
|
|
+
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
|
|
|
+ else if (dto.PortType == 2) return Ok(JsonView(true, "成功", url));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (dto.ExportType == 2) //表格
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (dto.ExportType == 3)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(400, "只可导出明细表!", ""));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(400, ex.Message, ""));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取三公费用标准city
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="placeData"></param>
|
|
|
+ /// <param name="nationalTravelFeeId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private string GetEnterExitCostDraftExportCity(List<Grp_NationalTravelFee> placeData, int nationalTravelFeeId)
|
|
|
+ {
|
|
|
+ string _city = string.Empty;
|
|
|
+
|
|
|
+ if (!placeData.Any()) return _city;
|
|
|
+
|
|
|
+ var data = placeData.Find(it => it.Id == nationalTravelFeeId);
|
|
|
+ if (data == null) return _city;
|
|
|
+
|
|
|
+ string country = data.Country;
|
|
|
+ string city = data.City;
|
|
|
+ if (city.Contains("其他城市") || city.Contains("所有城市")) _city = $"{country}-{city}";
|
|
|
+ else _city = city;
|
|
|
+ return _city;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-草稿 - 一键清空
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> EnterExitCostDraftOneClickEmpty(EnterExitCostDraftOneClickEmptyDto dto)
|
|
|
+ {
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数;"));
|
|
|
+ if (dto.Id < 1) return Ok(JsonView(false, "请传入有效的Id参数;"));
|
|
|
+
|
|
|
+ var _view = await _enterExitCostDraftRep.OneClickEmpty(dto.Id, dto.UserId);
|
|
|
+
|
|
|
+ if (_view.Code == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true, "操作成功"));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false, "操作失败"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-草稿 - 子项删除
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> EnterExitCostDraftSubItemDel(EnterExitCostDraftSubItemDelDto dto)
|
|
|
+ {
|
|
|
+ var data = await _enterExitCostDraftRep.EnterExitCostDraftSubItemDel(dto);
|
|
|
+
|
|
|
+ if (data.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, data.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "操作成功!", data.Data));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 三公其他费用草稿 删除
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public IActionResult EnterExitCostDraftOtherExpensesDel(EnterExitCostDraftOtherExpensesDelDto dto)
|
|
|
+ {
|
|
|
+ var jw = JsonView(false, "删除失败!");
|
|
|
+
|
|
|
+ var data = new Grp_DayOtherPriceDraft()
|
|
|
+ {
|
|
|
+ Id = dto.Id,
|
|
|
+ IsDel = 1,
|
|
|
+ DeleteUserId = dto.DeleteUserId,
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")
|
|
|
+ };
|
|
|
+
|
|
|
+ var del = _sqlSugar.Updateable(data).UpdateColumns(it => new { it.IsDel, it.DeleteUserId, it.DeleteTime }).ExecuteCommand();
|
|
|
+
|
|
|
+ if (del > 0)
|
|
|
+ {
|
|
|
+ jw.Code = 200;
|
|
|
+ jw.Msg = "删除成功!";
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 团组经理模块 出入境费用 移动端(Android/IOS)
|
|
|
|
|
|
/// <summary>
|