|
@@ -5217,6 +5217,53 @@ FROM
|
|
|
{
|
|
|
var data = await _enterExitCostRep.PostEnterExitCostOperate(dto);
|
|
|
|
|
|
+ if (dto.DayOtherPriceData.Any())
|
|
|
+ {
|
|
|
+ var inserList = dto.DayOtherPriceData
|
|
|
+ .Where(x => x.Id == 0)
|
|
|
+ .Select(x => new Grp_DayOtherPrice
|
|
|
+ {
|
|
|
+ Cost = x.Cost,
|
|
|
+ Id = x.Id,
|
|
|
+ CreateTime = DateTime.Now,
|
|
|
+ CreateUserId = dto.UserId,
|
|
|
+ Currency = x.Currency,
|
|
|
+ Diid = x.Diid,
|
|
|
+ Index = x.Index,
|
|
|
+ IsDel = 0,
|
|
|
+ SetDataId = x.SetDataId,
|
|
|
+ SubTotal = x.SubTotal
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
+ var updateList = dto.DayOtherPriceData
|
|
|
+ .Where(x => x.Id != 0)
|
|
|
+ .Select(x => new Grp_DayOtherPrice
|
|
|
+ {
|
|
|
+ Cost = x.Cost,
|
|
|
+ Id = x.Id,
|
|
|
+ CreateTime = DateTime.Now,
|
|
|
+ CreateUserId = dto.UserId,
|
|
|
+ Currency = x.Currency,
|
|
|
+ Diid = x.Diid,
|
|
|
+ Index = x.Index,
|
|
|
+ IsDel = 0,
|
|
|
+ SetDataId = x.SetDataId,
|
|
|
+ SubTotal = x.SubTotal,
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
+ //添加
|
|
|
+ _sqlSugar.BeginTran();
|
|
|
+ if (inserList.Any())
|
|
|
+ {
|
|
|
+ var rowCount = _sqlSugar.Insertable<Grp_DayOtherPrice>(inserList).ExecuteCommand();
|
|
|
+ }
|
|
|
+ if (updateList.Any())
|
|
|
+ {
|
|
|
+ var rowCount = _sqlSugar.Updateable<Grp_DayOtherPrice>(updateList).ExecuteCommand();
|
|
|
+ }
|
|
|
+ _sqlSugar.CommitTran();
|
|
|
+ }
|
|
|
+
|
|
|
if (data.Code != 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, data.Msg));
|
|
@@ -5314,6 +5361,20 @@ FROM
|
|
|
List<Grp_DayAndCost> dac2 = _DayAndCosts.Where(it => it.Type == 2).ToList(); //伙食费
|
|
|
List<Grp_DayAndCost> dac3 = _DayAndCosts.Where(it => it.Type == 3).ToList(); //公杂费
|
|
|
List<Grp_DayAndCost> dac4 = _DayAndCosts.Where(it => it.Type == 4).ToList(); //培训费
|
|
|
+ var dac5 = _sqlSugar.Queryable<Grp_DayOtherPrice>()
|
|
|
+ .LeftJoin<Sys_SetData>((x,a)=> a.IsDel == 0 && a.Id == x.SetDataId)
|
|
|
+ .LeftJoin<Sys_SetData>((x, a, b) => a.IsDel == 0 && a.Id == x.Currency)
|
|
|
+ .Where((x, a, b) => x.IsDel == 0 && x.Diid == dto.DiId)
|
|
|
+ .Select((x, a, b) => new
|
|
|
+ {
|
|
|
+ x.Index,
|
|
|
+ itemName = a.Name,
|
|
|
+ CurrencyStr = b.Name,
|
|
|
+ x.Cost,
|
|
|
+ x.SubTotal,
|
|
|
+ })
|
|
|
+ .OrderBy((x) => x.Index)
|
|
|
+ .ToList();
|
|
|
|
|
|
var _CurrDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0 && it.STid == 66).ToList();
|
|
|
var _DelegationInfo = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(it => it.IsDel == 0 && it.Id == dto.DiId).First();
|
|
@@ -5357,6 +5418,7 @@ FROM
|
|
|
decimal mealsFeeTotal = _DayAndCosts.Where(it => it.Type == 2).Sum(it => it.SubTotal); // 伙食费费
|
|
|
decimal miscellaneousFeeTotal = _DayAndCosts.Where(it => it.Type == 3).Sum(it => it.SubTotal); // 公杂费
|
|
|
decimal tainFeeTotal = _DayAndCosts.Where(it => it.Type == 4).Sum(it => it.SubTotal); // 培训费
|
|
|
+ decimal otherPriceTotal = dac5.Sum(x => x.SubTotal);
|
|
|
|
|
|
decimal insidePayTotal = _EnterExitCosts.InsidePay;
|
|
|
|
|
@@ -5442,7 +5504,9 @@ FROM
|
|
|
int table1Row = 0,
|
|
|
table2Row = 0,
|
|
|
table3Row = 0,
|
|
|
- table4Row = 0;
|
|
|
+ table4Row = 0,
|
|
|
+ table5Row = 0;
|
|
|
+
|
|
|
//住宿费
|
|
|
if (_EnterExitCosts.ChoiceThree == 1)
|
|
|
{
|
|
@@ -5646,7 +5710,52 @@ FROM
|
|
|
{
|
|
|
table4.Rows.RemoveAt(table4Row);
|
|
|
}
|
|
|
- decimal otherFeeTotal = insidePayTotal + stayFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + tainFeeTotal;
|
|
|
+
|
|
|
+ //其他费用
|
|
|
+ Aspose.Words.Tables.Table table5 = allTables[3] as Aspose.Words.Tables.Table;
|
|
|
+ if (_EnterExitCosts.OtherExpenses_Checked == 1)
|
|
|
+ {
|
|
|
+ dic.Add("SubQT", otherPriceTotal.ToString("#0.00"));
|
|
|
+
|
|
|
+ table5Row = table5.Count;
|
|
|
+ #region 填充word表格内容
|
|
|
+
|
|
|
+ for (int i = 0; i < dac5.Count; i++)
|
|
|
+ {
|
|
|
+ var dac = dac5[i];
|
|
|
+ if (dac == null) continue;
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 0, 0);
|
|
|
+ builder.Write("第" + dac.Index.ToString() + "项:");
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 1, 0);
|
|
|
+
|
|
|
+ builder.Write(dac.itemName);
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 2, 0);
|
|
|
+ builder.Write("费用标准:");
|
|
|
+
|
|
|
+ builder.MoveToCell(3, i, 3, 0);
|
|
|
+ builder.Write(dac.Cost.ToString("#0.00") + dac.CurrencyStr);
|
|
|
+
|
|
|
+ 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("SubQT", "0.00");
|
|
|
+ //删除多余行
|
|
|
+ while (table5.Rows.Count > table5Row)
|
|
|
+ {
|
|
|
+ table5.Rows.RemoveAt(table5Row);
|
|
|
+ }
|
|
|
+
|
|
|
+ //加上其他费用
|
|
|
+ decimal otherFeeTotal = insidePayTotal + stayFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + tainFeeTotal + otherPriceTotal;
|
|
|
|
|
|
decimal subJJC = 0.00M,
|
|
|
subGWC = 0.00M,
|
|
@@ -6700,6 +6809,15 @@ FROM
|
|
|
if (dto.Id < 1) return Ok(JsonView(false, "请传入有效的Id参数;"));
|
|
|
|
|
|
var _view = await _enterExitCostRep._OneClickClear(dto.Id, dto.DiId, dto.UserId);
|
|
|
+ await _sqlSugar.Updateable<Grp_DayOtherPrice>()
|
|
|
+ .Where(x => x.Diid == dto.DiId && x.IsDel == 0)
|
|
|
+ .SetColumns(x => new Grp_DayOtherPrice
|
|
|
+ {
|
|
|
+ IsDel = 1,
|
|
|
+ DeleteUserId = dto.UserId,
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
+ })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
@@ -6734,6 +6852,35 @@ FROM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 删除三公其他费用
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public IActionResult DeleteOtherExpenses(EnterExitCostSubItemDelDto dto)
|
|
|
+ {
|
|
|
+ var jw = JsonView(false,"删除失败!");
|
|
|
+
|
|
|
+ var data = new Grp_DayOtherPrice()
|
|
|
+ {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 团组模块 - 出入境国家费用标准 List
|
|
|
/// </summary>
|