Commit 4a190957d705e3dbf027ecd526ee678a5176edbe
Merge remote-tracking branch 'origin/de_wangfs_202511' into dev
# Conflicts: # urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java
Showing
17 changed files
with
218 additions
and
22 deletions
urbanops-framework/urbanops-common/src/main/java/com/zteits/urbanops/framework/common/biz/system/dict/DictDataCommonApi.java
| ... | ... | @@ -19,6 +19,15 @@ public interface DictDataCommonApi { |
| 19 | 19 | */ |
| 20 | 20 | List<DictDataRespDTO> getDictDataList(String dictType); |
| 21 | 21 | |
| 22 | + /** | |
| 23 | + * 获得指定字典类型的字典数据列表 | |
| 24 | + * | |
| 25 | + * @param dictType 字典类型 | |
| 26 | + * @param value 字典值 | |
| 27 | + * @return 字典数据列表 | |
| 28 | + */ | |
| 29 | + DictDataRespDTO getDictData(String dictType, String value ); | |
| 30 | + | |
| 22 | 31 | |
| 23 | 32 | |
| 24 | 33 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/PlanRateController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.planrate; |
| 2 | 2 | |
| 3 | +import jakarta.validation.constraints.NotBlank; | |
| 3 | 4 | import org.springframework.web.bind.annotation.*; |
| 4 | 5 | import jakarta.annotation.Resource; |
| 5 | 6 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -85,6 +86,15 @@ public class PlanRateController { |
| 85 | 86 | return success(BeanUtils.toBean(planRate, PlanRateRespVO.class)); |
| 86 | 87 | } |
| 87 | 88 | |
| 89 | + @GetMapping("/get-rateNo") | |
| 90 | + @Operation(summary = "获得计划频次明细") | |
| 91 | + @Parameter(name = "rate_no", description = "编号", required = true, example = "1024") | |
| 92 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:query')") | |
| 93 | + public CommonResult<PlanRateUpdateRespVO> getPlanRateDetail(@RequestParam("rate_no") @NotBlank String rateNo) { | |
| 94 | + return success(planRateService.getPlanRateDetailByRateNo(rateNo)); | |
| 95 | + } | |
| 96 | + | |
| 97 | + | |
| 88 | 98 | @GetMapping("/page") |
| 89 | 99 | @Operation(summary = "获得计划频次分页") |
| 90 | 100 | @PreAuthorize("@ss.hasPermission('garden:plan-rate:query')") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/PlanRateDetailController.java
| ... | ... | @@ -71,13 +71,16 @@ public class PlanRateDetailController { |
| 71 | 71 | return success(true); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - @GetMapping("/get-rateNo") | |
| 74 | + @GetMapping("/get-rate-value") | |
| 75 | 75 | @Operation(summary = "获得计划频次明细") |
| 76 | - @Parameter(name = "rateNo", description = "编号", required = true, example = "1024") | |
| 76 | + @Parameter(name = "busi_Line", description = "业务线", required = true, example = "1024") | |
| 77 | + @Parameter(name = "plan_type_id", description = "计划类型ID", required = true, example = "如浇水:101") | |
| 78 | + @Parameter(name = "level_id", description = "道路等级", required = true, example = "如10:特级") | |
| 77 | 79 | @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:query')") |
| 78 | - public CommonResult<List<PlanRateDetailRespVO>> getPlanRateDetail(@RequestParam("rateNo") @NotBlank String rateNo) { | |
| 79 | - List<PlanRateDetailDO> detailList = planRateDetailService.getPlanRateDetailByRateNo(rateNo); | |
| 80 | - return success(BeanUtils.toBean(detailList, PlanRateDetailRespVO.class)); | |
| 80 | + public CommonResult<PlanRateDetailRespVO> getPlanRateValue(@RequestParam("busi_Line") @NotBlank String busiLine, | |
| 81 | + @RequestParam("plan_type_id") @NotNull Integer planTypeId, | |
| 82 | + @RequestParam("level_id") @NotNull Integer levelId) { | |
| 83 | + return success(planRateDetailService.getPlanRateValue(busiLine, planTypeId, levelId )); | |
| 81 | 84 | } |
| 82 | 85 | |
| 83 | 86 | @GetMapping("/page") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRateDetailRespVO.java
| ... | ... | @@ -43,6 +43,10 @@ public class PlanRateDetailRespVO { |
| 43 | 43 | @ExcelProperty("周期ID: 1:日/次;2:周/次;3:月/次;4:年/次") |
| 44 | 44 | private Integer cycleId; |
| 45 | 45 | |
| 46 | + @Schema(description = "周期名称: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "11235") | |
| 47 | + @ExcelProperty("周期名称: 1:日/次;2:周/次;3:月/次;4:年/次") | |
| 48 | + private String cycleName; | |
| 49 | + | |
| 46 | 50 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 47 | 51 | @ExcelProperty("创建时间") |
| 48 | 52 | private LocalDateTime createTime; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRateUpdateRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +@Schema(description = "管理后台 - 计划频次 Response VO") | |
| 12 | +@Data | |
| 13 | +@ExcelIgnoreUnannotated | |
| 14 | +public class PlanRateUpdateRespVO { | |
| 15 | + | |
| 16 | + @Schema(description = "频次编号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 17 | + @ExcelProperty("频次编号") | |
| 18 | + private String rateNo; | |
| 19 | + | |
| 20 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 21 | + @ExcelProperty("业务线: yl-园林;wy-物业:sz-市政") | |
| 22 | + private String busiLine; | |
| 23 | + | |
| 24 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "16546") | |
| 25 | + @ExcelProperty("养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;") | |
| 26 | + private Integer planTypeId; | |
| 27 | + | |
| 28 | + @Schema(description = "是否为标准计划: 1:是;2:否", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 29 | + @ExcelProperty("是否为标准计划: 1:是;2:否") | |
| 30 | + private Integer stdPlan; | |
| 31 | + | |
| 32 | + @Schema(description = "明细", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 33 | + @ExcelProperty("明细") | |
| 34 | + private List<PlanRateDetailRespVO> details; | |
| 35 | + | |
| 36 | +} | |
| 0 | 37 | \ No newline at end of file | ... | ... |
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
| ... | ... | @@ -87,14 +87,14 @@ public interface ErrorCodeConstants { |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | // ========== 巡检计划汇总 TODO 补充编号 ========== |
| 90 | - ErrorCode INSPECTION_PLAN_NOT_EXISTS = new ErrorCode(1-100-007-001, "巡检计划汇总不存在"); | |
| 91 | - ErrorCode INSPECTION_CYCLE_ID_ERROR = new ErrorCode(1-100-007-002, "周期id错误"); | |
| 92 | - ErrorCode INSPECTION_CYCLE_ERROR = new ErrorCode(1-100-007-003, "获取两个时间之间间隔天数错误"); | |
| 93 | - ErrorCode INSPECTION_PLAN_EXISTS = new ErrorCode(1-100-007-004, "道路对应类型已存在记录"); | |
| 94 | - ErrorCode INSPECTION_PLAN_NOT_ALLOW_DELETE = new ErrorCode(1-100-007-005, "计划已开始执行不能删除"); | |
| 90 | + ErrorCode INSPECTION_PLAN_NOT_EXISTS = new ErrorCode(1-100-100-001, "巡检计划汇总不存在"); | |
| 91 | + ErrorCode INSPECTION_CYCLE_ID_ERROR = new ErrorCode(1-100-100-002, "周期id错误"); | |
| 92 | + ErrorCode INSPECTION_CYCLE_ERROR = new ErrorCode(1-200-100-003, "获取两个时间之间间隔天数错误"); | |
| 93 | + ErrorCode INSPECTION_PLAN_EXISTS = new ErrorCode(1-200-100-004, "道路对应类型已存在记录"); | |
| 94 | + ErrorCode INSPECTION_PLAN_NOT_ALLOW_DELETE = new ErrorCode(1-200-100-005, "计划已开始执行不能删除"); | |
| 95 | 95 | |
| 96 | 96 | // ========== 养护计划汇总 TODO 补充编号 ========== |
| 97 | - ErrorCode MAINTAIN_PLAN_NOT_EXISTS = new ErrorCode(1-100-006-001, "养护计划汇总不存在"); | |
| 97 | + ErrorCode MAINTAIN_PLAN_NOT_EXISTS = new ErrorCode(1-200-200-001, "养护计划汇总不存在"); | |
| 98 | 98 | |
| 99 | 99 | //========== 频次 TODO 补充编号 ========== |
| 100 | 100 | ErrorCode PLAN_RATE_EXISTS = new ErrorCode(1-100-006-002, "养护频次已存在"); |
| ... | ... | @@ -102,6 +102,10 @@ public interface ErrorCodeConstants { |
| 102 | 102 | |
| 103 | 103 | //========== 12345 ========== |
| 104 | 104 | ErrorCode HOTLINE_FILE_NOT_EXISTS = new ErrorCode(1-100-010-001, "12345案件-文件不存在"); |
| 105 | + ErrorCode PLAN_RATE_EXISTS = new ErrorCode(1-200-200-001, "养护频次已存在"); | |
| 106 | + ErrorCode PLAN_RATE_LEVEL_ID_DUPLICATE = new ErrorCode(1-200-200-002, "养护等级重复"); | |
| 107 | + ErrorCode PLAN_RATE_NOT_EXISTS = new ErrorCode(1-200-200-002, "未配置计划频次"); | |
| 108 | + ErrorCode PLAN_RATE_DETAIL_EXISTS = new ErrorCode(1-200-200-003, "计划频次已存在"); | |
| 105 | 109 | |
| 106 | 110 | ErrorCode HOTLINE_CASE_NOT_EXISTS = new ErrorCode(1-100-010-002, "12345案件-案件不存在"); |
| 107 | 111 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/PlanConstants.java
| ... | ... | @@ -4,4 +4,11 @@ public class PlanConstants { |
| 4 | 4 | |
| 5 | 5 | /*计划属性-字典key*/ |
| 6 | 6 | public static final String GARDEN_PLAN_ATTR_REDIS_KEY = "garden_plan_attr"; |
| 7 | + | |
| 8 | + /*周期-cycle_id_type-字典key*/ | |
| 9 | + public static final String CYCLE_ID_TYPE = "cycle_id_type"; | |
| 10 | + | |
| 11 | + /*养护级别-字典key*/ | |
| 12 | + public static final String CONSERVE_LEVEL = "conserve_level"; | |
| 13 | + | |
| 7 | 14 | } | ... | ... |
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 接口 |
| ... | ... | @@ -60,11 +59,12 @@ public interface PlanRateDetailService { |
| 60 | 59 | PageResult<PlanRateDetailDO> getPlanRateDetailPage(PlanRateDetailPageReqVO pageReqVO); |
| 61 | 60 | |
| 62 | 61 | /** |
| 63 | - * 获得计划频次明细 | |
| 64 | - * | |
| 65 | - * @param rateNo 编号 | |
| 66 | - * @return 计划频次明细列表 | |
| 62 | + * 获取养护频次值对象 | |
| 63 | + * @param busiLine 业务线 | |
| 64 | + * @param planTypeId 计划类型 | |
| 65 | + * @param levelId 道路等级 | |
| 66 | + * @return 对象 | |
| 67 | 67 | */ |
| 68 | - List<PlanRateDetailDO> getPlanRateDetailByRateNo(String rateNo); | |
| 68 | + PlanRateDetailRespVO getPlanRateValue(String busiLine,Integer planTypeId,Integer levelId); | |
| 69 | 69 | |
| 70 | 70 | } |
| 71 | 71 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateDetailServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.planrate; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 4 | +import com.zteits.urbanops.framework.common.biz.system.dict.dto.DictDataRespDTO; | |
| 5 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDO; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateMapper; | |
| 7 | +import com.zteits.urbanops.module.system.api.dict.DictDataApi; | |
| 4 | 8 | import org.springframework.stereotype.Service; |
| 5 | 9 | import jakarta.annotation.Resource; |
| 6 | 10 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -13,6 +17,11 @@ import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 13 | 17 | |
| 14 | 18 | import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateDetailMapper; |
| 15 | 19 | |
| 20 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 21 | +import static com.zteits.urbanops.framework.common.util.object.BeanUtils.copyProperties; | |
| 22 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_NOT_EXISTS; | |
| 23 | +import static com.zteits.urbanops.module.garden.enums.PlanConstants.CYCLE_ID_TYPE; | |
| 24 | + | |
| 16 | 25 | /** |
| 17 | 26 | * 计划频次明细 Service 实现类 |
| 18 | 27 | * |
| ... | ... | @@ -23,8 +32,14 @@ import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateDetailMapper |
| 23 | 32 | public class PlanRateDetailServiceImpl implements PlanRateDetailService { |
| 24 | 33 | |
| 25 | 34 | @Resource |
| 35 | + private PlanRateMapper planRateMapper; | |
| 36 | + | |
| 37 | + @Resource | |
| 26 | 38 | private PlanRateDetailMapper planRateDetailMapper; |
| 27 | 39 | |
| 40 | + @Resource | |
| 41 | + private DictDataApi dictDataApi; | |
| 42 | + | |
| 28 | 43 | @Override |
| 29 | 44 | public Long createPlanRateDetail(PlanRateDetailSaveReqVO createReqVO) { |
| 30 | 45 | // 插入 |
| ... | ... | @@ -75,11 +90,22 @@ public class PlanRateDetailServiceImpl implements PlanRateDetailService { |
| 75 | 90 | return planRateDetailMapper.selectPage(pageReqVO); |
| 76 | 91 | } |
| 77 | 92 | |
| 93 | + | |
| 78 | 94 | @Override |
| 79 | - public List<PlanRateDetailDO> getPlanRateDetailByRateNo(String rateNo) { | |
| 80 | - QueryWrapper<PlanRateDetailDO> sql = new QueryWrapper<>(); | |
| 81 | - sql.lambda().eq(PlanRateDetailDO::getRateNo, rateNo); | |
| 82 | - return planRateDetailMapper.selectList(sql); | |
| 95 | + public PlanRateDetailRespVO getPlanRateValue(String busiLine, Integer planTypeId, Integer levelId) { | |
| 96 | + QueryWrapper<PlanRateDetailDO> sql = new QueryWrapper<>(); | |
| 97 | + sql.lambda().eq(PlanRateDetailDO::getBusiLine, busiLine).eq(PlanRateDetailDO::getPlanTypeId, planTypeId).eq(PlanRateDetailDO::getLevelId, levelId); | |
| 98 | + PlanRateDetailDO planRateDetailDO = planRateDetailMapper.selectOne(sql); | |
| 99 | + if (planRateDetailDO == null) { | |
| 100 | + throw exception(PLAN_RATE_NOT_EXISTS); | |
| 101 | + } | |
| 102 | + PlanRateDetailRespVO respVO = new PlanRateDetailRespVO(); | |
| 103 | + BeanUtils.copyProperties(planRateDetailDO, respVO); | |
| 104 | + DictDataRespDTO dictData = dictDataApi.getDictData(CYCLE_ID_TYPE, planRateDetailDO.getCycleId() + ""); | |
| 105 | + if (dictData != null) { | |
| 106 | + respVO.setCycleName(dictData.getLabel()); | |
| 107 | + } | |
| 108 | + return respVO; | |
| 83 | 109 | } |
| 84 | 110 | |
| 85 | 111 | } |
| 86 | 112 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateService.java
| ... | ... | @@ -66,4 +66,13 @@ public interface PlanRateService { |
| 66 | 66 | */ |
| 67 | 67 | PageResult<PlanRateDO> getPlanRatePage(PlanRatePageReqVO pageReqVO); |
| 68 | 68 | |
| 69 | + /** | |
| 70 | + * 获得计划频次明细 | |
| 71 | + * | |
| 72 | + * @param rateNo 编号 | |
| 73 | + * @return 计划频次明细列表 | |
| 74 | + */ | |
| 75 | + PlanRateUpdateRespVO getPlanRateDetailByRateNo(String rateNo); | |
| 76 | + | |
| 77 | + | |
| 69 | 78 | } |
| 70 | 79 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateServiceImpl.java
| ... | ... | @@ -4,6 +4,10 @@ import cn.hutool.core.date.DateUtil; |
| 4 | 4 | import cn.hutool.core.util.RandomUtil; |
| 5 | 5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 6 | 6 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| 7 | +import com.zteits.urbanops.framework.common.biz.system.dict.DictDataCommonApi; | |
| 8 | +import com.zteits.urbanops.framework.common.biz.system.dict.dto.DictDataRespDTO; | |
| 9 | +import com.zteits.urbanops.framework.common.exception.ServiceException; | |
| 10 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 7 | 11 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 8 | 12 | import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDetailDO; |
| 9 | 13 | import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateDetailMapper; |
| ... | ... | @@ -23,6 +27,7 @@ import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateMapper; |
| 23 | 27 | |
| 24 | 28 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 25 | 29 | import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; |
| 30 | +import static com.zteits.urbanops.module.garden.enums.PlanConstants.CONSERVE_LEVEL; | |
| 26 | 31 | |
| 27 | 32 | /** |
| 28 | 33 | * 计划频次 Service 实现类 |
| ... | ... | @@ -39,6 +44,9 @@ public class PlanRateServiceImpl implements PlanRateService { |
| 39 | 44 | @Resource |
| 40 | 45 | private PlanRateDetailMapper planRateDetailMapper; |
| 41 | 46 | |
| 47 | + @Resource | |
| 48 | + private DictDataCommonApi dictDataCommonApi; | |
| 49 | + | |
| 42 | 50 | @Transactional(rollbackFor = Exception.class) |
| 43 | 51 | @Override |
| 44 | 52 | public Long createPlanRate(PlanRateSaveReqVO createReqVO) { |
| ... | ... | @@ -74,6 +82,7 @@ public class PlanRateServiceImpl implements PlanRateService { |
| 74 | 82 | detailDO.setUpdater(userName); |
| 75 | 83 | detailDO.setUpdateTime(now); |
| 76 | 84 | list.add(detailDO); |
| 85 | + validatePlanRateDetailExists(createReqVO.getBusiLine(), createReqVO.getPlanTypeId(), detail.getLevelId()); | |
| 77 | 86 | }); |
| 78 | 87 | /*2.插入频次明细*/ |
| 79 | 88 | planRateDetailMapper.insertBatch(list); |
| ... | ... | @@ -111,6 +120,7 @@ public class PlanRateServiceImpl implements PlanRateService { |
| 111 | 120 | detailDO.setUpdater(userName); |
| 112 | 121 | detailDO.setUpdateTime(now); |
| 113 | 122 | list.add(detailDO); |
| 123 | + validatePlanRateDetailExists(updateReqVO.getBusiLine(), updateReqVO.getPlanTypeId(), detail.getLevelId()); | |
| 114 | 124 | }); |
| 115 | 125 | /*3.插入频次明细*/ |
| 116 | 126 | planRateDetailMapper.insertBatch(list); |
| ... | ... | @@ -145,6 +155,22 @@ public class PlanRateServiceImpl implements PlanRateService { |
| 145 | 155 | } |
| 146 | 156 | } |
| 147 | 157 | |
| 158 | + /** | |
| 159 | + * 养护明细是否重复 | |
| 160 | + * @param planTypeId 养护类型 | |
| 161 | + * @param busiLine 业务线 | |
| 162 | + * @param levelId 道路等级 | |
| 163 | + */ | |
| 164 | + private void validatePlanRateDetailExists(String busiLine, Integer planTypeId, Integer levelId) { | |
| 165 | + QueryWrapper<PlanRateDetailDO> sql = new QueryWrapper<>(); | |
| 166 | + sql.lambda().eq(PlanRateDetailDO::getPlanTypeId, planTypeId).eq(PlanRateDetailDO::getBusiLine, busiLine) | |
| 167 | + .eq(PlanRateDetailDO::getLevelId, levelId); | |
| 168 | + if (planRateDetailMapper.selectCount(sql) > 0) { | |
| 169 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, levelId.toString()); | |
| 170 | + throw new ServiceException(PLAN_RATE_DETAIL_EXISTS.getCode(), "养护等级[" + dictData.getLabel() + "]已存在"); | |
| 171 | + } | |
| 172 | + } | |
| 173 | + | |
| 148 | 174 | @Override |
| 149 | 175 | public PlanRateDO getPlanRate(Long id) { |
| 150 | 176 | return planRateMapper.selectById(id); |
| ... | ... | @@ -155,4 +181,27 @@ public class PlanRateServiceImpl implements PlanRateService { |
| 155 | 181 | return planRateMapper.selectPage(pageReqVO); |
| 156 | 182 | } |
| 157 | 183 | |
| 184 | + @Override | |
| 185 | + public PlanRateUpdateRespVO getPlanRateDetailByRateNo(String rateNo) { | |
| 186 | + PlanRateUpdateRespVO respVO = new PlanRateUpdateRespVO(); | |
| 187 | + QueryWrapper<PlanRateDO> sql = new QueryWrapper<>(); | |
| 188 | + sql.lambda().eq(PlanRateDO::getRateNo, rateNo); | |
| 189 | + /*1.查询对象*/ | |
| 190 | + PlanRateDO planRateDO = planRateMapper.selectOne(sql); | |
| 191 | + if(null == planRateDO) { | |
| 192 | + return respVO; | |
| 193 | + } | |
| 194 | + respVO.setRateNo(planRateDO.getRateNo()); | |
| 195 | + respVO.setBusiLine(planRateDO.getBusiLine()); | |
| 196 | + respVO.setStdPlan(planRateDO.getStdPlan()); | |
| 197 | + respVO.setPlanTypeId(planRateDO.getPlanTypeId()); | |
| 198 | + /*2.查询明细*/ | |
| 199 | + QueryWrapper<PlanRateDetailDO> sqlDetail = new QueryWrapper<>(); | |
| 200 | + sqlDetail.lambda().eq(PlanRateDetailDO::getRateNo, rateNo); | |
| 201 | + List<PlanRateDetailDO> detail = planRateDetailMapper.selectList(sqlDetail); | |
| 202 | + List<PlanRateDetailRespVO> list = BeanUtils.toBean(detail, PlanRateDetailRespVO.class); | |
| 203 | + respVO.setDetails(list); | |
| 204 | + return respVO; | |
| 205 | + } | |
| 206 | + | |
| 158 | 207 | } |
| 159 | 208 | \ No newline at end of file | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/api/dict/DictDataApiImpl.java
| ... | ... | @@ -32,4 +32,12 @@ public class DictDataApiImpl implements DictDataApi { |
| 32 | 32 | return BeanUtils.toBean(list, DictDataRespDTO.class); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + @Override | |
| 36 | + public DictDataRespDTO getDictData(String dictType, String value) { | |
| 37 | + DictDataRespDTO dto = new DictDataRespDTO(); | |
| 38 | + DictDataDO dictData = dictDataService.getDictData(dictType, value); | |
| 39 | + BeanUtils.copyProperties(dictData, dto); | |
| 40 | + return dto; | |
| 41 | + } | |
| 42 | + | |
| 35 | 43 | } | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/permission/RoleController.java
| ... | ... | @@ -18,6 +18,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; |
| 18 | 18 | import jakarta.annotation.Resource; |
| 19 | 19 | import jakarta.servlet.http.HttpServletResponse; |
| 20 | 20 | import jakarta.validation.Valid; |
| 21 | +import jakarta.validation.constraints.NotBlank; | |
| 21 | 22 | import org.springframework.security.access.prepost.PreAuthorize; |
| 22 | 23 | import org.springframework.validation.annotation.Validated; |
| 23 | 24 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -80,6 +81,14 @@ public class RoleController { |
| 80 | 81 | return success(BeanUtils.toBean(role, RoleRespVO.class)); |
| 81 | 82 | } |
| 82 | 83 | |
| 84 | + @GetMapping("/get/busi-line") | |
| 85 | + @Operation(summary = "通过业务线查询角色列表") | |
| 86 | + @Parameter(name = "busi_line", description = "业务线", required = true) | |
| 87 | + @PreAuthorize("@ss.hasPermission('system:role:query')") | |
| 88 | + public CommonResult<List<RoleRespVO>> getRoleListByBusiLine(@RequestParam("busi_line") @NotBlank String busiLine) { | |
| 89 | + return success(roleService.getRoleListByBusiLine(busiLine)); | |
| 90 | + } | |
| 91 | + | |
| 83 | 92 | @GetMapping("/page") |
| 84 | 93 | @Operation(summary = "获得角色分页") |
| 85 | 94 | @PreAuthorize("@ss.hasPermission('system:role:query')") | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/dal/dataobject/permission/RoleDO.java
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/permission/RoleService.java
| ... | ... | @@ -2,6 +2,7 @@ package com.zteits.urbanops.module.system.service.permission; |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | 4 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RolePageReqVO; |
| 5 | +import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleRespVO; | |
| 5 | 6 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleSaveReqVO; |
| 6 | 7 | import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; |
| 7 | 8 | import jakarta.validation.Valid; |
| ... | ... | @@ -128,4 +129,10 @@ public interface RoleService { |
| 128 | 129 | */ |
| 129 | 130 | void validateRoleList(Collection<Long> ids); |
| 130 | 131 | |
| 132 | + /** | |
| 133 | + * 通过业务线查询角色列表 | |
| 134 | + * @param busiLine 业务线 | |
| 135 | + * @return | |
| 136 | + */ | |
| 137 | + List<RoleRespVO> getRoleListByBusiLine(String busiLine); | |
| 131 | 138 | } | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/permission/RoleServiceImpl.java
| ... | ... | @@ -5,11 +5,13 @@ import cn.hutool.core.collection.CollectionUtil; |
| 5 | 5 | import cn.hutool.core.util.ObjUtil; |
| 6 | 6 | import cn.hutool.core.util.ObjectUtil; |
| 7 | 7 | import cn.hutool.extra.spring.SpringUtil; |
| 8 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 8 | 9 | import com.zteits.urbanops.framework.common.enums.CommonStatusEnum; |
| 9 | 10 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 10 | 11 | import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; |
| 11 | 12 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 12 | 13 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RolePageReqVO; |
| 14 | +import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleRespVO; | |
| 13 | 15 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleSaveReqVO; |
| 14 | 16 | import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; |
| 15 | 17 | import com.zteits.urbanops.module.system.dal.mysql.permission.RoleMapper; |
| ... | ... | @@ -262,6 +264,14 @@ public class RoleServiceImpl implements RoleService { |
| 262 | 264 | }); |
| 263 | 265 | } |
| 264 | 266 | |
| 267 | + @Override | |
| 268 | + public List<RoleRespVO> getRoleListByBusiLine(String busiLine) { | |
| 269 | + QueryWrapper<RoleDO> sql = new QueryWrapper<>(); | |
| 270 | + sql.lambda().eq(RoleDO::getBusiLine, busiLine); | |
| 271 | + List<RoleDO> roleDOS = roleMapper.selectList(sql); | |
| 272 | + return BeanUtils.toBean(roleDOS, RoleRespVO.class); | |
| 273 | + } | |
| 274 | + | |
| 265 | 275 | /** |
| 266 | 276 | * 获得自身的代理对象,解决 AOP 生效问题 |
| 267 | 277 | * | ... | ... |