|
@@ -7,6 +7,7 @@ using EyeSoft.Collections.Generic;
|
|
|
using EyeSoft.IO;
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
using MySqlX.XDevAPI.Relational;
|
|
|
+using NetUV.Core.Handles;
|
|
|
using NPOI.HSSF.UserModel;
|
|
|
using NPOI.POIFS.Crypt.Dsig;
|
|
|
using NPOI.SS.Format;
|
|
@@ -7335,7 +7336,7 @@ FROM
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 团组模块 - 出入境国家费用标准 List
|
|
|
+ /// 团组模块 - 出入境国家费用标准-移动端 List
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
@@ -7375,12 +7376,12 @@ FROM
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 团组模块 - Info
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - Info
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostNationalTravelFeeMobileInfo(EnterExitCostInfobyDiIdDto dto)
|
|
|
+ public async Task<IActionResult> PostEnterExitCostMobileInfo(EnterExitCostInfobyDiIdDto dto)
|
|
|
{
|
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
@@ -7388,9 +7389,292 @@ FROM
|
|
|
var data = await _enterExitCostRep.GetEnterExitCostInfoByDiId(dto);
|
|
|
|
|
|
return Ok(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ #region op
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - OP --> 汇率
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostEnterExitCostMobileOpRate(PostEnterExitCostMobileFeeRateOpDto dto)
|
|
|
+ {
|
|
|
+ if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+ if (dto.Currencys.Length < 1) return Ok(JsonView(false, "请传入有效的汇率信息!"));
|
|
|
+ var currencyStr = CommonFun.GetCurrencyChinaToString(dto.Currencys.ToList());
|
|
|
+ int id = dto.Id;
|
|
|
+ if (id <= 0) //add
|
|
|
+ {
|
|
|
+ var add = await _sqlSugar.Insertable(new Grp_EnterExitCost() { CurrencyRemark = currencyStr, CreateUserId = dto.CurrUserId }).ExecuteCommandAsync();
|
|
|
+
|
|
|
+ if (add > 0) return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+ else //update
|
|
|
+ {
|
|
|
+ var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>().SetColumns(x => new Grp_EnterExitCost() { CurrencyRemark = currencyStr }).Where(x => x.Id == dto.Id).ExecuteCommandAsync();
|
|
|
+ if (upd > 0) return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - OP --> 复选框
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostEnterExitCostMobileOpCheckbox(PostEnterExitCostMobileFeeOpCheckboxDto dto)
|
|
|
+ {
|
|
|
+ if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+
|
|
|
+ var checkboxInfo = _mapper.Map<Grp_EnterExitCost>(dto);
|
|
|
+
|
|
|
+ int id = dto.Id;
|
|
|
+ if (id <= 0) //add
|
|
|
+ {
|
|
|
+ checkboxInfo.CreateUserId = dto.CurrUserId;
|
|
|
+ var add = await _sqlSugar.Insertable(checkboxInfo).ExecuteCommandAsync();
|
|
|
+
|
|
|
+ if (add > 0) return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+ else //update
|
|
|
+ {
|
|
|
+ var upd = await _sqlSugar.Updateable(checkboxInfo)
|
|
|
+ .UpdateColumns(x => new {
|
|
|
+ x.ChoiceOne,
|
|
|
+ x.ChoiceTwo,
|
|
|
+ x.SumJJC,
|
|
|
+ x.SumGWC,
|
|
|
+ x.SumTDC,
|
|
|
+ x.ChoiceThree,
|
|
|
+ x.ChoiceFour,
|
|
|
+ x.ChoiceFive,
|
|
|
+ x.ChoiceSix,
|
|
|
+ x.OtherExpenses_Checked
|
|
|
+ })
|
|
|
+ .Where(x => x.Id == id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (upd > 0) return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - OP --> 境内费用 Step1
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostEnterExitCostMobileOpStep1(PostEnterExitCostMobileOpStep1Dto dto)
|
|
|
+ {
|
|
|
+ if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+
|
|
|
+ var info = _mapper.Map<Grp_EnterExitCost>(dto);
|
|
|
+ info.InsidePay = dto.Visa + dto.Service + dto.Safe + dto.Ticket + dto.HeSuan + dto.YiMiao;
|
|
|
+
|
|
|
+ int id = dto.Id;
|
|
|
+ if (id <= 0) //add
|
|
|
+ {
|
|
|
+ info.CreateUserId = dto.CurrUserId;
|
|
|
+ var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
|
|
|
+
|
|
|
+ if (add > 0) return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+ else //update
|
|
|
+ {
|
|
|
+ var upd = await _sqlSugar.Updateable(info)
|
|
|
+ .UpdateColumns(x => new {
|
|
|
+ x.InsidePay,
|
|
|
+ x.VisaRemark,
|
|
|
+ x.Visa,
|
|
|
+ x.Service,
|
|
|
+ x.Safe,
|
|
|
+ x.Ticket,
|
|
|
+ x.HeSuan,
|
|
|
+ x.YiMiao,
|
|
|
+ })
|
|
|
+ .Where(x => x.Id == id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (upd > 0) return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - OP --> 国际旅费 Step2
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostEnterExitCostMobileOpStep2(PostEnterExitCostMobileOpStep2Dto dto)
|
|
|
+ {
|
|
|
+ if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+
|
|
|
+ var info = _mapper.Map<Grp_EnterExitCost>(dto);
|
|
|
+
|
|
|
+ int id = dto.Id;
|
|
|
+ if (id <= 0) //add
|
|
|
+ {
|
|
|
+ info.CreateUserId = dto.CurrUserId;
|
|
|
+ var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
|
|
|
+
|
|
|
+ if (add > 0) return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+ else //update
|
|
|
+ {
|
|
|
+ var upd = await _sqlSugar.Updateable(info)
|
|
|
+ .UpdateColumns(x => new {
|
|
|
+ x.OutsideJJPay,
|
|
|
+ x.OutsideGWPay,
|
|
|
+ x.OutsideTDPay,
|
|
|
+ x.AirJJ,
|
|
|
+ x.AirGW,
|
|
|
+ x.AirTD,
|
|
|
+ x.CityTranffic
|
|
|
+ })
|
|
|
+ .Where(x => x.Id == id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (upd > 0) return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - OP --> (住宿、伙食、公杂、培训) Step3-Step6
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostEnterExitCostMobileOpStep3To6(PostEnterExitCostMobileOpStep3To6Dto dto)
|
|
|
+ {
|
|
|
+ if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+ if (dto.Infos.Length < 1) return Ok(JsonView(false, "请传入有效的费用信息!"));
|
|
|
+ var feeTypeIds = new List<int>() {1,2,3,4, };
|
|
|
+ if (!feeTypeIds.Contains(dto.FeeType)) return Ok(JsonView(false, "请传入有效的费用类型!"));
|
|
|
+
|
|
|
+ var infos1 = _mapper.Map<List<Grp_DayAndCost>>(dto.Infos);
|
|
|
+ var infos = infos1.Select(x => new Grp_DayAndCost
|
|
|
+ {
|
|
|
+ Id = x.Id,
|
|
|
+ DiId = dto.DiId,
|
|
|
+ Type = dto.FeeType,
|
|
|
+ Days = x.Days,
|
|
|
+ NationalTravelFeeId = x.NationalTravelFeeId,
|
|
|
+ Cost = x.Cost,
|
|
|
+ Currency = x.Currency,
|
|
|
+ SubTotal = x.SubTotal,
|
|
|
+ CreateUserId = dto.CurrUserId
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var adds = infos.Where(x => x.Id <= 0).ToList();
|
|
|
+ var upds = infos.Where(x => x.Id > 0).ToList();
|
|
|
+ var status = false;
|
|
|
+ if (adds.Count > 0)
|
|
|
+ {
|
|
|
+ var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
|
|
|
+ if (add > 0) status = true;
|
|
|
+ }
|
|
|
+ if (upds.Count > 0)
|
|
|
+ {
|
|
|
+ var upd = await _sqlSugar.Updateable(adds)
|
|
|
+ .UpdateColumns(x => new
|
|
|
+ {
|
|
|
+ x.Days,
|
|
|
+ x.NationalTravelFeeId,
|
|
|
+ x.Cost,
|
|
|
+ x.Currency,
|
|
|
+ x.SubTotal
|
|
|
+ })
|
|
|
+ .WhereColumns(x => new { x.Id })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (upd > 0) status = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (status)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - OP --> 其他费用 Step7
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostEnterExitCostMobileOpStep7(PostEnterExitCostMobileOpStep7Dto dto)
|
|
|
+ {
|
|
|
+ if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+
|
|
|
+ var infos1 = _mapper.Map<List<Grp_DayOtherPrice>>(dto.Infos);
|
|
|
+ var infos = infos1.Select(x => new Grp_DayOtherPrice()
|
|
|
+ {
|
|
|
+ Id = x.Id,
|
|
|
+ Diid = dto.DiId,
|
|
|
+ SetDataId = x.SetDataId,
|
|
|
+ Index = x.Index,
|
|
|
+ Cost = x.Cost,
|
|
|
+ Currency = x.Currency,
|
|
|
+ SubTotal = x.SubTotal,
|
|
|
+ CreateUserId = dto.CurrUserId,
|
|
|
+ Remark = x.Remark
|
|
|
+ }).ToList();
|
|
|
+
|
|
|
+ var adds = infos.Where(x => x.Id <= 0).ToList();
|
|
|
+ var upds = infos.Where(x => x.Id > 0).ToList();
|
|
|
+ var status = false;
|
|
|
+ if (adds.Count > 0)
|
|
|
+ {
|
|
|
+ var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
|
|
|
+ if (add > 0) status = true;
|
|
|
+ }
|
|
|
+ if (upds.Count > 0)
|
|
|
+ {
|
|
|
+ var upd = await _sqlSugar.Updateable(adds)
|
|
|
+ .UpdateColumns(x => new
|
|
|
+ {
|
|
|
+ x.Index,
|
|
|
+ x.SetDataId,
|
|
|
+ x.Cost,
|
|
|
+ x.Currency,
|
|
|
+ x.SubTotal,
|
|
|
+ x.Remark
|
|
|
+ })
|
|
|
+ .WhereColumns(x => new { x.Id })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (upd > 0) status = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (status)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(false));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 签证费用录入
|