Commit 37275c2e5c02bb1457c4fea94901539d8debc5b8
Merge branch 'de_wangfs_202511' into dev
Showing
32 changed files
with
1153 additions
and
5 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanSaveReqVO.java
| ... | ... | @@ -33,6 +33,7 @@ public class InspectionPlanSaveReqVO { |
| 33 | 33 | private Long companyId; |
| 34 | 34 | |
| 35 | 35 | @Schema(description = "道路信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "[{\"deptId\":11,\"roadId\":1,\"roadName\":\"测试\"}]") |
| 36 | + @NotNull | |
| 36 | 37 | @Size(min = 1) |
| 37 | 38 | @Valid |
| 38 | 39 | private List<InspectionPlanRoadReqVO> roadListReqVO; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/PlanRateController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate; | |
| 2 | + | |
| 3 | +import org.springframework.web.bind.annotation.*; | |
| 4 | +import jakarta.annotation.Resource; | |
| 5 | +import org.springframework.validation.annotation.Validated; | |
| 6 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | +import io.swagger.v3.oas.annotations.Operation; | |
| 10 | + | |
| 11 | +import jakarta.validation.*; | |
| 12 | +import jakarta.servlet.http.*; | |
| 13 | +import java.util.*; | |
| 14 | +import java.io.IOException; | |
| 15 | + | |
| 16 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 17 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 18 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 19 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 20 | + | |
| 21 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.error; | |
| 22 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 23 | + | |
| 24 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 25 | + | |
| 26 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 27 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 28 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_LEVEL_ID_DUPLICATE; | |
| 29 | + | |
| 30 | +import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | |
| 31 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDO; | |
| 32 | +import com.zteits.urbanops.module.garden.service.planrate.PlanRateService; | |
| 33 | + | |
| 34 | +@Tag(name = "管理后台 - 计划频次") | |
| 35 | +@RestController | |
| 36 | +@RequestMapping("/garden/plan-rate") | |
| 37 | +@Validated | |
| 38 | +public class PlanRateController { | |
| 39 | + | |
| 40 | + @Resource | |
| 41 | + private PlanRateService planRateService; | |
| 42 | + | |
| 43 | + @PostMapping("/create") | |
| 44 | + @Operation(summary = "创建计划频次") | |
| 45 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate:create')") | |
| 46 | + public CommonResult<Long> createPlanRate(@Valid @RequestBody PlanRateSaveReqVO createReqVO) { | |
| 47 | + return success(planRateService.createPlanRate(createReqVO)); | |
| 48 | + } | |
| 49 | + | |
| 50 | + @PutMapping("/update") | |
| 51 | + @Operation(summary = "更新计划频次") | |
| 52 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate:update')") | |
| 53 | + public CommonResult<Boolean> updatePlanRate(@Valid @RequestBody PlanRateUpdateReqVO updateReqVO) { | |
| 54 | + if(updateReqVO.verify()){ | |
| 55 | + return error(PLAN_RATE_LEVEL_ID_DUPLICATE); | |
| 56 | + } | |
| 57 | + planRateService.updatePlanRate(updateReqVO); | |
| 58 | + return success(true); | |
| 59 | + } | |
| 60 | + | |
| 61 | + @DeleteMapping("/delete-rate-no") | |
| 62 | + @Operation(summary = "删除计划频次") | |
| 63 | + @Parameter(name = "rateNo", description = "频次编号", required = true) | |
| 64 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate:delete')") | |
| 65 | + public CommonResult<Boolean> deletePlanRate(@RequestParam("rateNo") String rateNo) { | |
| 66 | + planRateService.deletePlanRateByRateNo(rateNo); | |
| 67 | + return success(true); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @DeleteMapping("/delete-list") | |
| 71 | + @Parameter(name = "ids", description = "编号", required = true) | |
| 72 | + @Operation(summary = "批量删除计划频次") | |
| 73 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate:delete')") | |
| 74 | + public CommonResult<Boolean> deletePlanRateList(@RequestParam("ids") List<Long> ids) { | |
| 75 | + planRateService.deletePlanRateListByIds(ids); | |
| 76 | + return success(true); | |
| 77 | + } | |
| 78 | + | |
| 79 | + @GetMapping("/get") | |
| 80 | + @Operation(summary = "获得计划频次") | |
| 81 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 82 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate:query')") | |
| 83 | + public CommonResult<PlanRateRespVO> getPlanRate(@RequestParam("id") Long id) { | |
| 84 | + PlanRateDO planRate = planRateService.getPlanRate(id); | |
| 85 | + return success(BeanUtils.toBean(planRate, PlanRateRespVO.class)); | |
| 86 | + } | |
| 87 | + | |
| 88 | + @GetMapping("/page") | |
| 89 | + @Operation(summary = "获得计划频次分页") | |
| 90 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate:query')") | |
| 91 | + public CommonResult<PageResult<PlanRateRespVO>> getPlanRatePage(@Valid PlanRatePageReqVO pageReqVO) { | |
| 92 | + PageResult<PlanRateDO> pageResult = planRateService.getPlanRatePage(pageReqVO); | |
| 93 | + return success(BeanUtils.toBean(pageResult, PlanRateRespVO.class)); | |
| 94 | + } | |
| 95 | + | |
| 96 | + @GetMapping("/export-excel") | |
| 97 | + @Operation(summary = "导出计划频次 Excel") | |
| 98 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate:export')") | |
| 99 | + @ApiAccessLog(operateType = EXPORT) | |
| 100 | + public void exportPlanRateExcel(@Valid PlanRatePageReqVO pageReqVO, | |
| 101 | + HttpServletResponse response) throws IOException { | |
| 102 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 103 | + List<PlanRateDO> list = planRateService.getPlanRatePage(pageReqVO).getList(); | |
| 104 | + // 导出 Excel | |
| 105 | + ExcelUtils.write(response, "计划频次.xls", "数据", PlanRateRespVO.class, | |
| 106 | + BeanUtils.toBean(list, PlanRateRespVO.class)); | |
| 107 | + } | |
| 108 | + | |
| 109 | +} | |
| 0 | 110 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/PlanRateDetailController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate; | |
| 2 | + | |
| 3 | +import org.springframework.web.bind.annotation.*; | |
| 4 | +import jakarta.annotation.Resource; | |
| 5 | +import org.springframework.validation.annotation.Validated; | |
| 6 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | +import io.swagger.v3.oas.annotations.Operation; | |
| 10 | + | |
| 11 | +import jakarta.validation.constraints.*; | |
| 12 | +import jakarta.validation.*; | |
| 13 | +import jakarta.servlet.http.*; | |
| 14 | +import java.util.*; | |
| 15 | +import java.io.IOException; | |
| 16 | + | |
| 17 | +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.CommonResult; | |
| 20 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 21 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 24 | + | |
| 25 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 26 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 27 | + | |
| 28 | +import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | |
| 29 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDetailDO; | |
| 30 | +import com.zteits.urbanops.module.garden.service.planrate.PlanRateDetailService; | |
| 31 | + | |
| 32 | +@Tag(name = "管理后台 - 计划频次明细") | |
| 33 | +@RestController | |
| 34 | +@RequestMapping("/garden/plan-rate-detail") | |
| 35 | +@Validated | |
| 36 | +public class PlanRateDetailController { | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private PlanRateDetailService planRateDetailService; | |
| 40 | + | |
| 41 | + @PostMapping("/create") | |
| 42 | + @Operation(summary = "创建计划频次明细") | |
| 43 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:create')") | |
| 44 | + public CommonResult<Long> createPlanRateDetail(@Valid @RequestBody PlanRateDetailSaveReqVO createReqVO) { | |
| 45 | + return success(planRateDetailService.createPlanRateDetail(createReqVO)); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @PutMapping("/update") | |
| 49 | + @Operation(summary = "更新计划频次明细") | |
| 50 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:update')") | |
| 51 | + public CommonResult<Boolean> updatePlanRateDetail(@Valid @RequestBody PlanRateDetailSaveReqVO updateReqVO) { | |
| 52 | + planRateDetailService.updatePlanRateDetail(updateReqVO); | |
| 53 | + return success(true); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @DeleteMapping("/delete") | |
| 57 | + @Operation(summary = "删除计划频次明细") | |
| 58 | + @Parameter(name = "id", description = "编号", required = true) | |
| 59 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:delete')") | |
| 60 | + public CommonResult<Boolean> deletePlanRateDetail(@RequestParam("id") Long id) { | |
| 61 | + planRateDetailService.deletePlanRateDetail(id); | |
| 62 | + return success(true); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @DeleteMapping("/delete-list") | |
| 66 | + @Parameter(name = "ids", description = "编号", required = true) | |
| 67 | + @Operation(summary = "批量删除计划频次明细") | |
| 68 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:delete')") | |
| 69 | + public CommonResult<Boolean> deletePlanRateDetailList(@RequestParam("ids") List<Long> ids) { | |
| 70 | + planRateDetailService.deletePlanRateDetailListByIds(ids); | |
| 71 | + return success(true); | |
| 72 | + } | |
| 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 | + @GetMapping("/page") | |
| 84 | + @Operation(summary = "获得计划频次明细分页") | |
| 85 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:query')") | |
| 86 | + public CommonResult<PageResult<PlanRateDetailRespVO>> getPlanRateDetailPage(@Valid PlanRateDetailPageReqVO pageReqVO) { | |
| 87 | + PageResult<PlanRateDetailDO> pageResult = planRateDetailService.getPlanRateDetailPage(pageReqVO); | |
| 88 | + return success(BeanUtils.toBean(pageResult, PlanRateDetailRespVO.class)); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @GetMapping("/export-excel") | |
| 92 | + @Operation(summary = "导出计划频次明细 Excel") | |
| 93 | + @PreAuthorize("@ss.hasPermission('garden:plan-rate-detail:export')") | |
| 94 | + @ApiAccessLog(operateType = EXPORT) | |
| 95 | + public void exportPlanRateDetailExcel(@Valid PlanRateDetailPageReqVO pageReqVO, | |
| 96 | + HttpServletResponse response) throws IOException { | |
| 97 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 98 | + List<PlanRateDetailDO> list = planRateDetailService.getPlanRateDetailPage(pageReqVO).getList(); | |
| 99 | + // 导出 Excel | |
| 100 | + ExcelUtils.write(response, "计划频次明细.xls", "数据", PlanRateDetailRespVO.class, | |
| 101 | + BeanUtils.toBean(list, PlanRateDetailRespVO.class)); | |
| 102 | + } | |
| 103 | + | |
| 104 | +} | |
| 0 | 105 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRateDetailPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 11 | + | |
| 12 | +@Schema(description = "管理后台 - 计划频次明细分页 Request VO") | |
| 13 | +@Data | |
| 14 | +public class PlanRateDetailPageReqVO extends PageParam { | |
| 15 | + | |
| 16 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政") | |
| 17 | + private String busiLine; | |
| 18 | + | |
| 19 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", example = "7693") | |
| 20 | + private Integer planTypeId; | |
| 21 | + | |
| 22 | + @Schema(description = "级别: 10:特级;11:一级:12:二级;13:三级", example = "26893") | |
| 23 | + private Integer levelId; | |
| 24 | + | |
| 25 | + @Schema(description = "次数 如:1/3等") | |
| 26 | + private String rate; | |
| 27 | + | |
| 28 | + @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", example = "11235") | |
| 29 | + private Integer cycleId; | |
| 30 | + | |
| 31 | + @Schema(description = "创建时间") | |
| 32 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 33 | + private LocalDateTime[] createTime; | |
| 34 | + | |
| 35 | +} | |
| 0 | 36 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRateDetailRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import cn.idev.excel.annotation.*; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - 计划频次明细 Response VO") | |
| 11 | +@Data | |
| 12 | +@ExcelIgnoreUnannotated | |
| 13 | +public class PlanRateDetailRespVO { | |
| 14 | + | |
| 15 | + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6428") | |
| 16 | + @ExcelProperty("ID") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 频次编号 | |
| 21 | + */ | |
| 22 | + @Schema(description = "频次编号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 23 | + @ExcelProperty("频次编号") | |
| 24 | + private String rateNo; | |
| 25 | + | |
| 26 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 27 | + @ExcelProperty("业务线: yl-园林;wy-物业:sz-市政") | |
| 28 | + private String busiLine; | |
| 29 | + | |
| 30 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "7693") | |
| 31 | + @ExcelProperty("养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;") | |
| 32 | + private Integer planTypeId; | |
| 33 | + | |
| 34 | + @Schema(description = "级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "26893") | |
| 35 | + @ExcelProperty("级别: 10:特级;11:一级:12:二级;13:三级") | |
| 36 | + private Integer levelId; | |
| 37 | + | |
| 38 | + @Schema(description = "次数 如:1/3等") | |
| 39 | + @ExcelProperty("次数 如:1/3等") | |
| 40 | + private String rate; | |
| 41 | + | |
| 42 | + @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "11235") | |
| 43 | + @ExcelProperty("周期ID: 1:日/次;2:周/次;3:月/次;4:年/次") | |
| 44 | + private Integer cycleId; | |
| 45 | + | |
| 46 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 47 | + @ExcelProperty("创建时间") | |
| 48 | + private LocalDateTime createTime; | |
| 49 | + | |
| 50 | +} | |
| 0 | 51 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRateDetailSaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import jakarta.validation.constraints.*; | |
| 7 | + | |
| 8 | +@Schema(description = "管理后台 - 计划频次明细新增/修改 Request VO") | |
| 9 | +@Data | |
| 10 | +public class PlanRateDetailSaveReqVO { | |
| 11 | + | |
| 12 | + | |
| 13 | + @Schema(description = "级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") | |
| 14 | + @NotNull(message = "级别: 10:特级;11:一级:12:二级;13:三级不能为空") | |
| 15 | + private Integer levelId; | |
| 16 | + | |
| 17 | + @Schema(description = "次数 如:1/3等") | |
| 18 | + @NotEmpty(message = "次数不能为空") | |
| 19 | + private String rate; | |
| 20 | + | |
| 21 | + @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 22 | + @NotNull(message = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次不能为空") | |
| 23 | + private Integer cycleId; | |
| 24 | + | |
| 25 | +} | |
| 0 | 26 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRatePageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 11 | + | |
| 12 | +@Schema(description = "管理后台 - 计划频次分页 Request VO") | |
| 13 | +@Data | |
| 14 | +public class PlanRatePageReqVO extends PageParam { | |
| 15 | + | |
| 16 | + @Schema(description = "频次编号") | |
| 17 | + private String rateNo; | |
| 18 | + | |
| 19 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政") | |
| 20 | + private String busiLine; | |
| 21 | + | |
| 22 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", example = "16546") | |
| 23 | + private Integer planTypeId; | |
| 24 | + | |
| 25 | + @Schema(description = "是否为标准计划: 1:是;2:否") | |
| 26 | + private Integer stdPlan; | |
| 27 | + | |
| 28 | +} | |
| 0 | 29 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRateRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import cn.idev.excel.annotation.*; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - 计划频次 Response VO") | |
| 11 | +@Data | |
| 12 | +@ExcelIgnoreUnannotated | |
| 13 | +public class PlanRateRespVO { | |
| 14 | + | |
| 15 | + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18948") | |
| 16 | + @ExcelProperty("ID") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + @Schema(description = "频次编号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 20 | + @ExcelProperty("频次编号") | |
| 21 | + private String rateNo; | |
| 22 | + | |
| 23 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 24 | + @ExcelProperty("业务线: yl-园林;wy-物业:sz-市政") | |
| 25 | + private String busiLine; | |
| 26 | + | |
| 27 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "16546") | |
| 28 | + @ExcelProperty("养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;") | |
| 29 | + private Integer planTypeId; | |
| 30 | + | |
| 31 | + @Schema(description = "是否为标准计划: 1:是;2:否", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 32 | + @ExcelProperty("是否为标准计划: 1:是;2:否") | |
| 33 | + private Integer stdPlan; | |
| 34 | + | |
| 35 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 36 | + @ExcelProperty("创建时间") | |
| 37 | + private LocalDateTime createTime; | |
| 38 | + | |
| 39 | +} | |
| 0 | 40 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRateSaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.Valid; | |
| 5 | +import lombok.*; | |
| 6 | +import java.util.*; | |
| 7 | +import jakarta.validation.constraints.*; | |
| 8 | + | |
| 9 | +@Schema(description = "管理后台 - 计划频次新增/修改 Request VO") | |
| 10 | +@Data | |
| 11 | +public class PlanRateSaveReqVO { | |
| 12 | + | |
| 13 | + | |
| 14 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 15 | + @NotEmpty(message = "业务线: yl-园林;wy-物业:sz-市政不能为空") | |
| 16 | + private String busiLine; | |
| 17 | + | |
| 18 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "16546") | |
| 19 | + @NotNull(message = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;不能为空") | |
| 20 | + private Integer planTypeId; | |
| 21 | + | |
| 22 | + @Schema(description = "是否为标准计划: 1:是;2:否", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 23 | + @NotNull(message = "是否为标准计划: 1:是;2:否不能为空") | |
| 24 | + private Integer stdPlan; | |
| 25 | + | |
| 26 | + @NotNull@NotNull(message = "频次明细不能为空") | |
| 27 | + @Size(min = 1) | |
| 28 | + @Valid | |
| 29 | + private List<PlanRateDetailSaveReqVO> details; | |
| 30 | + | |
| 31 | +} | |
| 0 | 32 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/planrate/vo/PlanRateUpdateReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.planrate.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.module.garden.util.FieldDuplicateCheckerUtil; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import jakarta.validation.Valid; | |
| 6 | +import jakarta.validation.constraints.NotEmpty; | |
| 7 | +import jakarta.validation.constraints.NotNull; | |
| 8 | +import jakarta.validation.constraints.Size; | |
| 9 | +import lombok.Data; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | +import java.util.Set; | |
| 13 | +import java.util.stream.Collectors; | |
| 14 | + | |
| 15 | +@Schema(description = "管理后台 - 计划频次新增/修改 Request VO") | |
| 16 | +@Data | |
| 17 | +public class PlanRateUpdateReqVO { | |
| 18 | + /** | |
| 19 | + * 频次编号 | |
| 20 | + */ | |
| 21 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 22 | + @NotEmpty(message = "频次编号不能为空") | |
| 23 | + private String rateNo; | |
| 24 | + | |
| 25 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 26 | + @NotEmpty(message = "业务线: yl-园林;wy-物业:sz-市政不能为空") | |
| 27 | + private String busiLine; | |
| 28 | + | |
| 29 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "16546") | |
| 30 | + @NotNull(message = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;不能为空") | |
| 31 | + private Integer planTypeId; | |
| 32 | + | |
| 33 | + @Schema(description = "是否为标准计划: 1:是;2:否", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 34 | + @NotNull(message = "是否为标准计划: 1:是;2:否不能为空") | |
| 35 | + private Integer stdPlan; | |
| 36 | + | |
| 37 | + @NotNull@NotNull(message = "频次明细不能为空") | |
| 38 | + @Size(min = 1) | |
| 39 | + @Valid | |
| 40 | + private List<PlanRateDetailSaveReqVO> details; | |
| 41 | + | |
| 42 | + public boolean verify() { | |
| 43 | + return FieldDuplicateCheckerUtil.hasDuplicate(details, PlanRateDetailSaveReqVO::getLevelId); | |
| 44 | + } | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | +} | |
| 0 | 49 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/planrate/PlanRateDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.planrate; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import java.time.LocalDateTime; | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | +import com.baomidou.mybatisplus.annotation.*; | |
| 8 | +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 计划频次 DO | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +@TableName("garden_plan_rate") | |
| 16 | +@KeySequence("garden_plan_rate_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 17 | +@Data | |
| 18 | +@EqualsAndHashCode(callSuper = true) | |
| 19 | +@ToString(callSuper = true) | |
| 20 | +@Builder | |
| 21 | +@NoArgsConstructor | |
| 22 | +@AllArgsConstructor | |
| 23 | +public class PlanRateDO extends BaseDO { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * ID | |
| 27 | + */ | |
| 28 | + @TableId | |
| 29 | + private Long id; | |
| 30 | + /** | |
| 31 | + * 频次编号 | |
| 32 | + */ | |
| 33 | + private String rateNo; | |
| 34 | + /** | |
| 35 | + * 业务线: yl-园林;wy-物业:sz-市政 | |
| 36 | + */ | |
| 37 | + private String busiLine; | |
| 38 | + /** | |
| 39 | + * 养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视; | |
| 40 | + */ | |
| 41 | + private Integer planTypeId; | |
| 42 | + /** | |
| 43 | + * 是否为标准计划: 1:是;2:否 | |
| 44 | + */ | |
| 45 | + private Integer stdPlan; | |
| 46 | + | |
| 47 | + | |
| 48 | +} | |
| 0 | 49 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/planrate/PlanRateDetailDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.planrate; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import java.time.LocalDateTime; | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | +import com.baomidou.mybatisplus.annotation.*; | |
| 8 | +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 计划频次明细 DO | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +@TableName("garden_plan_rate_detail") | |
| 16 | +@KeySequence("garden_plan_rate_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 17 | +@Data | |
| 18 | +@EqualsAndHashCode(callSuper = true) | |
| 19 | +@ToString(callSuper = true) | |
| 20 | +@Builder | |
| 21 | +@NoArgsConstructor | |
| 22 | +@AllArgsConstructor | |
| 23 | +public class PlanRateDetailDO extends BaseDO { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * ID | |
| 27 | + */ | |
| 28 | + @TableId | |
| 29 | + private Long id; | |
| 30 | + /** | |
| 31 | + * 频次编号 | |
| 32 | + */ | |
| 33 | + private String rateNo; | |
| 34 | + /** | |
| 35 | + * 业务线: yl-园林;wy-物业:sz-市政 | |
| 36 | + */ | |
| 37 | + private String busiLine; | |
| 38 | + /** | |
| 39 | + * 养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视; | |
| 40 | + */ | |
| 41 | + private Integer planTypeId; | |
| 42 | + /** | |
| 43 | + * 级别: 10:特级;11:一级:12:二级;13:三级 | |
| 44 | + */ | |
| 45 | + private Integer levelId; | |
| 46 | + /** | |
| 47 | + * 次数 如:1/3等 | |
| 48 | + */ | |
| 49 | + private String rate; | |
| 50 | + /** | |
| 51 | + * 周期ID: 1:日/次;2:周/次;3:月/次;4:年/次 | |
| 52 | + */ | |
| 53 | + private Integer cycleId; | |
| 54 | + | |
| 55 | + | |
| 56 | +} | |
| 0 | 57 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanDetailMapper.java
| ... | ... | @@ -8,6 +8,7 @@ import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | 8 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 9 | 9 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 10 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; |
| 11 | +import org.apache.ibatis.annotations.Param; | |
| 11 | 12 | |
| 12 | 13 | /** |
| 13 | 14 | * 巡检计划 Mapper |
| ... | ... | @@ -33,4 +34,6 @@ public interface InspectionPlanDetailMapper extends BaseMapperX<InspectionPlanDe |
| 33 | 34 | .orderByDesc(InspectionPlanDetailDO::getId)); |
| 34 | 35 | } |
| 35 | 36 | |
| 37 | + int deleteByBatchNo(@Param("batchNo") String batchNo); | |
| 38 | + | |
| 36 | 39 | } |
| 37 | 40 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanMapper.java
| ... | ... | @@ -7,6 +7,7 @@ import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 7 | 7 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; |
| 8 | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; |
| 10 | +import org.apache.ibatis.annotations.Param; | |
| 10 | 11 | |
| 11 | 12 | /** |
| 12 | 13 | * 巡检计划汇总 Mapper |
| ... | ... | @@ -30,4 +31,6 @@ public interface InspectionPlanMapper extends BaseMapperX<InspectionPlanDO> { |
| 30 | 31 | .orderByDesc(InspectionPlanDO::getId)); |
| 31 | 32 | } |
| 32 | 33 | |
| 34 | + int deleteByBatchNo(@Param("batchNo") String batchNo); | |
| 35 | + | |
| 33 | 36 | } |
| 34 | 37 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanRoleMapper.java
| 1 | 1 | package com.zteits.urbanops.module.garden.dal.mysql.inspectionplan; |
| 2 | 2 | |
| 3 | -import java.util.*; | |
| 4 | 3 | |
| 5 | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 5 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| ... | ... | @@ -8,6 +7,7 @@ import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | 7 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRolePageReqVO; |
| 9 | 8 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanRoleDO; |
| 10 | 9 | import org.apache.ibatis.annotations.Mapper; |
| 10 | +import org.apache.ibatis.annotations.Param; | |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * 巡检计划角色 Mapper |
| ... | ... | @@ -27,4 +27,6 @@ public interface InspectionPlanRoleMapper extends BaseMapperX<InspectionPlanRole |
| 27 | 27 | .orderByDesc(InspectionPlanRoleDO::getId)); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | + int deleteByBatchNo(@Param("batchNo") String batchNo); | |
| 31 | + | |
| 30 | 32 | } |
| 31 | 33 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/planrate/PlanRateDetailMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.planrate; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 6 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDetailDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | |
| 11 | +import org.apache.ibatis.annotations.Param; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 计划频次明细 Mapper | |
| 15 | + * | |
| 16 | + * @author 超级管理员 | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface PlanRateDetailMapper extends BaseMapperX<PlanRateDetailDO> { | |
| 20 | + | |
| 21 | + default PageResult<PlanRateDetailDO> selectPage(PlanRateDetailPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<PlanRateDetailDO>() | |
| 23 | + .eqIfPresent(PlanRateDetailDO::getBusiLine, reqVO.getBusiLine()) | |
| 24 | + .eqIfPresent(PlanRateDetailDO::getPlanTypeId, reqVO.getPlanTypeId()) | |
| 25 | + .eqIfPresent(PlanRateDetailDO::getLevelId, reqVO.getLevelId()) | |
| 26 | + .eqIfPresent(PlanRateDetailDO::getRate, reqVO.getRate()) | |
| 27 | + .eqIfPresent(PlanRateDetailDO::getCycleId, reqVO.getCycleId()) | |
| 28 | + .betweenIfPresent(PlanRateDetailDO::getCreateTime, reqVO.getCreateTime()) | |
| 29 | + .orderByDesc(PlanRateDetailDO::getId)); | |
| 30 | + } | |
| 31 | + | |
| 32 | + int deleteByRateNo(@Param("rateNo") String rateNo); | |
| 33 | + | |
| 34 | +} | |
| 0 | 35 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/planrate/PlanRateMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.planrate; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 6 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | |
| 11 | +import org.apache.ibatis.annotations.Param; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 计划频次 Mapper | |
| 15 | + * | |
| 16 | + * @author 超级管理员 | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface PlanRateMapper extends BaseMapperX<PlanRateDO> { | |
| 20 | + | |
| 21 | + default PageResult<PlanRateDO> selectPage(PlanRatePageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<PlanRateDO>() | |
| 23 | + .eqIfPresent(PlanRateDO::getRateNo, reqVO.getRateNo()) | |
| 24 | + .eqIfPresent(PlanRateDO::getBusiLine, reqVO.getBusiLine()) | |
| 25 | + .eqIfPresent(PlanRateDO::getPlanTypeId, reqVO.getPlanTypeId()) | |
| 26 | + .eqIfPresent(PlanRateDO::getStdPlan, reqVO.getStdPlan()) | |
| 27 | + .orderByDesc(PlanRateDO::getId)); | |
| 28 | + } | |
| 29 | + | |
| 30 | + int deleteByRateNo(@Param("rateNo") String rateNo); | |
| 31 | + | |
| 32 | +} | |
| 0 | 33 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java
| ... | ... | @@ -60,4 +60,9 @@ public interface ErrorCodeConstants { |
| 60 | 60 | ErrorCode INSPECTION_CYCLE_ID_ERROR = new ErrorCode(1-200-100-002, "周期id错误"); |
| 61 | 61 | ErrorCode INSPECTION_CYCLE_ERROR = new ErrorCode(1-200-100-003, "获取两个时间之间间隔天数错误"); |
| 62 | 62 | ErrorCode INSPECTION_PLAN_EXISTS = new ErrorCode(1-200-100-004, "道路对应类型已存在记录"); |
| 63 | + | |
| 64 | + //========== 频次 TODO 补充编号 ========== | |
| 65 | + ErrorCode PLAN_RATE_EXISTS = new ErrorCode(1-200-200-001, "养护频次已存在"); | |
| 66 | + ErrorCode PLAN_RATE_LEVEL_ID_DUPLICATE = new ErrorCode(1-200-200-002, "养护等级重复"); | |
| 67 | + | |
| 63 | 68 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| ... | ... | @@ -174,7 +174,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 174 | 174 | QueryWrapper<InspectionPlanDO> sql = new QueryWrapper<>(); |
| 175 | 175 | sql.lambda().eq(InspectionPlanDO::getPlanTypeId, req.getPlanTypeId()) |
| 176 | 176 | .in(InspectionPlanDO::getRoadId, roadIds) |
| 177 | - .between(InspectionPlanDO::getBeginTime, req.getBeginTime(), req.getEndTime()); | |
| 177 | + .le(InspectionPlanDO::getBeginTime, req.getEndTime()) // start_time <= endTime | |
| 178 | + .ge(InspectionPlanDO::getEndTime, req.getBeginTime()); // end_time >= startTime | |
| 178 | 179 | |
| 179 | 180 | Long count = inspectionPlanMapper.selectCount(sql); |
| 180 | 181 | if (count > 0) { |
| ... | ... | @@ -201,9 +202,9 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 201 | 202 | |
| 202 | 203 | @Override |
| 203 | 204 | public void deleteInspectionPlanByBatchNo(String batchNo) { |
| 204 | - inspectionPlanMapper.delete(InspectionPlanDO::getBatchNo, batchNo); | |
| 205 | - inspectionPlanDetailMapper.delete(InspectionPlanDetailDO::getBatchNo, batchNo); | |
| 206 | - inspectionPlanRoleMapper.delete(InspectionPlanRoleDO::getBatchNo, batchNo); | |
| 205 | + inspectionPlanMapper.deleteByBatchNo(batchNo); | |
| 206 | + inspectionPlanDetailMapper.deleteByBatchNo(batchNo); | |
| 207 | + inspectionPlanRoleMapper.deleteByBatchNo(batchNo); | |
| 207 | 208 | } |
| 208 | 209 | |
| 209 | 210 | } |
| 210 | 211 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateDetailService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.planrate; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import jakarta.validation.*; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDetailDO; | |
| 7 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 8 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 计划频次明细 Service 接口 | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +public interface PlanRateDetailService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建计划频次明细 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createPlanRateDetail(@Valid PlanRateDetailSaveReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 更新计划频次明细 | |
| 27 | + * | |
| 28 | + * @param updateReqVO 更新信息 | |
| 29 | + */ | |
| 30 | + void updatePlanRateDetail(@Valid PlanRateDetailSaveReqVO updateReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 删除计划频次明细 | |
| 34 | + * | |
| 35 | + * @param id 编号 | |
| 36 | + */ | |
| 37 | + void deletePlanRateDetail(Long id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 批量删除计划频次明细 | |
| 41 | + * | |
| 42 | + * @param ids 编号 | |
| 43 | + */ | |
| 44 | + void deletePlanRateDetailListByIds(List<Long> ids); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得计划频次明细 | |
| 48 | + * | |
| 49 | + * @param id 编号 | |
| 50 | + * @return 计划频次明细 | |
| 51 | + */ | |
| 52 | + PlanRateDetailDO getPlanRateDetail(Long id); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得计划频次明细分页 | |
| 56 | + * | |
| 57 | + * @param pageReqVO 分页查询 | |
| 58 | + * @return 计划频次明细分页 | |
| 59 | + */ | |
| 60 | + PageResult<PlanRateDetailDO> getPlanRateDetailPage(PlanRateDetailPageReqVO pageReqVO); | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 获得计划频次明细 | |
| 64 | + * | |
| 65 | + * @param rateNo 编号 | |
| 66 | + * @return 计划频次明细列表 | |
| 67 | + */ | |
| 68 | + List<PlanRateDetailDO> getPlanRateDetailByRateNo(String rateNo); | |
| 69 | + | |
| 70 | +} | |
| 0 | 71 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateDetailServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.planrate; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 4 | +import org.springframework.stereotype.Service; | |
| 5 | +import jakarta.annotation.Resource; | |
| 6 | +import org.springframework.validation.annotation.Validated; | |
| 7 | + | |
| 8 | +import java.util.*; | |
| 9 | +import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | |
| 10 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDetailDO; | |
| 11 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 12 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 13 | + | |
| 14 | +import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateDetailMapper; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * 计划频次明细 Service 实现类 | |
| 18 | + * | |
| 19 | + * @author 超级管理员 | |
| 20 | + */ | |
| 21 | +@Service | |
| 22 | +@Validated | |
| 23 | +public class PlanRateDetailServiceImpl implements PlanRateDetailService { | |
| 24 | + | |
| 25 | + @Resource | |
| 26 | + private PlanRateDetailMapper planRateDetailMapper; | |
| 27 | + | |
| 28 | + @Override | |
| 29 | + public Long createPlanRateDetail(PlanRateDetailSaveReqVO createReqVO) { | |
| 30 | + // 插入 | |
| 31 | + PlanRateDetailDO planRateDetail = BeanUtils.toBean(createReqVO, PlanRateDetailDO.class); | |
| 32 | + planRateDetailMapper.insert(planRateDetail); | |
| 33 | + | |
| 34 | + // 返回 | |
| 35 | + return planRateDetail.getId(); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public void updatePlanRateDetail(PlanRateDetailSaveReqVO updateReqVO) { | |
| 40 | + // 校验存在 | |
| 41 | + //validatePlanRateDetailExists(updateReqVO.getId()); | |
| 42 | + // 更新 | |
| 43 | + PlanRateDetailDO updateObj = BeanUtils.toBean(updateReqVO, PlanRateDetailDO.class); | |
| 44 | + planRateDetailMapper.updateById(updateObj); | |
| 45 | + } | |
| 46 | + | |
| 47 | + @Override | |
| 48 | + public void deletePlanRateDetail(Long id) { | |
| 49 | + // 校验存在 | |
| 50 | + validatePlanRateDetailExists(id); | |
| 51 | + // 删除 | |
| 52 | + planRateDetailMapper.deleteById(id); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Override | |
| 56 | + public void deletePlanRateDetailListByIds(List<Long> ids) { | |
| 57 | + // 删除 | |
| 58 | + planRateDetailMapper.deleteByIds(ids); | |
| 59 | + } | |
| 60 | + | |
| 61 | + | |
| 62 | + private void validatePlanRateDetailExists(Long id) { | |
| 63 | + if (planRateDetailMapper.selectById(id) == null) { | |
| 64 | + //throw exception(""); | |
| 65 | + } | |
| 66 | + } | |
| 67 | + | |
| 68 | + @Override | |
| 69 | + public PlanRateDetailDO getPlanRateDetail(Long id) { | |
| 70 | + return planRateDetailMapper.selectById(id); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Override | |
| 74 | + public PageResult<PlanRateDetailDO> getPlanRateDetailPage(PlanRateDetailPageReqVO pageReqVO) { | |
| 75 | + return planRateDetailMapper.selectPage(pageReqVO); | |
| 76 | + } | |
| 77 | + | |
| 78 | + @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); | |
| 83 | + } | |
| 84 | + | |
| 85 | +} | |
| 0 | 86 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.planrate; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import jakarta.validation.*; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDO; | |
| 7 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 8 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 计划频次 Service 接口 | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +public interface PlanRateService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建计划频次 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createPlanRate(@Valid PlanRateSaveReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 更新计划频次 | |
| 27 | + * | |
| 28 | + * @param updateReqVO 更新信息 | |
| 29 | + */ | |
| 30 | + void updatePlanRate(@Valid PlanRateUpdateReqVO updateReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 删除计划频次 | |
| 34 | + * | |
| 35 | + * @param id 编号 | |
| 36 | + */ | |
| 37 | + void deletePlanRate(Long id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 批量删除计划频次 | |
| 41 | + * | |
| 42 | + * @param ids 编号 | |
| 43 | + */ | |
| 44 | + void deletePlanRateListByIds(List<Long> ids); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 批量删除计划频次 | |
| 48 | + * | |
| 49 | + * @param rateNo 编号 | |
| 50 | + */ | |
| 51 | + void deletePlanRateByRateNo(String rateNo); | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 获得计划频次 | |
| 55 | + * | |
| 56 | + * @param id 编号 | |
| 57 | + * @return 计划频次 | |
| 58 | + */ | |
| 59 | + PlanRateDO getPlanRate(Long id); | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * 获得计划频次分页 | |
| 63 | + * | |
| 64 | + * @param pageReqVO 分页查询 | |
| 65 | + * @return 计划频次分页 | |
| 66 | + */ | |
| 67 | + PageResult<PlanRateDO> getPlanRatePage(PlanRatePageReqVO pageReqVO); | |
| 68 | + | |
| 69 | +} | |
| 0 | 70 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/planrate/PlanRateServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.planrate; | |
| 2 | + | |
| 3 | +import cn.hutool.core.date.DateUtil; | |
| 4 | +import cn.hutool.core.util.RandomUtil; | |
| 5 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 6 | +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | |
| 7 | +import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | |
| 8 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDetailDO; | |
| 9 | +import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateDetailMapper; | |
| 10 | +import org.springframework.stereotype.Service; | |
| 11 | +import jakarta.annotation.Resource; | |
| 12 | +import org.springframework.validation.annotation.Validated; | |
| 13 | +import org.springframework.transaction.annotation.Transactional; | |
| 14 | + | |
| 15 | +import java.time.LocalDateTime; | |
| 16 | +import java.util.*; | |
| 17 | + | |
| 18 | +import com.zteits.urbanops.module.garden.controller.admin.planrate.vo.*; | |
| 19 | +import com.zteits.urbanops.module.garden.dal.dataobject.planrate.PlanRateDO; | |
| 20 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 21 | + | |
| 22 | +import com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateMapper; | |
| 23 | + | |
| 24 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 25 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * 计划频次 Service 实现类 | |
| 29 | + * | |
| 30 | + * @author 超级管理员 | |
| 31 | + */ | |
| 32 | +@Service | |
| 33 | +@Validated | |
| 34 | +public class PlanRateServiceImpl implements PlanRateService { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private PlanRateMapper planRateMapper; | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private PlanRateDetailMapper planRateDetailMapper; | |
| 41 | + | |
| 42 | + @Transactional(rollbackFor = Exception.class) | |
| 43 | + @Override | |
| 44 | + public Long createPlanRate(PlanRateSaveReqVO createReqVO) { | |
| 45 | + // 校验存在 | |
| 46 | + validatePlanRateExists(createReqVO.getPlanTypeId(), createReqVO.getBusiLine()); | |
| 47 | + LocalDateTime now = LocalDateTime.now(); | |
| 48 | + String userName = SecurityFrameworkUtils.getLoginUserId() + ""; | |
| 49 | + String rateNo = DateUtil.format(new Date(), "yyyyMMddHHmmssSSS") + RandomUtil.randomInt(1000); | |
| 50 | + PlanRateDO planRate = new PlanRateDO(); | |
| 51 | + planRate.setRateNo(rateNo); | |
| 52 | + planRate.setStdPlan(createReqVO.getStdPlan()); | |
| 53 | + planRate.setBusiLine(createReqVO.getBusiLine()); | |
| 54 | + planRate.setPlanTypeId(createReqVO.getPlanTypeId()); | |
| 55 | + planRate.setCreator(userName); | |
| 56 | + planRate.setCreateTime(now); | |
| 57 | + planRate.setUpdater(userName); | |
| 58 | + planRate.setUpdateTime(now); | |
| 59 | + /*1.插入频次主表*/ | |
| 60 | + planRateMapper.insert(planRate); | |
| 61 | + | |
| 62 | + List<PlanRateDetailDO> list = new ArrayList<>(); | |
| 63 | + createReqVO.getDetails().forEach(detail -> { | |
| 64 | + PlanRateDetailDO detailDO = new PlanRateDetailDO(); | |
| 65 | + detailDO.setRateNo(rateNo); | |
| 66 | + detailDO.setBusiLine(createReqVO.getBusiLine()); | |
| 67 | + detailDO.setPlanTypeId(createReqVO.getPlanTypeId()); | |
| 68 | + detailDO.setLevelId(detail.getLevelId()); | |
| 69 | + detailDO.setRate(detail.getRate()); | |
| 70 | + detailDO.setCycleId(detail.getCycleId()); | |
| 71 | + detailDO.setCreator(userName); | |
| 72 | + detailDO.setCreateTime(now); | |
| 73 | + detailDO.setUpdater(userName); | |
| 74 | + detailDO.setUpdateTime(now); | |
| 75 | + list.add(detailDO); | |
| 76 | + }); | |
| 77 | + /*2.插入频次明细*/ | |
| 78 | + planRateDetailMapper.insertBatch(list); | |
| 79 | + // 返回 | |
| 80 | + return planRate.getId(); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @Transactional(rollbackFor = Exception.class) | |
| 84 | + @Override | |
| 85 | + public void updatePlanRate(PlanRateUpdateReqVO updateReqVO) { | |
| 86 | + /*1.删除明细*/ | |
| 87 | + int count = planRateDetailMapper.deleteByRateNo(updateReqVO.getRateNo()); | |
| 88 | + LocalDateTime now = LocalDateTime.now(); | |
| 89 | + String userName = SecurityFrameworkUtils.getLoginUserId() + ""; | |
| 90 | + UpdateWrapper<PlanRateDO> updateSql = new UpdateWrapper<>(); | |
| 91 | + updateSql.lambda() | |
| 92 | + .set(PlanRateDO::getStdPlan, updateReqVO.getStdPlan()) | |
| 93 | + .set(PlanRateDO::getUpdater, userName) | |
| 94 | + .set(PlanRateDO::getUpdateTime, now) | |
| 95 | + .eq(PlanRateDO::getRateNo, updateReqVO.getRateNo()); | |
| 96 | + /*2.更新主表*/ | |
| 97 | + planRateMapper.update(updateSql); | |
| 98 | + // 更新 | |
| 99 | + List<PlanRateDetailDO> list = new ArrayList<>(); | |
| 100 | + updateReqVO.getDetails().forEach(detail -> { | |
| 101 | + PlanRateDetailDO detailDO = new PlanRateDetailDO(); | |
| 102 | + detailDO.setRateNo(updateReqVO.getRateNo()); | |
| 103 | + detailDO.setBusiLine(updateReqVO.getBusiLine()); | |
| 104 | + detailDO.setPlanTypeId(updateReqVO.getPlanTypeId()); | |
| 105 | + detailDO.setLevelId(detail.getLevelId()); | |
| 106 | + detailDO.setRate(detail.getRate()); | |
| 107 | + detailDO.setCycleId(detail.getCycleId()); | |
| 108 | + detailDO.setCreator(userName); | |
| 109 | + detailDO.setCreateTime(now); | |
| 110 | + detailDO.setUpdater(userName); | |
| 111 | + detailDO.setUpdateTime(now); | |
| 112 | + list.add(detailDO); | |
| 113 | + }); | |
| 114 | + /*3.插入频次明细*/ | |
| 115 | + planRateDetailMapper.insertBatch(list); | |
| 116 | + } | |
| 117 | + | |
| 118 | + @Override | |
| 119 | + public void deletePlanRate(Long id) { | |
| 120 | + // 校验存在 | |
| 121 | + //validatePlanRateExists(id); | |
| 122 | + // 删除 | |
| 123 | + planRateMapper.deleteById(id); | |
| 124 | + } | |
| 125 | + | |
| 126 | + @Override | |
| 127 | + public void deletePlanRateListByIds(List<Long> ids) { | |
| 128 | + // 删除 | |
| 129 | + planRateMapper.deleteByIds(ids); | |
| 130 | + } | |
| 131 | + | |
| 132 | + @Override | |
| 133 | + public void deletePlanRateByRateNo(String rateNo) { | |
| 134 | + planRateMapper.deleteByRateNo(rateNo); | |
| 135 | + planRateDetailMapper.deleteByRateNo(rateNo); | |
| 136 | + } | |
| 137 | + | |
| 138 | + | |
| 139 | + private void validatePlanRateExists(Integer planTypeId, String busiLine) { | |
| 140 | + QueryWrapper<PlanRateDO> sql = new QueryWrapper<>(); | |
| 141 | + sql.lambda().eq(PlanRateDO::getPlanTypeId, planTypeId).eq(PlanRateDO::getBusiLine, busiLine); | |
| 142 | + if (planRateMapper.selectCount(sql) > 0) { | |
| 143 | + throw exception(PLAN_RATE_EXISTS); | |
| 144 | + } | |
| 145 | + } | |
| 146 | + | |
| 147 | + @Override | |
| 148 | + public PlanRateDO getPlanRate(Long id) { | |
| 149 | + return planRateMapper.selectById(id); | |
| 150 | + } | |
| 151 | + | |
| 152 | + @Override | |
| 153 | + public PageResult<PlanRateDO> getPlanRatePage(PlanRatePageReqVO pageReqVO) { | |
| 154 | + return planRateMapper.selectPage(pageReqVO); | |
| 155 | + } | |
| 156 | + | |
| 157 | +} | |
| 0 | 158 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/util/FieldDuplicateCheckerUtil.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.util; | |
| 2 | +import java.util.LinkedHashSet; | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Set; | |
| 5 | +import java.util.function.Function; | |
| 6 | + | |
| 7 | +public class FieldDuplicateCheckerUtil { | |
| 8 | + | |
| 9 | + /** | |
| 10 | + * 通用判断:指定字段是否存在重复值 | |
| 11 | + * @param list 目标列表(可为 null/空) | |
| 12 | + * @param fieldExtractor 字段提取器(如 User::getId、User::getName) | |
| 13 | + * @param <T> 列表元素类型 | |
| 14 | + * @param <R> 字段类型(需重写 equals/hashCode,如 Long、String、自定义类) | |
| 15 | + * @return true=存在重复,false=无重复 | |
| 16 | + */ | |
| 17 | + public static <T, R> boolean hasDuplicate(List<T> list, Function<T, R> fieldExtractor) { | |
| 18 | + // 边界条件:空列表或仅1个元素,直接返回无重复 | |
| 19 | + if (list == null || list.size() <= 1) { | |
| 20 | + return false; | |
| 21 | + } | |
| 22 | + | |
| 23 | + Set<R> fieldSet = new LinkedHashSet<>(); // 用于存储已出现的字段值 | |
| 24 | + for (T item : list) { | |
| 25 | + R fieldValue = fieldExtractor.apply(item); // 提取当前对象的字段值 | |
| 26 | + | |
| 27 | + // 处理 null 值:多个 null 视为重复 | |
| 28 | + if (fieldValue == null) { | |
| 29 | + // 统计 null 出现次数,>1 则返回重复 | |
| 30 | + long nullCount = list.stream().filter(t -> fieldExtractor.apply(t) == null).count(); | |
| 31 | + return nullCount > 1; | |
| 32 | + } | |
| 33 | + | |
| 34 | + // 非 null 值:添加到 Set 失败(已存在)→ 存在重复,短路返回 | |
| 35 | + if (!fieldSet.add(fieldValue)) { | |
| 36 | + return true; | |
| 37 | + } | |
| 38 | + } | |
| 39 | + | |
| 40 | + // 遍历完成无重复 | |
| 41 | + return false; | |
| 42 | + } | |
| 43 | +} | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanDetailMapper.xml
| ... | ... | @@ -8,5 +8,8 @@ |
| 8 | 8 | 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 |
| 9 | 9 | 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ |
| 10 | 10 | --> |
| 11 | + <delete id="deleteByBatchNo"> | |
| 12 | + delete from garden_inspection_plan_detail where batch_no =#{batchNo} | |
| 13 | + </delete> | |
| 11 | 14 | |
| 12 | 15 | </mapper> |
| 13 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanRoleMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanRoleMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + <delete id="deleteByBatchNo"> | |
| 12 | + delete from garden_inspection_plan_role where batch_no =#{batchNo} | |
| 13 | + </delete> | |
| 14 | + | |
| 15 | +</mapper> | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/planrate/PlanRateDetailMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateDetailMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | + <delete id="deleteByRateNo"> | |
| 13 | + delete from garden_plan_rate_detail where rate_no=#{rateNo} | |
| 14 | + </delete> | |
| 15 | +</mapper> | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/planrate/PlanRateMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="com.zteits.urbanops.module.garden.dal.mysql.planrate.PlanRateMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + <delete id="deleteByRateNo"> | |
| 12 | + delete from garden_plan_rate_detail where rate_no=#{rateNo} | |
| 13 | + </delete> | |
| 14 | +</mapper> | |
| 0 | 15 | \ No newline at end of file | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/dept/DeptController.java
| ... | ... | @@ -90,4 +90,12 @@ public class DeptController { |
| 90 | 90 | return success(BeanUtils.toBean(dept, DeptRespVO.class)); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | + @GetMapping("/sub-list") | |
| 94 | + @Operation(summary = "获取二级部门列表") | |
| 95 | + @PreAuthorize("@ss.hasPermission('system:dept:query')") | |
| 96 | + public CommonResult<List<DeptRespVO>> getSubDeptList() { | |
| 97 | + List<DeptDO> list = deptService.getSubDeptList(); | |
| 98 | + return success(BeanUtils.toBean(list, DeptRespVO.class)); | |
| 99 | + } | |
| 100 | + | |
| 93 | 101 | } | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptService.java
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java
| ... | ... | @@ -178,6 +178,11 @@ public class DeptServiceImpl implements DeptService { |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | @Override |
| 181 | + public List<DeptDO> getSubDeptList() { | |
| 182 | + return deptMapper.selectList(DeptDO::getParentId,100); | |
| 183 | + } | |
| 184 | + | |
| 185 | + @Override | |
| 181 | 186 | public List<DeptDO> getDeptList(DeptListReqVO reqVO) { |
| 182 | 187 | List<DeptDO> list = deptMapper.selectList(reqVO); |
| 183 | 188 | list.sort(Comparator.comparing(DeptDO::getSort)); | ... | ... |