模具维修修改

This commit is contained in:
2024-08-08 17:16:33 +08:00
parent 18dac9b6b2
commit 141de28d0c
6 changed files with 184 additions and 5 deletions

View File

@@ -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;
}
}
}