Przeglądaj źródła

Merge branch 'feature-bieao' of lift-manager/lift-server into develop

bieao 5 lat temu
rodzic
commit
9ec26b990d

+ 7 - 7
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenanceRecordService.java

@@ -191,14 +191,14 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
         if (ObjectUtil.isEmpty(entry)) return false;
         int interval = entry.getPlanInterval();
         List<MaintenancePlan> planList = maintenancePlanService.findPlanList(liftId, projectId, mtCompanyId, request.getCurrentTime(), "record");
+        //提前保养跳过当前保养的计划
+        Iterator<MaintenancePlan> iterator = planList.iterator();
+        if (iterator.hasNext()) {
+            MaintenancePlan next = iterator.next();
+            if (Objects.nonNull(next))
+                iterator.remove();
+        }
         if (CollUtil.isNotEmpty(planList)) {
-            //提前保养跳过当前保养的计划
-            Iterator<MaintenancePlan> iterator = planList.iterator();
-            if (iterator.hasNext()) {
-                MaintenancePlan next = iterator.next();
-                if (Objects.nonNull(next))
-                    iterator.remove();
-            }
             //获取当前时间后的维保计划列表,并清除计划
             maintenancePlanService.removeByIds(planList.stream().map(MaintenancePlan::getId).collect(Collectors.toList()));
         }