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 a206cb48..446ddf2e 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 @@ -210,12 +210,26 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { @Override public int delIndustryMaterialById(String id) { + + IndustryMaterialVo industryMaterialVo = industryMaterialMapper.selectIndustryMaterialById(id); Long batchId = industryMaterialVo.getBatchId(); IndustryBatchVo industryBatchVo = industryBatchService.selectIndustryBatchById(batchId); industryBatchVo.setBatchSize(industryBatchVo.getBatchSize() - 1); industryBatchService.updateIndustryBatch(industryBatchVo); - // 删除此数据 + // 删除此数据: 先清理摄像头放置删除后立马被写入 + // leftId和rightId + // 判断左摄像头的id是否与当前删除的相同如果相同则删除此缓存 + if (id.equals(redisCache.getCacheObject("leftId"))) { + redisCache.deleteObject("leftId"); + s7PLC.writeString("DB4.30","\u0000\u0000\u0000\u0000"); + + } + if (id.equals(redisCache.getCacheObject("rightId"))) { + redisCache.deleteObject("rightId"); + + s7PLC.writeString("DB44.30","\u0000\u0000\u0000\u0000"); + } industryMaterialMapper.deleteIndustryMaterialById(id); List industryMaterialVos = industryMaterialMapper.selectIndustryMaterialByBatchId(batchId); // 进行重新排列 @@ -234,18 +248,6 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { redisCache.setCacheObject("sort",sort); redisCache.setCacheObject("size",size); - // 接下来处理左右摄像头数据 - // leftId和rightId - // 判断左摄像头的id是否与当前删除的相同如果相同则删除此缓存 - if (id.equals(redisCache.getCacheObject("leftId"))) { - redisCache.deleteObject("leftId"); - s7PLC.writeString("DB4.30","\u0000\u0000\u0000\u0000"); - - } - if (id.equals(redisCache.getCacheObject("rightId"))) { - redisCache.deleteObject("rightId"); - s7PLC.writeString("DB44.30","\u0000\u0000\u0000\u0000"); - } return 1; 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 a13afaa5..19d47786 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 @@ -441,6 +441,8 @@ public class IndustryStepServiceImpl implements IIndustryStepService { @Override public int createStep(IndustryMaterial industryMaterial) { + + // 将状态改为了轧制中 List successList = industryMaterialService.resourceToWorkAndCreateStep(industryMaterial); if (Objects.nonNull(successList) && !successList.isEmpty()) { // 20250809 为了将不同工艺的物料生成不同工艺的道次,此处应该根据每一快物料生成对应的道次数据 @@ -459,16 +461,15 @@ public class IndustryStepServiceImpl implements IIndustryStepService { } // 拿到第一个物料对应的工艺要生成的所有道次 List industryTechnologyVos = industryTechnologyService.selectIndustryTechnologyList(industryTechnology); -// List industryMaterialVos = industryMaterialService.selectIndustryMaterialByBatchId(industryMaterial.getBatchId()); // 添加特判 当工艺表为空时通知前端无此工艺不可进入轧制页面 -// if (industryTechnologyVos.isEmpty()) { -// // 把状态改回去 -// success.setState(0L); -// industryMaterialMapper.updateIndustryMaterial(success); -// return Constants.NOT_HAVE_TECHNOLOGY; -// } - // TODO 将道次为空的也放入异常 + // 校验是否都存在道次 如果有一个不存在此工艺直接返回不做任何操作 + if (industryTechnologyVos.isEmpty()) { + // 把状态改回去 + success.setState(0L); + industryMaterialMapper.updateIndustryMaterial(success); + return Constants.NOT_HAVE_TECHNOLOGY; + } // 也就是说这里不管下面的物料是否为此工艺也按照此工艺生成道次只不过不需要操作 for (IndustryTechnologyVo industryTechnologyVo : industryTechnologyVos) {