Commit 3919af5ecd55771164e4440a0952e2099510d3ba
1 parent
479351f5
app巡查汇总查询提交
Showing
12 changed files
with
265 additions
and
20 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/AppInspectionPlanController.java
| ... | ... | @@ -2,7 +2,6 @@ package com.zteits.urbanops.module.garden.controller.app.inspectionplan; |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 4 | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 5 | -import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRespVO; | |
| 6 | 5 | import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanPageReqVO; |
| 7 | 6 | import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanRespVO; |
| 8 | 7 | import com.zteits.urbanops.module.garden.service.inspectionplan.InspectionPlanService; |
| ... | ... | @@ -11,7 +10,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | 10 | import jakarta.annotation.Resource; |
| 12 | 11 | import jakarta.validation.Valid; |
| 13 | 12 | import lombok.extern.slf4j.Slf4j; |
| 14 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 15 | 13 | import org.springframework.validation.annotation.Validated; |
| 16 | 14 | import org.springframework.web.bind.annotation.*; |
| 17 | 15 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| ... | ... | @@ -29,7 +27,7 @@ public class AppInspectionPlanController { |
| 29 | 27 | |
| 30 | 28 | @GetMapping("/page") |
| 31 | 29 | @Operation(summary = "app-巡检计划汇总分页") |
| 32 | - @PreAuthorize("@ss.hasPermission('app:garden:inspection-plan:query')") | |
| 30 | + //@PreAuthorize("@ss.hasPermission('app:garden:inspection-plan:query')") | |
| 33 | 31 | public CommonResult<PageResult<AppInspectionPlanRespVO>> getInspectionPlanAppPage(@Valid AppInspectionPlanPageReqVO pageReqVO) { |
| 34 | 32 | PageResult<AppInspectionPlanRespVO> pageResult = inspectionPlanService.getInspectionPlanAppPage(pageReqVO); |
| 35 | 33 | return success(pageResult); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/AppInspectionPlanDetailController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.app.inspectionplan; |
| 2 | 2 | |
| 3 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 4 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailReqVO; | |
| 6 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailRespVO; | |
| 3 | 7 | import com.zteits.urbanops.module.garden.service.inspectionplan.InspectionPlanDetailService; |
| 8 | +import io.swagger.v3.oas.annotations.Operation; | |
| 4 | 9 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 5 | 10 | import jakarta.annotation.Resource; |
| 11 | +import jakarta.validation.Valid; | |
| 12 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 6 | 13 | import org.springframework.validation.annotation.Validated; |
| 14 | +import org.springframework.web.bind.annotation.PostMapping; | |
| 15 | +import org.springframework.web.bind.annotation.RequestBody; | |
| 7 | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| 8 | 17 | import org.springframework.web.bind.annotation.RestController; |
| 9 | 18 | |
| 19 | +import java.util.List; | |
| 20 | + | |
| 21 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 10 | 23 | |
| 11 | 24 | @Tag(name = "APP管理 - 巡检计划") |
| 12 | 25 | @RestController |
| ... | ... | @@ -18,5 +31,13 @@ public class AppInspectionPlanDetailController { |
| 18 | 31 | private InspectionPlanDetailService inspectionPlanDetailService; |
| 19 | 32 | |
| 20 | 33 | |
| 34 | + @PostMapping("/get-details") | |
| 35 | + @Operation(summary = "app-巡检计划明细") | |
| 36 | + //@PreAuthorize("@ss.hasPermission('app:garden:inspection-plan-detail:query')") | |
| 37 | + public CommonResult<List<AppInspectionPlanDetailRespVO>> getInspectionPlanDetailAppPage(@Valid @RequestBody AppInspectionPlanDetailReqVO pageReqVO) { | |
| 38 | + List<AppInspectionPlanDetailRespVO> pageResult = inspectionPlanDetailService.getInspectionPlanDetailForApp(pageReqVO); | |
| 39 | + return success(pageResult); | |
| 40 | + } | |
| 41 | + | |
| 21 | 42 | |
| 22 | 43 | } |
| 23 | 44 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanDetailReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.Hidden; | |
| 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.NotBlank; | |
| 8 | +import jakarta.validation.constraints.NotNull; | |
| 9 | +import lombok.Data; | |
| 10 | + | |
| 11 | +import java.time.LocalDate; | |
| 12 | +import java.time.LocalDateTime; | |
| 13 | +import java.util.List; | |
| 14 | + | |
| 15 | +@Schema(description = "App管理 - 巡检计划明细 Request VO") | |
| 16 | +@Data | |
| 17 | +public class AppInspectionPlanDetailReqVO { | |
| 18 | + | |
| 19 | + @Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 20 | + @NotBlank(message = "批次号不能为空") | |
| 21 | + private String batchNo; | |
| 22 | + | |
| 23 | + @Schema(description = "道路id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 24 | + @NotNull(message = "道路id不能为空") | |
| 25 | + private Long roadId; | |
| 26 | + | |
| 27 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "24742") | |
| 28 | + @NotNull(message = "养护类型不能为空") | |
| 29 | + private Integer planTypeId; | |
| 30 | + | |
| 31 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 32 | + @NotNull(message = "完成状态不能为空") | |
| 33 | + @Min(value = 1, message = "状态最小为1") | |
| 34 | + @Max(value = 3, message = "状态不能大于4") | |
| 35 | + private Integer finishState; | |
| 36 | + | |
| 37 | + @Schema(description = "公司ID") | |
| 38 | + @Hidden | |
| 39 | + private Long companyId; | |
| 40 | + | |
| 41 | + @Schema(description = "角色IDS") | |
| 42 | + @Hidden | |
| 43 | + private List<Long> roleIds; | |
| 44 | + | |
| 45 | + @Schema(description = "业务线") | |
| 46 | + @Hidden | |
| 47 | + private List<String> busiLineList; | |
| 48 | + | |
| 49 | + @Schema(description = "系统时间") | |
| 50 | + @Hidden | |
| 51 | + private LocalDateTime localDateTime; | |
| 52 | +} | |
| 53 | + | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanDetailRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import jakarta.validation.constraints.NotNull; | |
| 6 | +import lombok.Data; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; | |
| 12 | + | |
| 13 | +@Schema(description = "管理后台 - 巡检明细计划 Response VO") | |
| 14 | +@Data | |
| 15 | +public class AppInspectionPlanDetailRespVO { | |
| 16 | + | |
| 17 | + @Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 18 | + private String batchNo; | |
| 19 | + | |
| 20 | + @Schema(description = "计划编码", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 21 | + private String planNo; | |
| 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 = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "24742") | |
| 30 | + @NotNull(message = "养护类型不能为空") | |
| 31 | + private Integer planTypeId; | |
| 32 | + | |
| 33 | + @Schema(description = "排序号:第n次计划", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 34 | + private Integer sortNum; | |
| 35 | + | |
| 36 | + @Schema(description = "执行开始时间") | |
| 37 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 38 | + private LocalDateTime beginTime; | |
| 39 | + | |
| 40 | + @Schema(description = "执行时间") | |
| 41 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 42 | + private LocalDateTime endTime; | |
| 43 | + | |
| 44 | + @Schema(description = "次数 如:1/3等", requiredMode = Schema.RequiredMode.REQUIRED, example = "1/3") | |
| 45 | + private String rate; | |
| 46 | + | |
| 47 | + @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "6415") | |
| 48 | + private Integer cycleId; | |
| 49 | + | |
| 50 | + @Schema(description = "计划次数") | |
| 51 | + private Integer planNum; | |
| 52 | + | |
| 53 | + @Schema(description = "完成次数") | |
| 54 | + private Integer planFinishNum; | |
| 55 | + | |
| 56 | + @Schema(description = "完成状态 1:未完成;2:已完成;", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 57 | + private Integer finishState; | |
| 58 | +} | |
| 59 | + | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanPageReqVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo; |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 4 | +import io.swagger.v3.oas.annotations.Hidden; | |
| 4 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 6 | import jakarta.validation.constraints.Max; |
| 6 | 7 | import jakarta.validation.constraints.Min; |
| ... | ... | @@ -17,21 +18,25 @@ public class AppInspectionPlanPageReqVO extends PageParam { |
| 17 | 18 | @Schema(description = "道路名称", example = "赵六") |
| 18 | 19 | private String roadName; |
| 19 | 20 | |
| 20 | - @Schema(description = "状态 1:未完成;3:已完成;4:已失效") | |
| 21 | - @NotNull | |
| 21 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 22 | + @NotNull(message = "完成状态不能为空") | |
| 22 | 23 | @Min(value = 1, message = "状态最小为1") |
| 23 | - @Max(value = 4, message = "状态不能大于4") | |
| 24 | + @Max(value = 3, message = "状态不能大于4") | |
| 24 | 25 | private Integer finishState; |
| 25 | 26 | |
| 26 | 27 | @Schema(description = "公司ID") |
| 28 | + @Hidden | |
| 27 | 29 | private Long companyId; |
| 28 | 30 | |
| 29 | 31 | @Schema(description = "角色IDS") |
| 32 | + @Hidden | |
| 30 | 33 | private List<Long> roleIds; |
| 31 | 34 | |
| 32 | 35 | @Schema(description = "业务线") |
| 36 | + @Hidden | |
| 33 | 37 | private List<String> busiLineList; |
| 34 | 38 | |
| 35 | 39 | @Schema(description = "系统时间") |
| 40 | + @Hidden | |
| 36 | 41 | private LocalDate localDate; |
| 37 | 42 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanRespVO.java
| ... | ... | @@ -14,12 +14,14 @@ import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YE |
| 14 | 14 | @ExcelIgnoreUnannotated |
| 15 | 15 | public class AppInspectionPlanRespVO { |
| 16 | 16 | |
| 17 | + @Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | |
| 18 | + private String batchNo; | |
| 17 | 19 | |
| 18 | 20 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") |
| 19 | 21 | private Long roadId; |
| 20 | 22 | |
| 21 | 23 | @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") |
| 22 | - private Long roadName; | |
| 24 | + private String roadName; | |
| 23 | 25 | |
| 24 | 26 | @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8439") |
| 25 | 27 | private String streetId; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanDetailMapper.java
| ... | ... | @@ -6,6 +6,8 @@ import java.util.*; |
| 6 | 6 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 7 | 7 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 8 | 8 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 9 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailReqVO; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailRespVO; | |
| 9 | 11 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 10 | 12 | import org.apache.ibatis.annotations.Mapper; |
| 11 | 13 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; |
| ... | ... | @@ -46,4 +48,11 @@ public interface InspectionPlanDetailMapper extends BaseMapperX<InspectionPlanDe |
| 46 | 48 | |
| 47 | 49 | int deleteByBatchNo(@Param("batchNo") String batchNo); |
| 48 | 50 | |
| 51 | + /** | |
| 52 | + * 获取巡检计划详情列表 | |
| 53 | + * | |
| 54 | + * @param pageReqVO 列表请求 | |
| 55 | + * @return 巡检计划详情列表 | |
| 56 | + */ | |
| 57 | + List<AppInspectionPlanDetailRespVO> getInspectionPlanDetailForApp(@Param("req") AppInspectionPlanDetailReqVO pageReqVO); | |
| 49 | 58 | } |
| 50 | 59 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanDetailService.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.inspectionplan; |
| 2 | 2 | |
| 3 | 3 | import java.util.*; |
| 4 | + | |
| 5 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailReqVO; | |
| 6 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailRespVO; | |
| 4 | 7 | import jakarta.validation.*; |
| 5 | 8 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; |
| 6 | 9 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 7 | 10 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 8 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | 11 | |
| 10 | 12 | /** |
| 11 | 13 | * 巡检计划 Service 接口 |
| ... | ... | @@ -59,4 +61,11 @@ public interface InspectionPlanDetailService { |
| 59 | 61 | */ |
| 60 | 62 | PageResult<InspectionPlanDetailDO> getInspectionPlanDetailPage(InspectionPlanDetailPageReqVO pageReqVO); |
| 61 | 63 | |
| 64 | + /** | |
| 65 | + * app-检计划明细分页 | |
| 66 | + * | |
| 67 | + * @param pageReqVO 分页查询 | |
| 68 | + * @return 巡检计划分页 | |
| 69 | + */ | |
| 70 | + List<AppInspectionPlanDetailRespVO> getInspectionPlanDetailForApp(AppInspectionPlanDetailReqVO pageReqVO); | |
| 62 | 71 | } |
| 63 | 72 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanDetailServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.inspectionplan; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollUtil; | |
| 3 | +import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | |
| 4 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailReqVO; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailRespVO; | |
| 6 | +import com.zteits.urbanops.module.system.api.permission.RoleApi; | |
| 7 | +import org.apache.commons.lang3.StringUtils; | |
| 4 | 8 | import org.springframework.stereotype.Service; |
| 5 | 9 | import jakarta.annotation.Resource; |
| 6 | 10 | import org.springframework.validation.annotation.Validated; |
| 7 | -import org.springframework.transaction.annotation.Transactional; | |
| 8 | 11 | |
| 12 | +import java.time.LocalDate; | |
| 13 | +import java.time.LocalDateTime; | |
| 9 | 14 | import java.util.*; |
| 10 | 15 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; |
| 11 | 16 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 12 | 17 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 13 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 14 | 18 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 15 | 19 | |
| 16 | 20 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanDetailMapper; |
| 17 | 21 | |
| 18 | 22 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 19 | 23 | import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; |
| 20 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 21 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | |
| 22 | 24 | |
| 23 | 25 | /** |
| 24 | 26 | * 巡检计划 Service 实现类 |
| ... | ... | @@ -32,6 +34,9 @@ public class InspectionPlanDetailServiceImpl implements InspectionPlanDetailServ |
| 32 | 34 | @Resource |
| 33 | 35 | private InspectionPlanDetailMapper inspectionPlanDetailMapper; |
| 34 | 36 | |
| 37 | + @Resource | |
| 38 | + private RoleApi roleApi; | |
| 39 | + | |
| 35 | 40 | @Override |
| 36 | 41 | public Long createInspectionPlanDetail(InspectionPlanDetailSaveReqVO createReqVO) { |
| 37 | 42 | // 插入 |
| ... | ... | @@ -82,4 +87,21 @@ public class InspectionPlanDetailServiceImpl implements InspectionPlanDetailServ |
| 82 | 87 | return inspectionPlanDetailMapper.selectPage(pageReqVO); |
| 83 | 88 | } |
| 84 | 89 | |
| 90 | + @Override | |
| 91 | + public List<AppInspectionPlanDetailRespVO> getInspectionPlanDetailForApp(AppInspectionPlanDetailReqVO pageReqVO) { | |
| 92 | + String busiLine = SecurityFrameworkUtils.getBusiLine(); | |
| 93 | + Long companyId = SecurityFrameworkUtils.getCompanyId(); | |
| 94 | + if (StringUtils.isNotEmpty(busiLine)) { | |
| 95 | + pageReqVO.setBusiLineList(Arrays.asList(busiLine.split(","))); | |
| 96 | + } | |
| 97 | + pageReqVO.setCompanyId(companyId); | |
| 98 | + | |
| 99 | + /*1.查询登录用户角色*/ | |
| 100 | + List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 101 | + pageReqVO.setRoleIds(roleIds); | |
| 102 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 103 | + /*2.明细*/ | |
| 104 | + return inspectionPlanDetailMapper.getInspectionPlanDetailForApp(pageReqVO); | |
| 105 | + } | |
| 106 | + | |
| 85 | 107 | } |
| 86 | 108 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| ... | ... | @@ -39,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional; |
| 39 | 39 | import org.springframework.util.CollectionUtils; |
| 40 | 40 | import org.springframework.validation.annotation.Validated; |
| 41 | 41 | |
| 42 | +import java.time.LocalDate; | |
| 42 | 43 | import java.time.LocalDateTime; |
| 43 | 44 | import java.time.format.DateTimeFormatter; |
| 44 | 45 | import java.util.*; |
| ... | ... | @@ -79,9 +80,6 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 79 | 80 | @Resource |
| 80 | 81 | private RoleApi roleApi; |
| 81 | 82 | |
| 82 | - @Resource | |
| 83 | - private RoleApi poleApi; | |
| 84 | - | |
| 85 | 83 | @Transactional(rollbackFor = Exception.class) |
| 86 | 84 | @Override |
| 87 | 85 | public CommonResult<Integer> createInspectionPlan(InspectionPlanSaveReqVO createReqVO) { |
| ... | ... | @@ -332,8 +330,9 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 332 | 330 | pageReqVO.setCompanyId(companyId); |
| 333 | 331 | |
| 334 | 332 | /*1.查询登录用户角色*/ |
| 335 | - List<Long> roleIds = poleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 333 | + List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 336 | 334 | pageReqVO.setRoleIds(roleIds); |
| 335 | + pageReqVO.setLocalDate(LocalDate.now()); | |
| 337 | 336 | /*2.分页*/ |
| 338 | 337 | IPage<AppInspectionPlanRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 339 | 338 | IPage<AppInspectionPlanRespVO> page = inspectionPlanMapper.getInspectionPlanAppPage(mpPage, pageReqVO); | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanDetailMapper.xml
| ... | ... | @@ -12,4 +12,64 @@ |
| 12 | 12 | delete from garden_inspection_plan_detail where batch_no =#{batchNo} |
| 13 | 13 | </delete> |
| 14 | 14 | |
| 15 | + <select id="getInspectionPlanDetailForApp" resultType="com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailRespVO"> | |
| 16 | + SELECT | |
| 17 | + a.batch_no, | |
| 18 | + b.plan_no, | |
| 19 | + a.road_id, | |
| 20 | + a.road_name, | |
| 21 | + a.plan_type_id, | |
| 22 | + a.level_id, | |
| 23 | + a.plan_type_id, | |
| 24 | + a.rate, | |
| 25 | + a.cycle_id, | |
| 26 | + b.sort_num, | |
| 27 | + b.plan_num, | |
| 28 | + b.plan_finish_num, | |
| 29 | + b.finish_state, | |
| 30 | + b.begin_time, | |
| 31 | + b.end_time | |
| 32 | + FROM | |
| 33 | + garden_inspection_plan a, | |
| 34 | + garden_inspection_plan_detail b, | |
| 35 | + garden_inspection_plan_role c | |
| 36 | + WHERE | |
| 37 | + a.batch_no = b.batch_no | |
| 38 | + AND b.batch_no=c.batch_no | |
| 39 | + AND a.road_id=b.road_id | |
| 40 | + AND a.dept_id =b.dept_id | |
| 41 | + AND a.deleted = b.deleted | |
| 42 | + AND a.deleted = 0 | |
| 43 | + AND a.batch_no = #{req.batchNo} | |
| 44 | + and a.road_id=#{req.roadId} | |
| 45 | + and a.plan_type_id=#{req.planTypeId} | |
| 46 | + AND a.company_id = #{req.companyId} | |
| 47 | + <if test="req.roleIds != null and req.roleIds.size() > 0"> | |
| 48 | + AND c.role_id IN | |
| 49 | + <foreach collection="req.roleIds" item="roleId" open="(" separator="," close=")"> | |
| 50 | + #{roleId} | |
| 51 | + </foreach> | |
| 52 | + </if> | |
| 53 | + <if test="req.busiLineList != null and req.busiLineList.size() > 0"> | |
| 54 | + AND a.busi_line IN | |
| 55 | + <foreach collection="req.busiLineList" item="busiLine" open="(" separator="," close=")"> | |
| 56 | + #{busiLine} | |
| 57 | + </foreach> | |
| 58 | + </if> | |
| 59 | + <!--状态 1:未完成;2:已完成;3:已失效--> | |
| 60 | + <if test="req.finishState == 3"> | |
| 61 | + <![CDATA[and b.end_time < #{req.localDateTime}]]> | |
| 62 | + </if> | |
| 63 | + <if test="req.finishState == 2"> | |
| 64 | + and b.finish_state = #{req.finishState} | |
| 65 | + </if> | |
| 66 | + <if test="req.finishState == 1"> | |
| 67 | + and b.finish_state = #{req.finishState} | |
| 68 | + <![CDATA[ and b.begin_time <= #{req.localDateTime} | |
| 69 | + and b.end_time >= #{req.localDateTime}]]> | |
| 70 | + </if> | |
| 71 | + | |
| 72 | + </select> | |
| 73 | + | |
| 74 | + | |
| 15 | 75 | </mapper> |
| 16 | 76 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | |
| 16 | 16 | <select id="getInspectionPlanAppPage" resultType="com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanRespVO"> |
| 17 | 17 | SELECT |
| 18 | + a.batch_no, | |
| 18 | 19 | a.road_id, |
| 19 | 20 | a.road_name, |
| 20 | 21 | a.plan_type_id, |
| ... | ... | @@ -26,6 +27,8 @@ |
| 26 | 27 | garden_inspection_plan_role b |
| 27 | 28 | WHERE |
| 28 | 29 | a.batch_no = b.batch_no |
| 30 | + AND a.dept_id =b.dept_id | |
| 31 | + AND a.deleted=0 | |
| 29 | 32 | AND a.company_id = #{req.companyId} |
| 30 | 33 | <if test="req.roadName != null and req.roadName !=''"> |
| 31 | 34 | AND a.road_name LIKE CONCAT('%',#{req.roadName},'%') |
| ... | ... | @@ -42,14 +45,19 @@ |
| 42 | 45 | #{busiLine} |
| 43 | 46 | </foreach> |
| 44 | 47 | </if> |
| 45 | - <!--状态 1:未完成;3:已完成;4:已失效--> | |
| 46 | - <if test="req.finishState == 4"> | |
| 48 | + <!--状态 1:未完成;2:已完成;3:已失效--> | |
| 49 | + <if test="req.finishState == 3"> | |
| 47 | 50 | <![CDATA[and a.end_time < #{req.localDate}]]> |
| 48 | 51 | </if> |
| 49 | - <if test="req.finishState == 3 or req.finishState == 1"> | |
| 52 | + <if test="req.finishState == 2"> | |
| 50 | 53 | and a.finish_state = #{req.finishState} |
| 51 | 54 | </if> |
| 55 | + <if test="req.finishState == 1"> | |
| 56 | + and a.finish_state = #{req.finishState} | |
| 57 | + <![CDATA[and a.end_time >= #{req.localDate}]]> | |
| 58 | + </if> | |
| 52 | 59 | GROUP BY |
| 60 | + a.batch_no, | |
| 53 | 61 | a.road_id, |
| 54 | 62 | a.road_name, |
| 55 | 63 | a.plan_type_id, | ... | ... |