|
@@ -7881,6 +7881,58 @@ FROM
|
|
|
return Ok(JsonView(true));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - OP --> 3-7项复选框单个复选框更改
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> EnterExitCostMobileOpSingleCheckbox(EnterExitCostMobileOpSingleCheckboxDto dto)
|
|
|
+ {
|
|
|
+ int itemTypeId = dto.ItemType, id = dto.Id, currUserId = dto.CurrUserId, diId = dto.DiId,isSelected = dto.IsSelected;
|
|
|
+ var itemTypes = new List<int>() { 3, 4, 5, 6, 7 };
|
|
|
+
|
|
|
+ if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (diId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+ if (currUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+ if (!itemTypes.Contains(itemTypeId)) return Ok(JsonView(false, $"请传入要修改的项类型;3:住宿费; 4:伙食费; 5:公杂费; 6:培训费;7:其他;"));
|
|
|
+
|
|
|
+ var checkboxInfo = new Grp_EnterExitCost() {
|
|
|
+ Id = id,
|
|
|
+ DiId = diId,
|
|
|
+ CreateUserId = currUserId
|
|
|
+ };
|
|
|
+
|
|
|
+ if (itemTypeId == 3) checkboxInfo.ChoiceThree = isSelected;
|
|
|
+ else if (itemTypeId == 4) checkboxInfo.ChoiceFour = isSelected;
|
|
|
+ else if (itemTypeId == 5) checkboxInfo.ChoiceFive = isSelected;
|
|
|
+ else if (itemTypeId == 6) checkboxInfo.ChoiceSix = isSelected;
|
|
|
+ else if (itemTypeId == 7) checkboxInfo.OtherExpenses_Checked = isSelected;
|
|
|
+
|
|
|
+
|
|
|
+ if (id <= 0) //add
|
|
|
+ {
|
|
|
+ checkboxInfo.CreateUserId = dto.CurrUserId;
|
|
|
+ var add = await _sqlSugar.Insertable(checkboxInfo).ExecuteCommandAsync();
|
|
|
+
|
|
|
+ if (add < 1) return Ok(JsonView(false));
|
|
|
+ }
|
|
|
+ else //update
|
|
|
+ {
|
|
|
+ var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
|
|
|
+ .SetColumnsIF(itemTypeId == 3, it => it.ChoiceThree == isSelected)
|
|
|
+ .SetColumnsIF(itemTypeId == 4, it => it.ChoiceFour == isSelected)
|
|
|
+ .SetColumnsIF(itemTypeId == 5, it => it.ChoiceFive == isSelected)
|
|
|
+ .SetColumnsIF(itemTypeId == 6, it => it.ChoiceSix == isSelected)
|
|
|
+ .SetColumnsIF(itemTypeId == 7, it => it.OtherExpenses_Checked == isSelected)
|
|
|
+ .Where(x => x.Id == id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (upd < 1) return Ok(JsonView(false));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(true));
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 团组模块 - 出入境费用-移动端 - OP --> 境内费用 Step1
|
|
|
/// </summary>
|
|
@@ -8002,6 +8054,7 @@ FROM
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
+ [ApiExplorerSettings(IgnoreApi = true)]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> EnterExitCostMobileOpBatchStep3To6(PostEnterExitCostMobileOpStep3To6Dto dto)
|
|
|
{
|
|
@@ -8070,7 +8123,7 @@ FROM
|
|
|
public async Task<IActionResult> EnterExitCostMobileOpSingleStep3To6(PostEnterExitCostMobileOpSingleStep3To6Dto dto)
|
|
|
{
|
|
|
var feeTypeIds = new List<int>() { 1, 2, 3, 4, };
|
|
|
- int parentId = dto.ParentId, subId = dto.SubId, feeType = dto.FeeType;
|
|
|
+ int subId = dto.SubId, feeType = dto.FeeType;
|
|
|
|
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
@@ -8078,113 +8131,42 @@ FROM
|
|
|
|
|
|
if (!feeTypeIds.Contains(feeType)) return Ok(JsonView(false, "请传入有效的费用类型!"));
|
|
|
|
|
|
- var parentInfo = new Grp_EnterExitCost();
|
|
|
- parentInfo.Id = dto.ParentId;
|
|
|
- parentInfo.CreateUserId = dto.CurrUserId;
|
|
|
-
|
|
|
- if (feeType == 1) parentInfo.ChoiceThree = dto.IsSelect;
|
|
|
- else if (feeType == 2) parentInfo.ChoiceFour = dto.IsSelect;
|
|
|
- else if (feeType == 3) parentInfo.ChoiceFive = dto.IsSelect;
|
|
|
- else if (feeType == 4) parentInfo.ChoiceSix = dto.IsSelect;
|
|
|
-
|
|
|
var subInfo = _mapper.Map<Grp_DayAndCost>(dto);
|
|
|
subInfo.Id = subId;
|
|
|
+ subInfo.DiId = dto.DiId;
|
|
|
+ subInfo.Type = feeType;
|
|
|
subInfo.CreateUserId = dto.CurrUserId;
|
|
|
|
|
|
- _sqlSugar.BeginTran();
|
|
|
- //主表op
|
|
|
- if (parentId < 1) //添加
|
|
|
+
|
|
|
+ //子表op
|
|
|
+ if (subId < 1)
|
|
|
{
|
|
|
- var parentAdd = await _sqlSugar.Insertable(parentInfo).ExecuteCommandAsync();
|
|
|
- if (parentAdd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
-
|
|
|
- //子表op
|
|
|
- if (subId < 1)
|
|
|
- {
|
|
|
- var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
|
|
|
- if (subAdd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
- .UpdateColumns(x => new
|
|
|
- {
|
|
|
- x.Days,
|
|
|
- x.NationalTravelFeeId,
|
|
|
- x.Cost,
|
|
|
- x.Currency,
|
|
|
- x.SubTotal
|
|
|
- })
|
|
|
- .WhereColumns(x => new { x.Id })
|
|
|
- .ExecuteCommandAsync();
|
|
|
- if (subUpd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
- }
|
|
|
+ var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
|
|
|
+ if (subAdd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- var parentUpd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
|
|
|
- .SetColumnsIF(feeType == 1, it => it.ChoiceThree == dto.IsSelect)
|
|
|
- .SetColumnsIF(feeType == 2, it => it.ChoiceFour == dto.IsSelect)
|
|
|
- .SetColumnsIF(feeType == 3, it => it.ChoiceFive == dto.IsSelect)
|
|
|
- .SetColumnsIF(feeType == 4, it => it.ChoiceSix == dto.IsSelect)
|
|
|
- .Where(it => it.Id == parentId)
|
|
|
- .ExecuteCommandAsync();
|
|
|
-
|
|
|
- if (parentUpd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
-
|
|
|
- //子表op
|
|
|
- if (subId < 1)
|
|
|
- {
|
|
|
- var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
|
|
|
- if (subAdd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
- .UpdateColumns(x => new
|
|
|
- {
|
|
|
- x.Days,
|
|
|
- x.NationalTravelFeeId,
|
|
|
- x.Cost,
|
|
|
- x.Currency,
|
|
|
- x.SubTotal
|
|
|
- })
|
|
|
- .WhereColumns(x => new { x.Id })
|
|
|
- .ExecuteCommandAsync();
|
|
|
- if (subUpd < 1)
|
|
|
+ var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
+ .UpdateColumns(x => new
|
|
|
{
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
- }
|
|
|
+ x.Days,
|
|
|
+ x.NationalTravelFeeId,
|
|
|
+ x.Cost,
|
|
|
+ x.Currency,
|
|
|
+ x.SubTotal
|
|
|
+ })
|
|
|
+ .WhereColumns(x => new { x.Id })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (subUpd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
- _sqlSugar.CommitTran();
|
|
|
+
|
|
|
var itemTotal = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Type == dto.FeeType).Sum(x => x.SubTotal);
|
|
|
|
|
|
//消息通知
|
|
|
+ var parentId = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId).OrderByDescending(x => x.CreateTime).First().Id;
|
|
|
await EnterExitCostMobileOpNotice(dto.DiId, parentId, dto.CurrUserId);
|
|
|
|
|
|
- return Ok(JsonView(new { isSelect = dto.IsSelect, itemTotal = itemTotal }));
|
|
|
+ return Ok(JsonView(new { itemTotal = itemTotal }));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -8192,6 +8174,7 @@ FROM
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
+ [ApiExplorerSettings(IgnoreApi = true)]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> EnterExitCostMobileOpBatchStep7(PostEnterExitCostMobileOpStep7Dto dto)
|
|
|
{
|
|
@@ -8246,125 +8229,55 @@ FROM
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 团组模块 - 出入境费用-移动端 - OP --> 其他费用-批量 Step7
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - OP --> 其他费用-单条 Step7
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> EnterExitCostMobileOpSingleStep7(PostEnterExitCostMobileOpSingleStep7Dto dto)
|
|
|
{
|
|
|
- int parentId = dto.ParentId, subId = dto.SubId;
|
|
|
+ int subId = dto.SubId;
|
|
|
+ int diId = dto.Diid;
|
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
- if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+ if (diId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
|
- var parentInfo = new Grp_EnterExitCost();
|
|
|
- parentInfo.Id = parentId;
|
|
|
- parentInfo.OtherExpenses_Checked = dto.IsSelect;
|
|
|
- parentInfo.CreateUserId = dto.CurrUserId;
|
|
|
-
|
|
|
var subInfo = _mapper.Map<Grp_DayOtherPrice>(dto);
|
|
|
subInfo.Id = subId;
|
|
|
+ subInfo.Diid = dto.Diid;
|
|
|
subInfo.CreateUserId = dto.CurrUserId;
|
|
|
|
|
|
- #region 主表op
|
|
|
- _sqlSugar.BeginTran();
|
|
|
- //主表op
|
|
|
- if (parentId < 1)
|
|
|
+ #region 子表op
|
|
|
+ if (subId < 1)//add
|
|
|
{
|
|
|
- var parentAdd = await _sqlSugar.Insertable(parentInfo).ExecuteCommandAsync();
|
|
|
- if (parentAdd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
-
|
|
|
- #region 子表op
|
|
|
- if (subId < 1)//add
|
|
|
- {
|
|
|
- var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
|
|
|
- if (subAdd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
- }
|
|
|
- else //upd
|
|
|
- {
|
|
|
- var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
- .UpdateColumns(x => new
|
|
|
- {
|
|
|
- x.Index,
|
|
|
- x.SetDataId,
|
|
|
- x.Cost,
|
|
|
- x.Currency,
|
|
|
- x.SubTotal,
|
|
|
- x.Remark
|
|
|
- })
|
|
|
- .WhereColumns(x => new { x.Id })
|
|
|
- .ExecuteCommandAsync();
|
|
|
- if (subUpd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
- }
|
|
|
- #endregion
|
|
|
+ var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
|
|
|
+ if (subAdd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
- else
|
|
|
+ else //upd
|
|
|
{
|
|
|
- var parentUpd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
|
|
|
- .SetColumns(it => it.OtherExpenses_Checked == dto.IsSelect)
|
|
|
- .Where(it => it.Id == parentId)
|
|
|
- .ExecuteCommandAsync();
|
|
|
-
|
|
|
- if (parentUpd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
-
|
|
|
- #region 子表op
|
|
|
- if (subId < 1)//add
|
|
|
- {
|
|
|
- var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
|
|
|
- if (subAdd < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
- }
|
|
|
- else //upd
|
|
|
- {
|
|
|
- var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
- .UpdateColumns(x => new
|
|
|
- {
|
|
|
- x.Index,
|
|
|
- x.SetDataId,
|
|
|
- x.Cost,
|
|
|
- x.Currency,
|
|
|
- x.SubTotal,
|
|
|
- x.Remark
|
|
|
- })
|
|
|
- .WhereColumns(x => new { x.Id })
|
|
|
- .ExecuteCommandAsync();
|
|
|
- if (subUpd < 1)
|
|
|
+ var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
+ .UpdateColumns(x => new
|
|
|
{
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false));
|
|
|
- }
|
|
|
- }
|
|
|
- #endregion
|
|
|
+ x.Index,
|
|
|
+ x.SetDataId,
|
|
|
+ x.Cost,
|
|
|
+ x.Currency,
|
|
|
+ x.SubTotal,
|
|
|
+ x.Remark
|
|
|
+ })
|
|
|
+ .WhereColumns(x => new { x.Id })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (subUpd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
- _sqlSugar.CommitTran();
|
|
|
#endregion
|
|
|
|
|
|
- var itemTotal = _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == dto.DiId).Sum(x => x.SubTotal);
|
|
|
+ var itemTotal = _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == diId).Sum(x => x.SubTotal);
|
|
|
|
|
|
//消息通知
|
|
|
- await EnterExitCostMobileOpNotice(dto.DiId, parentId, dto.CurrUserId);
|
|
|
+ var parentId = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == diId).OrderByDescending(x => x.CreateTime).First().Id;
|
|
|
+ await EnterExitCostMobileOpNotice(dto.Diid, parentId, dto.CurrUserId);
|
|
|
|
|
|
- return Ok(JsonView(new { isSelect = dto.IsSelect, itemTotal = itemTotal }));
|
|
|
+ return Ok(JsonView(new { itemTotal = itemTotal }));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|