Commit f78a867b59f7530d34030e445e2ea6ca9fa75151
1 parent
dd855940
修改道路及增加道路频次
Showing
5 changed files
with
38 additions
and
2 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/PlanRateDetailController.java
| ... | ... | @@ -80,6 +80,19 @@ public class PlanRateDetailController { |
| 80 | 80 | return success(BeanUtils.toBean(detailList, PlanRateDetailRespVO.class)); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | + @GetMapping("/get-rate-value") | |
| 84 | + @Operation(summary = "获得计划频次明细") | |
| 85 | + @Parameter(name = "busi_Line", description = "业务线", required = true, example = "1024") | |
| 86 | + @Parameter(name = "plan_type_id", description = "计划类型ID", required = true, example = "如浇水:101") | |
| 87 | + @Parameter(name = "level_id", description = "道路等级", required = true, example = "如10:特级") | |
| 88 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:query')") | |
| 89 | + public CommonResult<PlanRateDetailRespVO> getPlanRateValue(@RequestParam("busi_Line") @NotBlank String busiLine, | |
| 90 | + @RequestParam("plan_type_id") @NotNull Integer planTypeId, | |
| 91 | + @RequestParam("level_id") @NotNull Integer levelId) { | |
| 92 | + PlanRateDetailDO detail = planRateDetailService.getPlanRateValue(busiLine, planTypeId, levelId ); | |
| 93 | + return success(BeanUtils.toBean(detail, PlanRateDetailRespVO.class)); | |
| 94 | + } | |
| 95 | + | |
| 83 | 96 | @GetMapping("/page") |
| 84 | 97 | @Operation(summary = "获得计划频次明细分页") |
| 85 | 98 | @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:query')") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadController.java
| ... | ... | @@ -91,7 +91,7 @@ public class RoadController { |
| 91 | 91 | @PostMapping("/list") |
| 92 | 92 | @Operation(summary = "获得道路列表") |
| 93 | 93 | @PreAuthorize("@ss.hasPermission('garden:road:query')") |
| 94 | - public CommonResult<List<RoadListRespVO>> getRoadList(@Valid RoadListReqVO reqVO) { | |
| 94 | + public CommonResult<List<RoadListRespVO>> getRoadList(@Valid @RequestBody RoadListReqVO reqVO) { | |
| 95 | 95 | List<RoadDO> roadList = roadService.getRoadList(reqVO); |
| 96 | 96 | return success(BeanUtils.toBean(roadList, RoadListRespVO.class)); |
| 97 | 97 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java
| ... | ... | @@ -71,6 +71,7 @@ public interface ErrorCodeConstants { |
| 71 | 71 | //========== 频次 TODO 补充编号 ========== |
| 72 | 72 | ErrorCode PLAN_RATE_EXISTS = new ErrorCode(1-200-200-001, "养护频次已存在"); |
| 73 | 73 | ErrorCode PLAN_RATE_LEVEL_ID_DUPLICATE = new ErrorCode(1-200-200-002, "养护等级重复"); |
| 74 | + ErrorCode PLAN_RATE_NOT_EXISTS = new ErrorCode(1-200-200-002, "未配置计划频次"); | |
| 74 | 75 | |
| 75 | 76 | ErrorCode MATERIAL_TYPE_NOT_EXISTS = new ErrorCode(1-100-004-001, "物料类型不存在"); |
| 76 | 77 | ErrorCode MATERIAL_TYPE_MANAGER_NOT_EXISTS = new ErrorCode(1-100-004-002, "耗材类别管理不存在"); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateDetailService.java
| ... | ... | @@ -5,7 +5,6 @@ import jakarta.validation.*; |
| 5 | 5 | import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; |
| 6 | 6 | import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDetailDO; |
| 7 | 7 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 8 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | 8 | |
| 10 | 9 | /** |
| 11 | 10 | * 计划频次明细 Service 接口 |
| ... | ... | @@ -67,4 +66,13 @@ public interface PlanRateDetailService { |
| 67 | 66 | */ |
| 68 | 67 | List<PlanRateDetailDO> getPlanRateDetailByRateNo(String rateNo); |
| 69 | 68 | |
| 69 | + /** | |
| 70 | + * 获取养护频次值对象 | |
| 71 | + * @param busiLine 业务线 | |
| 72 | + * @param planTypeId 计划类型 | |
| 73 | + * @param levelId 道路等级 | |
| 74 | + * @return 对象 | |
| 75 | + */ | |
| 76 | + PlanRateDetailDO getPlanRateValue(String busiLine,Integer planTypeId,Integer levelId); | |
| 77 | + | |
| 70 | 78 | } |
| 71 | 79 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateDetailServiceImpl.java
| ... | ... | @@ -13,6 +13,9 @@ import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 13 | 13 | |
| 14 | 14 | import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateDetailMapper; |
| 15 | 15 | |
| 16 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 17 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_NOT_EXISTS; | |
| 18 | + | |
| 16 | 19 | /** |
| 17 | 20 | * 计划频次明细 Service 实现类 |
| 18 | 21 | * |
| ... | ... | @@ -82,4 +85,15 @@ public class PlanRateDetailServiceImpl implements PlanRateDetailService { |
| 82 | 85 | return planRateDetailMapper.selectList(sql); |
| 83 | 86 | } |
| 84 | 87 | |
| 88 | + @Override | |
| 89 | + public PlanRateDetailDO getPlanRateValue(String busiLine, Integer planTypeId, Integer levelId) { | |
| 90 | + QueryWrapper<PlanRateDetailDO> sql = new QueryWrapper<>(); | |
| 91 | + sql.lambda().eq(PlanRateDetailDO::getBusiLine, busiLine).eq(PlanRateDetailDO::getPlanTypeId, planTypeId).eq(PlanRateDetailDO::getLevelId, levelId); | |
| 92 | + PlanRateDetailDO planRateDetailDO = planRateDetailMapper.selectOne(sql); | |
| 93 | + if (planRateDetailDO == null) { | |
| 94 | + throw exception(PLAN_RATE_NOT_EXISTS); | |
| 95 | + } | |
| 96 | + return planRateDetailDO; | |
| 97 | + } | |
| 98 | + | |
| 85 | 99 | } |
| 86 | 100 | \ No newline at end of file | ... | ... |