diff --git a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml index 2b169bf..98f9d0b 100644 --- a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml +++ b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml @@ -5531,6 +5531,13 @@ + + + 根据成品获取配置完成的产线 + + + + 更新 @@ -5728,6 +5735,13 @@ + + + 配置完成的产线 + + + + 查询单条 @@ -9676,6 +9690,11 @@ 名称 + + + 成品Id + + 输出 diff --git a/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/FinalsInfoService.cs b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/FinalsInfoService.cs index a935c11..e0fc016 100644 --- a/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/FinalsInfoService.cs +++ b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/FinalsInfoService.cs @@ -128,6 +128,25 @@ namespace BPA.MES.Base.Application.Services return entity; } /// + /// 根据成品获取配置完成的产线 + /// + /// + /// + [HttpGet] + public async Task FinishLineList(string finalId) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a, b) => a.LineId==b.Id) + .Where((a, b) => a.FinalId == finalId && a.Status=="1") + .Select((a, b) => new + { + key = a.LineId, + value = b.Name, + status = a.Status + }).ToListAsync(); + return entity; + } + /// /// 更新 /// /// diff --git a/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/IFinalsInfoService.cs b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/IFinalsInfoService.cs index b709cbf..43d2f7f 100644 --- a/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/IFinalsInfoService.cs +++ b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/IFinalsInfoService.cs @@ -45,6 +45,12 @@ /// Task LineList(string finalId); /// + /// 配置完成的产线 + /// + /// + /// + Task FinishLineList(string finalId); + /// /// 查询单条 /// /// diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs index 09bbff6..aaa8fbc 100644 --- a/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs @@ -115,7 +115,7 @@ namespace BPA.MES.Base.Application.Services throw Oops.Bah("名称或编码已存在!"); } ProductLineEntity entity = input.Adapt(); - var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(x=>x.CreateTime).ExecuteCommandHasChangeAsync(); return res; } /// diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkPlanDto.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkPlanDto.cs index 70e778f..3c5aeb5 100644 --- a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkPlanDto.cs +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkPlanDto.cs @@ -64,6 +64,11 @@ namespace BPA.MES.Base.Application.Services /// 名称 /// public string Name { get; set; } + /// + /// 成品Id + /// + + public string FinalId { get; set; } } /// /// 输出 diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs index 9b2fe62..b16a7d4 100644 --- a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs @@ -31,7 +31,9 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services public async Task Add(WorkInfoAddInput input) { bool result = false; + var planEntity =await _dbContext.Queryable().Where(x=>x.Id==input.PlanId).FirstAsync(); Pztj_WorkInfoEntity entity = input.Adapt(); + entity.FinalId = planEntity.FinalId; List workDeviceRecordEntities = new(); foreach (var item in input.WorkDevices) { diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkPlanService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkPlanService.cs index 220a5b1..d5d9126 100644 --- a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkPlanService.cs +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkPlanService.cs @@ -91,6 +91,7 @@ namespace BPA.MES.Base.Application.Services { var entity = await _dbContext.Queryable() .WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.FinalId),x=>x.FinalId ==input.FinalId) .ToPagedListAsync(input.PageIndex, input.PageSize); SqlSugarPagedList output = entity.Adapt>(); return output;