|
@@ -1270,6 +1270,23 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
|
|
|
String jccs = apsReportCheckoutService.selectJccsByReportId(apsReportRecordsDo.getId());
|
|
|
apsReportRecordsDo.setReportjgcs(jgcs);
|
|
|
apsReportRecordsDo.setReportjccs(jccs);
|
|
|
+
|
|
|
+ //是否坯料工序!=是,并且是第一道工序,并且输入批次号不为空,并且在线上在制品可以找到对应的检验等级
|
|
|
+ if (!apsProcessOperationDo.getIfblankprocess().equals("是")
|
|
|
+ && StringUtils.isBlank(apsProcessOperationProcessEquDo.getPreviousprocessesids())
|
|
|
+ && StringUtils.isNotBlank(nowReportRecordsDo.getBatchnumber())) {
|
|
|
+ //定义检验等级排序,从大->小
|
|
|
+ List<String> checkLevelOrder = Arrays.asList("待判", "不合格", "BC级", "B级");
|
|
|
+ List<String> inputBatchNumber = Arrays.asList(nowReportRecordsDo.getBatchnumber().split(","));
|
|
|
+ List<ApsWorkInProgressInventoryDo> inputList = apsWorkInProgressInventoryService.list(new LambdaQueryWrapper<ApsWorkInProgressInventoryDo>()
|
|
|
+ .in(ApsWorkInProgressInventoryDo::getBatchnumber, inputBatchNumber)
|
|
|
+ .isNotNull(ApsWorkInProgressInventoryDo::getInspectionlevel)
|
|
|
+ .ne(ApsWorkInProgressInventoryDo::getInspectionlevel, ""));
|
|
|
+ if (!inputList.isEmpty()) {
|
|
|
+ ApsWorkInProgressInventoryDo minWorkInProgress = inputList.stream().min(Comparator.comparingInt(a -> checkLevelOrder.indexOf(a.getInspectionlevel()))).orElse(null);
|
|
|
+ apsReportRecordsDo.setBlanklevel(minWorkInProgress.getInspectionlevel());
|
|
|
+ }
|
|
|
+ }
|
|
|
this.updateById(apsReportRecordsDo);
|
|
|
|
|
|
OrganizationCodeAndDeviceCodeVo organizationCodeAndDeviceCodeVo = this.baseMapper.selectOrganizationCodeAndDeviceCode(apsProcessOperationProcessEquDo.getProcessdeviceid());
|