|
@@ -79,9 +79,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <param name="portType"></param>
|
|
|
/// <param name="diId"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> _AddAndUpdate(VisaFeeAddAndUpdateDto dto)
|
|
|
+ public async Task<Result> _Update(VisaFeeAddAndUpdateDto dto)
|
|
|
{
|
|
|
- if (dto.Status < 1 || dto.Status > 2) return _result = new Result() { Code = -1, Msg = "请传入有效的Status参数" };
|
|
|
if (dto.VisaFeeInfos.Count < 1) return _result = new Result() { Code = -1, Msg = "请传入有效的签证费用集合参数" };
|
|
|
if (dto.PortType < 1 || dto.PortType > 3) return _result = new Result() { Code = -1, Msg = "请传入有效的portType参数" };
|
|
|
|
|
@@ -116,8 +115,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
VisaPrice = item.VisaFee,
|
|
|
LastUpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
};
|
|
|
- int update = _sqlSugar.Updateable(_CountryFeeCost).UpdateColumns(it => new { it.VisaPrice, it.LastUpdateTime }).WhereColumns(it => it.Id).ExecuteCommand();
|
|
|
- if (update > 0)
|
|
|
+ int update1 = _sqlSugar.Updateable(_CountryFeeCost).UpdateColumns(it => new { it.VisaPrice, it.LastUpdateTime }).WhereColumns(it => it.Id).ExecuteCommand();
|
|
|
+ if (update1 > 0)
|
|
|
{
|
|
|
visaFeeUpdate = true;
|
|
|
}
|
|
@@ -136,26 +135,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if (dto.Status == 1) //添加
|
|
|
+ //执行删除
|
|
|
+ var update = _sqlSugar.Updateable<Grp_VisaFeeInfo>().SetColumns(it => new Grp_VisaFeeInfo()
|
|
|
{
|
|
|
- var add = _sqlSugar.Insertable(visaInfos).ExecuteCommand();
|
|
|
- if (add > 0)
|
|
|
- {
|
|
|
- CommitTran();
|
|
|
- return new Result() {Code = 0 ,Msg = "操作成功!" };
|
|
|
- }
|
|
|
- }
|
|
|
- else if (dto.Status == 2) //修改
|
|
|
+ DeleteUserId = dto.OpUserId,
|
|
|
+ DeleteTime = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ IsDel = 1
|
|
|
+
|
|
|
+ }).Where(it => it.DiId == dto.DiId).ExecuteCommand();
|
|
|
+
|
|
|
+ var add = _sqlSugar.Insertable(visaInfos).ExecuteCommand();
|
|
|
+ if (add > 0)
|
|
|
{
|
|
|
- var update = _sqlSugar.Updateable(visaInfos).IgnoreColumns(it => new { it.CreateUserId,it.CreateTime,it.IsDel }).WhereColumns(it => it.Id).ExecuteCommand();
|
|
|
- if (update > 0 || visaFeeUpdate)
|
|
|
- {
|
|
|
- CommitTran();
|
|
|
- return new Result() { Code = 0, Msg = "操作成功!" };
|
|
|
- }
|
|
|
+ CommitTran();
|
|
|
+ return new Result() {Code = 0 ,Msg = "操作成功!" };
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
RollbackTran();
|
|
|
return _result;
|
|
|
}
|