Commit 8f469e6fca2e6dcbfb433f9f403c9dfe3c3bd66a
1 parent
5f5a817e
测试bug优化
Showing
28 changed files
with
284 additions
and
48 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/InspectionPlanController.java
| @@ -113,8 +113,8 @@ public class InspectionPlanController { | @@ -113,8 +113,8 @@ public class InspectionPlanController { | ||
| 113 | @Operation(summary = "获得巡检计划汇总分页") | 113 | @Operation(summary = "获得巡检计划汇总分页") |
| 114 | @PreAuthorize("@ss.hasPermission('garden:inspection-plan:query')") | 114 | @PreAuthorize("@ss.hasPermission('garden:inspection-plan:query')") |
| 115 | public CommonResult<PageResult<InspectionPlanRespVO>> getInspectionPlanPage(@Valid InspectionPlanPageReqVO pageReqVO) { | 115 | public CommonResult<PageResult<InspectionPlanRespVO>> getInspectionPlanPage(@Valid InspectionPlanPageReqVO pageReqVO) { |
| 116 | - PageResult<InspectionPlanDO> pageResult = inspectionPlanService.getInspectionPlanPage(pageReqVO); | ||
| 117 | - return success(BeanUtils.toBean(pageResult, InspectionPlanRespVO.class)); | 116 | + PageResult<InspectionPlanRespVO> pageResult = inspectionPlanService.getInspectionPlanPage(pageReqVO); |
| 117 | + return success(pageResult); | ||
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | @GetMapping("/export-excel") | 120 | @GetMapping("/export-excel") |
| @@ -124,10 +124,10 @@ public class InspectionPlanController { | @@ -124,10 +124,10 @@ public class InspectionPlanController { | ||
| 124 | public void exportInspectionPlanExcel(@Valid InspectionPlanPageReqVO pageReqVO, | 124 | public void exportInspectionPlanExcel(@Valid InspectionPlanPageReqVO pageReqVO, |
| 125 | HttpServletResponse response) throws IOException { | 125 | HttpServletResponse response) throws IOException { |
| 126 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | 126 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| 127 | - List<InspectionPlanDO> list = inspectionPlanService.getInspectionPlanPage(pageReqVO).getList(); | 127 | + List<InspectionPlanRespVO> list = inspectionPlanService.getInspectionPlanPage(pageReqVO).getList(); |
| 128 | // 导出 Excel | 128 | // 导出 Excel |
| 129 | ExcelUtils.write(response, "巡检计划汇总.xls", "数据", InspectionPlanRespVO.class, | 129 | ExcelUtils.write(response, "巡检计划汇总.xls", "数据", InspectionPlanRespVO.class, |
| 130 | - BeanUtils.toBean(list, InspectionPlanRespVO.class)); | 130 | + list); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | } | 133 | } |
| 134 | \ No newline at end of file | 134 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanDetailRespVO.java
| @@ -3,8 +3,6 @@ package com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo; | @@ -3,8 +3,6 @@ package com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | 5 | ||
| 6 | -import java.time.LocalDate; | ||
| 7 | -import java.util.*; | ||
| 8 | 6 | ||
| 9 | import java.time.LocalDateTime; | 7 | import java.time.LocalDateTime; |
| 10 | import cn.idev.excel.annotation.*; | 8 | import cn.idev.excel.annotation.*; |
| @@ -48,11 +46,11 @@ public class InspectionPlanDetailRespVO { | @@ -48,11 +46,11 @@ public class InspectionPlanDetailRespVO { | ||
| 48 | 46 | ||
| 49 | @Schema(description = "执行开始时间") | 47 | @Schema(description = "执行开始时间") |
| 50 | @ExcelProperty("执行开始时间") | 48 | @ExcelProperty("执行开始时间") |
| 51 | - private LocalDate beginTime; | 49 | + private LocalDateTime beginTime; |
| 52 | 50 | ||
| 53 | @Schema(description = "执行时间") | 51 | @Schema(description = "执行时间") |
| 54 | @ExcelProperty("执行时间") | 52 | @ExcelProperty("执行时间") |
| 55 | - private LocalDate endTime; | 53 | + private LocalDateTime endTime; |
| 56 | 54 | ||
| 57 | @Schema(description = "完成状态 1:未完成;2:进行中;3:已完成", requiredMode = Schema.RequiredMode.REQUIRED) | 55 | @Schema(description = "完成状态 1:未完成;2:进行中;3:已完成", requiredMode = Schema.RequiredMode.REQUIRED) |
| 58 | @ExcelProperty("完成状态 1:未完成;2:进行中;3:已完成") | 56 | @ExcelProperty("完成状态 1:未完成;2:进行中;3:已完成") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanPageReqVO.java
| @@ -43,4 +43,7 @@ public class InspectionPlanPageReqVO extends PageParam { | @@ -43,4 +43,7 @@ public class InspectionPlanPageReqVO extends PageParam { | ||
| 43 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 43 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 44 | private LocalDateTime[] endTime; | 44 | private LocalDateTime[] endTime; |
| 45 | 45 | ||
| 46 | + @Schema(description = "完成状态 : 1:未完成;2:已完成") | ||
| 47 | + private Integer finishState; | ||
| 48 | + | ||
| 46 | } | 49 | } |
| 47 | \ No newline at end of file | 50 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanRespVO.java
| @@ -4,6 +4,8 @@ import com.fhs.core.trans.vo.VO; | @@ -4,6 +4,8 @@ import com.fhs.core.trans.vo.VO; | ||
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.*; | 5 | import lombok.*; |
| 6 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 7 | import cn.idev.excel.annotation.*; | 9 | import cn.idev.excel.annotation.*; |
| 8 | 10 | ||
| 9 | @Schema(description = "管理后台 - 巡检计划汇总 Response VO") | 11 | @Schema(description = "管理后台 - 巡检计划汇总 Response VO") |
| @@ -39,10 +41,17 @@ public class InspectionPlanRespVO implements VO { | @@ -39,10 +41,17 @@ public class InspectionPlanRespVO implements VO { | ||
| 39 | @ExcelProperty("归属(一级部门id)") | 41 | @ExcelProperty("归属(一级部门id)") |
| 40 | private Long companyId; | 42 | private Long companyId; |
| 41 | 43 | ||
| 44 | + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "20800") | ||
| 45 | + @ExcelProperty("归属(一级部门id)") | ||
| 46 | + private String companyName; | ||
| 47 | + | ||
| 42 | @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "16445") | 48 | @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "16445") |
| 43 | @ExcelProperty("部门ID(道路负责部门id)") | 49 | @ExcelProperty("部门ID(道路负责部门id)") |
| 44 | private Long deptId; | 50 | private Long deptId; |
| 45 | 51 | ||
| 52 | + @ExcelProperty("部门(道路负责部门)") | ||
| 53 | + private String deptName; | ||
| 54 | + | ||
| 46 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15557") | 55 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15557") |
| 47 | @ExcelProperty("道路ID") | 56 | @ExcelProperty("道路ID") |
| 48 | private Long roadId; | 57 | private Long roadId; |
| @@ -55,6 +64,10 @@ public class InspectionPlanRespVO implements VO { | @@ -55,6 +64,10 @@ public class InspectionPlanRespVO implements VO { | ||
| 55 | @ExcelProperty("养护级别: 10:特级;11:一级:12:二级;13:三级") | 64 | @ExcelProperty("养护级别: 10:特级;11:一级:12:二级;13:三级") |
| 56 | private Integer levelId; | 65 | private Integer levelId; |
| 57 | 66 | ||
| 67 | + @Schema(description = "次数 如:1/3等", requiredMode = Schema.RequiredMode.REQUIRED, example = "1/3") | ||
| 68 | + @ExcelProperty("次数 如:1/3等") | ||
| 69 | + private String rate; | ||
| 70 | + | ||
| 58 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "6415") | 71 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "6415") |
| 59 | @ExcelProperty("周期ID: 1:日/次;2:周/次;3:月/次;4:年/次") | 72 | @ExcelProperty("周期ID: 1:日/次;2:周/次;3:月/次;4:年/次") |
| 60 | private Integer cycleId; | 73 | private Integer cycleId; |
| @@ -93,9 +106,17 @@ public class InspectionPlanRespVO implements VO { | @@ -93,9 +106,17 @@ public class InspectionPlanRespVO implements VO { | ||
| 93 | /** | 106 | /** |
| 94 | * 创建者 | 107 | * 创建者 |
| 95 | */ | 108 | */ |
| 96 | - @Schema(description = "创建人名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZIEITS") | 109 | + @Schema(description = "创建人名字", example = "ZIEITS") |
| 97 | @ExcelProperty("创建人") | 110 | @ExcelProperty("创建人") |
| 98 | private String creatorName; | 111 | private String creatorName; |
| 99 | 112 | ||
| 113 | + /** | ||
| 114 | + * 角色 | ||
| 115 | + */ | ||
| 116 | + @Schema(description = "角色列表", example = "ZIEITS") | ||
| 117 | + @ExcelProperty("角色列表") | ||
| 118 | + private List<String> roleNameList; | ||
| 119 | + | ||
| 120 | + | ||
| 100 | 121 | ||
| 101 | } | 122 | } |
| 102 | \ No newline at end of file | 123 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/MaintainPlanController.java
| @@ -111,8 +111,8 @@ public class MaintainPlanController { | @@ -111,8 +111,8 @@ public class MaintainPlanController { | ||
| 111 | @Operation(summary = "获得养护计划汇总分页") | 111 | @Operation(summary = "获得养护计划汇总分页") |
| 112 | @PreAuthorize("@ss.hasPermission('garden:maintain-plan:query')") | 112 | @PreAuthorize("@ss.hasPermission('garden:maintain-plan:query')") |
| 113 | public CommonResult<PageResult<MaintainPlanRespVO>> getMaintainPlanPage(@Valid MaintainPlanPageReqVO pageReqVO) { | 113 | public CommonResult<PageResult<MaintainPlanRespVO>> getMaintainPlanPage(@Valid MaintainPlanPageReqVO pageReqVO) { |
| 114 | - PageResult<MaintainPlanDO> pageResult = maintainPlanService.getMaintainPlanPage(pageReqVO); | ||
| 115 | - return success(BeanUtils.toBean(pageResult, MaintainPlanRespVO.class)); | 114 | + PageResult<MaintainPlanRespVO> pageResult = maintainPlanService.getMaintainPlanPage(pageReqVO); |
| 115 | + return success(pageResult); | ||
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | @GetMapping("/export-excel") | 118 | @GetMapping("/export-excel") |
| @@ -122,10 +122,10 @@ public class MaintainPlanController { | @@ -122,10 +122,10 @@ public class MaintainPlanController { | ||
| 122 | public void exportMaintainPlanExcel(@Valid MaintainPlanPageReqVO pageReqVO, | 122 | public void exportMaintainPlanExcel(@Valid MaintainPlanPageReqVO pageReqVO, |
| 123 | HttpServletResponse response) throws IOException { | 123 | HttpServletResponse response) throws IOException { |
| 124 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | 124 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| 125 | - List<MaintainPlanDO> list = maintainPlanService.getMaintainPlanPage(pageReqVO).getList(); | 125 | + List<MaintainPlanRespVO> list = maintainPlanService.getMaintainPlanPage(pageReqVO).getList(); |
| 126 | // 导出 Excel | 126 | // 导出 Excel |
| 127 | ExcelUtils.write(response, "养护计划汇总.xls", "数据", MaintainPlanRespVO.class, | 127 | ExcelUtils.write(response, "养护计划汇总.xls", "数据", MaintainPlanRespVO.class, |
| 128 | - BeanUtils.toBean(list, MaintainPlanRespVO.class)); | 128 | + list); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | } | 131 | } |
| 132 | \ No newline at end of file | 132 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanDetailRespVO.java
| @@ -3,7 +3,6 @@ package com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo; | @@ -3,7 +3,6 @@ package com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | 5 | ||
| 6 | -import java.time.LocalDate; | ||
| 7 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| 8 | import cn.idev.excel.annotation.*; | 7 | import cn.idev.excel.annotation.*; |
| 9 | 8 | ||
| @@ -46,11 +45,11 @@ public class MaintainPlanDetailRespVO { | @@ -46,11 +45,11 @@ public class MaintainPlanDetailRespVO { | ||
| 46 | 45 | ||
| 47 | @Schema(description = "执行开始时间") | 46 | @Schema(description = "执行开始时间") |
| 48 | @ExcelProperty("执行开始时间") | 47 | @ExcelProperty("执行开始时间") |
| 49 | - private LocalDate beginTime; | 48 | + private LocalDateTime beginTime; |
| 50 | 49 | ||
| 51 | @Schema(description = "执行时间") | 50 | @Schema(description = "执行时间") |
| 52 | @ExcelProperty("执行时间") | 51 | @ExcelProperty("执行时间") |
| 53 | - private LocalDate endTime; | 52 | + private LocalDateTime endTime; |
| 54 | 53 | ||
| 55 | @Schema(description = "完成百分比", requiredMode = Schema.RequiredMode.REQUIRED) | 54 | @Schema(description = "完成百分比", requiredMode = Schema.RequiredMode.REQUIRED) |
| 56 | @ExcelProperty("完成百分比") | 55 | @ExcelProperty("完成百分比") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanPageReqVO.java
| @@ -44,4 +44,7 @@ public class MaintainPlanPageReqVO extends PageParam { | @@ -44,4 +44,7 @@ public class MaintainPlanPageReqVO extends PageParam { | ||
| 44 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 44 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 45 | private LocalDate[] endTime; | 45 | private LocalDate[] endTime; |
| 46 | 46 | ||
| 47 | + @Schema(description = "完成状态 : 1:未完成;2:已完成") | ||
| 48 | + private Integer finishState; | ||
| 49 | + | ||
| 47 | } | 50 | } |
| 48 | \ No newline at end of file | 51 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanRespVO.java
| @@ -42,10 +42,18 @@ public class MaintainPlanRespVO { | @@ -42,10 +42,18 @@ public class MaintainPlanRespVO { | ||
| 42 | @ExcelProperty("归属(一级部门id)") | 42 | @ExcelProperty("归属(一级部门id)") |
| 43 | private Long companyId; | 43 | private Long companyId; |
| 44 | 44 | ||
| 45 | + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "20800") | ||
| 46 | + @ExcelProperty("归属(一级部门id)") | ||
| 47 | + private String companyName; | ||
| 48 | + | ||
| 45 | @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "12055") | 49 | @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "12055") |
| 46 | @ExcelProperty("部门ID(道路负责部门id)") | 50 | @ExcelProperty("部门ID(道路负责部门id)") |
| 47 | private Long deptId; | 51 | private Long deptId; |
| 48 | 52 | ||
| 53 | + @Schema(description = "部门(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "12055") | ||
| 54 | + @ExcelProperty("部门") | ||
| 55 | + private String deptName; | ||
| 56 | + | ||
| 49 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19114") | 57 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19114") |
| 50 | @ExcelProperty("道路ID") | 58 | @ExcelProperty("道路ID") |
| 51 | private Long roadId; | 59 | private Long roadId; |
| @@ -58,6 +66,10 @@ public class MaintainPlanRespVO { | @@ -58,6 +66,10 @@ public class MaintainPlanRespVO { | ||
| 58 | @ExcelProperty("养护级别: 10:特级;11:一级:12:二级;13:三级") | 66 | @ExcelProperty("养护级别: 10:特级;11:一级:12:二级;13:三级") |
| 59 | private Integer levelId; | 67 | private Integer levelId; |
| 60 | 68 | ||
| 69 | + @Schema(description = "次数 如:1/3等", requiredMode = Schema.RequiredMode.REQUIRED, example = "1/3") | ||
| 70 | + @ExcelProperty("次数 如:1/3等") | ||
| 71 | + private String rate; | ||
| 72 | + | ||
| 61 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "28220") | 73 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "28220") |
| 62 | @ExcelProperty("周期ID: 1:日/次;2:周/次;3:月/次;4:年/次") | 74 | @ExcelProperty("周期ID: 1:日/次;2:周/次;3:月/次;4:年/次") |
| 63 | private Integer cycleId; | 75 | private Integer cycleId; |
| @@ -98,5 +110,11 @@ public class MaintainPlanRespVO { | @@ -98,5 +110,11 @@ public class MaintainPlanRespVO { | ||
| 98 | @ExcelProperty("创建时间") | 110 | @ExcelProperty("创建时间") |
| 99 | private LocalDateTime createTime; | 111 | private LocalDateTime createTime; |
| 100 | 112 | ||
| 113 | + /** | ||
| 114 | + * 角色 | ||
| 115 | + */ | ||
| 116 | + @Schema(description = "角色列表", example = "ZIEITS") | ||
| 117 | + @ExcelProperty("角色列表") | ||
| 118 | + private List<String> roleNameList; | ||
| 101 | 119 | ||
| 102 | } | 120 | } |
| 103 | \ No newline at end of file | 121 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanSaveReqVO.java
| @@ -14,6 +14,7 @@ import jakarta.validation.constraints.*; | @@ -14,6 +14,7 @@ import jakarta.validation.constraints.*; | ||
| 14 | public class MaintainPlanSaveReqVO { | 14 | public class MaintainPlanSaveReqVO { |
| 15 | 15 | ||
| 16 | @Schema(description = "计划名称后缀", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "张三") | 16 | @Schema(description = "计划名称后缀", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "张三") |
| 17 | + @Max(value = 15) | ||
| 17 | private String planNameSuffix; | 18 | private String planNameSuffix; |
| 18 | 19 | ||
| 19 | @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | 20 | @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadSaveReqVO.java
| @@ -2,8 +2,8 @@ package com.zteits.urbanops.module.garden.controller.admin.road.vo; | @@ -2,8 +2,8 @@ package com.zteits.urbanops.module.garden.controller.admin.road.vo; | ||
| 2 | 2 | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | -import java.util.*; | ||
| 6 | import jakarta.validation.constraints.*; | 5 | import jakarta.validation.constraints.*; |
| 6 | +import org.hibernate.validator.constraints.Length; | ||
| 7 | 7 | ||
| 8 | @Schema(description = "管理后台 - 道路管理新增/修改 Request VO") | 8 | @Schema(description = "管理后台 - 道路管理新增/修改 Request VO") |
| 9 | @Data | 9 | @Data |
| @@ -11,6 +11,7 @@ public class RoadSaveReqVO { | @@ -11,6 +11,7 @@ public class RoadSaveReqVO { | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | @Schema(description = "道路名称", example = "赵六") | 13 | @Schema(description = "道路名称", example = "赵六") |
| 14 | + @Length(max = 128) | ||
| 14 | private String roadName; | 15 | private String roadName; |
| 15 | 16 | ||
| 16 | @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11139") | 17 | @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11139") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/inspectionplan/InspectionPlanDO.java
| @@ -66,6 +66,11 @@ public class InspectionPlanDO extends BaseDO { | @@ -66,6 +66,11 @@ public class InspectionPlanDO extends BaseDO { | ||
| 66 | */ | 66 | */ |
| 67 | private Integer levelId; | 67 | private Integer levelId; |
| 68 | /** | 68 | /** |
| 69 | + * 次数 如:1/3等 | ||
| 70 | + */ | ||
| 71 | + private String rate; | ||
| 72 | + | ||
| 73 | + /** | ||
| 69 | * 周期ID: 1:日/次;2:周/次;3:月/次;4:年/次 | 74 | * 周期ID: 1:日/次;2:周/次;3:月/次;4:年/次 |
| 70 | */ | 75 | */ |
| 71 | private Integer cycleId; | 76 | private Integer cycleId; |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/inspectionplan/InspectionPlanDetailDO.java
| @@ -60,11 +60,11 @@ public class InspectionPlanDetailDO extends BaseDO { | @@ -60,11 +60,11 @@ public class InspectionPlanDetailDO extends BaseDO { | ||
| 60 | /** | 60 | /** |
| 61 | * 执行开始时间 | 61 | * 执行开始时间 |
| 62 | */ | 62 | */ |
| 63 | - private LocalDate beginTime; | 63 | + private LocalDateTime beginTime; |
| 64 | /** | 64 | /** |
| 65 | * 执行时间 | 65 | * 执行时间 |
| 66 | */ | 66 | */ |
| 67 | - private LocalDate endTime; | 67 | + private LocalDateTime endTime; |
| 68 | /** | 68 | /** |
| 69 | * 完成状态 1:未完成;2:进行中;3:已完成 | 69 | * 完成状态 1:未完成;2:进行中;3:已完成 |
| 70 | */ | 70 | */ |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainplan/MaintainPlanDO.java
| @@ -66,6 +66,11 @@ public class MaintainPlanDO extends BaseDO { | @@ -66,6 +66,11 @@ public class MaintainPlanDO extends BaseDO { | ||
| 66 | * 养护级别: 10:特级;11:一级:12:二级;13:三级 | 66 | * 养护级别: 10:特级;11:一级:12:二级;13:三级 |
| 67 | */ | 67 | */ |
| 68 | private Integer levelId; | 68 | private Integer levelId; |
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * 次数 如:1/3等 | ||
| 72 | + */ | ||
| 73 | + private String rate; | ||
| 69 | /** | 74 | /** |
| 70 | * 周期ID: 1:日/次;2:周/次;3:月/次;4:年/次 | 75 | * 周期ID: 1:日/次;2:周/次;3:月/次;4:年/次 |
| 71 | */ | 76 | */ |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainplan/MaintainPlanDetailDO.java
| @@ -2,7 +2,8 @@ package com.zteits.urbanops.module.garden.dal.dataobject.maintainplan; | @@ -2,7 +2,8 @@ package com.zteits.urbanops.module.garden.dal.dataobject.maintainplan; | ||
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | 4 | ||
| 5 | -import java.time.LocalDate; | 5 | +import java.time.LocalDateTime; |
| 6 | + | ||
| 6 | import com.baomidou.mybatisplus.annotation.*; | 7 | import com.baomidou.mybatisplus.annotation.*; |
| 7 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | 8 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; |
| 8 | 9 | ||
| @@ -57,11 +58,11 @@ public class MaintainPlanDetailDO extends BaseDO { | @@ -57,11 +58,11 @@ public class MaintainPlanDetailDO extends BaseDO { | ||
| 57 | /** | 58 | /** |
| 58 | * 执行开始时间 | 59 | * 执行开始时间 |
| 59 | */ | 60 | */ |
| 60 | - private LocalDate beginTime; | 61 | + private LocalDateTime beginTime; |
| 61 | /** | 62 | /** |
| 62 | * 执行时间 | 63 | * 执行时间 |
| 63 | */ | 64 | */ |
| 64 | - private LocalDate endTime; | 65 | + private LocalDateTime endTime; |
| 65 | /** | 66 | /** |
| 66 | * 完成百分比 | 67 | * 完成百分比 |
| 67 | */ | 68 | */ |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanDetailMapper.java
| @@ -31,6 +31,7 @@ public interface InspectionPlanDetailMapper extends BaseMapperX<InspectionPlanDe | @@ -31,6 +31,7 @@ public interface InspectionPlanDetailMapper extends BaseMapperX<InspectionPlanDe | ||
| 31 | .betweenIfPresent(InspectionPlanDetailDO::getEndTime, reqVO.getEndTime()) | 31 | .betweenIfPresent(InspectionPlanDetailDO::getEndTime, reqVO.getEndTime()) |
| 32 | .eqIfPresent(InspectionPlanDetailDO::getFinishState, reqVO.getFinishState()) | 32 | .eqIfPresent(InspectionPlanDetailDO::getFinishState, reqVO.getFinishState()) |
| 33 | .betweenIfPresent(InspectionPlanDetailDO::getCreateTime, reqVO.getCreateTime()) | 33 | .betweenIfPresent(InspectionPlanDetailDO::getCreateTime, reqVO.getCreateTime()) |
| 34 | + .eq(InspectionPlanDetailDO::getDeleted,0) | ||
| 34 | .orderByDesc(InspectionPlanDetailDO::getId)); | 35 | .orderByDesc(InspectionPlanDetailDO::getId)); |
| 35 | } | 36 | } |
| 36 | 37 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanInterceptMapper.java
| @@ -26,7 +26,10 @@ public interface InspectionPlanInterceptMapper extends BaseMapperX<InspectionPla | @@ -26,7 +26,10 @@ public interface InspectionPlanInterceptMapper extends BaseMapperX<InspectionPla | ||
| 26 | .eqIfPresent(InspectionPlanDO::getCompanyId, reqVO.getCompanyId()) | 26 | .eqIfPresent(InspectionPlanDO::getCompanyId, reqVO.getCompanyId()) |
| 27 | .likeIfPresent(InspectionPlanDO::getRoadName, reqVO.getRoadName()) | 27 | .likeIfPresent(InspectionPlanDO::getRoadName, reqVO.getRoadName()) |
| 28 | .eqIfPresent(InspectionPlanDO::getLevelId, reqVO.getLevelId()) | 28 | .eqIfPresent(InspectionPlanDO::getLevelId, reqVO.getLevelId()) |
| 29 | + .eqIfPresent(InspectionPlanDO::getFinishState, reqVO.getFinishState()) | ||
| 30 | + .eq(InspectionPlanDO::getFinishState, reqVO.getFinishState()) | ||
| 29 | .betweenIfPresent(InspectionPlanDO::getBeginTime, reqVO.getBeginTime()) | 31 | .betweenIfPresent(InspectionPlanDO::getBeginTime, reqVO.getBeginTime()) |
| 32 | + .eq(InspectionPlanDO::getDeleted,0) | ||
| 30 | .betweenIfPresent(InspectionPlanDO::getEndTime, reqVO.getEndTime()) | 33 | .betweenIfPresent(InspectionPlanDO::getEndTime, reqVO.getEndTime()) |
| 31 | .orderByDesc(InspectionPlanDO::getId)); | 34 | .orderByDesc(InspectionPlanDO::getId)); |
| 32 | } | 35 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanMapper.java
| 1 | package com.zteits.urbanops.module.garden.dal.mysql.inspectionplan; | 1 | package com.zteits.urbanops.module.garden.dal.mysql.inspectionplan; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -import com.zteits.urbanops.framework.annotation.ProcessBusinessLine; | ||
| 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | 6 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| @@ -28,6 +27,7 @@ public interface InspectionPlanMapper extends BaseMapperX<InspectionPlanDO> { | @@ -28,6 +27,7 @@ public interface InspectionPlanMapper extends BaseMapperX<InspectionPlanDO> { | ||
| 28 | .eqIfPresent(InspectionPlanDO::getLevelId, reqVO.getLevelId()) | 27 | .eqIfPresent(InspectionPlanDO::getLevelId, reqVO.getLevelId()) |
| 29 | .betweenIfPresent(InspectionPlanDO::getBeginTime, reqVO.getBeginTime()) | 28 | .betweenIfPresent(InspectionPlanDO::getBeginTime, reqVO.getBeginTime()) |
| 30 | .betweenIfPresent(InspectionPlanDO::getEndTime, reqVO.getEndTime()) | 29 | .betweenIfPresent(InspectionPlanDO::getEndTime, reqVO.getEndTime()) |
| 30 | + .eq(InspectionPlanDO::getDeleted,0) | ||
| 31 | .orderByDesc(InspectionPlanDO::getId)); | 31 | .orderByDesc(InspectionPlanDO::getId)); |
| 32 | } | 32 | } |
| 33 | 33 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainplan/MaintainPlanInterceptMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.maintainplan; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.zteits.urbanops.framework.annotation.ProcessBusinessLine; | ||
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | ||
| 6 | +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | ||
| 7 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 8 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanPageReqVO; | ||
| 9 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; | ||
| 10 | +import org.apache.ibatis.annotations.Mapper; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 养护计划汇总 Mapper | ||
| 14 | + * | ||
| 15 | + * @author 超级管理员 | ||
| 16 | + */ | ||
| 17 | +@ProcessBusinessLine | ||
| 18 | +@Mapper | ||
| 19 | +public interface MaintainPlanInterceptMapper extends BaseMapperX<MaintainPlanDO> { | ||
| 20 | + | ||
| 21 | + default PageResult<MaintainPlanDO> selectPage(MaintainPlanPageReqVO reqVO) { | ||
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<MaintainPlanDO>() | ||
| 23 | + .eqIfPresent(MaintainPlanDO::getBatchNo, reqVO.getBatchNo()) | ||
| 24 | + .likeIfPresent(MaintainPlanDO::getPlanName, reqVO.getPlanName()) | ||
| 25 | + .eqIfPresent(MaintainPlanDO::getPlanAttr, reqVO.getPlanAttr()) | ||
| 26 | + .eqIfPresent(MaintainPlanDO::getPlanTypeId, reqVO.getPlanTypeId()) | ||
| 27 | + .eqIfPresent(MaintainPlanDO::getCompanyId, reqVO.getCompanyId()) | ||
| 28 | + .likeIfPresent(MaintainPlanDO::getRoadName, reqVO.getRoadName()) | ||
| 29 | + .eqIfPresent(MaintainPlanDO::getFinishState, reqVO.getFinishState()) | ||
| 30 | + .eqIfPresent(MaintainPlanDO::getLevelId, reqVO.getLevelId()) | ||
| 31 | + .betweenIfPresent(MaintainPlanDO::getBeginTime, reqVO.getBeginTime()) | ||
| 32 | + .betweenIfPresent(MaintainPlanDO::getEndTime, reqVO.getEndTime()) | ||
| 33 | + .eq(MaintainPlanDO::getDeleted,0) | ||
| 34 | + .orderByDesc(MaintainPlanDO::getId)); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | +} | ||
| 0 | \ No newline at end of file | 38 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainplan/MaintainPlanMapper.java
| @@ -28,6 +28,7 @@ public interface MaintainPlanMapper extends BaseMapperX<MaintainPlanDO> { | @@ -28,6 +28,7 @@ public interface MaintainPlanMapper extends BaseMapperX<MaintainPlanDO> { | ||
| 28 | .eqIfPresent(MaintainPlanDO::getLevelId, reqVO.getLevelId()) | 28 | .eqIfPresent(MaintainPlanDO::getLevelId, reqVO.getLevelId()) |
| 29 | .betweenIfPresent(MaintainPlanDO::getBeginTime, reqVO.getBeginTime()) | 29 | .betweenIfPresent(MaintainPlanDO::getBeginTime, reqVO.getBeginTime()) |
| 30 | .betweenIfPresent(MaintainPlanDO::getEndTime, reqVO.getEndTime()) | 30 | .betweenIfPresent(MaintainPlanDO::getEndTime, reqVO.getEndTime()) |
| 31 | + .eq(MaintainPlanDO::getDeleted,0) | ||
| 31 | .orderByDesc(MaintainPlanDO::getId)); | 32 | .orderByDesc(MaintainPlanDO::getId)); |
| 32 | } | 33 | } |
| 33 | 34 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanRoleService.java
| @@ -60,4 +60,11 @@ public interface InspectionPlanRoleService { | @@ -60,4 +60,11 @@ public interface InspectionPlanRoleService { | ||
| 60 | */ | 60 | */ |
| 61 | PageResult<InspectionPlanRoleDO> getInspectionPlanRolePage(InspectionPlanRolePageReqVO pageReqVO); | 61 | PageResult<InspectionPlanRoleDO> getInspectionPlanRolePage(InspectionPlanRolePageReqVO pageReqVO); |
| 62 | 62 | ||
| 63 | + /** | ||
| 64 | + * 通过批次号查询 | ||
| 65 | + * @param batchNo 批次号 | ||
| 66 | + * @return 巡检计划 | ||
| 67 | + */ | ||
| 68 | + List<InspectionPlanRoleDO> getInspectionPlanRoleList(String batchNo); | ||
| 69 | + | ||
| 63 | } | 70 | } |
| 64 | \ No newline at end of file | 71 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanRoleServiceImpl.java
| 1 | package com.zteits.urbanops.module.garden.service.inspectionplan; | 1 | package com.zteits.urbanops.module.garden.service.inspectionplan; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 3 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRolePageReqVO; | 4 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRolePageReqVO; |
| 4 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRoleSaveReqVO; | 5 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRoleSaveReqVO; |
| 5 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanRoleDO; | 6 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanRoleDO; |
| @@ -74,4 +75,10 @@ public class InspectionPlanRoleServiceImpl implements InspectionPlanRoleService | @@ -74,4 +75,10 @@ public class InspectionPlanRoleServiceImpl implements InspectionPlanRoleService | ||
| 74 | return inspectionPlanRoleMapper.selectPage(pageReqVO); | 75 | return inspectionPlanRoleMapper.selectPage(pageReqVO); |
| 75 | } | 76 | } |
| 76 | 77 | ||
| 78 | + @Override | ||
| 79 | + public List<InspectionPlanRoleDO> getInspectionPlanRoleList(String batchNo) { | ||
| 80 | + return inspectionPlanRoleMapper.selectList(new QueryWrapper<InspectionPlanRoleDO>().lambda() | ||
| 81 | + .eq(InspectionPlanRoleDO::getBatchNo, batchNo)); | ||
| 82 | + } | ||
| 83 | + | ||
| 77 | } | 84 | } |
| 78 | \ No newline at end of file | 85 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanService.java
| @@ -58,7 +58,7 @@ public interface InspectionPlanService { | @@ -58,7 +58,7 @@ public interface InspectionPlanService { | ||
| 58 | * @param pageReqVO 分页查询 | 58 | * @param pageReqVO 分页查询 |
| 59 | * @return 巡检计划汇总分页 | 59 | * @return 巡检计划汇总分页 |
| 60 | */ | 60 | */ |
| 61 | - PageResult<InspectionPlanDO> getInspectionPlanPage(InspectionPlanPageReqVO pageReqVO); | 61 | + PageResult<InspectionPlanRespVO> getInspectionPlanPage(InspectionPlanPageReqVO pageReqVO); |
| 62 | 62 | ||
| 63 | /** | 63 | /** |
| 64 | * 根据批次号删除 | 64 | * 根据批次号删除 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| @@ -4,7 +4,6 @@ import cn.hutool.core.thread.ThreadUtil; | @@ -4,7 +4,6 @@ import cn.hutool.core.thread.ThreadUtil; | ||
| 4 | import cn.hutool.core.util.RandomUtil; | 4 | import cn.hutool.core.util.RandomUtil; |
| 5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 6 | import com.zteits.urbanops.framework.common.pojo.CommonResult; | 6 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 7 | -import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; | ||
| 8 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; | 7 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 9 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | 8 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 10 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; | 9 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| @@ -15,10 +14,16 @@ import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlan | @@ -15,10 +14,16 @@ import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlan | ||
| 15 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; | 14 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; |
| 16 | import com.zteits.urbanops.module.garden.enums.PlanConstants; | 15 | import com.zteits.urbanops.module.garden.enums.PlanConstants; |
| 17 | import com.zteits.urbanops.module.garden.util.TimeIntervalCalculatorUtil; | 16 | import com.zteits.urbanops.module.garden.util.TimeIntervalCalculatorUtil; |
| 17 | +import com.zteits.urbanops.module.system.api.dept.DeptApi; | ||
| 18 | +import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; | ||
| 19 | +import com.zteits.urbanops.module.system.api.permission.RoleApi; | ||
| 20 | +import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; | ||
| 21 | +import jodd.util.StringUtil; | ||
| 18 | import lombok.extern.slf4j.Slf4j; | 22 | import lombok.extern.slf4j.Slf4j; |
| 19 | import org.springframework.stereotype.Service; | 23 | import org.springframework.stereotype.Service; |
| 20 | import jakarta.annotation.Resource; | 24 | import jakarta.annotation.Resource; |
| 21 | import org.springframework.transaction.annotation.Transactional; | 25 | import org.springframework.transaction.annotation.Transactional; |
| 26 | +import org.springframework.util.CollectionUtils; | ||
| 22 | import org.springframework.validation.annotation.Validated; | 27 | import org.springframework.validation.annotation.Validated; |
| 23 | 28 | ||
| 24 | import java.time.LocalDate; | 29 | import java.time.LocalDate; |
| @@ -59,6 +64,12 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -59,6 +64,12 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 59 | @Resource | 64 | @Resource |
| 60 | private InspectionPlanRoleMapper inspectionPlanRoleMapper; | 65 | private InspectionPlanRoleMapper inspectionPlanRoleMapper; |
| 61 | 66 | ||
| 67 | + @Resource | ||
| 68 | + private DeptApi deptApi; | ||
| 69 | + | ||
| 70 | + @Resource | ||
| 71 | + private RoleApi roleApi; | ||
| 72 | + | ||
| 62 | @Transactional(rollbackFor = Exception.class) | 73 | @Transactional(rollbackFor = Exception.class) |
| 63 | @Override | 74 | @Override |
| 64 | public CommonResult<Integer> createInspectionPlan(InspectionPlanSaveReqVO createReqVO) { | 75 | public CommonResult<Integer> createInspectionPlan(InspectionPlanSaveReqVO createReqVO) { |
| @@ -75,7 +86,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -75,7 +86,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 75 | } | 86 | } |
| 76 | //计算开始和计算时间 在间隔周期下每天的次数 | 87 | //计算开始和计算时间 在间隔周期下每天的次数 |
| 77 | List<String> betweenDayList = TimeIntervalCalculatorUtil.calculateIntervals(createReqVO.getBeginTime(), createReqVO.getEndTime(), createReqVO.getCycleId(), rateValue); | 88 | List<String> betweenDayList = TimeIntervalCalculatorUtil.calculateIntervals(createReqVO.getBeginTime(), createReqVO.getEndTime(), createReqVO.getCycleId(), rateValue); |
| 78 | - if (CollectionUtils.isAnyEmpty(betweenDayList)) { | 89 | + if (CollectionUtils.isEmpty(betweenDayList)) { |
| 79 | log.warn("获取两个时间之间间隔天数错误"); | 90 | log.warn("获取两个时间之间间隔天数错误"); |
| 80 | return CommonResult.error(INSPECTION_CYCLE_ERROR); | 91 | return CommonResult.error(INSPECTION_CYCLE_ERROR); |
| 81 | } | 92 | } |
| @@ -103,13 +114,15 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -103,13 +114,15 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 103 | inspectionPlan.setCreatorName(userName); | 114 | inspectionPlan.setCreatorName(userName); |
| 104 | inspectionPlan.setUpdater(userId); | 115 | inspectionPlan.setUpdater(userId); |
| 105 | inspectionPlan.setUpdaterName(userName); | 116 | inspectionPlan.setUpdaterName(userName); |
| 117 | + inspectionPlan.setRate(createReqVO.getRateValue()); | ||
| 106 | inspectionPlan.setDeptId(roadReqVO.getDeptId()); | 118 | inspectionPlan.setDeptId(roadReqVO.getDeptId()); |
| 107 | inspectionPlan.setRoadId(roadReqVO.getRoadId()); | 119 | inspectionPlan.setRoadId(roadReqVO.getRoadId()); |
| 108 | inspectionPlan.setRoadName(roadReqVO.getRoadName()); | 120 | inspectionPlan.setRoadName(roadReqVO.getRoadName()); |
| 109 | //计划属性label | 121 | //计划属性label |
| 110 | String planAttrLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); | 122 | String planAttrLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); |
| 111 | String planTypeIdLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.INSPECTION_MAINTAIN_TYPE, createReqVO.getPlanTypeId()); | 123 | String planTypeIdLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.INSPECTION_MAINTAIN_TYPE, createReqVO.getPlanTypeId()); |
| 112 | - inspectionPlan.setPlanName(roadReqVO.getRoadName() + planAttrLabel + planTypeIdLabel + createReqVO.getPlanNameSuffix()); | 124 | + String planNameSuffix = StringUtil.isNotEmpty(createReqVO.getPlanNameSuffix()) ? createReqVO.getPlanNameSuffix() :""; |
| 125 | + inspectionPlan.setPlanName(roadReqVO.getRoadName() + planAttrLabel + planTypeIdLabel + planNameSuffix); | ||
| 113 | inspectionPlanList.add(inspectionPlan); | 126 | inspectionPlanList.add(inspectionPlan); |
| 114 | /*2.插入角色*/ | 127 | /*2.插入角色*/ |
| 115 | createReqVO.getRoleIds().forEach(roleId -> { | 128 | createReqVO.getRoleIds().forEach(roleId -> { |
| @@ -131,8 +144,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -131,8 +144,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 131 | InspectionPlanDetailDO entity = getInspectionPlanDetailDO(batchNo, createReqVO, roadReqVO, now); | 144 | InspectionPlanDetailDO entity = getInspectionPlanDetailDO(batchNo, createReqVO, roadReqVO, now); |
| 132 | ThreadUtil.sleep(2); | 145 | ThreadUtil.sleep(2); |
| 133 | entity.setSortNum(i + 1); | 146 | entity.setSortNum(i + 1); |
| 134 | - entity.setBeginTime(LocalDate.parse(dateStr[0], DateTimeFormatter.ofPattern("yyyy-MM-dd"))); | ||
| 135 | - entity.setEndTime(LocalDate.parse(dateStr[1], DateTimeFormatter.ofPattern("yyyy-MM-dd"))); | 147 | + entity.setBeginTime(LocalDateTime.parse(dateStr[0], DateTimeFormatter.ofPattern("yyyy-MM-dd 00:00:00"))); |
| 148 | + entity.setEndTime(LocalDateTime.parse(dateStr[1], DateTimeFormatter.ofPattern("yyyy-MM-dd 23:59:59"))); | ||
| 136 | detailDOList.add(entity); | 149 | detailDOList.add(entity); |
| 137 | } | 150 | } |
| 138 | }); | 151 | }); |
| @@ -231,8 +244,51 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -231,8 +244,51 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 231 | } | 244 | } |
| 232 | 245 | ||
| 233 | @Override | 246 | @Override |
| 234 | - public PageResult<InspectionPlanDO> getInspectionPlanPage(InspectionPlanPageReqVO pageReqVO) { | ||
| 235 | - return inspectionPlanInterceptMapper.selectPage(pageReqVO); | 247 | + public PageResult<InspectionPlanRespVO> getInspectionPlanPage(InspectionPlanPageReqVO pageReqVO) { |
| 248 | + PageResult<InspectionPlanDO> pageResult = inspectionPlanInterceptMapper.selectPage(pageReqVO); | ||
| 249 | + | ||
| 250 | + PageResult<InspectionPlanRespVO> result = BeanUtils.toBean(pageResult, InspectionPlanRespVO.class); | ||
| 251 | + addDataInspectionPlan(result.getList()); | ||
| 252 | + return result; | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + /** | ||
| 256 | + * 回填部门/公司/角色 | ||
| 257 | + * @param list 分页对象 | ||
| 258 | + */ | ||
| 259 | + private void addDataInspectionPlan(List<InspectionPlanRespVO> list ){ | ||
| 260 | + if(CollectionUtils.isEmpty(list)){ | ||
| 261 | + return ; | ||
| 262 | + } | ||
| 263 | + //公司 | ||
| 264 | + Set<Long> companyIds = list.stream().map(InspectionPlanRespVO::getCompanyId).collect(Collectors.toSet()); | ||
| 265 | + //部门 | ||
| 266 | + Set<Long> deptIds = list.stream().map(InspectionPlanRespVO::getDeptId).collect(Collectors.toSet()); | ||
| 267 | + deptIds.addAll(companyIds); | ||
| 268 | + /*1.获取部门*/ | ||
| 269 | + Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(deptIds); | ||
| 270 | + | ||
| 271 | + list.forEach(plan -> { | ||
| 272 | + DeptRespDTO dept = deptMap.get(plan.getDeptId()); | ||
| 273 | + if (dept != null) { | ||
| 274 | + plan.setDeptName(dept.getName()); | ||
| 275 | + | ||
| 276 | + } | ||
| 277 | + DeptRespDTO company = deptMap.get(plan.getCompanyId()); | ||
| 278 | + if(company != null){ | ||
| 279 | + plan.setCompanyName(company.getName()); | ||
| 280 | + } | ||
| 281 | + List<InspectionPlanRoleDO> roleList = inspectionPlanRoleMapper.selectList(new QueryWrapper<InspectionPlanRoleDO>().lambda() | ||
| 282 | + .eq(InspectionPlanRoleDO::getBatchNo, plan.getBatchNo())); | ||
| 283 | + | ||
| 284 | + Set<Long> roleIds = roleList.stream().map(InspectionPlanRoleDO::getRoleId).collect(Collectors.toSet()); | ||
| 285 | + if(!CollectionUtils.isEmpty(roleIds)){ | ||
| 286 | + List<RoleDO> roles = roleApi.getRoleList(roleIds); | ||
| 287 | + if(!CollectionUtils.isEmpty(roles)){ | ||
| 288 | + plan.setRoleNameList(roles.stream().map(RoleDO::getName).collect(Collectors.toList())); | ||
| 289 | + } | ||
| 290 | + } | ||
| 291 | + }); | ||
| 236 | } | 292 | } |
| 237 | 293 | ||
| 238 | @Override | 294 | @Override |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanService.java
| @@ -59,7 +59,7 @@ public interface MaintainPlanService { | @@ -59,7 +59,7 @@ public interface MaintainPlanService { | ||
| 59 | * @param pageReqVO 分页查询 | 59 | * @param pageReqVO 分页查询 |
| 60 | * @return 养护计划汇总分页 | 60 | * @return 养护计划汇总分页 |
| 61 | */ | 61 | */ |
| 62 | - PageResult<MaintainPlanDO> getMaintainPlanPage(MaintainPlanPageReqVO pageReqVO); | 62 | + PageResult<MaintainPlanRespVO> getMaintainPlanPage(MaintainPlanPageReqVO pageReqVO); |
| 63 | 63 | ||
| 64 | /** | 64 | /** |
| 65 | * 根据批次号删除 | 65 | * 根据批次号删除 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanServiceImpl.java
| 1 | package com.zteits.urbanops.module.garden.service.maintainplan; | 1 | package com.zteits.urbanops.module.garden.service.maintainplan; |
| 2 | 2 | ||
| 3 | -import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.hutool.core.date.DateUtil; | 3 | import cn.hutool.core.date.DateUtil; |
| 5 | import cn.hutool.core.thread.ThreadUtil; | 4 | import cn.hutool.core.thread.ThreadUtil; |
| 6 | import cn.hutool.core.util.RandomUtil; | 5 | import cn.hutool.core.util.RandomUtil; |
| @@ -9,16 +8,19 @@ import com.zteits.urbanops.framework.common.pojo.CommonResult; | @@ -9,16 +8,19 @@ import com.zteits.urbanops.framework.common.pojo.CommonResult; | ||
| 9 | import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; | 8 | import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; |
| 10 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; | 9 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 11 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | 10 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 12 | -import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; | ||
| 13 | -import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; | ||
| 14 | -import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanRoleDO; | ||
| 15 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; | 11 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; |
| 16 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanRoleDO; | 12 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanRoleDO; |
| 17 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanDetailMapper; | 13 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanDetailMapper; |
| 14 | +import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanInterceptMapper; | ||
| 18 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanRoleMapper; | 15 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanRoleMapper; |
| 19 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; | 16 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; |
| 20 | import com.zteits.urbanops.module.garden.enums.PlanConstants; | 17 | import com.zteits.urbanops.module.garden.enums.PlanConstants; |
| 21 | import com.zteits.urbanops.module.garden.util.TimeIntervalCalculatorUtil; | 18 | import com.zteits.urbanops.module.garden.util.TimeIntervalCalculatorUtil; |
| 19 | +import com.zteits.urbanops.module.system.api.dept.DeptApi; | ||
| 20 | +import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; | ||
| 21 | +import com.zteits.urbanops.module.system.api.permission.RoleApi; | ||
| 22 | +import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; | ||
| 23 | +import jodd.util.StringUtil; | ||
| 22 | import lombok.extern.slf4j.Slf4j; | 24 | import lombok.extern.slf4j.Slf4j; |
| 23 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
| 24 | import jakarta.annotation.Resource; | 26 | import jakarta.annotation.Resource; |
| @@ -54,6 +56,8 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | @@ -54,6 +56,8 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | ||
| 54 | @Resource | 56 | @Resource |
| 55 | private MaintainPlanMapper maintainPlanMapper; | 57 | private MaintainPlanMapper maintainPlanMapper; |
| 56 | 58 | ||
| 59 | + @Resource | ||
| 60 | + private MaintainPlanInterceptMapper maintainPlanInterceptMapper; | ||
| 57 | 61 | ||
| 58 | @Resource | 62 | @Resource |
| 59 | private MaintainPlanDetailMapper maintainPlanDetailMapper; | 63 | private MaintainPlanDetailMapper maintainPlanDetailMapper; |
| @@ -61,6 +65,15 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | @@ -61,6 +65,15 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | ||
| 61 | @Resource | 65 | @Resource |
| 62 | private MaintainPlanRoleMapper maintainPlanRoleMapper; | 66 | private MaintainPlanRoleMapper maintainPlanRoleMapper; |
| 63 | 67 | ||
| 68 | + @Resource | ||
| 69 | + private DeptApi deptApi; | ||
| 70 | + | ||
| 71 | + @Resource | ||
| 72 | + private RoleApi roleApi; | ||
| 73 | + | ||
| 74 | + @Resource | ||
| 75 | + private MaintainPlanRoleMapper MaintainPlanRoleMapper; | ||
| 76 | + | ||
| 64 | @Override | 77 | @Override |
| 65 | public CommonResult<Integer> createMaintainPlan(MaintainPlanSaveReqVO createReqVO) { | 78 | public CommonResult<Integer> createMaintainPlan(MaintainPlanSaveReqVO createReqVO) { |
| 66 | //存在性校验 | 79 | //存在性校验 |
| @@ -104,13 +117,15 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | @@ -104,13 +117,15 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | ||
| 104 | maintainPlan.setCreatorName(userName); | 117 | maintainPlan.setCreatorName(userName); |
| 105 | maintainPlan.setUpdater(userId); | 118 | maintainPlan.setUpdater(userId); |
| 106 | maintainPlan.setUpdaterName(userName); | 119 | maintainPlan.setUpdaterName(userName); |
| 120 | + maintainPlan.setRate(createReqVO.getRateValue()); | ||
| 107 | maintainPlan.setDeptId(roadReqVO.getDeptId()); | 121 | maintainPlan.setDeptId(roadReqVO.getDeptId()); |
| 108 | maintainPlan.setRoadId(roadReqVO.getRoadId()); | 122 | maintainPlan.setRoadId(roadReqVO.getRoadId()); |
| 109 | maintainPlan.setRoadName(roadReqVO.getRoadName()); | 123 | maintainPlan.setRoadName(roadReqVO.getRoadName()); |
| 110 | //计划属性label | 124 | //计划属性label |
| 111 | String planAttrLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); | 125 | String planAttrLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); |
| 112 | String planTypeIdLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.MAINTAIN_TYPE, createReqVO.getPlanTypeId()); | 126 | String planTypeIdLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.MAINTAIN_TYPE, createReqVO.getPlanTypeId()); |
| 113 | - maintainPlan.setPlanName(roadReqVO.getRoadName() + planAttrLabel + planTypeIdLabel + createReqVO.getPlanNameSuffix()); | 127 | + String planNameSuffix = StringUtil.isNotEmpty(createReqVO.getPlanNameSuffix()) ? createReqVO.getPlanNameSuffix() :""; |
| 128 | + maintainPlan.setPlanName(roadReqVO.getRoadName() + planAttrLabel + planTypeIdLabel + planNameSuffix); | ||
| 114 | maintainPlanList.add(maintainPlan); | 129 | maintainPlanList.add(maintainPlan); |
| 115 | /*2.插入角色*/ | 130 | /*2.插入角色*/ |
| 116 | createReqVO.getRoleIds().forEach(roleId -> { | 131 | createReqVO.getRoleIds().forEach(roleId -> { |
| @@ -132,8 +147,8 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | @@ -132,8 +147,8 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | ||
| 132 | MaintainPlanDetailDO entity = getMaintainPlanDetailDO(batchNo, createReqVO, roadReqVO, now); | 147 | MaintainPlanDetailDO entity = getMaintainPlanDetailDO(batchNo, createReqVO, roadReqVO, now); |
| 133 | ThreadUtil.sleep(2); | 148 | ThreadUtil.sleep(2); |
| 134 | entity.setSortNum(i+1); | 149 | entity.setSortNum(i+1); |
| 135 | - entity.setBeginTime(LocalDate.parse(dateStr[0], DateTimeFormatter.ofPattern("yyyy-MM-dd"))); | ||
| 136 | - entity.setEndTime(LocalDate.parse(dateStr[1], DateTimeFormatter.ofPattern("yyyy-MM-dd"))); | 150 | + entity.setBeginTime(LocalDateTime.parse(dateStr[0], DateTimeFormatter.ofPattern("yyyy-MM-dd 00:00:00"))); |
| 151 | + entity.setEndTime(LocalDateTime.parse(dateStr[1], DateTimeFormatter.ofPattern("yyyy-MM-dd 23:59:59"))); | ||
| 137 | detailDOList.add(entity); | 152 | detailDOList.add(entity); |
| 138 | } | 153 | } |
| 139 | }); | 154 | }); |
| @@ -225,10 +240,54 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | @@ -225,10 +240,54 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | ||
| 225 | } | 240 | } |
| 226 | 241 | ||
| 227 | @Override | 242 | @Override |
| 228 | - public PageResult<MaintainPlanDO> getMaintainPlanPage(MaintainPlanPageReqVO pageReqVO) { | ||
| 229 | - return maintainPlanMapper.selectPage(pageReqVO); | 243 | + public PageResult<MaintainPlanRespVO> getMaintainPlanPage(MaintainPlanPageReqVO pageReqVO) { |
| 244 | + PageResult<MaintainPlanDO> pageResult = maintainPlanInterceptMapper.selectPage(pageReqVO); | ||
| 245 | + PageResult<MaintainPlanRespVO> result = BeanUtils.toBean(pageResult, MaintainPlanRespVO.class); | ||
| 246 | + addDataInspectionPlan(result.getList()); | ||
| 247 | + return result; | ||
| 230 | } | 248 | } |
| 231 | 249 | ||
| 250 | + /** | ||
| 251 | + * 回填部门/公司/角色 | ||
| 252 | + * @param list 分页对象 | ||
| 253 | + */ | ||
| 254 | + private void addDataInspectionPlan(List<MaintainPlanRespVO> list ){ | ||
| 255 | + if(org.springframework.util.CollectionUtils.isEmpty(list)){ | ||
| 256 | + return ; | ||
| 257 | + } | ||
| 258 | + | ||
| 259 | + //公司 | ||
| 260 | + Set<Long> companyIds = list.stream().map(MaintainPlanRespVO::getCompanyId).collect(Collectors.toSet()); | ||
| 261 | + //部门 | ||
| 262 | + Set<Long> deptIds = list.stream().map(MaintainPlanRespVO::getDeptId).collect(Collectors.toSet()); | ||
| 263 | + deptIds.addAll(companyIds); | ||
| 264 | + /*1.获取部门*/ | ||
| 265 | + Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(deptIds); | ||
| 266 | + | ||
| 267 | + list.forEach(plan -> { | ||
| 268 | + DeptRespDTO dept = deptMap.get(plan.getDeptId()); | ||
| 269 | + if (dept != null) { | ||
| 270 | + plan.setDeptName(dept.getName()); | ||
| 271 | + | ||
| 272 | + } | ||
| 273 | + DeptRespDTO company = deptMap.get(plan.getCompanyId()); | ||
| 274 | + if(company != null){ | ||
| 275 | + plan.setCompanyName(company.getName()); | ||
| 276 | + } | ||
| 277 | + List<MaintainPlanRoleDO> roleList = maintainPlanRoleMapper.selectList(new QueryWrapper<MaintainPlanRoleDO>().lambda() | ||
| 278 | + .eq(MaintainPlanRoleDO::getBatchNo, plan.getBatchNo())); | ||
| 279 | + | ||
| 280 | + Set<Long> roleIds = roleList.stream().map(MaintainPlanRoleDO::getRoleId).collect(Collectors.toSet()); | ||
| 281 | + if(!org.springframework.util.CollectionUtils.isEmpty(roleIds)){ | ||
| 282 | + List<RoleDO> roles = roleApi.getRoleList(roleIds); | ||
| 283 | + if(!org.springframework.util.CollectionUtils.isEmpty(roles)){ | ||
| 284 | + plan.setRoleNameList(roles.stream().map(RoleDO::getName).collect(Collectors.toList())); | ||
| 285 | + } | ||
| 286 | + } | ||
| 287 | + }); | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + | ||
| 232 | @Override | 291 | @Override |
| 233 | public void deleteInspectionPlanByBatchNo(String batchNo) { | 292 | public void deleteInspectionPlanByBatchNo(String batchNo) { |
| 234 | MaintainPlanDO inspectionPlanDO = maintainPlanMapper.selectOne(MaintainPlanDO::getBatchNo, batchNo); | 293 | MaintainPlanDO inspectionPlanDO = maintainPlanMapper.selectOne(MaintainPlanDO::getBatchNo, batchNo); |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java
| 1 | package com.zteits.urbanops.module.garden.service.road; | 1 | package com.zteits.urbanops.module.garden.service.road; |
| 2 | 2 | ||
| 3 | -import cn.hutool.core.collection.CollUtil; | ||
| 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 5 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | 4 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 6 | import com.zteits.urbanops.module.garden.dal.mysql.road.RoadInterceptMapper; | 5 | import com.zteits.urbanops.module.garden.dal.mysql.road.RoadInterceptMapper; |
| @@ -8,22 +7,16 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,22 +7,16 @@ import org.apache.commons.lang3.StringUtils; | ||
| 8 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
| 9 | import jakarta.annotation.Resource; | 8 | import jakarta.annotation.Resource; |
| 10 | import org.springframework.validation.annotation.Validated; | 9 | import org.springframework.validation.annotation.Validated; |
| 11 | -import org.springframework.transaction.annotation.Transactional; | ||
| 12 | 10 | ||
| 13 | import java.time.LocalDateTime; | 11 | import java.time.LocalDateTime; |
| 14 | import java.util.*; | 12 | import java.util.*; |
| 15 | import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; | 13 | import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; |
| 16 | import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; | 14 | import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; |
| 17 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 15 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 18 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | ||
| 19 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; | 16 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 20 | 17 | ||
| 21 | import com.zteits.urbanops.module.garden.dal.mysql.road.RoadMapper; | 18 | import com.zteits.urbanops.module.garden.dal.mysql.road.RoadMapper; |
| 22 | 19 | ||
| 23 | -import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 24 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | ||
| 25 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | ||
| 26 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | ||
| 27 | 20 | ||
| 28 | /** | 21 | /** |
| 29 | * 道路管理 Service 实现类 | 22 | * 道路管理 Service 实现类 |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/api/permission/RoleApi.java
| 1 | package com.zteits.urbanops.module.system.api.permission; | 1 | package com.zteits.urbanops.module.system.api.permission; |
| 2 | 2 | ||
| 3 | +import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; | ||
| 4 | + | ||
| 3 | import java.util.Collection; | 5 | import java.util.Collection; |
| 6 | +import java.util.List; | ||
| 4 | 7 | ||
| 5 | /** | 8 | /** |
| 6 | * 角色 API 接口 | 9 | * 角色 API 接口 |
| @@ -18,4 +21,11 @@ public interface RoleApi { | @@ -18,4 +21,11 @@ public interface RoleApi { | ||
| 18 | */ | 21 | */ |
| 19 | void validRoleList(Collection<Long> ids); | 22 | void validRoleList(Collection<Long> ids); |
| 20 | 23 | ||
| 24 | + /** | ||
| 25 | + * 获得角色列表 | ||
| 26 | + * | ||
| 27 | + * @param ids 角色编号数组 | ||
| 28 | + * @return 角色列表 | ||
| 29 | + */ | ||
| 30 | + List<RoleDO> getRoleList(Collection<Long> ids); | ||
| 21 | } | 31 | } |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/api/permission/RoleApiImpl.java
| 1 | package com.zteits.urbanops.module.system.api.permission; | 1 | package com.zteits.urbanops.module.system.api.permission; |
| 2 | 2 | ||
| 3 | +import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; | ||
| 3 | import com.zteits.urbanops.module.system.service.permission.RoleService; | 4 | import com.zteits.urbanops.module.system.service.permission.RoleService; |
| 4 | import org.springframework.stereotype.Service; | 5 | import org.springframework.stereotype.Service; |
| 5 | 6 | ||
| 6 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; |
| 7 | import java.util.Collection; | 8 | import java.util.Collection; |
| 9 | +import java.util.List; | ||
| 8 | 10 | ||
| 9 | /** | 11 | /** |
| 10 | * 角色 API 实现类 | 12 | * 角色 API 实现类 |
| @@ -21,4 +23,9 @@ public class RoleApiImpl implements RoleApi { | @@ -21,4 +23,9 @@ public class RoleApiImpl implements RoleApi { | ||
| 21 | public void validRoleList(Collection<Long> ids) { | 23 | public void validRoleList(Collection<Long> ids) { |
| 22 | roleService.validateRoleList(ids); | 24 | roleService.validateRoleList(ids); |
| 23 | } | 25 | } |
| 26 | + | ||
| 27 | + @Override | ||
| 28 | + public List<RoleDO> getRoleList(Collection<Long> ids) { | ||
| 29 | + return roleService.getRoleList(ids); | ||
| 30 | + } | ||
| 24 | } | 31 | } |