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 6f3b420f..a464ef7d 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 @@ -557,11 +557,8 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { IndustryMaterial industryMaterial = new IndustryMaterial(); industryMaterial.setBatchId(industryMaterialDto.getBatchId()); int pos = -1; - Long state = industryMaterialDto.getState(); - // 3代表的是该批次中存在道次异常,下面的查询时直接跳过这个批次 - state = state == 3 ? 5 : state; // 查询下一个应该将operation改为 1 的批次 并且为同一状态 - industryMaterial.setState(state); + industryMaterial.setState(5L); industryMaterial.setDelFlag(1L); // 查出连同正在运行的道次以及左边料物信息 List industryMaterialVos = industryMaterialMapper.selectIndustryMaterialAndStepList(industryMaterial); @@ -574,7 +571,8 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { // 判断列表是否只有一个对象 如果是的话则不需要更新字段operation if (industryMaterialVos.size() == 1) { redisCache.setCacheObject("nextStepFlagError", 1L, 100, TimeUnit.HOURS); - return 1; + // 如果只有一个对象且此对象存在了道次异常则将其opration置为0 + return 0; } // 记录当前正在运行的是第几个 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 ad7f3236..1004b264 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,14 +141,7 @@ public class IndustryStepServiceImpl implements IIndustryStepService { @Override public List selectIndustryStepListByProcess(IndustryStep industryStep) { - List industryStepVos = industryStepMapper.selectIndustryStepList(industryStep); - if (industryStepVos.isEmpty()) { - // 表示该批次没有出现道次 直接return - industryStep = new IndustryStep(); - industryStep.setMaterialId(industryStep.getMaterialId()); - industryStep.setBatchId(industryStep.getBatchId()); - return industryStepMapper.selectIndustryStepList(industryStep); - } + List industryStepVos = industryStepMapper.selectErrorIndustryStepList(industryStep); int pos = 0; for (IndustryStepVo resultStepVo : industryStepVos) { if (resultStepVo.getOperation() == 1L) { diff --git a/industry-system/src/main/resources/mapper/work/IndustryMaterialMapper.xml b/industry-system/src/main/resources/mapper/work/IndustryMaterialMapper.xml index 871fc69c..d5e1d82f 100644 --- a/industry-system/src/main/resources/mapper/work/IndustryMaterialMapper.xml +++ b/industry-system/src/main/resources/mapper/work/IndustryMaterialMapper.xml @@ -55,8 +55,8 @@ diff --git a/industry-system/src/main/resources/mapper/work/IndustryStepMapper.xml b/industry-system/src/main/resources/mapper/work/IndustryStepMapper.xml index 0ecc7ed1..5b547cee 100644 --- a/industry-system/src/main/resources/mapper/work/IndustryStepMapper.xml +++ b/industry-system/src/main/resources/mapper/work/IndustryStepMapper.xml @@ -54,8 +54,8 @@ and angle = #{angle} and operation = #{operation} and state = #{state} - and material_id = #{materialId} - and batch_id = #{batchId} + and material_id = #{materialId} + and batch_id = #{batchId} order by step