From 867677f46518fbd042de7b9d82717a6ceb171d47 Mon Sep 17 00:00:00 2001 From: 86156 <823267011@qq.com> Date: Thu, 10 Jul 2025 14:18:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work/IndustryStepController.java | 2 +- .../work/domain/IndustryTechnology.java | 5 ++++ .../service/IIndustryMaterialService.java | 2 +- .../impl/IndustryMaterialServiceImpl.java | 8 +++--- .../service/impl/IndustryStepServiceImpl.java | 26 ++++++------------- .../mapper/work/IndustryStepMapper.xml | 6 ++--- .../mapper/work/IndustryTechnologyMapper.xml | 12 ++++++++- 7 files changed, 33 insertions(+), 28 deletions(-) diff --git a/industry-admin/src/main/java/com/industry/web/controller/work/IndustryStepController.java b/industry-admin/src/main/java/com/industry/web/controller/work/IndustryStepController.java index ca693bef..32411234 100644 --- a/industry-admin/src/main/java/com/industry/web/controller/work/IndustryStepController.java +++ b/industry-admin/src/main/java/com/industry/web/controller/work/IndustryStepController.java @@ -187,7 +187,7 @@ public class IndustryStepController extends BaseController public AjaxResult resource(IndustryMaterial industryMaterial){ return AjaxResult.success(industryStepService.createStep(industryMaterial)); - } +} diff --git a/industry-system/src/main/java/com/industry/work/domain/IndustryTechnology.java b/industry-system/src/main/java/com/industry/work/domain/IndustryTechnology.java index 14fe889e..be418908 100644 --- a/industry-system/src/main/java/com/industry/work/domain/IndustryTechnology.java +++ b/industry-system/src/main/java/com/industry/work/domain/IndustryTechnology.java @@ -52,5 +52,10 @@ public class IndustryTechnology extends BaseEntity /** 删除标志 */ private Long delFlag; + /** 直径 */ + private Double diameter; + + @Excel(name = "规格") + private String specification; } diff --git a/industry-system/src/main/java/com/industry/work/service/IIndustryMaterialService.java b/industry-system/src/main/java/com/industry/work/service/IIndustryMaterialService.java index 4ab97377..b3031182 100644 --- a/industry-system/src/main/java/com/industry/work/service/IIndustryMaterialService.java +++ b/industry-system/src/main/java/com/industry/work/service/IIndustryMaterialService.java @@ -100,7 +100,7 @@ public interface IIndustryMaterialService * @param industryMaterial batchId state=1 * @return */ - String resourceToWorkAndCreateStep(IndustryMaterial industryMaterial); + IndustryMaterialVo resourceToWorkAndCreateStep(IndustryMaterial industryMaterial); /** * 异常料切换 diff --git a/industry-system/src/main/java/com/industry/work/service/impl/IndustryMaterialServiceImpl.java b/industry-system/src/main/java/com/industry/work/service/impl/IndustryMaterialServiceImpl.java index 7a7e6291..b521c677 100644 --- a/industry-system/src/main/java/com/industry/work/service/impl/IndustryMaterialServiceImpl.java +++ b/industry-system/src/main/java/com/industry/work/service/impl/IndustryMaterialServiceImpl.java @@ -646,7 +646,7 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { @Override @Transactional - public String resourceToWorkAndCreateStep(IndustryMaterial industryMaterial) { + public IndustryMaterialVo resourceToWorkAndCreateStep(IndustryMaterial industryMaterial) { IndustryMaterialVo industryMaterialVo = new IndustryMaterialVo(); industryMaterialVo.setBatchId(industryMaterial.getBatchId()); // 获得该批次的所有原料 @@ -658,7 +658,7 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { IndustryMaterialVo firstIndustryMaterial = industryMaterialVos.get(0); for (IndustryMaterialVo materialVo : industryMaterialVos) { if (!Objects.equals(firstIndustryMaterial.getTechnology(), materialVo.getTechnology())) { - return "0"; + return null; } } for (IndustryMaterialVo materialVo : industryMaterialVos) { @@ -666,9 +666,9 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { updateIndustryMaterial(materialVo); } // 到了这里表示工艺都相同返回1 - return firstIndustryMaterial.getTechnology(); + return firstIndustryMaterial; } else { - return "0"; + return null; } 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 f2765586..2ce27396 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 @@ -141,16 +141,12 @@ public class IndustryStepServiceImpl implements IIndustryStepService { @Override public List selectIndustryStepListByProcess(IndustryStep industryStep) { - String materialId = industryStep.getMaterialId(); - Long batchId = industryStep.getBatchId(); - industryStep.setMaterialId(materialId); - industryStep.setBatchId(batchId); List industryStepVos = industryStepMapper.selectIndustryStepList(industryStep); if (industryStepVos.isEmpty()) { // 表示该批次没有出现道次 直接return industryStep = new IndustryStep(); - industryStep.setMaterialId(materialId); - industryStep.setBatchId(batchId); + industryStep.setMaterialId(industryStep.getMaterialId()); + industryStep.setBatchId(industryStep.getBatchId()); return industryStepMapper.selectIndustryStepList(industryStep); } int pos = 0; @@ -257,14 +253,6 @@ public class IndustryStepServiceImpl implements IIndustryStepService { // nextStepFlag为切换道次的标志位,当其为1时需要进行切换道次,否则不用切换道次 return 0; } - - -// s7PLC.writeBoolean("DB15.1.2", true); -// while (!s7PLC.readBoolean("DB15.1.2")) { -// Threads.sleep(500); -// -// } -// if (s7PLC.readBoolean("DB15.1.2")) { Threads.sleep(5000); // 更新该批次中的全部道次的 "操作中" 字段为0 IndustryStep step = new IndustryStep(); @@ -329,6 +317,7 @@ public class IndustryStepServiceImpl implements IIndustryStepService { IndustryStep industryStep = new IndustryStep(); industryStep.setDelFlag(1L); industryStep.setState(0L); + industryStep.setBatchId(industryMaterial.getBatchId()); List industryStepVos = industryStepMapper.selectErrorIndustryStepList(industryStep); IndustryStep smallStep = industryStepVos.get(0); @@ -415,12 +404,14 @@ public class IndustryStepServiceImpl implements IIndustryStepService { @Override public int createStep(IndustryMaterial industryMaterial) { - String success = industryMaterialService.resourceToWorkAndCreateStep(industryMaterial); - if (!Objects.equals(success, "0")) { + IndustryMaterialVo success = industryMaterialService.resourceToWorkAndCreateStep(industryMaterial); + if (Objects.nonNull(success)) { // 进入这里说明工艺没问题接下里根据工艺表创建道次 // 判断当前是粗轧还是精轧 IndustryTechnology industryTechnology = new IndustryTechnology(); - industryTechnology.setTechnologyId(success); + industryTechnology.setTechnologyId(success.getTechnology()); + industryTechnology.setDiameter(success.getDiameter()); + industryTechnology.setSpecification(success.getSpecification()); if (Objects.equals(mode, "0")) { // 粗轧 industryTechnology.setState(0L); @@ -431,7 +422,6 @@ public class IndustryStepServiceImpl implements IIndustryStepService { List industryMaterialVos = industryMaterialService.selectIndustryMaterialByBatchId(industryMaterial.getBatchId()); // 添加特判 当工艺表为空时通知前端无此工艺不可进入轧制页面 if (industryTechnologyVos.isEmpty()) { - // 把状态改回去 if (Objects.nonNull(industryMaterialVos.get(0))) { for (IndustryMaterialVo materialVo : industryMaterialVos) { diff --git a/industry-system/src/main/resources/mapper/work/IndustryStepMapper.xml b/industry-system/src/main/resources/mapper/work/IndustryStepMapper.xml index 7f27e87e..202ac02b 100644 --- a/industry-system/src/main/resources/mapper/work/IndustryStepMapper.xml +++ b/industry-system/src/main/resources/mapper/work/IndustryStepMapper.xml @@ -47,8 +47,8 @@ and step = #{step} - and del_flag = 0 - and del_flag = #{delFlag} + and del_flag = 0 + and del_flag = #{delFlag} and reduction = #{reduction} and set_value = #{setValue} and angle = #{angle} @@ -64,7 +64,7 @@ and step = #{step} - and del_flag = #{delFlag} + and del_flag = #{delFlag} and reduction = #{reduction} and set_value = #{setValue} and angle = #{angle} diff --git a/industry-system/src/main/resources/mapper/work/IndustryTechnologyMapper.xml b/industry-system/src/main/resources/mapper/work/IndustryTechnologyMapper.xml index 07c370f0..2324f865 100644 --- a/industry-system/src/main/resources/mapper/work/IndustryTechnologyMapper.xml +++ b/industry-system/src/main/resources/mapper/work/IndustryTechnologyMapper.xml @@ -20,10 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - select id, technology_id, step, reduction, thickness_front, thickness_behind, angle, set_value, state, del_flag, remark, create_time, create_by, update_time, update_by from industry_technology + select id, technology_id, step, reduction, thickness_front, thickness_behind, angle, set_value, state, del_flag, remark, create_time, create_by, update_time, update_by,diameter,specification from industry_technology @@ -63,6 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_by, update_time, update_by, + diameter, + specification, #{technologyId}, @@ -79,6 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createBy}, #{updateTime}, #{updateBy}, + #{diameter}, + #{specification}, @@ -99,6 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_by = #{createBy}, update_time = #{updateTime}, update_by = #{updateBy}, + diameter = #{diameter}, + specification = #{specification}, where id = #{id}