Commit fe1e88741f5f6db75f770eb3c8bd50f9b850c6e4
Merge branch 'dev' of http://gitlab1.renniting.cn/JCSS/urbanops into dev
# Conflicts: # urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderController.java # urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenService.java # urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
Showing
59 changed files
with
666 additions
and
445 deletions
pom.xml
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | <!-- <module>urbanops-module-member</module>--> |
| 22 | 22 | <module>urbanops-module-bpm</module> |
| 23 | 23 | <module>urbanops-module-report</module> |
| 24 | + <module>urbanops-module-api</module> | |
| 24 | 25 | <!-- <module>urbanops-module-mp</module>--> |
| 25 | 26 | <!-- <module>urbanops-module-pay</module>--> |
| 26 | 27 | <!-- <module>urbanops-module-mall</module>--> | ... | ... |
urbanops-module-api/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 5 | + <modelVersion>4.0.0</modelVersion> | |
| 6 | + <parent> | |
| 7 | + <artifactId>urbanops</artifactId> | |
| 8 | + <groupId>com.zteits.boot</groupId> | |
| 9 | + <version>${revision}</version> | |
| 10 | + </parent> | |
| 11 | + <packaging>pom</packaging> | |
| 12 | + <modules> | |
| 13 | + <module>urbanops-module-workorder-api</module> | |
| 14 | + <module>urbanops-module-garden-api</module> | |
| 15 | + </modules> | |
| 16 | + | |
| 17 | + <artifactId>urbanops-module-api</artifactId> | |
| 18 | + <description> | |
| 19 | + 该包是技术组件,每个子包,代表一个组件。每个组件包括两部分: | |
| 20 | + 1. core 包:是该组件的核心封装 | |
| 21 | + 2. config 包:是该组件基于 Spring 的配置 | |
| 22 | + | |
| 23 | + 技术组件,也分成两类: | |
| 24 | + 1. 框架组件:和我们熟悉的 MyBatis、Redis 等等的拓展 | |
| 25 | + 2. 业务组件:和业务相关的组件的封装,例如说数据字典、操作日志等等。 | |
| 26 | + 如果是业务组件,Maven 名字会包含 biz | |
| 27 | + </description> | |
| 28 | + <url>https://github.com/YunaiV/ruoyi-vue-pro</url> | |
| 29 | + | |
| 30 | +</project> | ... | ... |
urbanops-module-api/urbanops-module-garden-api/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 5 | + | |
| 6 | + <parent> | |
| 7 | + <artifactId>urbanops-module-api</artifactId> | |
| 8 | + <groupId>com.zteits.boot</groupId> | |
| 9 | + <version>${revision}</version> | |
| 10 | + </parent> | |
| 11 | + <modelVersion>4.0.0</modelVersion> | |
| 12 | + <artifactId>urbanops-module-garden-api</artifactId> | |
| 13 | + <packaging>jar</packaging> | |
| 14 | + | |
| 15 | + <name>${project.artifactId}</name> | |
| 16 | + <description> | |
| 17 | + bpm 包下,业务流程管理(Business Process Management),我们放工作流的功能。 | |
| 18 | + 例如说:流程定义、表单配置、审核中心(我的申请、我的待办、我的已办)等等 | |
| 19 | + bpm 解释:https://baike.baidu.com/item/BPM/1933 | |
| 20 | + | |
| 21 | + 工作流基于 Flowable 6 实现,分成流程定义、流程表单、流程实例、流程任务等功能模块。 | |
| 22 | + </description> | |
| 23 | + <dependencies> | |
| 24 | + <!-- Web 相关 --> | |
| 25 | + <dependency> | |
| 26 | + <groupId>com.zteits.boot</groupId> | |
| 27 | + <artifactId>urbanops-spring-boot-starter-web</artifactId> | |
| 28 | + </dependency> | |
| 29 | + <!-- Test 测试相关 --> | |
| 30 | + <dependency> | |
| 31 | + <groupId>com.zteits.boot</groupId> | |
| 32 | + <artifactId>urbanops-spring-boot-starter-test</artifactId> | |
| 33 | + </dependency> | |
| 34 | + </dependencies> | |
| 35 | +</project> | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/material/MaterialApi.java renamed to urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/api/material/MaterialApi.java
urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/api/road/RoadApi.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.api.road; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.zteits.urbanops.module.garden.dto.road.RoadReqDTO; | |
| 5 | +import com.zteits.urbanops.module.garden.dto.road.RoadRespDTO; | |
| 6 | +import com.zteits.urbanops.module.garden.dto.road.RoadStreetRespDTO; | |
| 7 | + | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +public interface RoadApi { | |
| 11 | + List<RoadRespDTO> getRoadInfoBy(RoadReqDTO reqDTO); | |
| 12 | + | |
| 13 | + RoadStreetRespDTO getRoadInfoById(Long id); | |
| 14 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/material/dto/MaterialInventoryOutDto.java renamed to urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/dto/material/MaterialInventoryOutDto.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/road/dto/RoadReqDTO.java renamed to urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/dto/road/RoadReqDTO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/road/dto/RoadRespDTO.java renamed to urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/dto/road/RoadRespDTO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/road/dto/RoadStreetRespDTO.java renamed to urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/dto/road/RoadStreetRespDTO.java
urbanops-module-api/urbanops-module-workorder-api/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 5 | + | |
| 6 | + <parent> | |
| 7 | + <artifactId>urbanops-module-api</artifactId> | |
| 8 | + <groupId>com.zteits.boot</groupId> | |
| 9 | + <version>${revision}</version> | |
| 10 | + </parent> | |
| 11 | + <modelVersion>4.0.0</modelVersion> | |
| 12 | + <artifactId>urbanops-module-workorder-api</artifactId> | |
| 13 | + <packaging>jar</packaging> | |
| 14 | + | |
| 15 | + <name>${project.artifactId}</name> | |
| 16 | + <description> | |
| 17 | + bpm 包下,业务流程管理(Business Process Management),我们放工作流的功能。 | |
| 18 | + 例如说:流程定义、表单配置、审核中心(我的申请、我的待办、我的已办)等等 | |
| 19 | + bpm 解释:https://baike.baidu.com/item/BPM/1933 | |
| 20 | + | |
| 21 | + 工作流基于 Flowable 6 实现,分成流程定义、流程表单、流程实例、流程任务等功能模块。 | |
| 22 | + </description> | |
| 23 | + <dependencies> | |
| 24 | + <!-- Web 相关 --> | |
| 25 | + <dependency> | |
| 26 | + <groupId>com.zteits.boot</groupId> | |
| 27 | + <artifactId>urbanops-spring-boot-starter-web</artifactId> | |
| 28 | + </dependency> | |
| 29 | + <!-- Test 测试相关 --> | |
| 30 | + <dependency> | |
| 31 | + <groupId>com.zteits.boot</groupId> | |
| 32 | + <artifactId>urbanops-spring-boot-starter-test</artifactId> | |
| 33 | + </dependency> | |
| 34 | + <dependency> | |
| 35 | + <groupId>com.zteits.boot</groupId> | |
| 36 | + <artifactId>urbanops-spring-boot-starter-excel</artifactId> | |
| 37 | + </dependency> | |
| 38 | + </dependencies> | |
| 39 | +</project> | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/workorder/WorkOrderApi.java renamed to urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/api/WorkOrderApi.java
| 1 | -package com.zteits.urbanops.module.workorder.api.workorder; | |
| 1 | +package com.zteits.urbanops.module.workorder.api; | |
| 2 | 2 | |
| 3 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 4 | -import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; | |
| 5 | -import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; | |
| 6 | -import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderRespVO; | |
| 3 | +import com.zteits.urbanops.module.workorder.dto.AdminUserRespVO; | |
| 4 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | |
| 5 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; | |
| 7 | 6 | |
| 8 | 7 | import java.util.List; |
| 9 | 8 | |
| ... | ... | @@ -25,7 +24,7 @@ public interface WorkOrderApi { |
| 25 | 24 | * @param notHas false 不包含loginUserId |
| 26 | 25 | * @return |
| 27 | 26 | */ |
| 28 | - public List<AdminUserRespDTO> getUserByLoginIdAndRoleCode(Long loginUserId, String roleCode, String busiLine, boolean notHas); | |
| 27 | + public List<AdminUserRespVO> getUserByLoginIdAndRoleCode(Long loginUserId, String roleCode, String busiLine, boolean notHas); | |
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | 30 | * 通过道路 roadId 获取 当前人所在部门的 且对应的用户角色为roleCode的人员,按业务线busiLine 筛选 |
| ... | ... | @@ -34,7 +33,7 @@ public interface WorkOrderApi { |
| 34 | 33 | * @param busiLine |
| 35 | 34 | * @return |
| 36 | 35 | */ |
| 37 | - public List<AdminUserRespDTO> getUserByRoadIdAndRoleCode(Long roadId,String roleCode,String busiLine); | |
| 36 | + public List<AdminUserRespVO> getUserByRoadIdAndRoleCode(Long roadId, String roleCode, String busiLine); | |
| 38 | 37 | |
| 39 | 38 | /** |
| 40 | 39 | * 创建工单API | ... | ... |
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AdminUserRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.dto; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.enums.CommonStatusEnum; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.util.Set; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Admin 用户 Response DTO | |
| 10 | + * | |
| 11 | + * @author ZIEITS | |
| 12 | + */ | |
| 13 | +@Data | |
| 14 | +public class AdminUserRespVO { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 用户ID | |
| 18 | + */ | |
| 19 | + private Long id; | |
| 20 | + /** | |
| 21 | + * 用户昵称 | |
| 22 | + */ | |
| 23 | + private String nickname; | |
| 24 | + /** | |
| 25 | + * 帐号状态 | |
| 26 | + * | |
| 27 | + * 枚举 {@link CommonStatusEnum} | |
| 28 | + */ | |
| 29 | + private Integer status; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 部门ID | |
| 33 | + */ | |
| 34 | + private Long deptId; | |
| 35 | + /** | |
| 36 | + * 岗位编号数组 | |
| 37 | + */ | |
| 38 | + private Set<Long> postIds; | |
| 39 | + /** | |
| 40 | + * 手机号码 | |
| 41 | + */ | |
| 42 | + private String mobile; | |
| 43 | + /** | |
| 44 | + * 用户头像 | |
| 45 | + */ | |
| 46 | + private String avatar; | |
| 47 | + | |
| 48 | +} | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/AppGardenWorkOrderReqVO.java renamed to urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderReqVO.java
| 1 | -package com.zteits.urbanops.module.workorder.controller.app.garden.vo; | |
| 1 | +package com.zteits.urbanops.module.workorder.dto; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import jakarta.validation.constraints.NotEmpty; |
| ... | ... | @@ -9,7 +9,6 @@ import org.hibernate.validator.constraints.Length; |
| 9 | 9 | import java.math.BigDecimal; |
| 10 | 10 | import java.time.LocalDateTime; |
| 11 | 11 | import java.util.List; |
| 12 | -import java.util.Map; | |
| 13 | 12 | |
| 14 | 13 | /** |
| 15 | 14 | * @author yanhuiqing |
| ... | ... | @@ -93,3 +92,4 @@ public class AppGardenWorkOrderReqVO { |
| 93 | 92 | |
| 94 | 93 | |
| 95 | 94 | } |
| 95 | + | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/AppGardenWorkOrderRespVO.java renamed to urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderRespVO.java
| 1 | -package com.zteits.urbanops.module.workorder.controller.app.garden.vo; | |
| 1 | +package com.zteits.urbanops.module.workorder.dto; | |
| 2 | 2 | |
| 3 | -import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoRespVO; | |
| 4 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 4 | import lombok.Data; |
| 6 | 5 | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoRespVO.java renamed to urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/MainInfoRespVO.java
| 1 | -package com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo; | |
| 1 | +package com.zteits.urbanops.module.workorder.dto; | |
| 2 | 2 | |
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 3 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.*; | |
| 5 | -import java.util.*; | |
| 6 | -import java.math.BigDecimal; | |
| 6 | +import lombok.Data; | |
| 7 | 7 | |
| 8 | -import org.hibernate.validator.constraints.Length; | |
| 9 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.math.BigDecimal; | |
| 10 | 9 | import java.time.LocalDateTime; |
| 11 | -import cn.idev.excel.annotation.*; | |
| 10 | +import java.util.List; | |
| 11 | +import java.util.Set; | |
| 12 | 12 | |
| 13 | 13 | @Schema(description = "管理后台 - 工单信息 Response VO") |
| 14 | 14 | @Data | ... | ... |
urbanops-module-garden/pom.xml
| ... | ... | @@ -129,7 +129,19 @@ |
| 129 | 129 | <dependency> |
| 130 | 130 | <groupId>com.zteits.boot</groupId> |
| 131 | 131 | <artifactId>urbanops-module-bpm</artifactId> |
| 132 | - <version>2025.10-SNAPSHOT</version> | |
| 132 | + <version>${revision}</version> | |
| 133 | + <scope>compile</scope> | |
| 134 | + </dependency> | |
| 135 | + <dependency> | |
| 136 | + <groupId>com.zteits.boot</groupId> | |
| 137 | + <artifactId>urbanops-module-workorder-api</artifactId> | |
| 138 | + <version>${revision}</version> | |
| 139 | + <scope>compile</scope> | |
| 140 | + </dependency> | |
| 141 | + <dependency> | |
| 142 | + <groupId>com.zteits.boot</groupId> | |
| 143 | + <artifactId>urbanops-module-garden-api</artifactId> | |
| 144 | + <version>${revision}</version> | |
| 133 | 145 | <scope>compile</scope> |
| 134 | 146 | </dependency> |
| 135 | 147 | </dependencies> | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/material/MaterialApiImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.api.material; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | -import com.zteits.urbanops.module.garden.api.material.dto.MaterialInventoryOutDto; | |
| 5 | 4 | import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.MaterialInventoryOutSaveReqVO; |
| 5 | +import com.zteits.urbanops.module.garden.dto.material.MaterialInventoryOutDto; | |
| 6 | 6 | import com.zteits.urbanops.module.garden.service.materialinventoryout.MaterialInventoryOutService; |
| 7 | 7 | import jakarta.annotation.Resource; |
| 8 | 8 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -16,7 +16,7 @@ import org.springframework.validation.annotation.Validated; |
| 16 | 16 | */ |
| 17 | 17 | @Service |
| 18 | 18 | @Validated |
| 19 | -public class MaterialApiImpl implements MaterialApi{ | |
| 19 | +public class MaterialApiImpl implements MaterialApi { | |
| 20 | 20 | |
| 21 | 21 | @Resource |
| 22 | 22 | private MaterialInventoryOutService materialInventoryOutService; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/road/RoadApi.java deleted
| 1 | -package com.zteits.urbanops.module.garden.api.road; | |
| 2 | - | |
| 3 | -import com.zteits.urbanops.module.garden.api.road.dto.RoadReqDTO; | |
| 4 | -import com.zteits.urbanops.module.garden.api.road.dto.RoadRespDTO; | |
| 5 | -import com.zteits.urbanops.module.garden.api.road.dto.RoadStreetRespDTO; | |
| 6 | - | |
| 7 | -import java.util.List; | |
| 8 | - | |
| 9 | -/** | |
| 10 | - * @author yanhuiqing | |
| 11 | - * @version 1.0 | |
| 12 | - * @description: 道路api 通过经纬度 系统编码获取道路信息 | |
| 13 | - * @date 2025/12/9 22:12 | |
| 14 | - */ | |
| 15 | -public interface RoadApi { | |
| 16 | - public List<RoadRespDTO> getRoadInfoBy(RoadReqDTO reqDTO); | |
| 17 | - | |
| 18 | - public RoadStreetRespDTO getRoadInfoById(Long id); | |
| 19 | -} |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/road/RoadApiImpl.java
| ... | ... | @@ -5,10 +5,10 @@ import cn.hutool.json.JSONUtil; |
| 5 | 5 | import com.alibaba.fastjson.JSON; |
| 6 | 6 | import com.zteits.urbanops.framework.common.util.http.HttpUtils; |
| 7 | 7 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 8 | -import com.zteits.urbanops.module.garden.api.road.dto.RoadReqDTO; | |
| 9 | -import com.zteits.urbanops.module.garden.api.road.dto.RoadRespDTO; | |
| 10 | -import com.zteits.urbanops.module.garden.api.road.dto.RoadStreetRespDTO; | |
| 11 | 8 | import com.zteits.urbanops.module.garden.controller.admin.road.vo.RoadRespVO; |
| 9 | +import com.zteits.urbanops.module.garden.dto.road.RoadReqDTO; | |
| 10 | +import com.zteits.urbanops.module.garden.dto.road.RoadRespDTO; | |
| 11 | +import com.zteits.urbanops.module.garden.dto.road.RoadStreetRespDTO; | |
| 12 | 12 | import com.zteits.urbanops.module.garden.service.road.RoadService; |
| 13 | 13 | import jakarta.annotation.Resource; |
| 14 | 14 | import lombok.extern.slf4j.Slf4j; |
| ... | ... | @@ -29,7 +29,7 @@ import java.util.stream.Collectors; |
| 29 | 29 | */ |
| 30 | 30 | @Slf4j |
| 31 | 31 | @Service |
| 32 | -public class RoadApiImpl implements RoadApi{ | |
| 32 | +public class RoadApiImpl implements RoadApi { | |
| 33 | 33 | |
| 34 | 34 | @Value("${siot.roadUrl}") |
| 35 | 35 | private String roadInfoUrl; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanCommitRespVO.java
| ... | ... | @@ -17,6 +17,13 @@ public class InspectionPlanCommitRespVO { |
| 17 | 17 | @ExcelProperty("计划编码") |
| 18 | 18 | private String planNo; |
| 19 | 19 | |
| 20 | + /** | |
| 21 | + * 排序号:第n次计划提交 | |
| 22 | + */ | |
| 23 | + @Schema(description = "排序号") | |
| 24 | + @ExcelProperty("排序号") | |
| 25 | + private Integer sortNum; | |
| 26 | + | |
| 20 | 27 | @Schema(description = "计划名称") |
| 21 | 28 | @ExcelProperty("计划名称") |
| 22 | 29 | private String planName; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/MaintainPlanCommitController.java
| ... | ... | @@ -83,8 +83,9 @@ public class MaintainPlanCommitController { |
| 83 | 83 | @Operation(summary = "获取养护计划-共同处理人明细") |
| 84 | 84 | @Parameter(name = "plan_no", description = "计划编号", required = true, example = "1024") |
| 85 | 85 | @PreAuthorize("@ss.hasPermission('garden:maintain-plan-commit:query')") |
| 86 | - public CommonResult<List<MaintainPlanCommitDetailRespVO>> getMaintainPlanCommitDetailByPlanNo(@RequestParam("plan_no") String planNo) { | |
| 87 | - return success( maintainPlanCommitService.getMaintainPlanCommitDetailByPlanNo(planNo)); | |
| 86 | + public CommonResult<List<MaintainPlanCommitDetailRespVO>> getMaintainPlanCommitDetailByPlanNo(@RequestParam("plan_no") String planNo, | |
| 87 | + @RequestParam(value="sort_num", required = false) String sortNum) { | |
| 88 | + return success( maintainPlanCommitService.getMaintainPlanCommitDetailByPlanNo(planNo, sortNum)); | |
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | @GetMapping("/page") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanCommitDetailRespVO.java
| ... | ... | @@ -40,13 +40,6 @@ public class MaintainPlanCommitDetailRespVO { |
| 40 | 40 | @ExcelProperty("备注") |
| 41 | 41 | private String remark; |
| 42 | 42 | |
| 43 | - @Schema(description = "总完成百分比", example = "98.00") | |
| 44 | - private Integer totalFinishNum; | |
| 45 | - | |
| 46 | - @Schema(description = "本次完成百分比", example = "98.00") | |
| 47 | - @ExcelProperty("本次完成百分比") | |
| 48 | - private Integer finishPercent; | |
| 49 | - | |
| 50 | 43 | @Schema(description = "照片host", example = "aaa") |
| 51 | 44 | @ExcelProperty("照片host") |
| 52 | 45 | private String imgHost; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanCommitRespVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo; |
| 2 | 2 | |
| 3 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 4 | +import com.zteits.urbanops.framework.mybatis.core.type.StringListTypeHandler; | |
| 3 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 6 | import lombok.*; |
| 5 | 7 | |
| 6 | 8 | import java.time.LocalDateTime; |
| 9 | +import java.util.List; | |
| 7 | 10 | |
| 8 | 11 | import cn.idev.excel.annotation.*; |
| 9 | 12 | |
| ... | ... | @@ -67,14 +70,15 @@ public class MaintainPlanCommitRespVO { |
| 67 | 70 | @ExcelProperty("养护类型") |
| 68 | 71 | private Integer planTypeId; |
| 69 | 72 | |
| 70 | - @Schema(description = "本次完成百分比") | |
| 71 | - @ExcelProperty("本次完成百分比") | |
| 72 | - private Integer finishPercent; | |
| 73 | - | |
| 74 | 73 | @Schema(description = "完成次数") |
| 75 | 74 | @ExcelProperty("完成次数") |
| 76 | 75 | private Integer planFinishNum; |
| 77 | 76 | |
| 77 | + @Schema(description = "照片") | |
| 78 | + @ExcelProperty("照片") | |
| 79 | + @TableField(typeHandler = StringListTypeHandler.class) | |
| 80 | + private List<String> beginImgList; | |
| 81 | + | |
| 78 | 82 | @Schema(description = "完成时间") |
| 79 | 83 | @ExcelProperty("完成时间") |
| 80 | 84 | private LocalDateTime finishTime; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanDetailReqVO.java
| ... | ... | @@ -20,10 +20,10 @@ public class AppInspectionPlanDetailReqVO { |
| 20 | 20 | @NotBlank(message = "批次号不能为空") |
| 21 | 21 | private String batchNo; |
| 22 | 22 | |
| 23 | - @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 23 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效;4:已终止") | |
| 24 | 24 | @NotNull(message = "完成状态不能为空") |
| 25 | 25 | @Min(value = 1, message = "状态最小为1") |
| 26 | - @Max(value = 3, message = "状态不能大于4") | |
| 26 | + @Max(value = 4, message = "状态不能大于4") | |
| 27 | 27 | private Integer finishState; |
| 28 | 28 | |
| 29 | 29 | @Schema(description = "公司ID") |
| ... | ... | @@ -34,8 +34,13 @@ public class AppInspectionPlanDetailReqVO { |
| 34 | 34 | @Hidden |
| 35 | 35 | private List<String> busiLineList; |
| 36 | 36 | |
| 37 | - @Schema(description = "系统时间") | |
| 37 | + @Schema(description = "部门") | |
| 38 | + @Hidden | |
| 39 | + private Long deptId; | |
| 40 | + | |
| 41 | + @Schema(description = "开始时间") | |
| 38 | 42 | @Hidden |
| 39 | 43 | private LocalDateTime localDateTime; |
| 44 | + | |
| 40 | 45 | } |
| 41 | 46 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanPageReqVO.java
| ... | ... | @@ -8,7 +8,7 @@ import jakarta.validation.constraints.Min; |
| 8 | 8 | import jakarta.validation.constraints.NotNull; |
| 9 | 9 | import lombok.Data; |
| 10 | 10 | |
| 11 | -import java.time.LocalDate; | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | 12 | import java.util.List; |
| 13 | 13 | import java.util.Set; |
| 14 | 14 | |
| ... | ... | @@ -19,22 +19,27 @@ public class AppInspectionPlanPageReqVO extends PageParam { |
| 19 | 19 | @Schema(description = "道路名称", example = "赵六") |
| 20 | 20 | private String roadName; |
| 21 | 21 | |
| 22 | - @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 22 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效;4:已终止") | |
| 23 | 23 | @NotNull(message = "完成状态不能为空") |
| 24 | 24 | @Min(value = 1, message = "状态最小为1") |
| 25 | - @Max(value = 3, message = "状态不能大于4") | |
| 25 | + @Max(value = 4, message = "状态不能大于4") | |
| 26 | 26 | private Integer finishState; |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | @Schema(description = "批次号列表") |
| 30 | 30 | @Hidden |
| 31 | - private Set<String> batchNos; | |
| 31 | + private Set<Long> roleIds; | |
| 32 | 32 | |
| 33 | 33 | @Schema(description = "业务线") |
| 34 | 34 | @Hidden |
| 35 | 35 | private List<String> busiLineList; |
| 36 | 36 | |
| 37 | + @Schema(description = "部门") | |
| 38 | + @Hidden | |
| 39 | + private Long deptId; | |
| 40 | + | |
| 37 | 41 | @Schema(description = "系统时间") |
| 38 | 42 | @Hidden |
| 39 | - private LocalDate localDate; | |
| 43 | + private LocalDateTime localDateTime; | |
| 44 | + | |
| 40 | 45 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanCommitDetailPageRespVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; |
| 2 | 2 | |
| 3 | 3 | import cn.idev.excel.annotation.ExcelProperty; |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import com.zteits.urbanops.framework.mybatis.core.type.StringListTypeHandler; | |
| 4 | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 7 | import lombok.Data; |
| 6 | 8 | |
| ... | ... | @@ -42,9 +44,7 @@ public class AppMaintainPlanCommitDetailPageRespVO { |
| 42 | 44 | private String imgHost; |
| 43 | 45 | |
| 44 | 46 | @Schema(description = "开始照片") |
| 45 | - private String beginImg; | |
| 46 | - | |
| 47 | - @Schema(description = "开始照片") | |
| 47 | + @TableField(typeHandler = StringListTypeHandler.class) | |
| 48 | 48 | private List<String> beginImgList; |
| 49 | 49 | |
| 50 | 50 | /** |
| ... | ... | @@ -56,9 +56,6 @@ public class AppMaintainPlanCommitDetailPageRespVO { |
| 56 | 56 | */ |
| 57 | 57 | private Double opTime; |
| 58 | 58 | |
| 59 | - @Schema(description = "完成百分比", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 60 | - private Integer finishPercent; | |
| 61 | - | |
| 62 | 59 | @Schema(description = "完成状态 1:未完成;2:进行中;3:已完成", requiredMode = Schema.RequiredMode.REQUIRED) |
| 63 | 60 | private Integer finishState; |
| 64 | 61 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanCommitSaveReqVO.java
| ... | ... | @@ -16,10 +16,6 @@ public class AppMaintainPlanCommitSaveReqVO { |
| 16 | 16 | @NotEmpty(message = "计划编码不能为空") |
| 17 | 17 | private String planNo; |
| 18 | 18 | |
| 19 | - @Schema(description = "本次总完成百分比", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 20 | - @NotNull(message = "本次总完成百分比不能为空") | |
| 21 | - private Integer totalFinishPercent; | |
| 22 | - | |
| 23 | 19 | @Schema(description = "照片host", requiredMode = Schema.RequiredMode.REQUIRED) |
| 24 | 20 | @NotEmpty(message = "照片host不能为空") |
| 25 | 21 | private String imgHost; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanDetailListByRoadPageReqVO.java
| ... | ... | @@ -23,24 +23,21 @@ public class AppMaintainPlanDetailListByRoadPageReqVO extends PageParam { |
| 23 | 23 | @NotNull |
| 24 | 24 | private Long roadId; |
| 25 | 25 | |
| 26 | - @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 26 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效;4:终止") | |
| 27 | 27 | @NotNull(message = "完成状态不能为空") |
| 28 | 28 | @Min(value = 1, message = "状态最小为1") |
| 29 | - @Max(value = 3, message = "状态不能大于4") | |
| 29 | + @Max(value = 4, message = "状态不能大于4") | |
| 30 | 30 | private Integer finishState; |
| 31 | 31 | |
| 32 | 32 | @Schema(description = "计划名称") |
| 33 | 33 | private String planName; |
| 34 | 34 | |
| 35 | -// @Schema(description = "计划批次号列表") | |
| 36 | -// @Hidden | |
| 37 | -// private Set<String> batchNos; | |
| 38 | 35 | |
| 39 | 36 | @Schema(description = "业务线") |
| 40 | 37 | @Hidden |
| 41 | 38 | private List<String> busiLineList; |
| 42 | 39 | |
| 43 | - @Schema(description = "系统时间") | |
| 44 | - @Hidden | |
| 40 | + @Schema(description = "开始时间") | |
| 45 | 41 | private LocalDateTime localDateTime; |
| 42 | + | |
| 46 | 43 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPagePlanTypeReqVO.java
| ... | ... | @@ -30,20 +30,25 @@ public class AppMaintainPlanPagePlanTypeReqVO extends PageParam { |
| 30 | 30 | @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") |
| 31 | 31 | @NotNull(message = "完成状态不能为空") |
| 32 | 32 | @Min(value = 1, message = "状态最小为1") |
| 33 | - @Max(value = 3, message = "状态不能大于4") | |
| 33 | + @Max(value = 4, message = "状态不能大于4") | |
| 34 | 34 | private Integer finishState; |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | @Schema(description = "计划批次号列表") |
| 38 | 38 | @Hidden |
| 39 | - private Set<String> batchNos; | |
| 39 | + private Set<Long> roleIds; | |
| 40 | 40 | |
| 41 | 41 | @Schema(description = "业务线") |
| 42 | 42 | @Hidden |
| 43 | 43 | private List<String> busiLineList; |
| 44 | 44 | |
| 45 | - @Schema(description = "系统时间") | |
| 45 | + @Schema(description = "部门id") | |
| 46 | + @Hidden | |
| 47 | + private Long deptId; | |
| 48 | + | |
| 49 | + @Schema(description = "开始时间") | |
| 46 | 50 | @Hidden |
| 47 | 51 | private LocalDateTime localDateTime; |
| 48 | 52 | |
| 53 | + | |
| 49 | 54 | } |
| 50 | 55 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPageRoadReqVO.java
| ... | ... | @@ -8,7 +8,7 @@ import jakarta.validation.constraints.Min; |
| 8 | 8 | import jakarta.validation.constraints.NotNull; |
| 9 | 9 | import lombok.Data; |
| 10 | 10 | |
| 11 | -import java.time.LocalDate; | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | 12 | import java.util.List; |
| 13 | 13 | import java.util.Set; |
| 14 | 14 | |
| ... | ... | @@ -23,23 +23,29 @@ public class AppMaintainPlanPageRoadReqVO extends PageParam { |
| 23 | 23 | * 完成状态 1:未完成;2:已完成;3:已失效 |
| 24 | 24 | * @see com.zteits.urbanops.module.garden.enums.FinishStateEnum |
| 25 | 25 | */ |
| 26 | - @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 26 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效;4:已终止") | |
| 27 | 27 | @NotNull(message = "完成状态不能为空") |
| 28 | 28 | @Min(value = 1, message = "状态最小为1") |
| 29 | - @Max(value = 3, message = "状态不能大于4") | |
| 29 | + @Max(value = 4, message = "状态不能大于4") | |
| 30 | 30 | private Integer finishState; |
| 31 | 31 | |
| 32 | 32 | |
| 33 | - @Schema(description = "批次号") | |
| 33 | + @Schema(description = "角色id列表") | |
| 34 | 34 | @Hidden |
| 35 | - private Set<String> batchNos; | |
| 35 | + private Set<Long> roleIds; | |
| 36 | 36 | |
| 37 | 37 | @Schema(description = "业务线") |
| 38 | 38 | @Hidden |
| 39 | 39 | private List<String> busiLineList; |
| 40 | 40 | |
| 41 | - @Schema(description = "系统时间") | |
| 41 | + @Schema(description = "部门id") | |
| 42 | 42 | @Hidden |
| 43 | - private LocalDate localDate; | |
| 43 | + private Long deptId; | |
| 44 | + | |
| 45 | + @Schema(description = "当前时间") | |
| 46 | + @Hidden | |
| 47 | + private LocalDateTime localDateTime; | |
| 48 | + | |
| 49 | + | |
| 44 | 50 | |
| 45 | 51 | } |
| 46 | 52 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPageRoadRespVO.java
| ... | ... | @@ -35,10 +35,10 @@ public class AppMaintainPlanPageRoadRespVO{ |
| 35 | 35 | @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "8588") |
| 36 | 36 | private Integer levelId; |
| 37 | 37 | |
| 38 | - @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效") | |
| 38 | + @Schema(description = "完成状态 1:未完成;2:已完成;3:已失效;4:已终止") | |
| 39 | 39 | @NotNull(message = "完成状态不能为空") |
| 40 | 40 | @Min(value = 1, message = "状态最小为1") |
| 41 | - @Max(value = 3, message = "状态不能大于4") | |
| 41 | + @Max(value = 4, message = "状态不能大于5") | |
| 42 | 42 | private Integer finishState; |
| 43 | 43 | |
| 44 | 44 | @Schema(description = "计划次数", requiredMode = Schema.RequiredMode.REQUIRED) |
| ... | ... | @@ -50,11 +50,9 @@ public class AppMaintainPlanPageRoadRespVO{ |
| 50 | 50 | private Integer planFinishNum; |
| 51 | 51 | |
| 52 | 52 | @Schema(description = "执行开始时间") |
| 53 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 54 | 53 | private LocalDate beginTime; |
| 55 | 54 | |
| 56 | 55 | @Schema(description = "执行时间") |
| 57 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 58 | 56 | private LocalDate endTime; |
| 59 | 57 | |
| 60 | 58 | } |
| 61 | 59 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/convert/AppGardenWorkOrderConvert.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.convert; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanCommitSaveReqVO; | |
| 4 | +import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; | |
| 5 | +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; | |
| 6 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.factory.Mappers; | |
| 9 | + | |
| 10 | +import java.math.BigDecimal; | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | + | |
| 13 | +@Mapper | |
| 14 | +public interface AppGardenWorkOrderConvert { | |
| 15 | + | |
| 16 | + public static final AppGardenWorkOrderConvert INSTANCE = Mappers.getMapper(AppGardenWorkOrderConvert.class); | |
| 17 | + | |
| 18 | + default AppGardenWorkOrderReqVO buildAppGardenWorkOrderReqVO(AppInspectionPlanCommitSaveReqVO createReqVO, InspectionPlanDO inspectionPlanDO, RoadDO roadDO, String planNo ) { | |
| 19 | + AppGardenWorkOrderReqVO orderReqVO = new AppGardenWorkOrderReqVO(); | |
| 20 | + orderReqVO.setRoadId(inspectionPlanDO.getRoadId()); | |
| 21 | + orderReqVO.setRoadName(inspectionPlanDO.getRoadName()); | |
| 22 | + orderReqVO.setImgs(createReqVO.getImgList()); | |
| 23 | + orderReqVO.setRemark(createReqVO.getRemark()); | |
| 24 | + orderReqVO.setPressingType(2);//紧急 | |
| 25 | + orderReqVO.setOrderName(inspectionPlanDO.getPlanName()); | |
| 26 | + orderReqVO.setSourceId(1);//来源ID 工单来源 1、巡查 | |
| 27 | + orderReqVO.setSourceName("园林巡查上报"); | |
| 28 | + orderReqVO.setThirdWorkNo(planNo); | |
| 29 | + orderReqVO.setFinishDate(LocalDateTime.now()); | |
| 30 | + orderReqVO.setBusiLine(inspectionPlanDO.getBusiLine()); | |
| 31 | + orderReqVO.setLatLonType(3); | |
| 32 | + orderReqVO.setLat(new BigDecimal(roadDO.getStartingLatitude())); | |
| 33 | + orderReqVO.setLon(new BigDecimal(roadDO.getStartingLongitude())); | |
| 34 | + orderReqVO.setLonLatAddress(roadDO.getStartingRemark()); | |
| 35 | + return orderReqVO; | |
| 36 | + } | |
| 37 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainplan/MaintainPlanCommitDO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainplan/MaintainPlanCommitMapper.java
| ... | ... | @@ -36,10 +36,4 @@ public interface MaintainPlanCommitMapper extends BaseMapperX<MaintainPlanCommit |
| 36 | 36 | */ |
| 37 | 37 | IPage<AppMaintainPlanCommitDetailPageRespVO> appMaintainPlanCommitDetailPage(@Param("page") IPage<AppMaintainPlanCommitDetailPageRespVO> page, @Param("req") AppMaintainPlanCommitPageReqVO pageReqVO); |
| 38 | 38 | |
| 39 | - /** | |
| 40 | - * 获取所有已完成比例 | |
| 41 | - * | |
| 42 | - * @return | |
| 43 | - */ | |
| 44 | - int selectFinishPercent(@Param("planNo") String planNo, @Param("sortNum") Integer sortNum); | |
| 45 | 39 | } |
| 46 | 40 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/FinishStateEnum.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanCommitServiceImpl.java
| ... | ... | @@ -14,16 +14,24 @@ import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.Insp |
| 14 | 14 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanCommitSaveReqVO; |
| 15 | 15 | import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanCommitRespVO; |
| 16 | 16 | import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanCommitSaveReqVO; |
| 17 | +import com.zteits.urbanops.module.garden.convert.AppGardenWorkOrderConvert; | |
| 17 | 18 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanCommitDO; |
| 18 | 19 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; |
| 19 | 20 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 21 | +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; | |
| 20 | 22 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanCommitMapper; |
| 21 | 23 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanDetailMapper; |
| 22 | 24 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanMapper; |
| 25 | +import com.zteits.urbanops.module.garden.dal.mysql.road.RoadMapper; | |
| 26 | +import com.zteits.urbanops.module.garden.enums.FinishStateEnum; | |
| 23 | 27 | import com.zteits.urbanops.module.system.api.dept.DeptApi; |
| 24 | 28 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 25 | 29 | import com.zteits.urbanops.module.system.api.permission.RoleApi; |
| 30 | +import com.zteits.urbanops.module.workorder.api.WorkOrderApi; | |
| 31 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | |
| 32 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; | |
| 26 | 33 | import jakarta.annotation.Resource; |
| 34 | +import lombok.extern.slf4j.Slf4j; | |
| 27 | 35 | import org.apache.commons.lang3.StringUtils; |
| 28 | 36 | import org.springframework.stereotype.Service; |
| 29 | 37 | import org.springframework.transaction.annotation.Transactional; |
| ... | ... | @@ -45,6 +53,7 @@ import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.INSPECT |
| 45 | 53 | */ |
| 46 | 54 | @Service |
| 47 | 55 | @Validated |
| 56 | +@Slf4j | |
| 48 | 57 | public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitService { |
| 49 | 58 | |
| 50 | 59 | @Resource |
| ... | ... | @@ -57,10 +66,13 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 57 | 66 | private InspectionPlanDetailMapper inspectionPlanDetailMapper; |
| 58 | 67 | |
| 59 | 68 | @Resource |
| 69 | + private RoadMapper roadMapper; | |
| 70 | + | |
| 71 | + @Resource | |
| 60 | 72 | private DeptApi deptApi; |
| 61 | 73 | |
| 62 | 74 | @Resource |
| 63 | - private RoleApi roleApi; | |
| 75 | + private WorkOrderApi workOrderApi; | |
| 64 | 76 | |
| 65 | 77 | @Override |
| 66 | 78 | public Long createInspectionPlanCommit(InspectionPlanCommitSaveReqVO createReqVO) { |
| ... | ... | @@ -86,21 +98,23 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 86 | 98 | if(null == inspectionPlanDO){ |
| 87 | 99 | throw exception(INSPECTION_PLAN_NOT_EXISTS); |
| 88 | 100 | } |
| 101 | + /*3.转工单*/ | |
| 102 | + String orderNO = addWorkOrder(createReqVO, inspectionPlanDO); | |
| 89 | 103 | |
| 90 | 104 | InspectionPlanCommitDO inspectionPlanCommit = getInspectionPlanCommitDO(createReqVO, inspectionPlanDO); |
| 91 | - | |
| 92 | - /*3.查询计划明细最大次数*/ | |
| 105 | + inspectionPlanCommit.setTransWorkNo(orderNO); | |
| 106 | + /*4.查询计划明细最大次数*/ | |
| 93 | 107 | Long countNum = inspectionPlanCommitMapper.selectCount(new QueryWrapper<InspectionPlanCommitDO>().lambda() |
| 94 | 108 | .eq(InspectionPlanCommitDO::getPlanNo, createReqVO.getPlanNo())); |
| 95 | 109 | |
| 96 | 110 | inspectionPlanCommit.setSortNum(countNum.intValue() + 1); |
| 97 | - /*4.插入明细*/ | |
| 111 | + /*5.插入明细*/ | |
| 98 | 112 | inspectionPlanCommitMapper.insert(inspectionPlanCommit); |
| 99 | 113 | |
| 100 | 114 | Integer detailFinishNum = inspectionPlanDetailDO.getPlanFinishNum() + 1; |
| 101 | - int detailFinishState = 1; | |
| 115 | + int detailFinishState = FinishStateEnum.NOT_FINISHED.getStatus(); | |
| 102 | 116 | if(detailFinishNum.equals(inspectionPlanDetailDO.getPlanNum())){ |
| 103 | - detailFinishState = 2; | |
| 117 | + detailFinishState = FinishStateEnum.FINISHED.getStatus(); | |
| 104 | 118 | } |
| 105 | 119 | LambdaUpdateWrapper<InspectionPlanDetailDO> detailUpdateSql = new LambdaUpdateWrapper<InspectionPlanDetailDO>() |
| 106 | 120 | .set(InspectionPlanDetailDO::getPlanFinishNum, detailFinishNum) |
| ... | ... | @@ -110,9 +124,9 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 110 | 124 | inspectionPlanDetailMapper.update(detailUpdateSql); |
| 111 | 125 | |
| 112 | 126 | Integer planFinishNum = inspectionPlanDO.getPlanFinishNum() + 1; |
| 113 | - int planFinishState = 1; | |
| 127 | + int planFinishState = FinishStateEnum.NOT_FINISHED.getStatus(); | |
| 114 | 128 | if(planFinishNum.equals(inspectionPlanDO.getPlanNum())){ |
| 115 | - planFinishState = 2; | |
| 129 | + planFinishState = FinishStateEnum.FINISHED.getStatus(); | |
| 116 | 130 | } |
| 117 | 131 | LambdaUpdateWrapper<InspectionPlanDO> updateSql = new LambdaUpdateWrapper<InspectionPlanDO>() |
| 118 | 132 | .set(InspectionPlanDO::getPlanFinishNum, planFinishNum) |
| ... | ... | @@ -124,6 +138,25 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 124 | 138 | return 1L; |
| 125 | 139 | } |
| 126 | 140 | |
| 141 | + /** | |
| 142 | + * 转工单 | |
| 143 | + * @param createReqVO | |
| 144 | + * @param inspectionPlanDO | |
| 145 | + * @return | |
| 146 | + */ | |
| 147 | + private String addWorkOrder(AppInspectionPlanCommitSaveReqVO createReqVO, InspectionPlanDO inspectionPlanDO) { | |
| 148 | + //转交状态: 1:未转交;2:已转交 | |
| 149 | + if (createReqVO.getTransState().equals(1)) { | |
| 150 | + return null; | |
| 151 | + } | |
| 152 | + //查询道路信息 | |
| 153 | + RoadDO roadDO = roadMapper.selectOne(RoadDO::getId, inspectionPlanDO.getRoadId()); | |
| 154 | + AppGardenWorkOrderReqVO appGardenWorkOrderReqVO = AppGardenWorkOrderConvert.INSTANCE.buildAppGardenWorkOrderReqVO(createReqVO, inspectionPlanDO, roadDO, createReqVO.getPlanNo()); | |
| 155 | + AppGardenWorkOrderRespVO workOrder = workOrderApi.createWorkOrder(appGardenWorkOrderReqVO); | |
| 156 | + log.info("创建工单结果:{}", JSONObject.toJSONString(workOrder)); | |
| 157 | + return workOrder.getOrderNo(); | |
| 158 | + } | |
| 159 | + | |
| 127 | 160 | private static InspectionPlanCommitDO getInspectionPlanCommitDO(AppInspectionPlanCommitSaveReqVO createReqVO, InspectionPlanDO inspectionPlanDO) { |
| 128 | 161 | LocalDateTime now = LocalDateTime.now(); |
| 129 | 162 | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| ... | ... | @@ -242,11 +275,5 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 242 | 275 | }); |
| 243 | 276 | } |
| 244 | 277 | |
| 245 | -// private List<InspectionPlanCommitRespVO> imgProcess(List<InspectionPlanCommitRespVO> list) { | |
| 246 | -// list.forEach(e -> { | |
| 247 | -// e.setImgList(StrUtils.imgProcess(e.getImg(), "")); | |
| 248 | -// }); | |
| 249 | -// return list; | |
| 250 | -// } | |
| 251 | 278 | |
| 252 | 279 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanDetailServiceImpl.java
| ... | ... | @@ -100,6 +100,7 @@ public class InspectionPlanDetailServiceImpl implements InspectionPlanDetailServ |
| 100 | 100 | pageReqVO.setBusiLineList(Arrays.asList(busiLine.split(","))); |
| 101 | 101 | } |
| 102 | 102 | pageReqVO.setCompanyId(companyId); |
| 103 | + pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | |
| 103 | 104 | pageReqVO.setLocalDateTime(LocalDateTime.now()); |
| 104 | 105 | |
| 105 | 106 | /*2.明细*/ | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| ... | ... | @@ -52,7 +52,6 @@ import java.util.stream.Collectors; |
| 52 | 52 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 53 | 53 | import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; |
| 54 | 54 | import static com.zteits.urbanops.module.garden.enums.PlanConstants.CYCLE_ID_TYPE; |
| 55 | -import static javax.management.Query.eq; | |
| 56 | 55 | |
| 57 | 56 | /** |
| 58 | 57 | * 巡检计划汇总 Service 实现类 |
| ... | ... | @@ -365,13 +364,13 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 365 | 364 | } |
| 366 | 365 | |
| 367 | 366 | /*1.查询登录用户角色*/ |
| 368 | - Set<String> batchNos = this.getBatchNosByLoginUserId(); | |
| 369 | - if(CollectionUtils.isEmpty(batchNos)){ | |
| 370 | - return PageResult.empty(); | |
| 367 | + List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 368 | + if (CollectionUtils.isEmpty(roleIds)) { | |
| 369 | + return new PageResult<>(null, 0L); | |
| 371 | 370 | } |
| 372 | - | |
| 373 | - pageReqVO.setBatchNos(batchNos); | |
| 374 | - pageReqVO.setLocalDate(LocalDate.now()); | |
| 371 | + pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | |
| 372 | + pageReqVO.setRoleIds(new HashSet<>(roleIds)); | |
| 373 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 375 | 374 | /*2.分页*/ |
| 376 | 375 | IPage<AppInspectionPlanRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 377 | 376 | IPage<AppInspectionPlanRespVO> page = inspectionPlanMapper.getInspectionPlanAppPage(mpPage, pageReqVO); |
| ... | ... | @@ -400,29 +399,6 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 400 | 399 | }); |
| 401 | 400 | } |
| 402 | 401 | |
| 403 | - /** | |
| 404 | - * 获取登录用户批次号List | |
| 405 | - */ | |
| 406 | - private Set<String> getBatchNosByLoginUserId() { | |
| 407 | - Long companyId = SecurityFrameworkUtils.getCompanyId(); | |
| 408 | - Long deptId = SecurityFrameworkUtils.getDeptId(); | |
| 409 | - /*1.查询登录用户角色*/ | |
| 410 | - List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 411 | - if (CollectionUtils.isEmpty(roleIds)) { | |
| 412 | - return Collections.emptySet(); | |
| 413 | - } | |
| 414 | - QueryWrapper<InspectionPlanRoleDO> roleSql = new QueryWrapper<>(); | |
| 415 | - roleSql.select("batch_no"); | |
| 416 | - roleSql.lambda().in(InspectionPlanRoleDO::getRoleId, roleIds). | |
| 417 | - eq(InspectionPlanRoleDO::getCompanyId, companyId) | |
| 418 | - .eq(InspectionPlanRoleDO::getDeptId, deptId); | |
| 419 | - List<InspectionPlanRoleDO> roleList = inspectionPlanRoleMapper.selectList(roleSql); | |
| 420 | - if (CollectionUtils.isEmpty(roleList)) { | |
| 421 | - return Collections.emptySet(); | |
| 422 | - } | |
| 423 | - return roleList.stream().map(InspectionPlanRoleDO::getBatchNo).collect(Collectors.toSet()); | |
| 424 | - } | |
| 425 | - | |
| 426 | 402 | @Override |
| 427 | 403 | public void updateExpiredInspectionPlans() { |
| 428 | 404 | // 更新过期的计划状态为过期(3) | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanCommitService.java
| ... | ... | @@ -70,7 +70,7 @@ public interface MaintainPlanCommitService { |
| 70 | 70 | * @param planNo 计划编号 |
| 71 | 71 | * @return 养护计划明细列表 |
| 72 | 72 | */ |
| 73 | - List<MaintainPlanCommitDetailRespVO> getMaintainPlanCommitDetailByPlanNo(String planNo); | |
| 73 | + List<MaintainPlanCommitDetailRespVO> getMaintainPlanCommitDetailByPlanNo(String planNo, String sortNum); | |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * 获得养护计划明细分页 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanCommitServiceImpl.java
| ... | ... | @@ -94,9 +94,8 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 94 | 94 | throw exception(MAINTAIN_PLAN_NOT_EXISTS); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | + //排序号 | |
| 97 | 98 | int sortNum = maintainPlanDetailDO.getPlanFinishNum() +1; |
| 98 | - /*3.查询已完成比例*/ | |
| 99 | -// int finishPercent = maintainPlanCommitMapper.selectFinishPercent(createReqVO.getPlanNo(), sortNum); | |
| 100 | 99 | |
| 101 | 100 | MaintainPlanCommitDO commitDO = new MaintainPlanCommitDO(); |
| 102 | 101 | commitDO.setBatchNo(maintainPlanDO.getBatchNo()); |
| ... | ... | @@ -108,7 +107,6 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 108 | 107 | commitDO.setCompanyId(maintainPlanDO.getCompanyId()); |
| 109 | 108 | commitDO.setDeptId(maintainPlanDO.getDeptId()); |
| 110 | 109 | commitDO.setRoadId(maintainPlanDO.getRoadId()); |
| 111 | - commitDO.setFinishPercent(createReqVO.getTotalFinishPercent()); | |
| 112 | 110 | commitDO.setImgHost(createReqVO.getImgHost()); |
| 113 | 111 | commitDO.setBeginImg(JSONObject.toJSONString(createReqVO.getBeginImg())); |
| 114 | 112 | commitDO.setProcessImg("[]"); |
| ... | ... | @@ -145,40 +143,34 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 145 | 143 | } |
| 146 | 144 | |
| 147 | 145 | |
| 148 | - int detailFinishNum = maintainPlanDetailDO.getPlanFinishNum(); | |
| 149 | - if(createReqVO.getTotalFinishPercent().equals(100)){ | |
| 150 | - detailFinishNum = detailFinishNum + 1; | |
| 151 | - } | |
| 152 | - | |
| 146 | + int detailFinishNum = maintainPlanDetailDO.getPlanFinishNum() + 1; | |
| 153 | 147 | //完成状态 1:未完成;2:已完成 |
| 154 | 148 | int detailFinishState = FinishStateEnum.NOT_FINISHED.getStatus(); |
| 155 | 149 | if(detailFinishNum == maintainPlanDetailDO.getPlanNum()){ |
| 156 | 150 | detailFinishState = FinishStateEnum.FINISHED.getStatus(); |
| 157 | 151 | } |
| 158 | 152 | |
| 159 | - //完成状态 1:未完成;2:已完成 | |
| 160 | - if(detailFinishState == FinishStateEnum.FINISHED.getStatus()){ | |
| 161 | - //更新明细 | |
| 162 | - LambdaUpdateWrapper<MaintainPlanDetailDO> detailUpdateSql = new LambdaUpdateWrapper<MaintainPlanDetailDO>() | |
| 163 | - .set(MaintainPlanDetailDO::getPlanFinishNum, detailFinishNum) | |
| 164 | - .set(MaintainPlanDetailDO::getFinishState, detailFinishState) | |
| 165 | - .set(MaintainPlanDetailDO::getUpdateTime, LocalDateTime.now()) | |
| 166 | - .eq(MaintainPlanDetailDO::getPlanNo, createReqVO.getPlanNo()); | |
| 167 | - maintainPlanDetailMapper.update(detailUpdateSql); | |
| 168 | - | |
| 169 | - int finishState = FinishStateEnum.NOT_FINISHED.getStatus(); | |
| 170 | - if(maintainPlanDO.getPlanNum().equals(maintainPlanDO.getPlanFinishNum()+1)){ | |
| 171 | - finishState = FinishStateEnum.FINISHED.getStatus(); | |
| 172 | - } | |
| 173 | - LambdaUpdateWrapper<MaintainPlanDO> maintainPlanDOSql = new LambdaUpdateWrapper<MaintainPlanDO>() | |
| 174 | - .set(MaintainPlanDO::getPlanFinishNum, maintainPlanDO.getPlanFinishNum()+1) | |
| 175 | - .set(MaintainPlanDO::getFinishState, finishState) | |
| 176 | - .set(MaintainPlanDO::getUpdateTime, LocalDateTime.now()) | |
| 177 | - .eq(MaintainPlanDO::getBatchNo, maintainPlanDO.getBatchNo()); | |
| 178 | - //更新计划汇总 | |
| 179 | - maintainPlanMapper.update(maintainPlanDOSql); | |
| 180 | - } | |
| 153 | + //更新明细 | |
| 154 | + LambdaUpdateWrapper<MaintainPlanDetailDO> detailUpdateSql = new LambdaUpdateWrapper<MaintainPlanDetailDO>() | |
| 155 | + .set(MaintainPlanDetailDO::getPlanFinishNum, detailFinishNum) | |
| 156 | + .set(MaintainPlanDetailDO::getFinishState, detailFinishState) | |
| 157 | + .set(MaintainPlanDetailDO::getUpdateTime, LocalDateTime.now()) | |
| 158 | + .eq(MaintainPlanDetailDO::getPlanNo, createReqVO.getPlanNo()); | |
| 159 | + maintainPlanDetailMapper.update(detailUpdateSql); | |
| 181 | 160 | |
| 161 | + | |
| 162 | + Integer planFinishNum = maintainPlanDO.getPlanFinishNum()+1; | |
| 163 | + int finishState = FinishStateEnum.NOT_FINISHED.getStatus(); | |
| 164 | + if(maintainPlanDO.getPlanNum().equals(planFinishNum)){ | |
| 165 | + finishState = FinishStateEnum.FINISHED.getStatus(); | |
| 166 | + } | |
| 167 | + LambdaUpdateWrapper<MaintainPlanDO> maintainPlanDOSql = new LambdaUpdateWrapper<MaintainPlanDO>() | |
| 168 | + .set(MaintainPlanDO::getPlanFinishNum, planFinishNum) | |
| 169 | + .set(MaintainPlanDO::getFinishState, finishState) | |
| 170 | + .set(MaintainPlanDO::getUpdateTime, LocalDateTime.now()) | |
| 171 | + .eq(MaintainPlanDO::getBatchNo, maintainPlanDO.getBatchNo()); | |
| 172 | + //更新计划汇总 | |
| 173 | + maintainPlanMapper.update(maintainPlanDOSql); | |
| 182 | 174 | return commitDO.getId(); |
| 183 | 175 | } |
| 184 | 176 | |
| ... | ... | @@ -222,21 +214,18 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 222 | 214 | //分页 |
| 223 | 215 | IPage<AppMaintainPlanCommitDetailPageRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 224 | 216 | IPage<AppMaintainPlanCommitDetailPageRespVO> page = maintainPlanCommitMapper.appMaintainPlanCommitDetailPage(mpPage, pageReqVO); |
| 225 | - | |
| 226 | - page.getRecords().forEach(respVO -> { | |
| 227 | - respVO.setBeginImgList(StrUtils.imgProcess(respVO.getBeginImg(), "")); | |
| 228 | - }); | |
| 229 | - | |
| 230 | 217 | // 转换返回 |
| 231 | 218 | return new PageResult<>(page.getRecords(), page.getTotal()); |
| 232 | 219 | } |
| 233 | 220 | |
| 234 | 221 | @Override |
| 235 | - public List<MaintainPlanCommitDetailRespVO> getMaintainPlanCommitDetailByPlanNo(String planNo) { | |
| 222 | + public List<MaintainPlanCommitDetailRespVO> getMaintainPlanCommitDetailByPlanNo(String planNo, String sortNum) { | |
| 236 | 223 | List<MaintainPlanCommitDetailRespVO> respList = new ArrayList<>(); |
| 237 | 224 | /*1.查询处理明细*/ |
| 238 | 225 | List<MaintainPlanCommitDO> list = maintainPlanCommitMapper.selectList(new QueryWrapper<MaintainPlanCommitDO>().lambda() |
| 239 | - .eq(MaintainPlanCommitDO::getPlanNo, planNo).eq(MaintainPlanCommitDO::getDeleted, 0)); | |
| 226 | + .eq(MaintainPlanCommitDO::getPlanNo, planNo) | |
| 227 | + .eq(null != sortNum, MaintainPlanCommitDO::getSortNum, sortNum) | |
| 228 | + .eq(MaintainPlanCommitDO::getDeleted, 0)); | |
| 240 | 229 | if (CollectionUtils.isEmpty(list)) { |
| 241 | 230 | return Collections.emptyList(); |
| 242 | 231 | } |
| ... | ... | @@ -250,7 +239,6 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 250 | 239 | respVO.setBeginImgList(StrUtils.imgProcess(e.getBeginImg(), "")); |
| 251 | 240 | respVO.setProcessImgList(StrUtils.imgProcess(e.getProcessImg(), "")); |
| 252 | 241 | respVO.setEndImgList(StrUtils.imgProcess(e.getEndImg(), "")); |
| 253 | - respVO.setTotalFinishNum(maintainPlanDetailDO.getPlanFinishNum()); | |
| 254 | 242 | List<MaintainPlanCommonUserVO> commonUsers = new ArrayList<>(); |
| 255 | 243 | List<MaintainPlanCommonUserDO> maintainPlanCommonUserList = maintainPlanCommonUserMapper.selectList(new QueryWrapper<MaintainPlanCommonUserDO>().lambda() |
| 256 | 244 | .eq(MaintainPlanCommonUserDO::getParentId, maintainPlanDetailDO.getId()) | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanDetailServiceImpl.java
| ... | ... | @@ -114,11 +114,7 @@ public class MaintainPlanDetailServiceImpl implements MaintainPlanDetailService |
| 114 | 114 | if (StringUtils.isNotEmpty(busiLine)) { |
| 115 | 115 | pageReqVO.setBusiLineList(Arrays.asList(busiLine.split(","))); |
| 116 | 116 | } |
| 117 | - | |
| 118 | - /*1.查询登录用户角色*/ | |
| 119 | -// Set<String> batchNos = this.getBatchNosByLoginUserId(); | |
| 120 | -// pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 121 | -// pageReqVO.setBatchNos(batchNos); | |
| 117 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 122 | 118 | /*2.分页*/ |
| 123 | 119 | IPage<AppMaintainPlanDetailRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 124 | 120 | IPage<AppMaintainPlanDetailRespVO> page = maintainPlanDetailMapper.appMaintainPlanDetailListByRoadPage(mpPage, pageReqVO); |
| ... | ... | @@ -128,8 +124,6 @@ public class MaintainPlanDetailServiceImpl implements MaintainPlanDetailService |
| 128 | 124 | |
| 129 | 125 | @Override |
| 130 | 126 | public List<AppMaintainNotFinishPlanDetailRespVO> getMaintainNotFinishPlanCommitDetail(AppMaintainNotFinishPlanDetailReqVO reqVO) { |
| 131 | - //完成状态 1:未完成;2:已完成;3:已失效 | |
| 132 | -// reqVO.setFinishState(1); | |
| 133 | 127 | reqVO.setLocalDateTime(LocalDateTime.now()); |
| 134 | 128 | return maintainPlanDetailMapper.getMaintainNotFinishPlanCommitDetail(reqVO); |
| 135 | 129 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanServiceImpl.java
| ... | ... | @@ -377,13 +377,14 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 377 | 377 | pageReqVO.setBusiLineList(Arrays.asList(busiLine.split(","))); |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - /*1.查询登录用户计划编码列表*/ | |
| 381 | - Set<String> batchNos = this.getBatchNosByLoginUserId(); | |
| 382 | - if(CollectionUtils.isEmpty(batchNos)){ | |
| 383 | - return PageResult.empty(); | |
| 380 | + /*1.查询登录用户角色*/ | |
| 381 | + List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 382 | + if (CollectionUtils.isEmpty(roleIds)) { | |
| 383 | + new PageResult<>(null, 0L); | |
| 384 | 384 | } |
| 385 | - pageReqVO.setBatchNos(batchNos); | |
| 386 | - pageReqVO.setLocalDate(LocalDate.now()); | |
| 385 | + pageReqVO.setRoleIds(new HashSet<>(roleIds)); | |
| 386 | + pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | |
| 387 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 387 | 388 | /*2.分页*/ |
| 388 | 389 | IPage<AppMaintainPlanPageRoadRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 389 | 390 | IPage<AppMaintainPlanPageRoadRespVO> page = maintainPlanMapper.appMaintainPlanRoadPage(mpPage, pageReqVO); |
| ... | ... | @@ -391,29 +392,6 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 391 | 392 | return new PageResult<>(page.getRecords(), page.getTotal()); |
| 392 | 393 | } |
| 393 | 394 | |
| 394 | - /** | |
| 395 | - * 获取登录用户批次号List | |
| 396 | - */ | |
| 397 | - private Set<String> getBatchNosByLoginUserId() { | |
| 398 | - Long companyId = SecurityFrameworkUtils.getCompanyId(); | |
| 399 | - Long deptId = SecurityFrameworkUtils.getDeptId(); | |
| 400 | - /*1.查询登录用户角色*/ | |
| 401 | - List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 402 | - if (CollectionUtils.isEmpty(roleIds)) { | |
| 403 | - return Collections.emptySet(); | |
| 404 | - } | |
| 405 | - QueryWrapper<MaintainPlanRoleDO> roleSql = new QueryWrapper<>(); | |
| 406 | - roleSql.select("batch_no"); | |
| 407 | - roleSql.lambda().in(MaintainPlanRoleDO::getRoleId, roleIds). | |
| 408 | - eq(MaintainPlanRoleDO::getCompanyId, companyId) | |
| 409 | - .eq(MaintainPlanRoleDO::getDeptId, deptId); | |
| 410 | - List<MaintainPlanRoleDO> roleList = maintainPlanRoleMapper.selectList(roleSql); | |
| 411 | - if (CollectionUtils.isEmpty(roleList)) { | |
| 412 | - return Collections.emptySet(); | |
| 413 | - } | |
| 414 | - return roleList.stream().map(MaintainPlanRoleDO::getBatchNo).collect(Collectors.toSet()); | |
| 415 | - } | |
| 416 | - | |
| 417 | 395 | @Override |
| 418 | 396 | public PageResult<AppMaintainPlanPagePlanTypeRespVO> appMaintainPlanPlanTypePage(AppMaintainPlanPagePlanTypeReqVO pageReqVO) { |
| 419 | 397 | String busiLine = SecurityFrameworkUtils.getBusiLine(); |
| ... | ... | @@ -421,11 +399,12 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 421 | 399 | pageReqVO.setBusiLineList(Arrays.asList(busiLine.split(","))); |
| 422 | 400 | } |
| 423 | 401 | /*1.查询登录用户计划编码列表*/ |
| 424 | - Set<String> batchNos = this.getBatchNosByLoginUserId(); | |
| 425 | - if(CollectionUtils.isEmpty(batchNos)){ | |
| 426 | - return PageResult.empty(); | |
| 402 | + List<Long> roleIds = roleApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 403 | + if (CollectionUtils.isEmpty(roleIds)) { | |
| 404 | + return new PageResult<>(null, 0L); | |
| 427 | 405 | } |
| 428 | - pageReqVO.setBatchNos(batchNos); | |
| 406 | + pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | |
| 407 | + pageReqVO.setRoleIds(new HashSet<>(roleIds)); | |
| 429 | 408 | pageReqVO.setLocalDateTime(LocalDateTime.now()); |
| 430 | 409 | /*2.分页*/ |
| 431 | 410 | IPage<AppMaintainPlanPagePlanTypeRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanCommitMapper.xml
| ... | ... | @@ -33,16 +33,15 @@ |
| 33 | 33 | a.finish_time as finishTime, |
| 34 | 34 | a.user_id, |
| 35 | 35 | a.user_name, |
| 36 | + a.sort_num, | |
| 36 | 37 | a.remark, |
| 37 | 38 | a.creator, |
| 38 | 39 | a.creator_name, |
| 39 | 40 | a.create_time |
| 40 | 41 | FROM |
| 41 | - garden_inspection_plan_commit a, | |
| 42 | - garden_inspection_plan b | |
| 43 | - where a.batch_no=b.batch_no | |
| 44 | - AND a.deleted = b. deleted | |
| 45 | - AND a.deleted = 0 | |
| 42 | + garden_inspection_plan_commit a | |
| 43 | + INNER JOIN garden_inspection_plan b ON a.batch_no = b.batch_no AND a.deleted= b.deleted | |
| 44 | + where a.deleted = 0 | |
| 46 | 45 | <if test="req.planNo != null and req.planNo !=''"> |
| 47 | 46 | and a.plan_no = #{req.planNo} |
| 48 | 47 | </if> |
| ... | ... | @@ -125,15 +124,10 @@ |
| 125 | 124 | c.user_name, |
| 126 | 125 | c.finish_time, |
| 127 | 126 | c.remark |
| 128 | - FROM | |
| 129 | - garden_inspection_plan a, | |
| 130 | - garden_inspection_plan_detail b, | |
| 131 | - garden_inspection_plan_commit c | |
| 132 | - WHERE a.batch_no = b.batch_no | |
| 133 | - AND b.plan_no=c.plan_no | |
| 134 | - AND a.dept_id =b.dept_id | |
| 135 | - AND a.deleted = b.deleted | |
| 136 | - AND a.deleted = 0 | |
| 127 | + FROM garden_inspection_plan_detail b | |
| 128 | + INNER JOIN garden_inspection_plan a ON a.batch_no = b.batch_no | |
| 129 | + INNER JOIN garden_inspection_plan_commit c ON c.plan_no = b.plan_no AND b.batch_no = c.batch_no | |
| 130 | + WHERE a.deleted = 0 | |
| 137 | 131 | AND b.plan_no = #{planNo} |
| 138 | 132 | <if test="busiLineList != null and busiLineList.size() > 0"> |
| 139 | 133 | AND a.busi_line IN |
| ... | ... | @@ -141,5 +135,6 @@ |
| 141 | 135 | #{id} |
| 142 | 136 | </foreach> |
| 143 | 137 | </if> |
| 138 | + ORDER BY c.id DESC | |
| 144 | 139 | </select> |
| 145 | 140 | </mapper> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanDetailMapper.xml
| ... | ... | @@ -30,14 +30,12 @@ |
| 30 | 30 | b.begin_time, |
| 31 | 31 | b.end_time |
| 32 | 32 | FROM |
| 33 | - garden_inspection_plan a, | |
| 34 | - garden_inspection_plan_detail b | |
| 35 | - WHERE | |
| 36 | - a.batch_no = b.batch_no | |
| 37 | - AND a.deleted = b.deleted | |
| 38 | - AND a.deleted = 0 | |
| 33 | + garden_inspection_plan a | |
| 34 | + INNER JOIN garden_inspection_plan_detail b ON a.batch_no = b.batch_no AND a.deleted = b.deleted | |
| 35 | + WHERE a.deleted = 0 | |
| 39 | 36 | AND a.batch_no = #{req.batchNo} |
| 40 | 37 | AND a.company_id = #{req.companyId} |
| 38 | + AND a.dept_id = #{req.deptId} | |
| 41 | 39 | <if test="req.busiLineList != null and req.busiLineList.size() > 0"> |
| 42 | 40 | AND a.busi_line IN |
| 43 | 41 | <foreach collection="req.busiLineList" item="busiLine" open="(" separator="," close=")"> |
| ... | ... | @@ -45,19 +43,26 @@ |
| 45 | 43 | </foreach> |
| 46 | 44 | </if> |
| 47 | 45 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 48 | - <if test="req.finishState == 3"> | |
| 49 | - and b.finish_state = #{req.finishState} | |
| 50 | - <![CDATA[and b.end_time < #{req.localDateTime}]]> | |
| 51 | - </if> | |
| 52 | - <if test="req.finishState == 2"> | |
| 53 | - and b.finish_state = #{req.finishState} | |
| 54 | - </if> | |
| 55 | - <if test="req.finishState == 1"> | |
| 56 | - and b.finish_state = #{req.finishState} | |
| 57 | - <![CDATA[ and b.begin_time <= #{req.localDateTime} | |
| 58 | - and b.end_time >= #{req.localDateTime}]]> | |
| 59 | - </if> | |
| 60 | - | |
| 46 | + <choose> | |
| 47 | + <when test="req.finishState == 1"> | |
| 48 | + AND b.finish_state=1 | |
| 49 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 50 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 51 | + </when> | |
| 52 | + <when test="req.finishState == 2"> | |
| 53 | + AND b.finish_state = 2 | |
| 54 | + </when> | |
| 55 | + <when test="req.finishState == 3"> | |
| 56 | + AND b.finish_state = 3 | |
| 57 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 58 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 59 | + </when> | |
| 60 | + <when test="req.finishState == 4"> | |
| 61 | + AND b.finish_state = 4 | |
| 62 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 63 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 64 | + </when> | |
| 65 | + </choose> | |
| 61 | 66 | </select> |
| 62 | 67 | |
| 63 | 68 | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml
| ... | ... | @@ -15,28 +15,34 @@ |
| 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, | |
| 19 | - a.road_id, | |
| 20 | - a.road_name, | |
| 21 | - a.busi_line, | |
| 22 | - a.plan_type_id, | |
| 23 | - a.level_id, | |
| 24 | - a.finish_state, | |
| 25 | - a.begin_time, | |
| 26 | - a.end_time | |
| 27 | - FROM garden_inspection_plan a JOIN -- 建议用显式JOIN代替隐式连接,可读性更高 | |
| 28 | - garden_inspection_plan_detail b ON | |
| 29 | - a.batch_no = b.batch_no | |
| 30 | - AND a.deleted = b.deleted | |
| 31 | - WHERE a.deleted = 0 | |
| 32 | - <if test="req.roadName != null and req.roadName !=''"> | |
| 33 | - AND a.road_name LIKE CONCAT('%',#{req.roadName},'%') | |
| 34 | - </if> | |
| 35 | - <if test="req.batchNos != null and req.batchNos.size() > 0"> | |
| 36 | - AND a.batch_no IN | |
| 37 | - <foreach collection="req.batchNos" item="batchNo" open="(" separator="," close=")"> | |
| 38 | - #{batchNo} | |
| 39 | - </foreach> | |
| 18 | + b.batch_no, | |
| 19 | + b.plan_no, | |
| 20 | + a.road_id, | |
| 21 | + a.road_name, | |
| 22 | + a.busi_line, | |
| 23 | + a.plan_type_id, | |
| 24 | + a.level_id, | |
| 25 | + a.finish_state, | |
| 26 | + a.begin_time, | |
| 27 | + a.end_time | |
| 28 | + FROM | |
| 29 | + garden_inspection_plan_detail b | |
| 30 | + INNER JOIN garden_inspection_plan a ON a.batch_no = b.batch_no | |
| 31 | + INNER JOIN (SELECT DISTINCT batch_no | |
| 32 | + FROM garden_inspection_plan_role | |
| 33 | + WHERE deleted = 0 | |
| 34 | + AND dept_id = #{req.deptId} | |
| 35 | + <if test="req.roleIds != null and req.roleIds.size() > 0"> | |
| 36 | + AND role_id IN | |
| 37 | + <foreach collection="req.roleIds" item="roleId" open="(" separator="," close=")"> | |
| 38 | + #{roleId} | |
| 39 | + </foreach> | |
| 40 | + </if> | |
| 41 | + ) c ON b.batch_no = c.batch_no | |
| 42 | + WHERE | |
| 43 | + a.deleted = 0 | |
| 44 | + <if test="req.roadName != null and req.roadName !=''"> | |
| 45 | + AND a.road_name LIKE CONCAT('%', #{req.roadName}, '%') | |
| 40 | 46 | </if> |
| 41 | 47 | <if test="req.busiLineList != null and req.busiLineList.size() > 0"> |
| 42 | 48 | AND a.busi_line IN |
| ... | ... | @@ -44,18 +50,25 @@ |
| 44 | 50 | #{busiLine} |
| 45 | 51 | </foreach> |
| 46 | 52 | </if> |
| 47 | - <!--状态 1:未完成;2:已完成;3:已失效--> | |
| 48 | - <if test="req.finishState == 3"> | |
| 49 | - and b.finish_state = #{req.finishState} | |
| 50 | - <![CDATA[and a.end_time < #{req.localDate}]]> | |
| 53 | + <!-- 状态过滤 --> | |
| 54 | + <if test="req.finishState == 1"> | |
| 55 | + AND b.finish_state = 1 | |
| 56 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 57 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 51 | 58 | </if> |
| 52 | 59 | <if test="req.finishState == 2"> |
| 53 | - and b.finish_state = #{req.finishState} | |
| 60 | + AND b.finish_state = 2 | |
| 54 | 61 | </if> |
| 55 | - <if test="req.finishState == 1"> | |
| 56 | - and b.finish_state = #{req.finishState} | |
| 57 | - <![CDATA[and b.end_time >= #{req.localDate}]]> | |
| 58 | - <![CDATA[and b.begin_time <= #{req.localDate}]]> | |
| 62 | + <if test="req.finishState == 3"> | |
| 63 | + AND b.finish_state = 3 | |
| 64 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 65 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 66 | + </if> | |
| 67 | + <if test="req.finishState == 4"> | |
| 68 | + AND b.finish_state = 4 | |
| 69 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 70 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 59 | 71 | </if> |
| 72 | + ORDER BY b.id desc | |
| 60 | 73 | </select> |
| 61 | 74 | </mapper> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanCommitMapper.xml
| ... | ... | @@ -9,7 +9,17 @@ |
| 9 | 9 | 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ |
| 10 | 10 | --> |
| 11 | 11 | |
| 12 | - <select id="selectForPage" resultType="com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanCommitRespVO"> | |
| 12 | + <resultMap id="BaseResultMap" type="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanCommitDetailPageRespVO"> | |
| 13 | + <result property="beginImgList" column="begin_img" typeHandler="com.zteits.urbanops.framework.mybatis.core.type.StringArrayToListTypeHandler"/> | |
| 14 | + </resultMap> | |
| 15 | + | |
| 16 | + <resultMap id="BaseResultMapTwo" type="com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanCommitRespVO"> | |
| 17 | + <result property="beginImgList" column="begin_img" typeHandler="com.zteits.urbanops.framework.mybatis.core.type.StringArrayToListTypeHandler"/> | |
| 18 | + </resultMap> | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + <select id="selectForPage" resultMap="BaseResultMapTwo"> | |
| 13 | 23 | SELECT |
| 14 | 24 | a.batch_no, |
| 15 | 25 | a.plan_no, |
| ... | ... | @@ -28,19 +38,14 @@ |
| 28 | 38 | a.company_id, |
| 29 | 39 | a.dept_id, |
| 30 | 40 | c.finish_time, |
| 41 | + c.begin_img, | |
| 31 | 42 | c.user_name, |
| 32 | - c.finish_percent | |
| 43 | + c.sort_num | |
| 33 | 44 | FROM |
| 34 | - garden_maintain_plan_detail a, | |
| 35 | - garden_maintain_plan b, | |
| 36 | - garden_maintain_plan_commit c | |
| 37 | - WHERE | |
| 38 | - a.batch_no = b.batch_no | |
| 39 | - AND a.plan_no = c.plan_no | |
| 40 | - AND b.batch_no = c.batch_no | |
| 41 | - AND a.deleted = c.deleted | |
| 42 | - AND a.deleted = b.deleted | |
| 43 | - AND a.deleted = 0 | |
| 45 | + garden_maintain_plan_detail a | |
| 46 | + INNER JOIN garden_maintain_plan b ON a.batch_no = b.batch_no | |
| 47 | + INNER JOIN garden_maintain_plan_commit c ON a.batch_no = c.batch_no AND a.plan_no = c.plan_no | |
| 48 | + WHERE a.deleted = 0 | |
| 44 | 49 | <if test="req.planNo != null and req.planNo !=''"> |
| 45 | 50 | and a.plan_no LIKE CONCAT('%', #{req.planNo},'%') |
| 46 | 51 | </if> |
| ... | ... | @@ -71,9 +76,6 @@ |
| 71 | 76 | <if test="req.deptId != null"> |
| 72 | 77 | and a.dept_id = #{req.deptId} |
| 73 | 78 | </if> |
| 74 | -<!-- <if test="req.roleName != null and req.roleName !=''">--> | |
| 75 | -<!-- AND c.role_name LIKE CONCAT(#{req.roleName},'%')--> | |
| 76 | -<!-- </if>--> | |
| 77 | 79 | <if test="req.userName != null and req.userName !=''"> |
| 78 | 80 | AND c.user_name LIKE CONCAT('%', #{req.userName},'%') |
| 79 | 81 | </if> |
| ... | ... | @@ -89,7 +91,7 @@ |
| 89 | 91 | order by c.id desc |
| 90 | 92 | </select> |
| 91 | 93 | |
| 92 | - <select id="appMaintainPlanCommitDetailPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanCommitDetailPageRespVO"> | |
| 94 | + <select id="appMaintainPlanCommitDetailPage" resultMap="BaseResultMap"> | |
| 93 | 95 | SELECT |
| 94 | 96 | a.batch_no, |
| 95 | 97 | a.plan_no, |
| ... | ... | @@ -109,30 +111,16 @@ |
| 109 | 111 | a.company_id, |
| 110 | 112 | a.finish_state, |
| 111 | 113 | a.dept_id, |
| 112 | -<!-- c.finish_percent,--> | |
| 113 | 114 | c.begin_img, |
| 114 | 115 | c.img_host, |
| 115 | 116 | c.finish_time, |
| 116 | 117 | c.user_name, |
| 117 | 118 | c.remark |
| 118 | 119 | FROM |
| 119 | - garden_maintain_plan_detail a, | |
| 120 | - garden_maintain_plan b, | |
| 121 | - garden_maintain_plan_commit c | |
| 122 | - WHERE | |
| 123 | - a.batch_no = b.batch_no | |
| 124 | - AND a.batch_no = c.batch_no | |
| 125 | - AND a.plan_no = c.plan_no | |
| 126 | - AND c.plan_no = #{req.planNo} | |
| 120 | + garden_maintain_plan_detail a | |
| 121 | + INNER JOIN garden_maintain_plan b ON a.batch_no = b.batch_no | |
| 122 | + INNER JOIN garden_maintain_plan_commit c ON a.batch_no = c.batch_no AND a.plan_no = c.plan_no | |
| 123 | + WHERE a.plan_no = #{req.planNo} | |
| 124 | + ORDER BY c.id DESC | |
| 127 | 125 | </select> |
| 128 | - | |
| 129 | - <select id="selectFinishPercent" resultType="java.lang.Integer"> | |
| 130 | - SELECT | |
| 131 | - sum(a.finish_percent) as finishPercent | |
| 132 | - FROM | |
| 133 | - garden_maintain_plan_commit a | |
| 134 | - WHERE | |
| 135 | - a.plan_no = #{planNo} | |
| 136 | - AND a.sort_num = #{sortNum} | |
| 137 | - </select> | |
| 138 | 126 | </mapper> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanDetailMapper.xml
| ... | ... | @@ -23,16 +23,14 @@ |
| 23 | 23 | a.cycle_id, |
| 24 | 24 | c.plan_num, |
| 25 | 25 | c.plan_finish_num, |
| 26 | -<!-- c.finish_percent,--> | |
| 27 | 26 | c.finish_state, |
| 28 | 27 | c.begin_time, |
| 29 | 28 | c.end_time, |
| 30 | 29 | c.sort_num |
| 31 | 30 | FROM |
| 32 | - garden_maintain_plan a, | |
| 33 | - garden_maintain_plan_detail c | |
| 34 | - WHERE a.batch_no=c.batch_no | |
| 35 | - AND a.deleted=0 | |
| 31 | + garden_maintain_plan a | |
| 32 | + INNER JOIN garden_maintain_plan_detail c on a.batch_no=c.batch_no | |
| 33 | + WHERE a.deleted=0 | |
| 36 | 34 | AND a.road_id = #{req.roadId} |
| 37 | 35 | <if test="req.planName != null and req.planName !=''"> |
| 38 | 36 | AND a.plan_name LIKE CONCAT('%',#{req.planName},'%') |
| ... | ... | @@ -47,44 +45,49 @@ |
| 47 | 45 | AND a.batch_no= #{req.batchNo} |
| 48 | 46 | </if> |
| 49 | 47 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 50 | - <if test="req.finishState == 3"> | |
| 51 | - and a.finish_state = #{req.finishState} | |
| 52 | - <![CDATA[and c.end_time < #{req.localDateTime}]]> | |
| 53 | - </if> | |
| 54 | - <if test="req.finishState == 2"> | |
| 55 | - and c.finish_state = #{req.finishState} | |
| 56 | - </if> | |
| 57 | - <if test="req.finishState == 1"> | |
| 58 | - and c.finish_state = #{req.finishState} | |
| 59 | - <![CDATA[and c.end_time >= #{req.localDateTime}]]> | |
| 60 | - <![CDATA[and c.begin_time <= #{req.localDateTime}]]> | |
| 61 | - | |
| 62 | - </if> | |
| 48 | + <choose> | |
| 49 | + <when test="req.finishState == 1"> | |
| 50 | + AND c.finish_state = 1 | |
| 51 | + <![CDATA[AND c.begin_time <= #{req.localDateTime} | |
| 52 | + AND c.end_time >= #{req.localDateTime}]]> | |
| 53 | + </when> | |
| 54 | + <when test="req.finishState == 2"> | |
| 55 | + AND c.finish_state = 2 | |
| 56 | + </when> | |
| 57 | + <when test="req.finishState == 3"> | |
| 58 | + AND c.finish_state = 3 | |
| 59 | + <![CDATA[AND c.begin_time <= #{req.localDateTime} | |
| 60 | + AND c.end_time >= #{req.localDateTime}]]> | |
| 61 | + </when> | |
| 62 | + <when test="req.finishState == 4"> | |
| 63 | + AND c.finish_state = 4 | |
| 64 | + <![CDATA[AND c.begin_time <= #{req.localDateTime} | |
| 65 | + AND c.end_time >= #{req.localDateTime}]]> | |
| 66 | + </when> | |
| 67 | + </choose> | |
| 63 | 68 | </select> |
| 64 | 69 | |
| 65 | 70 | <select id="getMaintainNotFinishPlanCommitDetail" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainNotFinishPlanDetailRespVO"> |
| 66 | 71 | SELECT |
| 67 | - c.batch_no, | |
| 68 | - c.plan_no, | |
| 72 | + a.batch_no, | |
| 73 | + b.plan_no, | |
| 69 | 74 | a.plan_name, |
| 70 | 75 | a.plan_type_id, |
| 71 | 76 | a.rate, |
| 72 | 77 | a.cycle_id, |
| 73 | - c.plan_num, | |
| 74 | - c.plan_finish_num, | |
| 75 | - c.finish_state, | |
| 76 | - c.begin_time, | |
| 77 | - c.end_time, | |
| 78 | - c.sort_num | |
| 78 | + b.plan_num, | |
| 79 | + b.plan_finish_num, | |
| 80 | + b.finish_state, | |
| 81 | + b.begin_time, | |
| 82 | + b.end_time, | |
| 83 | + b.sort_num | |
| 79 | 84 | FROM |
| 80 | - garden_maintain_plan a, | |
| 81 | - garden_maintain_plan_detail c | |
| 82 | - WHERE a.batch_no=c.batch_no | |
| 83 | - AND a.deleted=0 | |
| 84 | - AND c.plan_no = #{req.planNo} | |
| 85 | + garden_maintain_plan a | |
| 86 | + INNER JOIN garden_maintain_plan_detail b ON a.batch_no=b.batch_no | |
| 87 | + WHERE a.deleted=0 | |
| 88 | + AND b.plan_no = #{req.planNo} | |
| 85 | 89 | AND a.plan_type_id = #{req.planTypeId} |
| 86 | 90 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 87 | - and c.finish_state = #{req.finishState} | |
| 88 | - <![CDATA[and c.end_time >= #{req.localDateTime}]]> | |
| 91 | + and b.finish_state = #{req.finishState} | |
| 89 | 92 | </select> |
| 90 | 93 | </mapper> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml
| ... | ... | @@ -16,80 +16,98 @@ |
| 16 | 16 | <select id="appMaintainPlanRoadPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO"> |
| 17 | 17 | SELECT |
| 18 | 18 | a.batch_no, |
| 19 | + b.plan_no, | |
| 19 | 20 | a.road_id, |
| 20 | 21 | a.road_name, |
| 21 | 22 | a.level_id, |
| 22 | 23 | a.finish_state, |
| 23 | 24 | a.plan_num, |
| 24 | 25 | a.plan_finish_num, |
| 25 | - a.begin_time, | |
| 26 | - a.end_time | |
| 26 | + b.begin_time, | |
| 27 | + b.end_time | |
| 27 | 28 | FROM |
| 28 | - garden_maintain_plan a | |
| 29 | - JOIN -- 建议用显式JOIN代替隐式连接,可读性更高 | |
| 30 | - garden_maintain_plan_detail b ON a.batch_no = b.batch_no | |
| 31 | - AND a.deleted = b.deleted | |
| 32 | - WHERE a.deleted = 0 | |
| 33 | - <if test="req.roadName != null and req.roadName !=''"> | |
| 34 | - AND a.road_name LIKE CONCAT('%',#{req.roadName},'%') | |
| 35 | - </if> | |
| 36 | - <if test="req.batchNos != null and req.batchNos.size() > 0"> | |
| 37 | - AND a.batch_no IN | |
| 38 | - <foreach collection="req.batchNos" item="batchNo" open="(" separator="," close=")"> | |
| 39 | - #{batchNo} | |
| 29 | + garden_maintain_plan_detail b | |
| 30 | + INNER JOIN garden_maintain_plan a ON b.batch_no = a.batch_no and a.deleted = b.deleted | |
| 31 | + INNER JOIN ( | |
| 32 | + SELECT DISTINCT batch_no | |
| 33 | + FROM garden_maintain_plan_role | |
| 34 | + WHERE deleted = 0 | |
| 35 | + AND dept_id = #{req.deptId} | |
| 36 | + <if test="req.roleIds != null and req.roleIds.size() > 0"> | |
| 37 | + AND role_id IN | |
| 38 | + <foreach collection="req.roleIds" item="roleId" open="(" separator="," close=")"> | |
| 39 | + #{roleId} | |
| 40 | 40 | </foreach> |
| 41 | 41 | </if> |
| 42 | + ) c ON b.batch_no = c.batch_no | |
| 43 | + WHERE | |
| 44 | + a.deleted = 0 | |
| 45 | + <if test="req.roadName != null and req.roadName != ''"> | |
| 46 | + AND a.road_name LIKE CONCAT('%', #{req.roadName}, '%') | |
| 47 | + </if> | |
| 42 | 48 | <if test="req.busiLineList != null and req.busiLineList.size() > 0"> |
| 43 | 49 | AND a.busi_line IN |
| 44 | 50 | <foreach collection="req.busiLineList" item="busiLine" open="(" separator="," close=")"> |
| 45 | 51 | #{busiLine} |
| 46 | 52 | </foreach> |
| 47 | 53 | </if> |
| 48 | - <!--状态 1:未完成;2:已完成;3:已失效--> | |
| 49 | - <if test="req.finishState == 3"> | |
| 50 | - and b.finish_state = #{req.finishState} | |
| 51 | - <![CDATA[and a.end_time < #{req.localDate}]]> | |
| 52 | - </if> | |
| 53 | - <if test="req.finishState == 2"> | |
| 54 | - and b.finish_state = #{req.finishState} | |
| 55 | - </if> | |
| 56 | - <if test="req.finishState == 1"> | |
| 57 | - and b.finish_state = #{req.finishState} | |
| 58 | - <![CDATA[and b.end_time >= #{req.localDate}]]> | |
| 59 | - <![CDATA[and b.begin_time <= #{req.localDate}]]> | |
| 60 | - </if> | |
| 54 | + <!-- 状态过滤 --> | |
| 55 | + <choose> | |
| 56 | + <when test="req.finishState == 1"> | |
| 57 | + AND b.finish_state = 1 | |
| 58 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 59 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 60 | + </when> | |
| 61 | + <when test="req.finishState == 2"> | |
| 62 | + AND b.finish_state = 2 | |
| 63 | + | |
| 64 | + </when> | |
| 65 | + <when test="req.finishState == 3"> | |
| 66 | + AND b.finish_state = 3 | |
| 67 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 68 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 69 | + </when> | |
| 70 | + <when test="req.finishState == 4"> | |
| 71 | + AND b.finish_state = 4 | |
| 72 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 73 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 74 | + </when> | |
| 75 | + </choose> | |
| 76 | + ORDER BY b.id desc | |
| 61 | 77 | </select> |
| 62 | 78 | |
| 63 | 79 | <select id="appMaintainPlanPlanTypePage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO"> |
| 64 | 80 | SELECT |
| 65 | - c.batch_no, | |
| 66 | - c.plan_no, | |
| 67 | - a.plan_name, | |
| 68 | - a.plan_type_id, | |
| 69 | - a.rate, | |
| 70 | - a.cycle_id, | |
| 71 | - c.plan_num, | |
| 72 | - c.plan_finish_num, | |
| 73 | - c.finish_state, | |
| 74 | - c.begin_time, | |
| 75 | - c.end_time | |
| 81 | + c.batch_no, | |
| 82 | + c.plan_no, | |
| 83 | + a.plan_name, | |
| 84 | + a.plan_type_id, | |
| 85 | + a.rate, | |
| 86 | + a.cycle_id, | |
| 87 | + c.plan_num, | |
| 88 | + c.plan_finish_num, | |
| 89 | + c.finish_state, | |
| 90 | + c.begin_time, | |
| 91 | + c.end_time | |
| 76 | 92 | FROM |
| 77 | - garden_maintain_plan a, | |
| 78 | - garden_maintain_plan_detail c | |
| 79 | - WHERE | |
| 80 | - a.batch_no = c.batch_no | |
| 81 | - AND a.deleted=c.deleted | |
| 82 | - AND a.deleted=0 | |
| 83 | - AND a.plan_type_id = #{req.planTypeId} | |
| 84 | - <if test="req.planName != null and req.planName !=''"> | |
| 85 | - AND a.plan_type_id LIKE CONCAT('%',#{req.planName},'%') | |
| 86 | - </if> | |
| 87 | - <if test="req.batchNos != null and req.batchNos.size() > 0"> | |
| 88 | - AND a.batch_no IN | |
| 89 | - <foreach collection="req.batchNos" item="batchNo" open="(" separator="," close=")"> | |
| 90 | - #{batchNo} | |
| 93 | + garden_maintain_plan a | |
| 94 | + INNER JOIN garden_maintain_plan_detail c ON a.batch_no = c.batch_no | |
| 95 | + INNER JOIN (select distinct batch_no, dept_id | |
| 96 | + from garden_maintain_plan_role | |
| 97 | + where deleted = 0 | |
| 98 | + AND dept_id = #{req.deptId} | |
| 99 | + <if test="req.roleIds != null and req.roleIds.size() > 0"> | |
| 100 | + AND role_id IN | |
| 101 | + <foreach collection="req.roleIds" item="roleId" open="(" separator="," close=")"> | |
| 102 | + #{roleId} | |
| 91 | 103 | </foreach> |
| 92 | 104 | </if> |
| 105 | + ) d ON c.batch_no = d.batch_no and c.dept_id = d.dept_id | |
| 106 | + AND a.deleted=0 | |
| 107 | + AND a.plan_type_id = #{req.planTypeId} | |
| 108 | + <if test="req.planName != null and req.planName !=''"> | |
| 109 | + AND a.plan_name LIKE CONCAT('%',#{req.planName},'%') | |
| 110 | + </if> | |
| 93 | 111 | <if test="req.busiLineList != null and req.busiLineList.size() > 0"> |
| 94 | 112 | AND a.busi_line IN |
| 95 | 113 | <foreach collection="req.busiLineList" item="busiLine" open="(" separator="," close=")"> |
| ... | ... | @@ -97,19 +115,26 @@ |
| 97 | 115 | </foreach> |
| 98 | 116 | </if> |
| 99 | 117 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 100 | - <if test="req.finishState == 3"> | |
| 101 | - and c.finish_state = #{req.finishState} | |
| 102 | - <![CDATA[and c.end_time < #{req.localDateTime}]]> | |
| 118 | + and c.finish_state =a.finish_state | |
| 119 | + <if test="req.finishState == 1"> | |
| 120 | + and a.finish_state = 1 | |
| 121 | + <![CDATA[and c.begin_time <= #{req.localDateTime} | |
| 122 | + and c.end_time >= #{req.localDateTime}]]> | |
| 103 | 123 | </if> |
| 104 | 124 | <if test="req.finishState == 2"> |
| 105 | - and c.finish_state = #{req.finishState} | |
| 125 | + and a.finish_state = 2 | |
| 106 | 126 | </if> |
| 107 | - <if test="req.finishState == 1"> | |
| 108 | - and c.finish_state = #{req.finishState} | |
| 109 | - <![CDATA[and c.end_time >= #{req.localDateTime}]]> | |
| 110 | - <![CDATA[and c.begin_time <= #{req.localDateTime}]]> | |
| 111 | - | |
| 127 | + <if test="req.finishState == 3"> | |
| 128 | + and a.finish_state = 3 | |
| 129 | + <![CDATA[and c.begin_time <= #{req.localDateTime} | |
| 130 | + and c.end_time >= #{req.localDateTime}]]> | |
| 131 | + </if> | |
| 132 | + <if test="req.finishState == 4"> | |
| 133 | + and a.finish_state = 4 | |
| 134 | + <![CDATA[and c.begin_time <= #{req.localDateTime} | |
| 135 | + and c.end_time >= #{req.localDateTime}]]> | |
| 112 | 136 | </if> |
| 137 | + ORDER BY a.id desc | |
| 113 | 138 | </select> |
| 114 | 139 | |
| 115 | 140 | </mapper> | ... | ... |
urbanops-module-workorder/pom.xml
| ... | ... | @@ -133,7 +133,13 @@ |
| 133 | 133 | </dependency> |
| 134 | 134 | <dependency> |
| 135 | 135 | <groupId>com.zteits.boot</groupId> |
| 136 | - <artifactId>urbanops-module-garden</artifactId> | |
| 136 | + <artifactId>urbanops-module-garden-api</artifactId> | |
| 137 | + <version>${revision}</version> | |
| 138 | + <scope>compile</scope> | |
| 139 | + </dependency> | |
| 140 | + <dependency> | |
| 141 | + <groupId>com.zteits.boot</groupId> | |
| 142 | + <artifactId>urbanops-module-workorder-api</artifactId> | |
| 137 | 143 | <version>${revision}</version> |
| 138 | 144 | <scope>compile</scope> |
| 139 | 145 | </dependency> | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/workorder/WorkOrderApiImpl.java
| 1 | 1 | package com.zteits.urbanops.module.workorder.api.workorder; |
| 2 | 2 | |
| 3 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 4 | 3 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 5 | 4 | import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 5 | +import com.zteits.urbanops.module.workorder.api.WorkOrderApi; | |
| 6 | 6 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; |
| 7 | -import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; | |
| 8 | -import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderRespVO; | |
| 9 | 7 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; |
| 10 | 8 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper; |
| 9 | +import com.zteits.urbanops.module.workorder.dto.AdminUserRespVO; | |
| 10 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | |
| 11 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; | |
| 11 | 12 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; |
| 12 | 13 | import jakarta.annotation.Resource; |
| 13 | 14 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -28,7 +29,7 @@ import static com.zteits.urbanops.framework.common.exception.util.ServiceExcepti |
| 28 | 29 | * @date 2025/12/5 17:21 |
| 29 | 30 | */ |
| 30 | 31 | @Service |
| 31 | -public class WorkOrderApiImpl implements WorkOrderApi{ | |
| 32 | +public class WorkOrderApiImpl implements WorkOrderApi { | |
| 32 | 33 | |
| 33 | 34 | @Resource |
| 34 | 35 | private MainInfoExtMapper workOrderExtMapper; |
| ... | ... | @@ -57,19 +58,21 @@ public class WorkOrderApiImpl implements WorkOrderApi{ |
| 57 | 58 | } |
| 58 | 59 | |
| 59 | 60 | @Override |
| 60 | - public List<AdminUserRespDTO> getUserByLoginIdAndRoleCode(Long loginUserId, String roleCode, String busiLine, boolean notHas) { | |
| 61 | + public List<AdminUserRespVO> getUserByLoginIdAndRoleCode(Long loginUserId, String roleCode, String busiLine, boolean notHas) { | |
| 61 | 62 | if(ObjectUtils.isEmpty(loginUserId) || ObjectUtils.isEmpty(roleCode) || ObjectUtils.isEmpty(busiLine)){ |
| 62 | 63 | throw exception0(BAD_REQUEST.getCode(),"param:loginUserId,roleCode,busiLine 不能为空!"); |
| 63 | 64 | } |
| 64 | - return workOrderExtMapper.getUserByLoginIdAndRoleCode(loginUserId,roleCode,busiLine,notHas); | |
| 65 | + List<AdminUserRespDTO> list = workOrderExtMapper.getUserByLoginIdAndRoleCode(loginUserId, roleCode, busiLine, notHas); | |
| 66 | + return BeanUtils.toBean(list, AdminUserRespVO.class); | |
| 65 | 67 | } |
| 66 | 68 | |
| 67 | 69 | @Override |
| 68 | - public List<AdminUserRespDTO> getUserByRoadIdAndRoleCode(Long roadId, String roleCode, String busiLine) { | |
| 70 | + public List<AdminUserRespVO> getUserByRoadIdAndRoleCode(Long roadId, String roleCode, String busiLine) { | |
| 69 | 71 | if(ObjectUtils.isEmpty(roadId) || ObjectUtils.isEmpty(roleCode) || ObjectUtils.isEmpty(busiLine)){ |
| 70 | 72 | throw exception0(BAD_REQUEST.getCode(),"param:roadId,roleCode,busiLine 不能为空!"); |
| 71 | 73 | } |
| 72 | - return workOrderExtMapper.getUserByRoadIdAndRoleCode(roadId,roleCode,busiLine); | |
| 74 | + List<AdminUserRespDTO> list = workOrderExtMapper.getUserByRoadIdAndRoleCode(roadId, roleCode, busiLine); | |
| 75 | + return BeanUtils.toBean(list, AdminUserRespVO.class); | |
| 73 | 76 | } |
| 74 | 77 | |
| 75 | 78 | @Override | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/MainInfoController.java
| ... | ... | @@ -11,11 +11,11 @@ import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 11 | 11 | import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; |
| 12 | 12 | import com.zteits.urbanops.module.system.service.dept.DeptService; |
| 13 | 13 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; |
| 14 | -import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoRespVO; | |
| 15 | 14 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoSaveReqVO; |
| 16 | 15 | import com.zteits.urbanops.module.workorder.convert.maininfo.MainInfoConvert; |
| 17 | 16 | import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; |
| 18 | 17 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| 18 | +import com.zteits.urbanops.module.workorder.dto.MainInfoRespVO; | |
| 19 | 19 | import com.zteits.urbanops.module.workorder.service.attachment.AttachmentService; |
| 20 | 20 | import com.zteits.urbanops.module.workorder.service.maininfo.MainInfoService; |
| 21 | 21 | import io.swagger.v3.oas.annotations.Operation; | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailPageReqVO.java
| ... | ... | @@ -16,6 +16,9 @@ public class MaterialDetailPageReqVO extends PageParam { |
| 16 | 16 | @Schema(description = "工单号") |
| 17 | 17 | private String orderNo; |
| 18 | 18 | |
| 19 | + @Schema(description = "来源 1:工单;2:园林-巡查;3:园林-养护", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 20 | + private Integer source; | |
| 21 | + | |
| 19 | 22 | @Schema(description = "提交用户ID", example = "10300") |
| 20 | 23 | private Long userId; |
| 21 | 24 | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailRespVO.java
| ... | ... | @@ -20,6 +20,10 @@ public class MaterialDetailRespVO { |
| 20 | 20 | @ExcelProperty("工单号") |
| 21 | 21 | private String orderNo; |
| 22 | 22 | |
| 23 | + @Schema(description = "来源 1:工单;2:园林-巡查;3:园林-养护", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 24 | + @ExcelProperty("来源 1:工单;2:园林-巡查;3:园林-养护") | |
| 25 | + private Integer source; | |
| 26 | + | |
| 23 | 27 | @Schema(description = "提交用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10300") |
| 24 | 28 | @ExcelProperty("提交用户ID") |
| 25 | 29 | private Long userId; | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailSaveReqVO.java
| ... | ... | @@ -16,6 +16,12 @@ public class MaterialDetailSaveReqVO { |
| 16 | 16 | @NotEmpty(message = "工单号不能为空") |
| 17 | 17 | private String orderNo; |
| 18 | 18 | |
| 19 | + /** | |
| 20 | + * 来源 1:工单;2:园林-巡查;3:园林-养护 | |
| 21 | + */ | |
| 22 | + @Schema(description = "来源 1:工单;2:园林-巡查;3:园林-养护", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 23 | + private Integer source; | |
| 24 | + | |
| 19 | 25 | @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27821") |
| 20 | 26 | @NotNull(message = "种类ID不能为空") |
| 21 | 27 | private Long classifyId; | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/convert/garden/AppGardenTaskConvert.java
| ... | ... | @@ -13,11 +13,11 @@ import com.zteits.urbanops.module.bpm.framework.flowable.core.util.FlowableUtils |
| 13 | 13 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 14 | 14 | import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 15 | 15 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; |
| 16 | -import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderRespVO; | |
| 17 | 16 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRespVO; |
| 18 | 17 | import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; |
| 19 | 18 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoExtDO; |
| 20 | 19 | import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; |
| 20 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; | |
| 21 | 21 | import org.flowable.engine.history.HistoricProcessInstance; |
| 22 | 22 | import org.flowable.engine.runtime.ProcessInstance; |
| 23 | 23 | import org.flowable.task.api.Task; | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/convert/maininfo/MainInfoConvert.java
| ... | ... | @@ -4,9 +4,9 @@ import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | 4 | import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; |
| 5 | 5 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 6 | 6 | import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 7 | -import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoRespVO; | |
| 8 | 7 | import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; |
| 9 | 8 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| 9 | +import com.zteits.urbanops.module.workorder.dto.MainInfoRespVO; | |
| 10 | 10 | import org.mapstruct.Mapper; |
| 11 | 11 | import org.mapstruct.factory.Mappers; |
| 12 | 12 | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/materialdetail/MaterialDetailDO.java
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/materialdetail/MaterialDetailMapper.java
| ... | ... | @@ -20,6 +20,7 @@ public interface MaterialDetailMapper extends BaseMapperX<MaterialDetailDO> { |
| 20 | 20 | default PageResult<MaterialDetailDO> selectPage(MaterialDetailPageReqVO reqVO) { |
| 21 | 21 | return selectPage(reqVO, new LambdaQueryWrapperX<MaterialDetailDO>() |
| 22 | 22 | .eqIfPresent(MaterialDetailDO::getOrderNo, reqVO.getOrderNo()) |
| 23 | + .eqIfPresent(MaterialDetailDO::getSource, reqVO.getSource()) | |
| 23 | 24 | .eqIfPresent(MaterialDetailDO::getUserId, reqVO.getUserId()) |
| 24 | 25 | .likeIfPresent(MaterialDetailDO::getUserName, reqVO.getUserName()) |
| 25 | 26 | .eqIfPresent(MaterialDetailDO::getClassifyId, reqVO.getClassifyId()) | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailServiceImpl.java
| ... | ... | @@ -3,9 +3,7 @@ package com.zteits.urbanops.module.workorder.service.materialdetail; |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | 4 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 5 | 5 | import com.zteits.urbanops.module.garden.api.material.MaterialApi; |
| 6 | -import com.zteits.urbanops.module.garden.api.material.dto.MaterialInventoryOutDto; | |
| 7 | -import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.MaterialInventoryOutSaveReqVO; | |
| 8 | -import com.zteits.urbanops.module.garden.service.materialinventoryout.MaterialInventoryOutService; | |
| 6 | +import com.zteits.urbanops.module.garden.dto.material.MaterialInventoryOutDto; | |
| 9 | 7 | import com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo.MaterialDetailPageReqVO; |
| 10 | 8 | import com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo.MaterialDetailSaveReqVO; |
| 11 | 9 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| ... | ... | @@ -106,6 +104,9 @@ public class MaterialDetailServiceImpl implements MaterialDetailService { |
| 106 | 104 | .map(vo -> { |
| 107 | 105 | MaterialDetailDO detailDO = new MaterialDetailDO(); |
| 108 | 106 | BeanUtils.copyProperties(vo, detailDO); // 单个对象属性拷贝 |
| 107 | + if(detailDO.getSource() == null){ | |
| 108 | + detailDO.setSource(1); | |
| 109 | + } | |
| 109 | 110 | detailDO.setUserId(getLoginUserId()); |
| 110 | 111 | detailDO.setUserName(getLoginUserNickname()); |
| 111 | 112 | return detailDO; | ... | ... |