|
@@ -34,6 +34,7 @@ import cn.com.ty.lift.common.utils.SendMessageUtil;
|
|
|
import cn.com.ty.lift.common.verify.Validate;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
@@ -459,12 +460,14 @@ public class LiftService extends ServiceImpl<LiftMapper, Lift> {
|
|
|
List<Long> liftIdList = new ArrayList<>();
|
|
|
liftIdList.add(entry.getId());
|
|
|
List<MaintenancePlan> planList = maintenancePlanService.getPlanList(mtCompanyId, liftIdList);
|
|
|
- //修改未完成的维保计划为新的维保负责人
|
|
|
- planList.forEach(plan -> plan.setWorkerId(newWorkerId));
|
|
|
- boolean planResult = maintenancePlanService.updateBatchById(planList);
|
|
|
- if (!planResult) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return RestResponse.fail(MessageUtils.get("msg.modify.fail"));
|
|
|
+ if (CollUtil.isNotEmpty(planList)) {
|
|
|
+ //修改未完成的维保计划为新的维保负责人
|
|
|
+ planList.forEach(plan -> plan.setWorkerId(newWorkerId));
|
|
|
+ boolean planResult = maintenancePlanService.updateBatchById(planList);
|
|
|
+ if (!planResult) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return RestResponse.fail(MessageUtils.get("msg.modify.fail"));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return RestResponse.success(null, MessageUtils.get("msg.modify.success"));
|