Browse Source

优化

shengtang
747575620@qq.com 1 year ago
parent
commit
8bd5d3c5c0
2 changed files with 26 additions and 7 deletions
  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 View File

@@ -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 View File

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


Loading…
Cancel
Save