|
@@ -266,53 +266,16 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 确认费用
|
|
|
- /// </summary>
|
|
|
- /// <param name="id"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public async Task<JsonView> ConfirmCost(ConfirmCostDto dto)
|
|
|
- {
|
|
|
- var _view = new JsonView() { Code = 20001, Msg = "操作失败!" };
|
|
|
- if (dto.Id < 1)
|
|
|
- {
|
|
|
- _view.Msg = MsgTips.Id;
|
|
|
- return _view;
|
|
|
- }
|
|
|
-
|
|
|
- int confirm = 1;
|
|
|
- if (dto.Type == 1) confirm = 2; // 确认
|
|
|
- else if (dto.Type == 2) { confirm = 1; } // 撤回
|
|
|
- else
|
|
|
- {
|
|
|
- _view.Msg = "请传入正确的type;1:确认 2:撤回";
|
|
|
- return _view;
|
|
|
- }
|
|
|
- var update = await _sqlSugar.Updateable<Grp_EnterExitCost>()
|
|
|
- .SetColumns(x => new Grp_EnterExitCost() { IsConfirm = confirm })
|
|
|
- .Where(x => x.Id == dto.Id)
|
|
|
- .ExecuteCommandAsync();
|
|
|
- if (update > 0)
|
|
|
- {
|
|
|
- _view.Code = 200;
|
|
|
- _view.Msg = "操作成功!";
|
|
|
- return _view;
|
|
|
- }
|
|
|
-
|
|
|
- return _view;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Del
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> PostEnterExitCostSubItemDel(EnterExitCostSubItemDelDto dto)
|
|
|
+ public async Task<Result> EnterExitCostDraftSubItemDel(EnterExitCostDraftSubItemDelDto dto)
|
|
|
{
|
|
|
Result result = new Result();
|
|
|
|
|
|
- var data = new Grp_DayAndCost()
|
|
|
+ var data = new Grp_DayAndCostDraft()
|
|
|
{
|
|
|
Id = dto.Id,
|
|
|
IsDel = 1,
|
|
@@ -328,102 +291,55 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 团组模块 - 出入境国家费用标准 - Add Or Update
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public async Task<Result> PostNationalTravelFeeOperate(NationalTravelFeeOperateDto dto)
|
|
|
- {
|
|
|
- Result result = new Result();
|
|
|
-
|
|
|
- Grp_NationalTravelFee nationalTravelFee = _mapper.Map<Grp_NationalTravelFee>(dto);
|
|
|
- nationalTravelFee.LastUpdateUserId = dto.UserId;
|
|
|
- nationalTravelFee.CreateUserId = dto.UserId;
|
|
|
-
|
|
|
- if (dto.PortType == 1) //web
|
|
|
- {
|
|
|
-
|
|
|
- var _nationalTravelFee = _sqlSugar.Storageable<Grp_NationalTravelFee>(nationalTravelFee).ToStorage();
|
|
|
- if (dto.Id == 0) //新增
|
|
|
- {
|
|
|
- string selectSql = string.Format(@"Select * From Grp_NationalTravelFee
|
|
|
- Where IsDel = 0
|
|
|
- And Continent = '{0}'
|
|
|
- And Country = '{1}'
|
|
|
- And City = '{2}'", dto.Continent, dto.Country, dto.City);
|
|
|
- Grp_NationalTravelFee nationalTravelFee1 = new Grp_NationalTravelFee();
|
|
|
- nationalTravelFee1 = await _sqlSugar.SqlQueryable<Grp_NationalTravelFee>(selectSql).FirstAsync();
|
|
|
- if (nationalTravelFee1 != null)
|
|
|
- {
|
|
|
- result.Msg = "该国家 城市已存在,请勿重复添加!";
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- _nationalTravelFee.AsInsertable.ExecuteCommand(); //不存在插入
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _nationalTravelFee.AsUpdateable
|
|
|
- .IgnoreColumns(it => new { it.CreateUserId, it.CreateTime, it.IsDel })
|
|
|
- .WhereColumns(it => it.Id)
|
|
|
- .ExecuteCommand(); //存在更新
|
|
|
- }
|
|
|
-
|
|
|
- result.Code = 0;
|
|
|
- }
|
|
|
- else if (dto.PortType == 2) //Android
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- else if (dto.PortType == 3) //Ios
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- else result.Msg = MsgTips.Port;
|
|
|
-
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 一键清空
|
|
|
/// 删除主表数据 Update
|
|
|
/// 删除子表数据 delete
|
|
|
/// </summary>
|
|
|
/// <param name="id"></param>
|
|
|
- /// <param name="diid"></param>
|
|
|
+ /// <param name="userId"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> _OneClickClear(int id, int diId, int userId)
|
|
|
+ public async Task<Result> OneClickEmpty(int id, int userId)
|
|
|
{
|
|
|
Result result = new Result() { Code = -1, Msg = "操作成功!" };
|
|
|
|
|
|
if (id < 1) return result = new Result() { Code = -1, Msg = "请传入有效的Id参数!" };
|
|
|
- if (diId < 1) return result = new Result() { Code = -1, Msg = "请传入有效的Id参数!" };
|
|
|
if (userId < 1) return result = new Result() { Code = -1, Msg = "请传入有效的UserId参数!" };
|
|
|
|
|
|
BeginTran();
|
|
|
- Grp_EnterExitCost _EnterExitCost = new Grp_EnterExitCost()
|
|
|
- {
|
|
|
- Id = id,
|
|
|
- IsDel = 1,
|
|
|
- DeleteUserId = userId,
|
|
|
- DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
- };
|
|
|
|
|
|
- //int update = await _sqlSugar.Updateable<Grp_EnterExitCost>(_EnterExitCost).Where(it => it.Id == id).ExecuteCommandAsync();
|
|
|
- int update = await _sqlSugar.Updateable<Grp_EnterExitCost>(_EnterExitCost)
|
|
|
- .UpdateColumns(it => new {
|
|
|
- it.IsDel,
|
|
|
- it.DeleteUserId,
|
|
|
- it.DeleteTime
|
|
|
- })
|
|
|
- .Where(it => it.Id == id).ExecuteCommandAsync();
|
|
|
+ int update = await _sqlSugar.Updateable<Grp_EnterExitCostDraft>()
|
|
|
+ .SetColumns(it => new Grp_EnterExitCostDraft()
|
|
|
+ {
|
|
|
+ IsDel = 1,
|
|
|
+ DeleteUserId = userId,
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
+ })
|
|
|
+ .Where(it => it.Id == id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
|
|
|
if (update > 0)
|
|
|
{
|
|
|
- string sqlDelete = string.Format(@"Delete From Grp_DayAndCost Where Diid = {0} ", diId);
|
|
|
- await ExecuteCommandAsync(sqlDelete);
|
|
|
+ await _sqlSugar.Updateable<Grp_DayAndCostDraft>()
|
|
|
+ .SetColumns(it => new Grp_DayAndCostDraft()
|
|
|
+ {
|
|
|
+ IsDel = 1,
|
|
|
+ DeleteUserId = userId,
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
+ })
|
|
|
+ .Where(it => it.ParentId == id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+
|
|
|
+ await _sqlSugar.Updateable<Grp_DayOtherPriceDraft>()
|
|
|
+ .SetColumns(it => new Grp_DayOtherPriceDraft()
|
|
|
+ {
|
|
|
+ IsDel = 1,
|
|
|
+ DeleteUserId = userId,
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
+ })
|
|
|
+ .Where(it => it.ParentId == id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+
|
|
|
result.Code = 0;
|
|
|
result.Msg = "操作成功!";
|
|
|
CommitTran();
|
|
@@ -436,9 +352,5 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|