Commit 95d3092434c6e52abb5effec891044131072f7a6
1 parent
30db68ba
app养护计划明细提交
Showing
14 changed files
with
535 additions
and
5 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanDetailRespVO.java
| ... | ... | @@ -20,6 +20,9 @@ public class AppInspectionPlanDetailRespVO { |
| 20 | 20 | @Schema(description = "计划编码", requiredMode = Schema.RequiredMode.REQUIRED) |
| 21 | 21 | private String planNo; |
| 22 | 22 | |
| 23 | + @Schema(description = "计划名称", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 24 | + private String planName; | |
| 25 | + | |
| 23 | 26 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") |
| 24 | 27 | private Long roadId; |
| 25 | 28 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/AppMaintainPlanController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.maintainplan; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 4 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 7 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 8 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 9 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanPageReqVO; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanRespVO; | |
| 11 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanSaveReqVO; | |
| 12 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanUpdateReqVO; | |
| 13 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeReqVO; | |
| 14 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO; | |
| 15 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadReqVO; | |
| 16 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO; | |
| 17 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; | |
| 18 | +import com.zteits.urbanops.module.garden.service.maintainplan.MaintainPlanService; | |
| 19 | +import io.swagger.v3.oas.annotations.Operation; | |
| 20 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 21 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 22 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 23 | +import jakarta.annotation.Resource; | |
| 24 | +import jakarta.servlet.http.HttpServletResponse; | |
| 25 | +import jakarta.validation.Valid; | |
| 26 | +import jakarta.validation.constraints.NotBlank; | |
| 27 | +import jakarta.validation.constraints.NotNull; | |
| 28 | +import lombok.extern.slf4j.Slf4j; | |
| 29 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 30 | +import org.springframework.validation.annotation.Validated; | |
| 31 | +import org.springframework.web.bind.annotation.*; | |
| 32 | + | |
| 33 | +import java.io.IOException; | |
| 34 | +import java.util.List; | |
| 35 | + | |
| 36 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | |
| 37 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.error; | |
| 38 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 39 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_VALUE_ERROR; | |
| 40 | + | |
| 41 | +@Tag(name = "APP管理 - 养护计划汇总") | |
| 42 | +@RestController | |
| 43 | +@RequestMapping("/app/garden/maintain-plan") | |
| 44 | +@Validated | |
| 45 | +@Slf4j | |
| 46 | +public class AppMaintainPlanController { | |
| 47 | + | |
| 48 | + @Resource | |
| 49 | + private MaintainPlanService maintainPlanService; | |
| 50 | + | |
| 51 | + @GetMapping("/get") | |
| 52 | + @Operation(summary = "获得养护计划汇总") | |
| 53 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 54 | + @PreAuthorize("@ss.hasPermission('garden:maintain-plan:query')") | |
| 55 | + public CommonResult<MaintainPlanRespVO> getMaintainPlan(@RequestParam("id") Long id) { | |
| 56 | + MaintainPlanDO maintainPlan = maintainPlanService.getMaintainPlan(id); | |
| 57 | + return success(BeanUtils.toBean(maintainPlan, MaintainPlanRespVO.class)); | |
| 58 | + } | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * APP获得养护计划汇总分页-按道路 | |
| 62 | + */ | |
| 63 | + @GetMapping("/page/road") | |
| 64 | + @Operation(summary = "APP按道路-获得养护计划汇总分页") | |
| 65 | + //@PreAuthorize("@ss.hasPermission('app:garden:maintain-plan:road:query')") | |
| 66 | + public CommonResult<PageResult<AppMaintainPlanPageRoadRespVO>> appMaintainPlanRoadPage(@Valid AppMaintainPlanPageRoadReqVO pageReqVO) { | |
| 67 | + PageResult<AppMaintainPlanPageRoadRespVO> pageResult = maintainPlanService.appMaintainPlanRoadPage(pageReqVO); | |
| 68 | + return success(pageResult); | |
| 69 | + } | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * APP获得养护计划汇总分页-养护类型 | |
| 73 | + */ | |
| 74 | + @GetMapping("/page/plan-type-id") | |
| 75 | + @Operation(summary = "APP按养护类型-获得养护计划汇总分页") | |
| 76 | + //@PreAuthorize("@ss.hasPermission('app:garden:maintain-plan:plan-type:query')") | |
| 77 | + public CommonResult<PageResult<AppMaintainPlanPagePlanTypeRespVO>> appMaintainPlanPlanTypePage(@Valid AppMaintainPlanPagePlanTypeReqVO pageReqVO) { | |
| 78 | + PageResult<AppMaintainPlanPagePlanTypeRespVO> pageResult = maintainPlanService.appMaintainPlanPlanTypePage(pageReqVO); | |
| 79 | + return success(pageResult); | |
| 80 | + } | |
| 81 | + | |
| 82 | + | |
| 83 | +} | |
| 0 | 84 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPagePlanTypeReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.Hidden; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import jakarta.validation.constraints.Max; | |
| 7 | +import jakarta.validation.constraints.Min; | |
| 8 | +import jakarta.validation.constraints.NotNull; | |
| 9 | +import lombok.Data; | |
| 10 | + | |
| 11 | +import java.time.LocalDate; | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +@Schema(description = "管理后台 - 养护计划汇总分页 Request VO") | |
| 15 | +@Data | |
| 16 | +public class AppMaintainPlanPagePlanTypeReqVO extends PageParam { | |
| 17 | + | |
| 18 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "24742") | |
| 19 | + @NotNull(message = "养护类型不能为空") | |
| 20 | + private Integer planTypeId; | |
| 21 | + | |
| 22 | + @Schema(description = "计划名称", example = "王五") | |
| 23 | + private String planName; | |
| 24 | + | |
| 25 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 26 | + @NotNull(message = "完成状态不能为空") | |
| 27 | + @Min(value = 1, message = "状态最小为1") | |
| 28 | + @Max(value = 3, message = "状态不能大于4") | |
| 29 | + private Integer finishState; | |
| 30 | + | |
| 31 | + @Schema(description = "公司ID") | |
| 32 | + @Hidden | |
| 33 | + private Long companyId; | |
| 34 | + | |
| 35 | + @Schema(description = "角色IDS") | |
| 36 | + @Hidden | |
| 37 | + private List<Long> roleIds; | |
| 38 | + | |
| 39 | + @Schema(description = "业务线") | |
| 40 | + @Hidden | |
| 41 | + private List<String> busiLineList; | |
| 42 | + | |
| 43 | + @Schema(description = "系统时间") | |
| 44 | + @Hidden | |
| 45 | + private LocalDate localDate; | |
| 46 | + | |
| 47 | +} | |
| 0 | 48 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPagePlanTypeRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import jakarta.validation.constraints.Max; | |
| 6 | +import jakarta.validation.constraints.Min; | |
| 7 | +import jakarta.validation.constraints.NotNull; | |
| 8 | +import lombok.Data; | |
| 9 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 10 | + | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | + | |
| 13 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; | |
| 14 | + | |
| 15 | +@Schema(description = "管理后台 - 养护计划汇总分页 Request VO") | |
| 16 | +@Data | |
| 17 | +public class AppMaintainPlanPagePlanTypeRespVO { | |
| 18 | + | |
| 19 | + @Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 20 | + private String batchNo; | |
| 21 | + | |
| 22 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 23 | + private Long roadId; | |
| 24 | + | |
| 25 | + @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 26 | + private String roadName; | |
| 27 | + | |
| 28 | + @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8439") | |
| 29 | + private String streetId; | |
| 30 | + | |
| 31 | + @Schema(description = "街道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | |
| 32 | + private String streetName; | |
| 33 | + | |
| 34 | + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "8588") | |
| 35 | + private Integer levelId; | |
| 36 | + | |
| 37 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 38 | + @NotNull(message = "完成状态不能为空") | |
| 39 | + @Min(value = 1, message = "状态最小为1") | |
| 40 | + @Max(value = 3, message = "状态不能大于4") | |
| 41 | + private Integer finishState; | |
| 42 | + | |
| 43 | + @Schema(description = "计划次数", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 44 | + @ExcelProperty("计划次数") | |
| 45 | + private Integer planNum; | |
| 46 | + | |
| 47 | + @Schema(description = "已完成次数", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 48 | + @ExcelProperty("已完成次数") | |
| 49 | + private Integer planFinishNum; | |
| 50 | + | |
| 51 | + | |
| 52 | + @Schema(description = "执行开始时间") | |
| 53 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 54 | + private LocalDateTime beginTime; | |
| 55 | + | |
| 56 | + @Schema(description = "执行时间") | |
| 57 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 58 | + private LocalDateTime endTime; | |
| 59 | + | |
| 60 | +} | |
| 0 | 61 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPageRoadReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.Hidden; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import jakarta.validation.constraints.Max; | |
| 7 | +import jakarta.validation.constraints.Min; | |
| 8 | +import jakarta.validation.constraints.NotNull; | |
| 9 | +import lombok.Data; | |
| 10 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 11 | + | |
| 12 | +import java.time.LocalDate; | |
| 13 | +import java.util.List; | |
| 14 | + | |
| 15 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 16 | + | |
| 17 | +@Schema(description = "管理后台 - 养护计划汇总分页 Request VO") | |
| 18 | +@Data | |
| 19 | +public class AppMaintainPlanPageRoadReqVO extends PageParam { | |
| 20 | + | |
| 21 | + @Schema(description = "道路名称", example = "王五") | |
| 22 | + private String roadName; | |
| 23 | + | |
| 24 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 25 | + @NotNull(message = "完成状态不能为空") | |
| 26 | + @Min(value = 1, message = "状态最小为1") | |
| 27 | + @Max(value = 3, message = "状态不能大于4") | |
| 28 | + private Integer finishState; | |
| 29 | + | |
| 30 | + @Schema(description = "公司ID") | |
| 31 | + @Hidden | |
| 32 | + private Long companyId; | |
| 33 | + | |
| 34 | + @Schema(description = "角色IDS") | |
| 35 | + @Hidden | |
| 36 | + private List<Long> roleIds; | |
| 37 | + | |
| 38 | + @Schema(description = "业务线") | |
| 39 | + @Hidden | |
| 40 | + private List<String> busiLineList; | |
| 41 | + | |
| 42 | + @Schema(description = "系统时间") | |
| 43 | + @Hidden | |
| 44 | + private LocalDate localDate; | |
| 45 | + | |
| 46 | +} | |
| 0 | 47 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPageRoadRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 4 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import jakarta.validation.constraints.Max; | |
| 7 | +import jakarta.validation.constraints.Min; | |
| 8 | +import jakarta.validation.constraints.NotNull; | |
| 9 | +import lombok.Data; | |
| 10 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 11 | + | |
| 12 | +import java.time.LocalDateTime; | |
| 13 | + | |
| 14 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; | |
| 15 | + | |
| 16 | +@Schema(description = "管理后台 - 养护计划汇总分页 Request VO") | |
| 17 | +@Data | |
| 18 | +public class AppMaintainPlanPageRoadRespVO{ | |
| 19 | + | |
| 20 | + @Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 21 | + private String batchNo; | |
| 22 | + | |
| 23 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 24 | + private Long roadId; | |
| 25 | + | |
| 26 | + @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 27 | + private String roadName; | |
| 28 | + | |
| 29 | + @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8439") | |
| 30 | + private String streetId; | |
| 31 | + | |
| 32 | + @Schema(description = "街道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | |
| 33 | + private String streetName; | |
| 34 | + | |
| 35 | + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "8588") | |
| 36 | + private Integer levelId; | |
| 37 | + | |
| 38 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 39 | + @NotNull(message = "完成状态不能为空") | |
| 40 | + @Min(value = 1, message = "状态最小为1") | |
| 41 | + @Max(value = 3, message = "状态不能大于4") | |
| 42 | + private Integer finishState; | |
| 43 | + | |
| 44 | + @Schema(description = "计划次数", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 45 | + @ExcelProperty("计划次数") | |
| 46 | + private Integer planNum; | |
| 47 | + | |
| 48 | + @Schema(description = "已完成次数", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 49 | + @ExcelProperty("已完成次数") | |
| 50 | + private Integer planFinishNum; | |
| 51 | + | |
| 52 | + | |
| 53 | + @Schema(description = "执行开始时间") | |
| 54 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 55 | + private LocalDateTime beginTime; | |
| 56 | + | |
| 57 | + @Schema(description = "执行时间") | |
| 58 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 59 | + private LocalDateTime endTime; | |
| 60 | + | |
| 61 | +} | |
| 0 | 62 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainplan/MaintainPlanMapper.java
| 1 | 1 | package com.zteits.urbanops.module.garden.dal.mysql.maintainplan; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
| 4 | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 5 | 6 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanRespVO; | |
| 9 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeReqVO; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO; | |
| 11 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadReqVO; | |
| 12 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO; | |
| 7 | 13 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; |
| 8 | 14 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 15 | import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; |
| ... | ... | @@ -34,4 +40,22 @@ public interface MaintainPlanMapper extends BaseMapperX<MaintainPlanDO> { |
| 34 | 40 | |
| 35 | 41 | int deleteByBatchNo(@Param("batchNo") String batchNo); |
| 36 | 42 | |
| 43 | + /** | |
| 44 | + * app-按道路获取巡检计划列表-app | |
| 45 | + * | |
| 46 | + * @param page | |
| 47 | + * @param req | |
| 48 | + * @return 列表 | |
| 49 | + */ | |
| 50 | + IPage<AppMaintainPlanPageRoadRespVO> appMaintainPlanRoadPage(@Param("page") IPage<AppMaintainPlanPageRoadRespVO> page, @Param("req") AppMaintainPlanPageRoadReqVO req); | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * app-按养护类型获取巡检计划列表-app | |
| 54 | + * | |
| 55 | + * @param page | |
| 56 | + * @param req | |
| 57 | + * @return 列表 | |
| 58 | + */ | |
| 59 | + IPage<AppMaintainPlanPagePlanTypeRespVO> appMaintainPlanPlanTypePage(@Param("page") IPage<AppMaintainPlanPagePlanTypeRespVO> page, @Param("req") AppMaintainPlanPagePlanTypeReqVO req); | |
| 60 | + | |
| 37 | 61 | } |
| 38 | 62 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanCommitServiceImpl.java
| ... | ... | @@ -202,7 +202,7 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 202 | 202 | List<AppInspectionPlanCommitRespVO> list = inspectionPlanCommitMapper.appInspectionPlanCommitListByPlanNo(planNo, busiLineList); |
| 203 | 203 | |
| 204 | 204 | list.forEach(e -> { |
| 205 | - e.setImgList(StrUtils.imgProcess(e.getImg(), e.getImgHost())); | |
| 205 | + e.setImgList(StrUtils.imgProcess(e.getImg(), "")); | |
| 206 | 206 | }); |
| 207 | 207 | return list; |
| 208 | 208 | } |
| ... | ... | @@ -238,7 +238,7 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 238 | 238 | |
| 239 | 239 | private List<InspectionPlanCommitRespVO> imgProcess(List<InspectionPlanCommitRespVO> list) { |
| 240 | 240 | list.forEach(e -> { |
| 241 | - e.setImgList(StrUtils.imgProcess(e.getImg(), e.getImgHost())); | |
| 241 | + e.setImgList(StrUtils.imgProcess(e.getImg(), "")); | |
| 242 | 242 | }); |
| 243 | 243 | return list; |
| 244 | 244 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanCommitServiceImpl.java
| ... | ... | @@ -103,9 +103,9 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 103 | 103 | list.forEach(e -> { |
| 104 | 104 | MaintainPlanCommitDetailRespVO respVO = new MaintainPlanCommitDetailRespVO(); |
| 105 | 105 | BeanUtils.copyProperties(e, respVO); |
| 106 | - respVO.setBeginImgList(StrUtils.imgProcess(e.getBeginImg(), e.getImgHost())); | |
| 107 | - respVO.setProcessImgList(StrUtils.imgProcess(e.getProcessImg(), e.getImgHost())); | |
| 108 | - respVO.setEndImgList(StrUtils.imgProcess(e.getEndImg(), e.getImgHost())); | |
| 106 | + respVO.setBeginImgList(StrUtils.imgProcess(e.getBeginImg(), "")); | |
| 107 | + respVO.setProcessImgList(StrUtils.imgProcess(e.getProcessImg(), "")); | |
| 108 | + respVO.setEndImgList(StrUtils.imgProcess(e.getEndImg(), "")); | |
| 109 | 109 | |
| 110 | 110 | List<MaintainPlanCommonUserVO> commonUsers = new ArrayList<>(); |
| 111 | 111 | List<MaintainPlanCommonUserDO> maintainPlanCommonUserList = maintainPlanCommonUserMapper.selectList(new QueryWrapper<MaintainPlanCommonUserDO>().lambda() | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanService.java
| ... | ... | @@ -3,6 +3,10 @@ package com.zteits.urbanops.module.garden.service.maintainplan; |
| 3 | 3 | import java.util.*; |
| 4 | 4 | |
| 5 | 5 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 6 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeReqVO; | |
| 7 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO; | |
| 8 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadReqVO; | |
| 9 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO; | |
| 6 | 10 | import jakarta.validation.*; |
| 7 | 11 | import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; |
| 8 | 12 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; |
| ... | ... | @@ -72,4 +76,20 @@ public interface MaintainPlanService { |
| 72 | 76 | * @param batchNo |
| 73 | 77 | */ |
| 74 | 78 | void stopPlanInspectionPlan(String batchNo); |
| 79 | + | |
| 80 | + /** | |
| 81 | + * app按道路-获得养护计划汇总分页 | |
| 82 | + * @param pageReqVO | |
| 83 | + * @return | |
| 84 | + */ | |
| 85 | + PageResult<AppMaintainPlanPageRoadRespVO> appMaintainPlanRoadPage(AppMaintainPlanPageRoadReqVO pageReqVO); | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * app按养护类型-获得养护计划汇总分页 | |
| 89 | + * @param pageReqVO | |
| 90 | + * @return | |
| 91 | + */ | |
| 92 | + PageResult<AppMaintainPlanPagePlanTypeRespVO> appMaintainPlanPlanTypePage(AppMaintainPlanPagePlanTypeReqVO pageReqVO); | |
| 93 | + | |
| 94 | + | |
| 75 | 95 | } |
| 76 | 96 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanServiceImpl.java
| ... | ... | @@ -4,17 +4,26 @@ import cn.hutool.core.date.DateUtil; |
| 4 | 4 | import cn.hutool.core.thread.ThreadUtil; |
| 5 | 5 | import cn.hutool.core.util.RandomUtil; |
| 6 | 6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 7 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
| 7 | 8 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 8 | 9 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 10 | +import com.zteits.urbanops.framework.mybatis.core.util.MyBatisUtils; | |
| 9 | 11 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 12 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanRespVO; | |
| 13 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeReqVO; | |
| 14 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO; | |
| 15 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadReqVO; | |
| 16 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO; | |
| 10 | 17 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; |
| 11 | 18 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 12 | 19 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanRoleDO; |
| 13 | 20 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; |
| 14 | 21 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanRoleDO; |
| 22 | +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; | |
| 15 | 23 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanDetailMapper; |
| 16 | 24 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanInterceptMapper; |
| 17 | 25 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanRoleMapper; |
| 26 | +import com.zteits.urbanops.module.garden.dal.mysql.road.RoadMapper; | |
| 18 | 27 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; |
| 19 | 28 | import com.zteits.urbanops.module.garden.enums.PlanConstants; |
| 20 | 29 | import com.zteits.urbanops.module.garden.util.timeinterval.PeriodResult; |
| ... | ... | @@ -25,11 +34,14 @@ import com.zteits.urbanops.module.system.api.permission.RoleApi; |
| 25 | 34 | import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; |
| 26 | 35 | import jodd.util.StringUtil; |
| 27 | 36 | import lombok.extern.slf4j.Slf4j; |
| 37 | +import org.apache.commons.lang3.StringUtils; | |
| 38 | +import org.apache.ibatis.annotations.Param; | |
| 28 | 39 | import org.springframework.stereotype.Service; |
| 29 | 40 | import jakarta.annotation.Resource; |
| 30 | 41 | import org.springframework.util.CollectionUtils; |
| 31 | 42 | import org.springframework.validation.annotation.Validated; |
| 32 | 43 | |
| 44 | +import java.time.LocalDate; | |
| 33 | 45 | import java.time.LocalDateTime; |
| 34 | 46 | import java.time.format.DateTimeFormatter; |
| 35 | 47 | import java.util.*; |
| ... | ... | @@ -68,6 +80,9 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 68 | 80 | private MaintainPlanRoleMapper maintainPlanRoleMapper; |
| 69 | 81 | |
| 70 | 82 | @Resource |
| 83 | + private RoadMapper roadMapper; | |
| 84 | + | |
| 85 | + @Resource | |
| 71 | 86 | private DeptApi deptApi; |
| 72 | 87 | |
| 73 | 88 | @Resource |
| ... | ... | @@ -312,4 +327,64 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 312 | 327 | maintainPlanRoleMapper.delete(MaintainPlanRoleDO::getBatchNo, batchNo); |
| 313 | 328 | } |
| 314 | 329 | |
| 330 | + @Override | |
| 331 | + public PageResult<AppMaintainPlanPageRoadRespVO> appMaintainPlanRoadPage(AppMaintainPlanPageRoadReqVO pageReqVO) { | |
| 332 | + String busiLine = SecurityFrameworkUtils.getBusiLine(); | |
| 333 | + Long companyId = SecurityFrameworkUtils.getCompanyId(); | |
| 334 | + if (StringUtils.isNotEmpty(busiLine)) { | |
| 335 | + pageReqVO.setBusiLineList(Arrays.asList(busiLine.split(","))); | |
| 336 | + } | |
| 337 | + pageReqVO.setCompanyId(companyId); | |
| 338 | + | |
| 339 | + /*1.查询登录用户角色*/ | |
| 340 | + List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 341 | + pageReqVO.setRoleIds(roleIds); | |
| 342 | + pageReqVO.setLocalDate(LocalDate.now()); | |
| 343 | + | |
| 344 | + /*2.分页*/ | |
| 345 | + IPage<AppMaintainPlanPageRoadRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); | |
| 346 | + IPage<AppMaintainPlanPageRoadRespVO> page = maintainPlanMapper.appMaintainPlanRoadPage(mpPage, pageReqVO); | |
| 347 | + addStreetInfo(page.getRecords()); | |
| 348 | + return new PageResult<>(page.getRecords(), page.getTotal()); | |
| 349 | + } | |
| 350 | + | |
| 351 | + @Override | |
| 352 | + public PageResult<AppMaintainPlanPagePlanTypeRespVO> appMaintainPlanPlanTypePage(AppMaintainPlanPagePlanTypeReqVO pageReqVO) { | |
| 353 | + String busiLine = SecurityFrameworkUtils.getBusiLine(); | |
| 354 | + Long companyId = SecurityFrameworkUtils.getCompanyId(); | |
| 355 | + if (StringUtils.isNotEmpty(busiLine)) { | |
| 356 | + pageReqVO.setBusiLineList(Arrays.asList(busiLine.split(","))); | |
| 357 | + } | |
| 358 | + pageReqVO.setCompanyId(companyId); | |
| 359 | + | |
| 360 | + /*1.查询登录用户角色*/ | |
| 361 | + List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 362 | + pageReqVO.setRoleIds(roleIds); | |
| 363 | + pageReqVO.setLocalDate(LocalDate.now()); | |
| 364 | + /*2.分页*/ | |
| 365 | + IPage<AppMaintainPlanPagePlanTypeRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); | |
| 366 | + IPage<AppMaintainPlanPagePlanTypeRespVO> page = maintainPlanMapper.appMaintainPlanPlanTypePage(mpPage, pageReqVO); | |
| 367 | + return new PageResult<>(page.getRecords(), page.getTotal()); | |
| 368 | + } | |
| 369 | + | |
| 370 | + private void addStreetInfo(List<AppMaintainPlanPageRoadRespVO> list){ | |
| 371 | + if(CollectionUtils.isEmpty(list)){ | |
| 372 | + return ; | |
| 373 | + } | |
| 374 | + Set<Long> roadIds = list.stream().map(AppMaintainPlanPageRoadRespVO::getRoadId).collect(Collectors.toSet()); | |
| 375 | + | |
| 376 | + | |
| 377 | + List<RoadDO> roadList = roadMapper.selectList(new QueryWrapper<RoadDO>().lambda().in(RoadDO::getId, roadIds)); | |
| 378 | + //list转map | |
| 379 | + Map<Long, RoadDO> roadMap = roadList.stream().collect(Collectors.toMap(RoadDO::getId, road -> road)); | |
| 380 | + | |
| 381 | + list.forEach(plan -> { | |
| 382 | + RoadDO road = roadMap.get(plan.getRoadId()); | |
| 383 | + if(road != null){ | |
| 384 | + plan.setStreetId(road.getStreetId()); | |
| 385 | + plan.setStreetName(road.getStreetName()); | |
| 386 | + } | |
| 387 | + }); | |
| 388 | + } | |
| 389 | + | |
| 315 | 390 | } |
| 316 | 391 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanDetailMapper.xml
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml
| ... | ... | @@ -11,4 +11,113 @@ |
| 11 | 11 | <delete id="deleteByBatchNo"> |
| 12 | 12 | delete from garden_maintain_plan where batch_no =#{batchNo} |
| 13 | 13 | </delete> |
| 14 | + | |
| 15 | + | |
| 16 | + <select id="appMaintainPlanRoadPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO"> | |
| 17 | + SELECT | |
| 18 | + a.batch_no, | |
| 19 | + a.road_id, | |
| 20 | + a.road_name, | |
| 21 | + a.level_id, | |
| 22 | + a.finish_state, | |
| 23 | + max(a.plan_num) as plan_num, | |
| 24 | + max(a.plan_finish_num) as plan_finish_num, | |
| 25 | + a.begin_time, | |
| 26 | + a.end_time | |
| 27 | + FROM | |
| 28 | + garden_maintain_plan a, | |
| 29 | + garden_maintain_plan_role b | |
| 30 | + WHERE | |
| 31 | + a.batch_no = b.batch_no | |
| 32 | + AND a.dept_id =b.dept_id | |
| 33 | + AND a.deleted=0 | |
| 34 | + AND a.company_id = #{req.companyId} | |
| 35 | + <if test="req.roadName != null and req.roadName !=''"> | |
| 36 | + AND a.road_name LIKE CONCAT('%',#{req.roadName},'%') | |
| 37 | + </if> | |
| 38 | + <if test="req.roleIds != null and req.roleIds.size() > 0"> | |
| 39 | + AND b.role_id IN | |
| 40 | + <foreach collection="req.roleIds" item="roleId" open="(" separator="," close=")"> | |
| 41 | + #{roleId} | |
| 42 | + </foreach> | |
| 43 | + </if> | |
| 44 | + <if test="req.busiLineList != null and req.busiLineList.size() > 0"> | |
| 45 | + AND a.busi_line IN | |
| 46 | + <foreach collection="req.busiLineList" item="busiLine" open="(" separator="," close=")"> | |
| 47 | + #{busiLine} | |
| 48 | + </foreach> | |
| 49 | + </if> | |
| 50 | + <!--状态 1:未完成;2:已完成;3:已失效--> | |
| 51 | + <if test="req.finishState == 3"> | |
| 52 | + <![CDATA[and a.end_time < #{req.localDate}]]> | |
| 53 | + </if> | |
| 54 | + <if test="req.finishState == 2"> | |
| 55 | + and a.finish_state = #{req.finishState} | |
| 56 | + </if> | |
| 57 | + <if test="req.finishState == 1"> | |
| 58 | + and a.finish_state = #{req.finishState} | |
| 59 | + <![CDATA[and a.end_time >= #{req.localDate}]]> | |
| 60 | + </if> | |
| 61 | + GROUP BY | |
| 62 | + a.batch_no, | |
| 63 | + a.road_id, | |
| 64 | + a.road_name, | |
| 65 | + a.level_id, | |
| 66 | + a.finish_state, | |
| 67 | + a.begin_time, | |
| 68 | + a.end_time | |
| 69 | + </select> | |
| 70 | + | |
| 71 | + <select id="appMaintainPlanPlanTypePage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO"> | |
| 72 | + SELECT | |
| 73 | + c.batch_no, | |
| 74 | + c.plan_no, | |
| 75 | + a.plan_name, | |
| 76 | + a.plan_type_id, | |
| 77 | + a.rate, | |
| 78 | + a.cycle_id, | |
| 79 | + c.plan_num, | |
| 80 | + c.finish_percent, | |
| 81 | + c.finish_state, | |
| 82 | + c.begin_time, | |
| 83 | + c.end_time | |
| 84 | + FROM | |
| 85 | + garden_maintain_plan a, | |
| 86 | + garden_maintain_plan_role b, | |
| 87 | + garden_maintain_plan_detail c | |
| 88 | + WHERE | |
| 89 | + a.batch_no = b.batch_no | |
| 90 | + and a.batch_no=b.batch_no | |
| 91 | + AND a.dept_id =b.dept_id | |
| 92 | + AND a.deleted=0 | |
| 93 | + AND a.company_id = #{req.companyId} | |
| 94 | + AND a.company_id = #{req.planTypeId} | |
| 95 | + <if test="req.planName != null and req.planName !=''"> | |
| 96 | + AND a.plan_type_id LIKE CONCAT('%',#{req.planName},'%') | |
| 97 | + </if> | |
| 98 | + <if test="req.roleIds != null and req.roleIds.size() > 0"> | |
| 99 | + AND b.role_id IN | |
| 100 | + <foreach collection="req.roleIds" item="roleId" open="(" separator="," close=")"> | |
| 101 | + #{roleId} | |
| 102 | + </foreach> | |
| 103 | + </if> | |
| 104 | + <if test="req.busiLineList != null and req.busiLineList.size() > 0"> | |
| 105 | + AND a.busi_line IN | |
| 106 | + <foreach collection="req.busiLineList" item="busiLine" open="(" separator="," close=")"> | |
| 107 | + #{busiLine} | |
| 108 | + </foreach> | |
| 109 | + </if> | |
| 110 | + <!--状态 1:未完成;2:已完成;3:已失效--> | |
| 111 | + <if test="req.finishState == 3"> | |
| 112 | + <![CDATA[and c.end_time < #{req.localDate}]]> | |
| 113 | + </if> | |
| 114 | + <if test="req.finishState == 2"> | |
| 115 | + and c.finish_state = #{req.finishState} | |
| 116 | + </if> | |
| 117 | + <if test="req.finishState == 1"> | |
| 118 | + and c.finish_state = #{req.finishState} | |
| 119 | + <![CDATA[and c.end_time >= #{req.localDate}]]> | |
| 120 | + </if> | |
| 121 | + </select> | |
| 122 | + | |
| 14 | 123 | </mapper> |
| 15 | 124 | \ No newline at end of file | ... | ... |