Commit 808d0fbc1ad8738698845201987b5e577a4202ac
Merge branch 'de_wangfs_202511' into dev
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 | 113 | @Operation(summary = "获得巡检计划汇总分页") |
| 114 | 114 | @PreAuthorize("@ss.hasPermission('garden:inspection-plan:query')") |
| 115 | 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 | 120 | @GetMapping("/export-excel") |
| ... | ... | @@ -124,10 +124,10 @@ public class InspectionPlanController { |
| 124 | 124 | public void exportInspectionPlanExcel(@Valid InspectionPlanPageReqVO pageReqVO, |
| 125 | 125 | HttpServletResponse response) throws IOException { |
| 126 | 126 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| 127 | - List<InspectionPlanDO> list = inspectionPlanService.getInspectionPlanPage(pageReqVO).getList(); | |
| 127 | + List<InspectionPlanRespVO> list = inspectionPlanService.getInspectionPlanPage(pageReqVO).getList(); | |
| 128 | 128 | // 导出 Excel |
| 129 | 129 | ExcelUtils.write(response, "巡检计划汇总.xls", "数据", InspectionPlanRespVO.class, |
| 130 | - BeanUtils.toBean(list, InspectionPlanRespVO.class)); | |
| 130 | + list); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | } |
| 134 | 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 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| 5 | 5 | |
| 6 | -import java.time.LocalDate; | |
| 7 | -import java.util.*; | |
| 8 | 6 | |
| 9 | 7 | import java.time.LocalDateTime; |
| 10 | 8 | import cn.idev.excel.annotation.*; |
| ... | ... | @@ -48,11 +46,11 @@ public class InspectionPlanDetailRespVO { |
| 48 | 46 | |
| 49 | 47 | @Schema(description = "执行开始时间") |
| 50 | 48 | @ExcelProperty("执行开始时间") |
| 51 | - private LocalDate beginTime; | |
| 49 | + private LocalDateTime beginTime; | |
| 52 | 50 | |
| 53 | 51 | @Schema(description = "执行时间") |
| 54 | 52 | @ExcelProperty("执行时间") |
| 55 | - private LocalDate endTime; | |
| 53 | + private LocalDateTime endTime; | |
| 56 | 54 | |
| 57 | 55 | @Schema(description = "完成状态 1:未完成;2:进行中;3:已完成", requiredMode = Schema.RequiredMode.REQUIRED) |
| 58 | 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 | 43 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 44 | 44 | private LocalDateTime[] endTime; |
| 45 | 45 | |
| 46 | + @Schema(description = "完成状态 : 1:未完成;2:已完成") | |
| 47 | + private Integer finishState; | |
| 48 | + | |
| 46 | 49 | } |
| 47 | 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 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.*; |
| 6 | 6 | import java.time.LocalDateTime; |
| 7 | +import java.util.List; | |
| 8 | + | |
| 7 | 9 | import cn.idev.excel.annotation.*; |
| 8 | 10 | |
| 9 | 11 | @Schema(description = "管理后台 - 巡检计划汇总 Response VO") |
| ... | ... | @@ -39,10 +41,17 @@ public class InspectionPlanRespVO implements VO { |
| 39 | 41 | @ExcelProperty("归属(一级部门id)") |
| 40 | 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 | 48 | @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "16445") |
| 43 | 49 | @ExcelProperty("部门ID(道路负责部门id)") |
| 44 | 50 | private Long deptId; |
| 45 | 51 | |
| 52 | + @ExcelProperty("部门(道路负责部门)") | |
| 53 | + private String deptName; | |
| 54 | + | |
| 46 | 55 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15557") |
| 47 | 56 | @ExcelProperty("道路ID") |
| 48 | 57 | private Long roadId; |
| ... | ... | @@ -55,6 +64,10 @@ public class InspectionPlanRespVO implements VO { |
| 55 | 64 | @ExcelProperty("养护级别: 10:特级;11:一级:12:二级;13:三级") |
| 56 | 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 | 71 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "6415") |
| 59 | 72 | @ExcelProperty("周期ID: 1:日/次;2:周/次;3:月/次;4:年/次") |
| 60 | 73 | private Integer cycleId; |
| ... | ... | @@ -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 | 110 | @ExcelProperty("创建人") |
| 98 | 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 | 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 | 111 | @Operation(summary = "获得养护计划汇总分页") |
| 112 | 112 | @PreAuthorize("@ss.hasPermission('garden:maintain-plan:query')") |
| 113 | 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 | 118 | @GetMapping("/export-excel") |
| ... | ... | @@ -122,10 +122,10 @@ public class MaintainPlanController { |
| 122 | 122 | public void exportMaintainPlanExcel(@Valid MaintainPlanPageReqVO pageReqVO, |
| 123 | 123 | HttpServletResponse response) throws IOException { |
| 124 | 124 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| 125 | - List<MaintainPlanDO> list = maintainPlanService.getMaintainPlanPage(pageReqVO).getList(); | |
| 125 | + List<MaintainPlanRespVO> list = maintainPlanService.getMaintainPlanPage(pageReqVO).getList(); | |
| 126 | 126 | // 导出 Excel |
| 127 | 127 | ExcelUtils.write(response, "养护计划汇总.xls", "数据", MaintainPlanRespVO.class, |
| 128 | - BeanUtils.toBean(list, MaintainPlanRespVO.class)); | |
| 128 | + list); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | } |
| 132 | 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 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| 5 | 5 | |
| 6 | -import java.time.LocalDate; | |
| 7 | 6 | import java.time.LocalDateTime; |
| 8 | 7 | import cn.idev.excel.annotation.*; |
| 9 | 8 | |
| ... | ... | @@ -46,11 +45,11 @@ public class MaintainPlanDetailRespVO { |
| 46 | 45 | |
| 47 | 46 | @Schema(description = "执行开始时间") |
| 48 | 47 | @ExcelProperty("执行开始时间") |
| 49 | - private LocalDate beginTime; | |
| 48 | + private LocalDateTime beginTime; | |
| 50 | 49 | |
| 51 | 50 | @Schema(description = "执行时间") |
| 52 | 51 | @ExcelProperty("执行时间") |
| 53 | - private LocalDate endTime; | |
| 52 | + private LocalDateTime endTime; | |
| 54 | 53 | |
| 55 | 54 | @Schema(description = "完成百分比", requiredMode = Schema.RequiredMode.REQUIRED) |
| 56 | 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 | 44 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 45 | 45 | private LocalDate[] endTime; |
| 46 | 46 | |
| 47 | + @Schema(description = "完成状态 : 1:未完成;2:已完成") | |
| 48 | + private Integer finishState; | |
| 49 | + | |
| 47 | 50 | } |
| 48 | 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 | 42 | @ExcelProperty("归属(一级部门id)") |
| 43 | 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 | 49 | @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "12055") |
| 46 | 50 | @ExcelProperty("部门ID(道路负责部门id)") |
| 47 | 51 | private Long deptId; |
| 48 | 52 | |
| 53 | + @Schema(description = "部门(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "12055") | |
| 54 | + @ExcelProperty("部门") | |
| 55 | + private String deptName; | |
| 56 | + | |
| 49 | 57 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19114") |
| 50 | 58 | @ExcelProperty("道路ID") |
| 51 | 59 | private Long roadId; |
| ... | ... | @@ -58,6 +66,10 @@ public class MaintainPlanRespVO { |
| 58 | 66 | @ExcelProperty("养护级别: 10:特级;11:一级:12:二级;13:三级") |
| 59 | 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 | 73 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "28220") |
| 62 | 74 | @ExcelProperty("周期ID: 1:日/次;2:周/次;3:月/次;4:年/次") |
| 63 | 75 | private Integer cycleId; |
| ... | ... | @@ -98,5 +110,11 @@ public class MaintainPlanRespVO { |
| 98 | 110 | @ExcelProperty("创建时间") |
| 99 | 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 | 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 | 14 | public class MaintainPlanSaveReqVO { |
| 15 | 15 | |
| 16 | 16 | @Schema(description = "计划名称后缀", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "张三") |
| 17 | + @Max(value = 15) | |
| 17 | 18 | private String planNameSuffix; |
| 18 | 19 | |
| 19 | 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 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| 5 | -import java.util.*; | |
| 6 | 5 | import jakarta.validation.constraints.*; |
| 6 | +import org.hibernate.validator.constraints.Length; | |
| 7 | 7 | |
| 8 | 8 | @Schema(description = "管理后台 - 道路管理新增/修改 Request VO") |
| 9 | 9 | @Data |
| ... | ... | @@ -11,6 +11,7 @@ public class RoadSaveReqVO { |
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | @Schema(description = "道路名称", example = "赵六") |
| 14 | + @Length(max = 128) | |
| 14 | 15 | private String roadName; |
| 15 | 16 | |
| 16 | 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
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 | 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 | 69 | * 完成状态 1:未完成;2:进行中;3:已完成 |
| 70 | 70 | */ | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainplan/MaintainPlanDO.java
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 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | |
| 5 | -import java.time.LocalDate; | |
| 5 | +import java.time.LocalDateTime; | |
| 6 | + | |
| 6 | 7 | import com.baomidou.mybatisplus.annotation.*; |
| 7 | 8 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; |
| 8 | 9 | |
| ... | ... | @@ -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 | 31 | .betweenIfPresent(InspectionPlanDetailDO::getEndTime, reqVO.getEndTime()) |
| 32 | 32 | .eqIfPresent(InspectionPlanDetailDO::getFinishState, reqVO.getFinishState()) |
| 33 | 33 | .betweenIfPresent(InspectionPlanDetailDO::getCreateTime, reqVO.getCreateTime()) |
| 34 | + .eq(InspectionPlanDetailDO::getDeleted,0) | |
| 34 | 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 | 26 | .eqIfPresent(InspectionPlanDO::getCompanyId, reqVO.getCompanyId()) |
| 27 | 27 | .likeIfPresent(InspectionPlanDO::getRoadName, reqVO.getRoadName()) |
| 28 | 28 | .eqIfPresent(InspectionPlanDO::getLevelId, reqVO.getLevelId()) |
| 29 | + .eqIfPresent(InspectionPlanDO::getFinishState, reqVO.getFinishState()) | |
| 30 | + .eq(InspectionPlanDO::getFinishState, reqVO.getFinishState()) | |
| 29 | 31 | .betweenIfPresent(InspectionPlanDO::getBeginTime, reqVO.getBeginTime()) |
| 32 | + .eq(InspectionPlanDO::getDeleted,0) | |
| 30 | 33 | .betweenIfPresent(InspectionPlanDO::getEndTime, reqVO.getEndTime()) |
| 31 | 34 | .orderByDesc(InspectionPlanDO::getId)); |
| 32 | 35 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanMapper.java
| 1 | 1 | package com.zteits.urbanops.module.garden.dal.mysql.inspectionplan; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -import com.zteits.urbanops.framework.annotation.ProcessBusinessLine; | |
| 5 | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 5 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | 6 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| ... | ... | @@ -28,6 +27,7 @@ public interface InspectionPlanMapper extends BaseMapperX<InspectionPlanDO> { |
| 28 | 27 | .eqIfPresent(InspectionPlanDO::getLevelId, reqVO.getLevelId()) |
| 29 | 28 | .betweenIfPresent(InspectionPlanDO::getBeginTime, reqVO.getBeginTime()) |
| 30 | 29 | .betweenIfPresent(InspectionPlanDO::getEndTime, reqVO.getEndTime()) |
| 30 | + .eq(InspectionPlanDO::getDeleted,0) | |
| 31 | 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 | 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 | 28 | .eqIfPresent(MaintainPlanDO::getLevelId, reqVO.getLevelId()) |
| 29 | 29 | .betweenIfPresent(MaintainPlanDO::getBeginTime, reqVO.getBeginTime()) |
| 30 | 30 | .betweenIfPresent(MaintainPlanDO::getEndTime, reqVO.getEndTime()) |
| 31 | + .eq(MaintainPlanDO::getDeleted,0) | |
| 31 | 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 | 60 | */ |
| 61 | 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 | 71 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanRoleServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.inspectionplan; |
| 2 | 2 | |
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 3 | 4 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRolePageReqVO; |
| 4 | 5 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRoleSaveReqVO; |
| 5 | 6 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanRoleDO; |
| ... | ... | @@ -74,4 +75,10 @@ public class InspectionPlanRoleServiceImpl implements InspectionPlanRoleService |
| 74 | 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 | 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 | 58 | * @param pageReqVO 分页查询 |
| 59 | 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 | 4 | import cn.hutool.core.util.RandomUtil; |
| 5 | 5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 6 | 6 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 7 | -import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; | |
| 8 | 7 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 9 | 8 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 10 | 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 | 14 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; |
| 16 | 15 | import com.zteits.urbanops.module.garden.enums.PlanConstants; |
| 17 | 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 | 22 | import lombok.extern.slf4j.Slf4j; |
| 19 | 23 | import org.springframework.stereotype.Service; |
| 20 | 24 | import jakarta.annotation.Resource; |
| 21 | 25 | import org.springframework.transaction.annotation.Transactional; |
| 26 | +import org.springframework.util.CollectionUtils; | |
| 22 | 27 | import org.springframework.validation.annotation.Validated; |
| 23 | 28 | |
| 24 | 29 | import java.time.LocalDate; |
| ... | ... | @@ -59,6 +64,12 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 59 | 64 | @Resource |
| 60 | 65 | private InspectionPlanRoleMapper inspectionPlanRoleMapper; |
| 61 | 66 | |
| 67 | + @Resource | |
| 68 | + private DeptApi deptApi; | |
| 69 | + | |
| 70 | + @Resource | |
| 71 | + private RoleApi roleApi; | |
| 72 | + | |
| 62 | 73 | @Transactional(rollbackFor = Exception.class) |
| 63 | 74 | @Override |
| 64 | 75 | public CommonResult<Integer> createInspectionPlan(InspectionPlanSaveReqVO createReqVO) { |
| ... | ... | @@ -75,7 +86,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 75 | 86 | } |
| 76 | 87 | //计算开始和计算时间 在间隔周期下每天的次数 |
| 77 | 88 | List<String> betweenDayList = TimeIntervalCalculatorUtil.calculateIntervals(createReqVO.getBeginTime(), createReqVO.getEndTime(), createReqVO.getCycleId(), rateValue); |
| 78 | - if (CollectionUtils.isAnyEmpty(betweenDayList)) { | |
| 89 | + if (CollectionUtils.isEmpty(betweenDayList)) { | |
| 79 | 90 | log.warn("获取两个时间之间间隔天数错误"); |
| 80 | 91 | return CommonResult.error(INSPECTION_CYCLE_ERROR); |
| 81 | 92 | } |
| ... | ... | @@ -103,13 +114,15 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 103 | 114 | inspectionPlan.setCreatorName(userName); |
| 104 | 115 | inspectionPlan.setUpdater(userId); |
| 105 | 116 | inspectionPlan.setUpdaterName(userName); |
| 117 | + inspectionPlan.setRate(createReqVO.getRateValue()); | |
| 106 | 118 | inspectionPlan.setDeptId(roadReqVO.getDeptId()); |
| 107 | 119 | inspectionPlan.setRoadId(roadReqVO.getRoadId()); |
| 108 | 120 | inspectionPlan.setRoadName(roadReqVO.getRoadName()); |
| 109 | 121 | //计划属性label |
| 110 | 122 | String planAttrLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); |
| 111 | 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 | 126 | inspectionPlanList.add(inspectionPlan); |
| 114 | 127 | /*2.插入角色*/ |
| 115 | 128 | createReqVO.getRoleIds().forEach(roleId -> { |
| ... | ... | @@ -131,8 +144,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 131 | 144 | InspectionPlanDetailDO entity = getInspectionPlanDetailDO(batchNo, createReqVO, roadReqVO, now); |
| 132 | 145 | ThreadUtil.sleep(2); |
| 133 | 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 | 149 | detailDOList.add(entity); |
| 137 | 150 | } |
| 138 | 151 | }); |
| ... | ... | @@ -231,8 +244,51 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 231 | 244 | } |
| 232 | 245 | |
| 233 | 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 | 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 | 59 | * @param pageReqVO 分页查询 |
| 60 | 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 | 1 | package com.zteits.urbanops.module.garden.service.maintainplan; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollUtil; | |
| 4 | 3 | import cn.hutool.core.date.DateUtil; |
| 5 | 4 | import cn.hutool.core.thread.ThreadUtil; |
| 6 | 5 | import cn.hutool.core.util.RandomUtil; |
| ... | ... | @@ -9,16 +8,19 @@ import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 9 | 8 | import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; |
| 10 | 9 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 11 | 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 | 11 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; |
| 16 | 12 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanRoleDO; |
| 17 | 13 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanDetailMapper; |
| 14 | +import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanInterceptMapper; | |
| 18 | 15 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanRoleMapper; |
| 19 | 16 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; |
| 20 | 17 | import com.zteits.urbanops.module.garden.enums.PlanConstants; |
| 21 | 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 | 24 | import lombok.extern.slf4j.Slf4j; |
| 23 | 25 | import org.springframework.stereotype.Service; |
| 24 | 26 | import jakarta.annotation.Resource; |
| ... | ... | @@ -54,6 +56,8 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 54 | 56 | @Resource |
| 55 | 57 | private MaintainPlanMapper maintainPlanMapper; |
| 56 | 58 | |
| 59 | + @Resource | |
| 60 | + private MaintainPlanInterceptMapper maintainPlanInterceptMapper; | |
| 57 | 61 | |
| 58 | 62 | @Resource |
| 59 | 63 | private MaintainPlanDetailMapper maintainPlanDetailMapper; |
| ... | ... | @@ -61,6 +65,15 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 61 | 65 | @Resource |
| 62 | 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 | 77 | @Override |
| 65 | 78 | public CommonResult<Integer> createMaintainPlan(MaintainPlanSaveReqVO createReqVO) { |
| 66 | 79 | //存在性校验 |
| ... | ... | @@ -104,13 +117,15 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 104 | 117 | maintainPlan.setCreatorName(userName); |
| 105 | 118 | maintainPlan.setUpdater(userId); |
| 106 | 119 | maintainPlan.setUpdaterName(userName); |
| 120 | + maintainPlan.setRate(createReqVO.getRateValue()); | |
| 107 | 121 | maintainPlan.setDeptId(roadReqVO.getDeptId()); |
| 108 | 122 | maintainPlan.setRoadId(roadReqVO.getRoadId()); |
| 109 | 123 | maintainPlan.setRoadName(roadReqVO.getRoadName()); |
| 110 | 124 | //计划属性label |
| 111 | 125 | String planAttrLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); |
| 112 | 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 | 129 | maintainPlanList.add(maintainPlan); |
| 115 | 130 | /*2.插入角色*/ |
| 116 | 131 | createReqVO.getRoleIds().forEach(roleId -> { |
| ... | ... | @@ -132,8 +147,8 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 132 | 147 | MaintainPlanDetailDO entity = getMaintainPlanDetailDO(batchNo, createReqVO, roadReqVO, now); |
| 133 | 148 | ThreadUtil.sleep(2); |
| 134 | 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 | 152 | detailDOList.add(entity); |
| 138 | 153 | } |
| 139 | 154 | }); |
| ... | ... | @@ -225,10 +240,54 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 225 | 240 | } |
| 226 | 241 | |
| 227 | 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 | 291 | @Override |
| 233 | 292 | public void deleteInspectionPlanByBatchNo(String batchNo) { |
| 234 | 293 | MaintainPlanDO inspectionPlanDO = maintainPlanMapper.selectOne(MaintainPlanDO::getBatchNo, batchNo); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.road; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollUtil; | |
| 4 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 5 | 4 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 6 | 5 | import com.zteits.urbanops.module.garden.dal.mysql.road.RoadInterceptMapper; |
| ... | ... | @@ -8,22 +7,16 @@ import org.apache.commons.lang3.StringUtils; |
| 8 | 7 | import org.springframework.stereotype.Service; |
| 9 | 8 | import jakarta.annotation.Resource; |
| 10 | 9 | import org.springframework.validation.annotation.Validated; |
| 11 | -import org.springframework.transaction.annotation.Transactional; | |
| 12 | 10 | |
| 13 | 11 | import java.time.LocalDateTime; |
| 14 | 12 | import java.util.*; |
| 15 | 13 | import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; |
| 16 | 14 | import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; |
| 17 | 15 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 18 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 19 | 16 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 20 | 17 | |
| 21 | 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 | 22 | * 道路管理 Service 实现类 | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/api/permission/RoleApi.java
| 1 | 1 | package com.zteits.urbanops.module.system.api.permission; |
| 2 | 2 | |
| 3 | +import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; | |
| 4 | + | |
| 3 | 5 | import java.util.Collection; |
| 6 | +import java.util.List; | |
| 4 | 7 | |
| 5 | 8 | /** |
| 6 | 9 | * 角色 API 接口 |
| ... | ... | @@ -18,4 +21,11 @@ public interface RoleApi { |
| 18 | 21 | */ |
| 19 | 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 | 1 | package com.zteits.urbanops.module.system.api.permission; |
| 2 | 2 | |
| 3 | +import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; | |
| 3 | 4 | import com.zteits.urbanops.module.system.service.permission.RoleService; |
| 4 | 5 | import org.springframework.stereotype.Service; |
| 5 | 6 | |
| 6 | 7 | import jakarta.annotation.Resource; |
| 7 | 8 | import java.util.Collection; |
| 9 | +import java.util.List; | |
| 8 | 10 | |
| 9 | 11 | /** |
| 10 | 12 | * 角色 API 实现类 |
| ... | ... | @@ -21,4 +23,9 @@ public class RoleApiImpl implements RoleApi { |
| 21 | 23 | public void validRoleList(Collection<Long> ids) { |
| 22 | 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 | } | ... | ... |