Commit 80efeb1844ed12e28ac15193b658e76cbd99299a
1 parent
ccc20eee
养护计划
Showing
2 changed files
with
14 additions
and
0 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| ... | ... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 6 | 6 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 7 | 7 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| 8 | 8 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 9 | +import com.zteits.urbanops.framework.common.exception.ErrorCode; | |
| 9 | 10 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 10 | 11 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 11 | 12 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| ... | ... | @@ -89,6 +90,12 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 89 | 90 | @Transactional(rollbackFor = Exception.class) |
| 90 | 91 | @Override |
| 91 | 92 | public CommonResult<Integer> createInspectionPlan(InspectionPlanSaveReqVO createReqVO) { |
| 93 | + createReqVO.getRoadListReqVO().forEach(road -> { | |
| 94 | + if (road.getDeptId() == null || road.getRoadId() == 0L) { | |
| 95 | + ErrorCode errorCode = new ErrorCode(INSPECTION_PLAN_NOT_EXISTS.getCode(), road.getRoadName()+"未配置部门信息,请在道路管理界面配置班组"); | |
| 96 | + throw exception(errorCode); | |
| 97 | + } | |
| 98 | + }); | |
| 92 | 99 | //存在性校验 |
| 93 | 100 | validateInspectionPlanExists(createReqVO); |
| 94 | 101 | LocalDateTime now = LocalDateTime.now(); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanServiceImpl.java
| ... | ... | @@ -6,6 +6,7 @@ import cn.hutool.core.util.RandomUtil; |
| 6 | 6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 7 | 7 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| 8 | 8 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 9 | +import com.zteits.urbanops.framework.common.exception.ErrorCode; | |
| 9 | 10 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 10 | 11 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 11 | 12 | import com.zteits.urbanops.framework.mybatis.core.util.MyBatisUtils; |
| ... | ... | @@ -102,6 +103,12 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 102 | 103 | |
| 103 | 104 | @Override |
| 104 | 105 | public CommonResult<Integer> createMaintainPlan(MaintainPlanSaveReqVO createReqVO) { |
| 106 | + createReqVO.getRoadListReqVO().forEach(road -> { | |
| 107 | + if (road.getDeptId() == null || road.getRoadId() == 0L) { | |
| 108 | + ErrorCode errorCode = new ErrorCode(INSPECTION_PLAN_NOT_EXISTS.getCode(), road.getRoadName() + "未配置部门信息,请在道路管理界面配置班组"); | |
| 109 | + throw exception(errorCode); | |
| 110 | + } | |
| 111 | + }); | |
| 105 | 112 | //存在性校验 |
| 106 | 113 | validateMaintainPlanExists(createReqVO); |
| 107 | 114 | LocalDateTime now = LocalDateTime.now(); | ... | ... |