1 year ago
parent
commit
e898cf9bb1

+ 6 - 4
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -168,10 +168,12 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
         for (CheckStandard standard:checkStandards){
             checkIds.add(standard.getId());
         }
-        Weekend<CheckStandardSpare> weekend3 = new Weekend<>(CheckStandardSpare.class);
-        WeekendCriteria<CheckStandardSpare, Object> weekendCriteria3 = weekend3.weekendCriteria();
-        weekendCriteria3.andIn(CheckStandardSpare::getCheckId, checkIds);
-        checkStandardSpareMapper.deleteByExample(weekend3);
+        if (checkIds!=null&&checkIds.size()>0) {
+            Weekend<CheckStandardSpare> weekend3 = new Weekend<>(CheckStandardSpare.class);
+            WeekendCriteria<CheckStandardSpare, Object> weekendCriteria3 = weekend3.weekendCriteria();
+            weekendCriteria3.andIn(CheckStandardSpare::getCheckId, checkIds);
+            checkStandardSpareMapper.deleteByExample(weekend3);
+        }
 
         checkStandardMapper.deleteByExample(weekend1);
         //删除保养任务

+ 0 - 1
platform-service/src/main/java/com/platform/service/sqarepartmanage/impl/SparePartInfoServiceImpl.java

@@ -249,7 +249,6 @@ public class SparePartInfoServiceImpl extends BaseServiceImpl<SparePartInfoMappe
         weekend.weekendCriteria().andNotEqualTo(CheckJob::getStatus, CheckJobStatusEnum.FINISHED.getValue())
                 .andBetween(CheckJob::getStartTime, now, afterSixMonth);
         List<CheckJob> checkJobs = checkJobMapper.selectByExample(weekend);
-
         // 获取未执行的标准id,不能用stream获取id列表,会覆盖重复的标准id(不会重复,因为一个标准对应一个任务。)
         List<CheckStandardSpareVO> voList = new ArrayList<CheckStandardSpareVO>();
         if(CollectionUtil.isNotEmpty(checkJobs)){