模具维修修改
This commit is contained in:
@@ -122,5 +122,27 @@ namespace Tnb.EquipMgr
|
||||
throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<string> RepeatRepair(MaintainRecordRepeatInput input)
|
||||
{
|
||||
ToolMoldMaintainTask toolMoldMaintainTask = await _db.Queryable<ToolMoldMaintainTask>().SingleAsync(x => x.id == input.id);
|
||||
if (toolMoldMaintainTask.status != "YWC")
|
||||
{
|
||||
throw Oops.Bah("状态错误");
|
||||
}
|
||||
DbResult<bool> result = await _db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
await _db.Updateable<ToolMoldMaintainTask>()
|
||||
.SetColumns(x => x.repeat_result == input.repeat_result)
|
||||
.SetColumns(x => x.repeat_descrip == input.repeat_descrip)
|
||||
.SetColumns(x=>x.repeat_user_id==_userManager.UserId)
|
||||
.SetColumns(x=>x.repeat_time==DateTime.Now)
|
||||
.Where(x => x.id == input.id)
|
||||
.ExecuteCommandAsync();
|
||||
});
|
||||
|
||||
return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : result.IsSuccess ? "复核成功" : result.ErrorMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user