diff --git a/industry-system/src/main/java/com/industry/work/mapper/IndustryMaterialMapper.java b/industry-system/src/main/java/com/industry/work/mapper/IndustryMaterialMapper.java index f24e665d..110bcb85 100644 --- a/industry-system/src/main/java/com/industry/work/mapper/IndustryMaterialMapper.java +++ b/industry-system/src/main/java/com/industry/work/mapper/IndustryMaterialMapper.java @@ -71,6 +71,7 @@ public interface IndustryMaterialMapper * @return 结果 */ public int deleteIndustryMaterialByIds(String[] ids); + public int deleteMaterialById(String id); List selectIndustryMaterialByBatchId(Long batchId); 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 446ddf2e..c5f45be8 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 @@ -227,10 +227,9 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { } if (id.equals(redisCache.getCacheObject("rightId"))) { redisCache.deleteObject("rightId"); - s7PLC.writeString("DB44.30","\u0000\u0000\u0000\u0000"); } - industryMaterialMapper.deleteIndustryMaterialById(id); + industryMaterialMapper.deleteMaterialById(id); List industryMaterialVos = industryMaterialMapper.selectIndustryMaterialByBatchId(batchId); // 进行重新排列 for (int i = 1; i <= industryMaterialVos.size(); i++) { diff --git a/industry-system/src/main/resources/mapper/work/IndustryMaterialMapper.xml b/industry-system/src/main/resources/mapper/work/IndustryMaterialMapper.xml index 56c0f85a..5b675542 100644 --- a/industry-system/src/main/resources/mapper/work/IndustryMaterialMapper.xml +++ b/industry-system/src/main/resources/mapper/work/IndustryMaterialMapper.xml @@ -381,6 +381,12 @@ #{id} + + delete from industry_material where id in + + #{id} + + delete from industry_material where state = #{state}