Browse Source

联锁删除对应删除临时表数据

LLL 5 months ago
parent
commit
5c6b8d3ada

+ 20 - 4
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/service/impl/InterlockSummaryServiceImpl.java

@@ -78,8 +78,14 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
                 LambdaQueryWrapper<InterlockDetail> detailWrapper = new LambdaQueryWrapper<>();
                 detailWrapper.eq(InterlockDetail::getSummaryid,id);
                 interlockDetailMapper.delete(detailWrapper);
+                //删除联锁详细信息临时表数据
+                LambdaQueryWrapper<InterlockDetailTemp> queryWrapper2= new LambdaQueryWrapper<>();
+                queryWrapper2.eq(InterlockDetailTemp::getSummaryid,id);
+                detailTempMapper.delete(queryWrapper2);
                 //删除联锁
                 interlockSummaryMapper.deleteById(id);
+                //删除联锁临时表数据
+                summaryTempMapper.deleteById(id);
             }
         }
     }
@@ -97,8 +103,14 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
         LambdaQueryWrapper<InterlockDetail> detailWrapper = new LambdaQueryWrapper<>();
         detailWrapper.eq(InterlockDetail::getSummaryid,id);
         interlockDetailMapper.delete(detailWrapper);
+        //删除联锁详细信息临时表数据
+        LambdaQueryWrapper<InterlockDetailTemp> queryWrapper2= new LambdaQueryWrapper<>();
+        queryWrapper2.eq(InterlockDetailTemp::getSummaryid,id);
+        detailTempMapper.delete(queryWrapper2);
         //删除联锁
         interlockSummaryMapper.deleteById(id);
+        //删除联锁临时表数据
+        summaryTempMapper.deleteById(id);
     }
 
     /**
@@ -150,6 +162,10 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
         LambdaQueryWrapper<InterlockDetail> queryWrapper1 = new LambdaQueryWrapper<>();
         queryWrapper1.eq(InterlockDetail::getSummaryid,summaryId);
         interlockDetailMapper.delete(queryWrapper1);
+        //删除该联锁对应的联锁详细信息临时表数据
+        LambdaQueryWrapper<InterlockDetailTemp> queryWrapper2= new LambdaQueryWrapper<>();
+        queryWrapper2.eq(InterlockDetailTemp::getSummaryid,summaryId);
+        detailTempMapper.delete(queryWrapper2);
 
 
         //新增——联锁输出值点位
@@ -184,7 +200,7 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
                 }
                 if(dto.getInstrumentStatus().equals("1")) instrumentStatus = "1";
             }
-            //控制系统状态
+            //控制系统状态 TODO
             if("非正常".equals(dto.getMpStatus()) || "非正常".equals(dto.getMpStatus()) || "非正常".equals(dto.getMpStatus())) {
                 dto.setControlSystemStatus("1");
                 controlSystemStatus = "1";
@@ -213,9 +229,9 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
         InterlockSummary interlockSummary = InterlockSummaryConvert.INSTANCE.toInterlockSummary1(interlockAddDTO,interlockStatus,loopHealthLevel);
         //修改联锁总表数据
         interlockSummaryMapper.updateById(interlockSummary);
-        //新增联锁总表临时表数据
+        //修改联锁总表临时表数据
         InterlockSummaryTemp interlockSummaryTemp = TempConvert.INSTANCE.toInterlockSummaryTemp(interlockSummary);
-        summaryTempMapper.insert(interlockSummaryTemp);
+        summaryTempMapper.updateById(interlockSummaryTemp);
     }
 
     /**
@@ -275,7 +291,7 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
                 }
                 if(dto.getInstrumentStatus().equals("1")) instrumentStatus = "1";
             }
-            //控制系统状态
+            //控制系统状态 TODO
             if("非正常".equals(dto.getMpStatus()) || "非正常".equals(dto.getMpStatus()) || "非正常".equals(dto.getMpStatus())) {
                 dto.setControlSystemStatus("1");
                 controlSystemStatus = "1";