浏览代码

优化

shengtang
父节点
当前提交
8bd5d3c5c0
共有 2 个文件被更改,包括 26 次插入7 次删除
  1. +8
    -0
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoCraftstepRecordDto.cs
  2. +18
    -7
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs

+ 8
- 0
backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoCraftstepRecordDto.cs 查看文件

@@ -49,6 +49,14 @@
/// </summary>
public string WorkCraftstepId { get; set; }
/// <summary>
/// 工单Id
/// </summary>
public string WorkId { get; set; }
/// <summary>
/// 锅数
/// </summary>
public string PotNum { get; set; }
/// <summary>
/// 状态
/// </summary>
public RecipeStatus Status { get; set; }


+ 18
- 7
backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs 查看文件

@@ -359,15 +359,26 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services
[HttpPost]
public async Task<bool> UpdateWorkCraftStepsStatus(WorkInfoCraftstepRecordUpdateInput input)
{
WorkInfoCraftstepRecordEntity entity = new()
if (!string.IsNullOrEmpty(input.WorkId))
{
Id = input.WorkCraftstepId,
Status = input.Status,
UpdateTime = DateTime.Now
};
bool res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
bool res = await _dbContext.Updateable<WorkInfoCraftstepRecordEntity>()
.SetColumns(x=>x.Status==input.Status)
.SetColumns(x=>x.UpdateTime==DateTime.Now).IgnoreColumns(true).Where(x=>x.WorkId==input.WorkId && x.PotNum==input.PotNum).ExecuteCommandHasChangeAsync();
return res;
}
else
{
WorkInfoCraftstepRecordEntity entity = new()
{
Id = input.WorkCraftstepId,
Status = input.Status,
UpdateTime = DateTime.Now
};
bool res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
}

/// <summary>
/// 强制结束工单
/// </summary>


正在加载...
取消
保存