|
@@ -26,6 +26,7 @@ import cn.com.ty.lift.common.model.PushMessage;
|
|
|
import cn.com.ty.lift.common.model.PushUserInfo;
|
|
|
import cn.com.ty.lift.common.utils.DateUtils;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.poi.excel.ExcelUtil;
|
|
|
import cn.hutool.poi.excel.ExcelWriter;
|
|
@@ -387,7 +388,7 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
|
|
|
LambdaQueryWrapper<MaintenancePlan> lambdaQueryWrapper = queryWrapper.lambda();
|
|
|
lambdaQueryWrapper.eq(MaintenancePlan::getMtCompanyId, mtCompanyId);
|
|
|
lambdaQueryWrapper.eq(MaintenancePlan::getLiftId, liftId);
|
|
|
- lambdaQueryWrapper.gt(MaintenancePlan::getCount, periods);
|
|
|
+ lambdaQueryWrapper.ge(MaintenancePlan::getCount, periods);
|
|
|
return list(lambdaQueryWrapper);
|
|
|
}
|
|
|
|
|
@@ -446,17 +447,13 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
|
|
|
} else if (isNull && ObjectUtil.isNotEmpty(updateInterval)) {
|
|
|
//获取当前期数后的维保计划列表,并清除计划
|
|
|
planList = findPlanList(mtCompanyId, liftId, periods);
|
|
|
- LocalDate planDate;
|
|
|
- Optional<MaintenancePlan> planOptional = planList.stream()
|
|
|
- .filter(entity -> entity.getCount().equals(periods)).findFirst();
|
|
|
- if (planOptional.isPresent()) {
|
|
|
- MaintenancePlan maintenancePlan = planOptional.get();
|
|
|
- planDate = maintenancePlan.getPlanDate();
|
|
|
+ if (CollUtil.isNotEmpty(planList)) {
|
|
|
+ LocalDate planDate = planList.get(0).getPlanDate();
|
|
|
+ removeByIds(planList.stream().map(MaintenancePlan::getId).collect(Collectors.toList()));
|
|
|
+ //更新项目电梯关联表保养间隔
|
|
|
+ projectLiftRelevanceService.modify(relevance);
|
|
|
+ plans = generatePlan(plan, periods, updateInterval, planDate, endDate);
|
|
|
} else return false;
|
|
|
- removeByIds(planList.stream().map(MaintenancePlan::getId).collect(Collectors.toList()));
|
|
|
- //更新项目电梯关联表保养间隔
|
|
|
- projectLiftRelevanceService.modify(relevance);
|
|
|
- plans = generatePlan(plan, periods, updateInterval, planDate, endDate);
|
|
|
} else if (isNotNull && ObjectUtil.isNotEmpty(updateInterval)) {
|
|
|
//获取当前期数后的维保计划列表,并清除计划
|
|
|
planList = findPlanList(mtCompanyId, liftId, periods);
|