|
@@ -418,26 +418,34 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <param name="id"></param>
|
|
|
/// <param name="diid"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> _OneClickClear(int id, int diid,int userId)
|
|
|
+ public async Task<Result> _OneClickClear(int id, int diId, 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 (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
|
|
|
-
|
|
|
+ Id = id,
|
|
|
};
|
|
|
|
|
|
+ int update = await _sqlSugar.Updateable<Grp_EnterExitCost>(_EnterExitCost).Where(it => it.Id == id).ExecuteCommandAsync();
|
|
|
|
|
|
-
|
|
|
- CommitTran();
|
|
|
-
|
|
|
- RollbackTran();
|
|
|
- result.Msg = "操作失败";
|
|
|
+ if (update > 0) {
|
|
|
+ string sqlDelete = string.Format(@" Delete From Grp_DayAndCost Where Diid = {0} ", diId);
|
|
|
+ await ExecuteCommandAsync(sqlDelete);
|
|
|
+ result.Code = 0;
|
|
|
+ result.Msg = "操作成功!";
|
|
|
+ CommitTran();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.Msg = "操作失败";
|
|
|
+ RollbackTran();
|
|
|
+ }
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|