Commit bc33240e0d1fd129e8f3fa230dcb5a15a0025d34
1 parent
8f9f56ae
提交
Showing
2 changed files
with
10 additions
and
5 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/PlanRateDetailController.java
| @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.Operation; | @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.Operation; | ||
| 11 | import jakarta.validation.constraints.*; | 11 | import jakarta.validation.constraints.*; |
| 12 | import jakarta.validation.*; | 12 | import jakarta.validation.*; |
| 13 | import jakarta.servlet.http.*; | 13 | import jakarta.servlet.http.*; |
| 14 | + | ||
| 14 | import java.util.*; | 15 | import java.util.*; |
| 15 | import java.io.IOException; | 16 | import java.io.IOException; |
| 16 | 17 | ||
| @@ -18,11 +19,13 @@ import com.zteits.urbanops.framework.common.pojo.PageParam; | @@ -18,11 +19,13 @@ import com.zteits.urbanops.framework.common.pojo.PageParam; | ||
| 18 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 19 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 19 | import com.zteits.urbanops.framework.common.pojo.CommonResult; | 20 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 20 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; | 21 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 22 | + | ||
| 21 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | 23 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| 22 | 24 | ||
| 23 | import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | 25 | import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; |
| 24 | 26 | ||
| 25 | import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | 27 | import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; |
| 28 | + | ||
| 26 | import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | 29 | import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; |
| 27 | 30 | ||
| 28 | import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | 31 | import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; |
| @@ -65,7 +68,7 @@ public class PlanRateDetailController { | @@ -65,7 +68,7 @@ public class PlanRateDetailController { | ||
| 65 | @DeleteMapping("/delete-list") | 68 | @DeleteMapping("/delete-list") |
| 66 | @Parameter(name = "ids", description = "编号", required = true) | 69 | @Parameter(name = "ids", description = "编号", required = true) |
| 67 | @Operation(summary = "批量删除计划频次明细") | 70 | @Operation(summary = "批量删除计划频次明细") |
| 68 | - @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:delete')") | 71 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:delete')") |
| 69 | public CommonResult<Boolean> deletePlanRateDetailList(@RequestParam("ids") List<Long> ids) { | 72 | public CommonResult<Boolean> deletePlanRateDetailList(@RequestParam("ids") List<Long> ids) { |
| 70 | planRateDetailService.deletePlanRateDetailListByIds(ids); | 73 | planRateDetailService.deletePlanRateDetailListByIds(ids); |
| 71 | return success(true); | 74 | return success(true); |
| @@ -80,7 +83,7 @@ public class PlanRateDetailController { | @@ -80,7 +83,7 @@ public class PlanRateDetailController { | ||
| 80 | public CommonResult<PlanRateDetailRespVO> getPlanRateValue(@RequestParam("busi_Line") @NotBlank String busiLine, | 83 | public CommonResult<PlanRateDetailRespVO> getPlanRateValue(@RequestParam("busi_Line") @NotBlank String busiLine, |
| 81 | @RequestParam("plan_type_id") @NotNull Integer planTypeId, | 84 | @RequestParam("plan_type_id") @NotNull Integer planTypeId, |
| 82 | @RequestParam("level_id") @NotNull Integer levelId) { | 85 | @RequestParam("level_id") @NotNull Integer levelId) { |
| 83 | - return success(planRateDetailService.getPlanRateValue(busiLine, planTypeId, levelId )); | 86 | + return success(planRateDetailService.getPlanRateValue(busiLine, planTypeId, levelId)); |
| 84 | } | 87 | } |
| 85 | 88 | ||
| 86 | @GetMapping("/page") | 89 | @GetMapping("/page") |
| @@ -96,12 +99,12 @@ public class PlanRateDetailController { | @@ -96,12 +99,12 @@ public class PlanRateDetailController { | ||
| 96 | @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:export')") | 99 | @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:export')") |
| 97 | @ApiAccessLog(operateType = EXPORT) | 100 | @ApiAccessLog(operateType = EXPORT) |
| 98 | public void exportPlanRateDetailExcel(@Valid PlanRateDetailPageReqVO pageReqVO, | 101 | public void exportPlanRateDetailExcel(@Valid PlanRateDetailPageReqVO pageReqVO, |
| 99 | - HttpServletResponse response) throws IOException { | 102 | + HttpServletResponse response) throws IOException { |
| 100 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | 103 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| 101 | List<PlanRateDetailDO> list = planRateDetailService.getPlanRateDetailPage(pageReqVO).getList(); | 104 | List<PlanRateDetailDO> list = planRateDetailService.getPlanRateDetailPage(pageReqVO).getList(); |
| 102 | // 导出 Excel | 105 | // 导出 Excel |
| 103 | ExcelUtils.write(response, "计划频次明细.xls", "数据", PlanRateDetailRespVO.class, | 106 | ExcelUtils.write(response, "计划频次明细.xls", "数据", PlanRateDetailRespVO.class, |
| 104 | - BeanUtils.toBean(list, PlanRateDetailRespVO.class)); | 107 | + BeanUtils.toBean(list, PlanRateDetailRespVO.class)); |
| 105 | } | 108 | } |
| 106 | 109 | ||
| 107 | } | 110 | } |
| 108 | \ No newline at end of file | 111 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateDetailServiceImpl.java
| @@ -94,7 +94,9 @@ public class PlanRateDetailServiceImpl implements PlanRateDetailService { | @@ -94,7 +94,9 @@ public class PlanRateDetailServiceImpl implements PlanRateDetailService { | ||
| 94 | @Override | 94 | @Override |
| 95 | public PlanRateDetailRespVO getPlanRateValue(String busiLine, Integer planTypeId, Integer levelId) { | 95 | public PlanRateDetailRespVO getPlanRateValue(String busiLine, Integer planTypeId, Integer levelId) { |
| 96 | QueryWrapper<PlanRateDetailDO> sql = new QueryWrapper<>(); | 96 | QueryWrapper<PlanRateDetailDO> sql = new QueryWrapper<>(); |
| 97 | - sql.lambda().eq(PlanRateDetailDO::getBusiLine, busiLine).eq(PlanRateDetailDO::getPlanTypeId, planTypeId).eq(PlanRateDetailDO::getLevelId, levelId); | 97 | + sql.lambda().eq(PlanRateDetailDO::getBusiLine, busiLine) |
| 98 | + .eq(PlanRateDetailDO::getPlanTypeId, planTypeId) | ||
| 99 | + .eq(PlanRateDetailDO::getLevelId, levelId); | ||
| 98 | PlanRateDetailDO planRateDetailDO = planRateDetailMapper.selectOne(sql); | 100 | PlanRateDetailDO planRateDetailDO = planRateDetailMapper.selectOne(sql); |
| 99 | if (planRateDetailDO == null) { | 101 | if (planRateDetailDO == null) { |
| 100 | throw exception(PLAN_RATE_NOT_EXISTS); | 102 | throw exception(PLAN_RATE_NOT_EXISTS); |