Commit ad88168c7cdf0bb2f2e35b16e20cc224db54c02f
1 parent
f78a867b
修改道路及增加道路频次
Showing
7 changed files
with
84 additions
and
23 deletions
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,15 +71,6 @@ public class PlanRateDetailController { |
| 71 | 71 | return success(true); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - @GetMapping("/get-rateNo") | |
| 75 | - @Operation(summary = "获得计划频次明细") | |
| 76 | - @Parameter(name = "rateNo", description = "编号", required = true, example = "1024") | |
| 77 | - @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)); | |
| 81 | - } | |
| 82 | - | |
| 83 | 74 | @GetMapping("/get-rate-value") |
| 84 | 75 | @Operation(summary = "获得计划频次明细") |
| 85 | 76 | @Parameter(name = "busi_Line", description = "业务线", required = true, example = "1024") | ... | ... |
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/service/planrate/PlanRateDetailService.java
| ... | ... | @@ -59,14 +59,6 @@ public interface PlanRateDetailService { |
| 59 | 59 | PageResult<PlanRateDetailDO> getPlanRateDetailPage(PlanRateDetailPageReqVO pageReqVO); |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * 获得计划频次明细 | |
| 63 | - * | |
| 64 | - * @param rateNo 编号 | |
| 65 | - * @return 计划频次明细列表 | |
| 66 | - */ | |
| 67 | - List<PlanRateDetailDO> getPlanRateDetailByRateNo(String rateNo); | |
| 68 | - | |
| 69 | - /** | |
| 70 | 62 | * 获取养护频次值对象 |
| 71 | 63 | * @param busiLine 业务线 |
| 72 | 64 | * @param planTypeId 计划类型 | ... | ... |
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.module.garden.dal.dataobject.planrate.PlanRateDO; | |
| 5 | +import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateMapper; | |
| 4 | 6 | import org.springframework.stereotype.Service; |
| 5 | 7 | import jakarta.annotation.Resource; |
| 6 | 8 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -26,6 +28,9 @@ import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RA |
| 26 | 28 | public class PlanRateDetailServiceImpl implements PlanRateDetailService { |
| 27 | 29 | |
| 28 | 30 | @Resource |
| 31 | + private PlanRateMapper planRateMapper; | |
| 32 | + | |
| 33 | + @Resource | |
| 29 | 34 | private PlanRateDetailMapper planRateDetailMapper; |
| 30 | 35 | |
| 31 | 36 | @Override |
| ... | ... | @@ -78,12 +83,6 @@ public class PlanRateDetailServiceImpl implements PlanRateDetailService { |
| 78 | 83 | return planRateDetailMapper.selectPage(pageReqVO); |
| 79 | 84 | } |
| 80 | 85 | |
| 81 | - @Override | |
| 82 | - public List<PlanRateDetailDO> getPlanRateDetailByRateNo(String rateNo) { | |
| 83 | - QueryWrapper<PlanRateDetailDO> sql = new QueryWrapper<>(); | |
| 84 | - sql.lambda().eq(PlanRateDetailDO::getRateNo, rateNo); | |
| 85 | - return planRateDetailMapper.selectList(sql); | |
| 86 | - } | |
| 87 | 86 | |
| 88 | 87 | @Override |
| 89 | 88 | public PlanRateDetailDO getPlanRateValue(String busiLine, Integer planTypeId, Integer levelId) { | ... | ... |
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,7 @@ 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.util.object.BeanUtils; | |
| 7 | 8 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 8 | 9 | import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDetailDO; |
| 9 | 10 | import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateDetailMapper; |
| ... | ... | @@ -155,4 +156,27 @@ public class PlanRateServiceImpl implements PlanRateService { |
| 155 | 156 | return planRateMapper.selectPage(pageReqVO); |
| 156 | 157 | } |
| 157 | 158 | |
| 159 | + @Override | |
| 160 | + public PlanRateUpdateRespVO getPlanRateDetailByRateNo(String rateNo) { | |
| 161 | + PlanRateUpdateRespVO respVO = new PlanRateUpdateRespVO(); | |
| 162 | + QueryWrapper<PlanRateDO> sql = new QueryWrapper<>(); | |
| 163 | + sql.lambda().eq(PlanRateDO::getRateNo, rateNo); | |
| 164 | + /*1.查询对象*/ | |
| 165 | + PlanRateDO planRateDO = planRateMapper.selectOne(sql); | |
| 166 | + if(null == planRateDO) { | |
| 167 | + return respVO; | |
| 168 | + } | |
| 169 | + respVO.setRateNo(planRateDO.getRateNo()); | |
| 170 | + respVO.setBusiLine(planRateDO.getBusiLine()); | |
| 171 | + respVO.setStdPlan(planRateDO.getStdPlan()); | |
| 172 | + respVO.setPlanTypeId(planRateDO.getPlanTypeId()); | |
| 173 | + /*2.查询明细*/ | |
| 174 | + QueryWrapper<PlanRateDetailDO> sqlDetail = new QueryWrapper<>(); | |
| 175 | + sqlDetail.lambda().eq(PlanRateDetailDO::getRateNo, rateNo); | |
| 176 | + List<PlanRateDetailDO> detail = planRateDetailMapper.selectList(sqlDetail); | |
| 177 | + List<PlanRateDetailRespVO> list = BeanUtils.toBean(detail, PlanRateDetailRespVO.class); | |
| 178 | + respVO.setDetails(list); | |
| 179 | + return respVO; | |
| 180 | + } | |
| 181 | + | |
| 158 | 182 | } |
| 159 | 183 | \ No newline at end of file | ... | ... |