diff --git a/industry-common/src/main/java/com/industry/common/constant/Constants.java b/industry-common/src/main/java/com/industry/common/constant/Constants.java index 56085250..fe6819f1 100644 --- a/industry-common/src/main/java/com/industry/common/constant/Constants.java +++ b/industry-common/src/main/java/com/industry/common/constant/Constants.java @@ -19,7 +19,7 @@ public class Constants /** * 无此工艺 */ - public static final int NOT_HAVE_TECHNOLOGY = 2; + public static final int NOT_HAVE_TECHNOLOGY = 3; /** * 为处理此道次 diff --git a/industry-system/src/main/java/com/industry/work/service/impl/IndustryStepServiceImpl.java b/industry-system/src/main/java/com/industry/work/service/impl/IndustryStepServiceImpl.java index 19d47786..ba85be8c 100644 --- a/industry-system/src/main/java/com/industry/work/service/impl/IndustryStepServiceImpl.java +++ b/industry-system/src/main/java/com/industry/work/service/impl/IndustryStepServiceImpl.java @@ -445,8 +445,9 @@ public class IndustryStepServiceImpl implements IIndustryStepService { // 将状态改为了轧制中 List successList = industryMaterialService.resourceToWorkAndCreateStep(industryMaterial); if (Objects.nonNull(successList) && !successList.isEmpty()) { - // 20250809 为了将不同工艺的物料生成不同工艺的道次,此处应该根据每一快物料生成对应的道次数据 + for (IndustryMaterialVo success : successList) { + // 进入这里说明工艺没问题接下里根据工艺表创建道次 // 判断当前是粗轧还是精轧 IndustryTechnology industryTechnology = new IndustryTechnology(); @@ -471,6 +472,26 @@ public class IndustryStepServiceImpl implements IIndustryStepService { return Constants.NOT_HAVE_TECHNOLOGY; } + } + // 20250809 为了将不同工艺的物料生成不同工艺的道次,此处应该根据每一快物料生成对应的道次数据 + for (IndustryMaterialVo success : successList) { + // 进入这里说明工艺没问题接下里根据工艺表创建道次 + // 判断当前是粗轧还是精轧 + IndustryTechnology industryTechnology = new IndustryTechnology(); + industryTechnology.setTechnologyId(success.getTechnology()); + industryTechnology.setDiameter(success.getDiameter()); + industryTechnology.setSpecification(success.getSpecification()); + if (Objects.equals(mode, "0")) { + // 粗轧 + industryTechnology.setState(0L); + } else { + industryTechnology.setState(1L); + } + // 拿到第一个物料对应的工艺要生成的所有道次 + List industryTechnologyVos = industryTechnologyService.selectIndustryTechnologyList(industryTechnology); + // 添加特判 当工艺表为空时通知前端无此工艺不可进入轧制页面 + + // 也就是说这里不管下面的物料是否为此工艺也按照此工艺生成道次只不过不需要操作 for (IndustryTechnologyVo industryTechnologyVo : industryTechnologyVos) { IndustryStep industryStep = getIndustryStep(industryMaterial, success, industryTechnologyVo);