模具维修修改

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

@@ -5,6 +5,7 @@ namespace Tnb.EquipMgr.Entities.Dto
public string id { get; set; } = string.Empty;
public string repeat_result { get; set; } = string.Empty;
public string repeat_descrip { get; set; } = string.Empty;
public string? repeat_remark { get; set; }
public string? attachment { get; set; }

View File

@@ -61,4 +61,29 @@ public partial class ToolMoldMaintainTask : BaseEntity<string>
public string? wxattachment { get; set; }
public string? wxdescribe { get; set; }
/// <summary>
/// 复核 1 通过 2 不通过
/// </summary>
public string repeat_result { get; set; }
/// <summary>
/// 复核结果描述
/// </summary>
public string repeat_descrip { get; set; }
/// <summary>
/// 复核人
/// </summary>
public string repeat_user_id { get; set; }
/// <summary>
/// 复核时间
/// </summary>
public DateTime? repeat_time { get; set; }
/// <summary>
/// 工时(小时)
/// </summary>
public decimal cost_work_time { get; set; }
}

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