Commit 30db68baa64d72d7003a0d76c3e28cda15610c01

Authored by 王富生
2 parents c156032a af1b082b

Merge remote-tracking branch 'origin/dev' into dev

Showing 13 changed files with 284 additions and 57 deletions
urbanops-framework/urbanops-common/src/main/java/com/zteits/urbanops/framework/common/pojo/CommonResult.java
@@ -73,7 +73,7 @@ public class CommonResult<T> implements Serializable { @@ -73,7 +73,7 @@ public class CommonResult<T> implements Serializable {
73 CommonResult<T> result = new CommonResult<>(); 73 CommonResult<T> result = new CommonResult<>();
74 result.code = GlobalErrorCodeConstants.SUCCESS.getCode(); 74 result.code = GlobalErrorCodeConstants.SUCCESS.getCode();
75 result.data = data; 75 result.data = data;
76 - result.msg = ""; 76 + result.msg = GlobalErrorCodeConstants.SUCCESS.getMsg();
77 return result; 77 return result;
78 } 78 }
79 79
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
@@ -24,13 +24,17 @@ public class BpmCommonConstant { @@ -24,13 +24,17 @@ public class BpmCommonConstant {
24 */ 24 */
25 public static final String BPM_MUNICIPAL_INSPECT_WO = "municipal_inspect_wo"; 25 public static final String BPM_MUNICIPAL_INSPECT_WO = "municipal_inspect_wo";
26 /** 26 /**
27 - * 园林问题单图片类型 27 + * 园林问题单处理前图片描述
28 */ 28 */
29 public static final String PROBLEM_IMG_GROUP = "01"; 29 public static final String PROBLEM_IMG_GROUP = "01";
30 /** 30 /**
  31 + * 园林问题单处理中图片类型
  32 + */
  33 + public static final String HANDLE_IMG_GROUP = "02";
  34 + /**
31 * 园林处理结果图片类型 35 * 园林处理结果图片类型
32 */ 36 */
33 - public static final String RESULT_IMG_GROUP = "02"; 37 + public static final String RESULT_IMG_GROUP = "03";
34 /** 38 /**
35 * 园林远景图片类型 39 * 园林远景图片类型
36 */ 40 */
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/garden/vo/BpmGardenWorkOrderCreateReqVO.java
@@ -7,6 +7,7 @@ import lombok.Data; @@ -7,6 +7,7 @@ import lombok.Data;
7 import org.hibernate.validator.constraints.Length; 7 import org.hibernate.validator.constraints.Length;
8 8
9 import java.math.BigDecimal; 9 import java.math.BigDecimal;
  10 +import java.time.LocalDateTime;
10 import java.util.List; 11 import java.util.List;
11 import java.util.Map; 12 import java.util.Map;
12 13
@@ -40,6 +41,10 @@ public class BpmGardenWorkOrderCreateReqVO { @@ -40,6 +41,10 @@ public class BpmGardenWorkOrderCreateReqVO {
40 @Length(max = 500) 41 @Length(max = 500)
41 private String remark; 42 private String remark;
42 43
  44 + @Schema(description = "工单完成结果描述", example = "已完成")
  45 + @Length(max = 500)
  46 + private String handleResult;
  47 +
43 @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") 48 @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2")
44 private Integer latLonType; 49 private Integer latLonType;
45 50
@@ -70,6 +75,9 @@ public class BpmGardenWorkOrderCreateReqVO { @@ -70,6 +75,9 @@ public class BpmGardenWorkOrderCreateReqVO {
70 @Schema(description = "三方工单ID") 75 @Schema(description = "三方工单ID")
71 private String thirdWorkNo; 76 private String thirdWorkNo;
72 77
  78 + @Schema(description = "完成时间")
  79 + private LocalDateTime finishDate;
  80 +
73 @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}") 81 @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}")
74 private Map<String, List<Long>> startUserSelectAssignees; 82 private Map<String, List<Long>> startUserSelectAssignees;
75 83
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoPageReqVO.java
@@ -5,6 +5,8 @@ import java.util.*; @@ -5,6 +5,8 @@ import java.util.*;
5 import io.swagger.v3.oas.annotations.media.Schema; 5 import io.swagger.v3.oas.annotations.media.Schema;
6 import com.zteits.urbanops.framework.common.pojo.PageParam; 6 import com.zteits.urbanops.framework.common.pojo.PageParam;
7 import java.math.BigDecimal; 7 import java.math.BigDecimal;
  8 +
  9 +import org.hibernate.validator.constraints.Length;
8 import org.springframework.format.annotation.DateTimeFormat; 10 import org.springframework.format.annotation.DateTimeFormat;
9 import java.time.LocalDateTime; 11 import java.time.LocalDateTime;
10 12
@@ -51,6 +53,10 @@ public class MainInfoPageReqVO extends PageParam { @@ -51,6 +53,10 @@ public class MainInfoPageReqVO extends PageParam {
51 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 53 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
52 private LocalDateTime[] commitDate; 54 private LocalDateTime[] commitDate;
53 55
  56 + @Schema(description = "完成时间")
  57 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  58 + private LocalDateTime[] finishDate;
  59 +
54 @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", example = "2") 60 @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", example = "2")
55 private Integer pressingType; 61 private Integer pressingType;
56 62
@@ -93,6 +99,9 @@ public class MainInfoPageReqVO extends PageParam { @@ -93,6 +99,9 @@ public class MainInfoPageReqVO extends PageParam {
93 @Schema(description = "工单描述", example = "你说的对") 99 @Schema(description = "工单描述", example = "你说的对")
94 private String remark; 100 private String remark;
95 101
  102 + @Schema(description = "工单完成结果描述", example = "已完成")
  103 + private String handleResult;
  104 +
96 @Schema(description = "创建时间") 105 @Schema(description = "创建时间")
97 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 106 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
98 private LocalDateTime[] createTime; 107 private LocalDateTime[] createTime;
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoRespVO.java
@@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema; @@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
4 import lombok.*; 4 import lombok.*;
5 import java.util.*; 5 import java.util.*;
6 import java.math.BigDecimal; 6 import java.math.BigDecimal;
  7 +
  8 +import org.hibernate.validator.constraints.Length;
7 import org.springframework.format.annotation.DateTimeFormat; 9 import org.springframework.format.annotation.DateTimeFormat;
8 import java.time.LocalDateTime; 10 import java.time.LocalDateTime;
9 import cn.idev.excel.annotation.*; 11 import cn.idev.excel.annotation.*;
@@ -65,6 +67,10 @@ public class MainInfoRespVO { @@ -65,6 +67,10 @@ public class MainInfoRespVO {
65 @ExcelProperty("提交日期") 67 @ExcelProperty("提交日期")
66 private LocalDateTime commitDate; 68 private LocalDateTime commitDate;
67 69
  70 + @Schema(description = "完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
  71 + @ExcelProperty("完成时间")
  72 + private LocalDateTime finishDate;
  73 +
68 @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") 74 @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
69 @ExcelProperty("紧急程度:1:特急;2:紧急;3:一般") 75 @ExcelProperty("紧急程度:1:特急;2:紧急;3:一般")
70 private Integer pressingType; 76 private Integer pressingType;
@@ -121,6 +127,10 @@ public class MainInfoRespVO { @@ -121,6 +127,10 @@ public class MainInfoRespVO {
121 @ExcelProperty("工单描述") 127 @ExcelProperty("工单描述")
122 private String remark; 128 private String remark;
123 129
  130 + @Schema(description = "工单完成结果描述", example = "已完成")
  131 + @ExcelProperty("工单完成结果描述")
  132 + private String handleResult;
  133 +
124 @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) 134 @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
125 @ExcelProperty("创建时间") 135 @ExcelProperty("创建时间")
126 private LocalDateTime createTime; 136 private LocalDateTime createTime;
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoSaveReqVO.java
@@ -5,6 +5,8 @@ import lombok.*; @@ -5,6 +5,8 @@ import lombok.*;
5 import java.util.*; 5 import java.util.*;
6 import jakarta.validation.constraints.*; 6 import jakarta.validation.constraints.*;
7 import java.math.BigDecimal; 7 import java.math.BigDecimal;
  8 +
  9 +import org.hibernate.validator.constraints.Length;
8 import org.springframework.format.annotation.DateTimeFormat; 10 import org.springframework.format.annotation.DateTimeFormat;
9 import java.time.LocalDateTime; 11 import java.time.LocalDateTime;
10 12
@@ -62,6 +64,9 @@ public class MainInfoSaveReqVO { @@ -62,6 +64,9 @@ public class MainInfoSaveReqVO {
62 @NotNull(message = "提交日期不能为空") 64 @NotNull(message = "提交日期不能为空")
63 private LocalDateTime commitDate; 65 private LocalDateTime commitDate;
64 66
  67 + @Schema(description = "完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
  68 + private LocalDateTime finishDate;
  69 +
65 @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") 70 @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
66 @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般不能为空") 71 @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般不能为空")
67 private Integer pressingType; 72 private Integer pressingType;
@@ -113,4 +118,8 @@ public class MainInfoSaveReqVO { @@ -113,4 +118,8 @@ public class MainInfoSaveReqVO {
113 @NotEmpty(message = "工单描述不能为空") 118 @NotEmpty(message = "工单描述不能为空")
114 private String remark; 119 private String remark;
115 120
  121 + @Schema(description = "工单完成结果描述", example = "已完成")
  122 + @Length(max = 500)
  123 + private String handleResult;
  124 +
116 } 125 }
117 \ No newline at end of file 126 \ No newline at end of file
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/AppGardenWorkOrderReqVO.java
@@ -7,6 +7,7 @@ import lombok.Data; @@ -7,6 +7,7 @@ import lombok.Data;
7 import org.hibernate.validator.constraints.Length; 7 import org.hibernate.validator.constraints.Length;
8 8
9 import java.math.BigDecimal; 9 import java.math.BigDecimal;
  10 +import java.time.LocalDateTime;
10 import java.util.List; 11 import java.util.List;
11 import java.util.Map; 12 import java.util.Map;
12 13
@@ -39,6 +40,10 @@ public class AppGardenWorkOrderReqVO { @@ -39,6 +40,10 @@ public class AppGardenWorkOrderReqVO {
39 @Length(max = 500) 40 @Length(max = 500)
40 private String remark; 41 private String remark;
41 42
  43 + @Schema(description = "工单完成结果描述", example = "已完成")
  44 + @Length(max = 500)
  45 + private String handleResult;
  46 +
42 47
43 @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") 48 @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2")
44 private Integer latLonType; 49 private Integer latLonType;
@@ -73,6 +78,9 @@ public class AppGardenWorkOrderReqVO { @@ -73,6 +78,9 @@ public class AppGardenWorkOrderReqVO {
73 @Schema(description = "三方工单ID") 78 @Schema(description = "三方工单ID")
74 private String thirdWorkNo; 79 private String thirdWorkNo;
75 80
  81 + @Schema(description = "完成时间")
  82 + private LocalDateTime finishDate;
  83 +
76 /* @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}") 84 /* @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}")
77 private Map<String, List<Long>> startUserSelectAssignees; 85 private Map<String, List<Long>> startUserSelectAssignees;
78 86
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/convert/garden/BpmGardenWorkOrderConverter.java 0 → 100644
  1 +package com.zteits.urbanops.module.workorder.convert.garden;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  5 +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant;
  6 +import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO;
  7 +import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO;
  8 +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO;
  9 +import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper;
  10 +import org.springframework.beans.BeanUtils;
  11 +
  12 +import java.util.Arrays;
  13 +import java.util.Collections;
  14 +import java.util.List;
  15 +import java.util.stream.Collectors;
  16 +
  17 +/**
  18 + * 手动实现 MainInfoDO 到 BpmGardenWorkOrderDO 的转换
  19 + * yanhuiqing
  20 + * 核心:
  21 + * 1. problemImgsList/completeImgsList 是 BpmGardenWorkOrderDO 扩展字段,通过查询附件赋值
  22 + * 2. 明确转换方向:MainInfoDO(源)→ BpmGardenWorkOrderDO(目标)
  23 + */
  24 +public class BpmGardenWorkOrderConverter {
  25 +
  26 + // 单例实例(保留原MapStruct的INSTANCE风格,也可改为Spring注入)
  27 + public static final BpmGardenWorkOrderConverter INSTANCE = new BpmGardenWorkOrderConverter();
  28 +
  29 + // ========== 单对象转换(核心方法) ==========
  30 + /**
  31 + * MainInfoDO → BpmGardenWorkOrderDO
  32 + * @param source 源对象
  33 + * @param attachmentMapper 附件Mapper,用于查询图片列表
  34 + * @return 目标对象
  35 + */
  36 + public BpmGardenWorkOrderDO convert(MainInfoDO source, AttachmentMapper attachmentMapper) {
  37 + // 1. 源对象为空,直接返回null
  38 + if (source == null) {
  39 + return null;
  40 + }
  41 +
  42 + // 2. 初始化目标对象,复制父类/公共属性(使用BeanUtils简化属性拷贝)
  43 + BpmGardenWorkOrderDO target = new BpmGardenWorkOrderDO();
  44 + // 拷贝MainInfoDO的所有属性到子类BpmGardenWorkOrderDO(需保证属性名和类型一致)
  45 + BeanUtils.copyProperties(source, target);
  46 +
  47 + // 3. 手动赋值扩展字段:查询问题图片列表和完成图片列表
  48 + List<String> problemImgsList = queryAttachment(
  49 + source.getBusiLine(),
  50 + BpmCommonConstant.PROBLEM_IMG_GROUP,
  51 + source.getOrderNo(),
  52 + attachmentMapper
  53 + );
  54 + List<String> completeImgsList = queryAttachment(
  55 + source.getBusiLine(),
  56 + BpmCommonConstant.RESULT_IMG_GROUP,
  57 + source.getOrderNo(),
  58 + attachmentMapper
  59 + );
  60 + target.setProblemImgsList(problemImgsList);
  61 + target.setCompleteImgsList(completeImgsList);
  62 +
  63 + return target;
  64 + }
  65 +
  66 + // ========== 集合转换 ==========
  67 + /**
  68 + * 批量转换 MainInfoDO 列表到 BpmGardenWorkOrderDO 列表
  69 + * @param sourceList 源列表
  70 + * @param attachmentMapper 附件Mapper
  71 + * @return 目标列表
  72 + */
  73 + public List<BpmGardenWorkOrderDO> convertList(List<MainInfoDO> sourceList, AttachmentMapper attachmentMapper) {
  74 + // 1. 源列表为空,返回空列表(避免NPE)
  75 + if (sourceList == null || sourceList.isEmpty()) {
  76 + return Collections.emptyList();
  77 + }
  78 +
  79 + // 2. 遍历源列表,调用单对象转换方法
  80 + return sourceList.stream()
  81 + .map(source -> convert(source, attachmentMapper))
  82 + .collect(Collectors.toList());
  83 + }
  84 +
  85 + // ========== 分页转换 ==========
  86 + /**
  87 + * 分页转换 MainInfoDO 分页对象到 BpmGardenWorkOrderDO 分页对象
  88 + * @param sourcePage 源分页对象
  89 + * @param attachmentMapper 附件Mapper
  90 + * @return 目标分页对象
  91 + */
  92 + public PageResult<BpmGardenWorkOrderDO> convertPage(PageResult<MainInfoDO> sourcePage, AttachmentMapper attachmentMapper) {
  93 + // 1. 源分页对象为空,返回空分页
  94 + if (sourcePage == null) {
  95 + return PageResult.empty();
  96 + }
  97 +
  98 + // 2. 转换列表数据,保留分页参数(总数、页码、页大小等)
  99 + List<BpmGardenWorkOrderDO> targetList = convertList(sourcePage.getList(), attachmentMapper);
  100 + return new PageResult<>(targetList, sourcePage.getTotal());
  101 + }
  102 +
  103 + // ========== 工具方法:查询附件列表(提取为私有方法,仅内部复用) ==========
  104 + private List<String> queryAttachment(String busiLine, String busiType, String orderNo, AttachmentMapper attachmentMapper) {
  105 +
  106 + LambdaQueryWrapper<AttachmentDO> queryWrapper = new LambdaQueryWrapper<AttachmentDO>()
  107 + .eq(AttachmentDO::getBusiLine, busiLine)
  108 + .eq(AttachmentDO::getBusiType, busiType)
  109 + .eq(AttachmentDO::getOrderNo, orderNo);
  110 + List<AttachmentDO> attachments = attachmentMapper.selectList(queryWrapper);
  111 + if (attachments == null || attachments.isEmpty()) {
  112 + return List.of();
  113 + }
  114 + return attachments.stream()
  115 + .map(AttachmentDO::getFileNames)
  116 + .filter(s -> s != null && !s.isEmpty())
  117 + .flatMap(s -> Arrays.stream(s.split(",")).map(String::trim))
  118 + .filter(s -> !s.isEmpty())
  119 + .distinct()
  120 + .collect(Collectors.toList());
  121 + }
  122 +}
0 \ No newline at end of file 123 \ No newline at end of file
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/garden/BpmGardenWorkOrderDO.java
@@ -2,7 +2,8 @@ package com.zteits.urbanops.module.workorder.dal.dataobject.garden; @@ -2,7 +2,8 @@ package com.zteits.urbanops.module.workorder.dal.dataobject.garden;
2 2
3 import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; 3 import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO;
4 import io.swagger.v3.oas.annotations.media.Schema; 4 import io.swagger.v3.oas.annotations.media.Schema;
5 -import lombok.Data; 5 +import lombok.*;
  6 +import lombok.experimental.SuperBuilder;
6 7
7 import java.util.List; 8 import java.util.List;
8 9
@@ -13,6 +14,12 @@ import java.util.List; @@ -13,6 +14,12 @@ import java.util.List;
13 * @date 2025/12/1 11:34 14 * @date 2025/12/1 11:34
14 */ 15 */
15 @Data 16 @Data
  17 +@NoArgsConstructor // 显式添加无参构造器
  18 +@EqualsAndHashCode(callSuper = true)
  19 +@Getter
  20 +@Setter
  21 +@ToString
  22 +@AllArgsConstructor
16 public class BpmGardenWorkOrderDO extends MainInfoDO { 23 public class BpmGardenWorkOrderDO extends MainInfoDO {
17 24
18 @Schema(description = "问题图片", example = "9184") 25 @Schema(description = "问题图片", example = "9184")
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoDO.java
1 package com.zteits.urbanops.module.workorder.dal.dataobject.maininfo; 1 package com.zteits.urbanops.module.workorder.dal.dataobject.maininfo;
2 2
  3 +import io.swagger.v3.oas.annotations.media.Schema;
3 import lombok.*; 4 import lombok.*;
4 import java.util.*; 5 import java.util.*;
5 import java.time.LocalDateTime; 6 import java.time.LocalDateTime;
@@ -9,6 +10,7 @@ import java.time.LocalDateTime; @@ -9,6 +10,7 @@ import java.time.LocalDateTime;
9 import java.time.LocalDateTime; 10 import java.time.LocalDateTime;
10 import com.baomidou.mybatisplus.annotation.*; 11 import com.baomidou.mybatisplus.annotation.*;
11 import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; 12 import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO;
  13 +import org.hibernate.validator.constraints.Length;
12 14
13 /** 15 /**
14 * 工单信息 DO 16 * 工单信息 DO
@@ -78,6 +80,11 @@ public class MainInfoDO extends BaseDO { @@ -78,6 +80,11 @@ public class MainInfoDO extends BaseDO {
78 * 提交日期 80 * 提交日期
79 */ 81 */
80 private LocalDateTime commitDate; 82 private LocalDateTime commitDate;
  83 +
  84 + /**
  85 + * 完成时间
  86 + */
  87 + private LocalDateTime finishDate;
81 /** 88 /**
82 * 紧急程度:1:特急;2:紧急;3:一般 89 * 紧急程度:1:特急;2:紧急;3:一般
83 */ 90 */
@@ -134,6 +141,10 @@ public class MainInfoDO extends BaseDO { @@ -134,6 +141,10 @@ public class MainInfoDO extends BaseDO {
134 * 工单描述 141 * 工单描述
135 */ 142 */
136 private String remark; 143 private String remark;
  144 + /**
  145 + * 工单完成结果描述
  146 + */
  147 + private String handleResult;
137 148
138 149
139 } 150 }
140 \ No newline at end of file 151 \ No newline at end of file
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java
@@ -31,6 +31,7 @@ public interface MainInfoMapper extends BaseMapperX&lt;MainInfoDO&gt; { @@ -31,6 +31,7 @@ public interface MainInfoMapper extends BaseMapperX&lt;MainInfoDO&gt; {
31 .eqIfPresent(MainInfoDO::getCuringLevelId, reqVO.getCuringLevelId()) 31 .eqIfPresent(MainInfoDO::getCuringLevelId, reqVO.getCuringLevelId())
32 .likeIfPresent(MainInfoDO::getCuringLevelName, reqVO.getCuringLevelName()) 32 .likeIfPresent(MainInfoDO::getCuringLevelName, reqVO.getCuringLevelName())
33 .betweenIfPresent(MainInfoDO::getCommitDate, reqVO.getCommitDate()) 33 .betweenIfPresent(MainInfoDO::getCommitDate, reqVO.getCommitDate())
  34 + .betweenIfPresent(MainInfoDO::getFinishDate, reqVO.getFinishDate())
34 .eqIfPresent(MainInfoDO::getPressingType, reqVO.getPressingType()) 35 .eqIfPresent(MainInfoDO::getPressingType, reqVO.getPressingType())
35 .eqIfPresent(MainInfoDO::getUserId, reqVO.getUserId()) 36 .eqIfPresent(MainInfoDO::getUserId, reqVO.getUserId())
36 .likeIfPresent(MainInfoDO::getUserName, reqVO.getUserName()) 37 .likeIfPresent(MainInfoDO::getUserName, reqVO.getUserName())
@@ -44,7 +45,8 @@ public interface MainInfoMapper extends BaseMapperX&lt;MainInfoDO&gt; { @@ -44,7 +45,8 @@ public interface MainInfoMapper extends BaseMapperX&lt;MainInfoDO&gt; {
44 .eqIfPresent(MainInfoDO::getBuzStatus, reqVO.getBuzStatus()) 45 .eqIfPresent(MainInfoDO::getBuzStatus, reqVO.getBuzStatus())
45 .eqIfPresent(MainInfoDO::getStatus, reqVO.getStatus()) 46 .eqIfPresent(MainInfoDO::getStatus, reqVO.getStatus())
46 .eqIfPresent(MainInfoDO::getProcessInstanceId, reqVO.getProcessInstanceId()) 47 .eqIfPresent(MainInfoDO::getProcessInstanceId, reqVO.getProcessInstanceId())
47 - .eqIfPresent(MainInfoDO::getRemark, reqVO.getRemark()) 48 + .likeIfPresent(MainInfoDO::getRemark, reqVO.getRemark())
  49 + .likeIfPresent(MainInfoDO::getHandleResult, reqVO.getHandleResult())
48 .betweenIfPresent(MainInfoDO::getCreateTime, reqVO.getCreateTime()) 50 .betweenIfPresent(MainInfoDO::getCreateTime, reqVO.getCreateTime())
49 .orderByDesc(MainInfoDO::getId)); 51 .orderByDesc(MainInfoDO::getId));
50 } 52 }
@@ -63,6 +65,7 @@ public interface MainInfoMapper extends BaseMapperX&lt;MainInfoDO&gt; { @@ -63,6 +65,7 @@ public interface MainInfoMapper extends BaseMapperX&lt;MainInfoDO&gt; {
63 .eqIfPresent(MainInfoDO::getCuringLevelId, reqVO.getCuringLevelId()) 65 .eqIfPresent(MainInfoDO::getCuringLevelId, reqVO.getCuringLevelId())
64 .likeIfPresent(MainInfoDO::getCuringLevelName, reqVO.getCuringLevelName()) 66 .likeIfPresent(MainInfoDO::getCuringLevelName, reqVO.getCuringLevelName())
65 .betweenIfPresent(MainInfoDO::getCommitDate, reqVO.getCommitDate()) 67 .betweenIfPresent(MainInfoDO::getCommitDate, reqVO.getCommitDate())
  68 + .betweenIfPresent(MainInfoDO::getFinishDate, reqVO.getFinishDate())
66 .eqIfPresent(MainInfoDO::getPressingType, reqVO.getPressingType()) 69 .eqIfPresent(MainInfoDO::getPressingType, reqVO.getPressingType())
67 .eqIfPresent(MainInfoDO::getUserId, loginUserId) 70 .eqIfPresent(MainInfoDO::getUserId, loginUserId)
68 .likeIfPresent(MainInfoDO::getUserName, reqVO.getUserName()) 71 .likeIfPresent(MainInfoDO::getUserName, reqVO.getUserName())
@@ -77,6 +80,7 @@ public interface MainInfoMapper extends BaseMapperX&lt;MainInfoDO&gt; { @@ -77,6 +80,7 @@ public interface MainInfoMapper extends BaseMapperX&lt;MainInfoDO&gt; {
77 .eqIfPresent(MainInfoDO::getStatus, reqVO.getStatus()) 80 .eqIfPresent(MainInfoDO::getStatus, reqVO.getStatus())
78 .eqIfPresent(MainInfoDO::getProcessInstanceId, reqVO.getProcessInstanceId()) 81 .eqIfPresent(MainInfoDO::getProcessInstanceId, reqVO.getProcessInstanceId())
79 .likeIfPresent(MainInfoDO::getRemark, reqVO.getRemark()) 82 .likeIfPresent(MainInfoDO::getRemark, reqVO.getRemark())
  83 + .likeIfPresent(MainInfoDO::getHandleResult, reqVO.getHandleResult())
80 .betweenIfPresent(MainInfoDO::getCreateTime, reqVO.getCreateTime()) 84 .betweenIfPresent(MainInfoDO::getCreateTime, reqVO.getCreateTime())
81 .orderByDesc(MainInfoDO::getId)); 85 .orderByDesc(MainInfoDO::getId));
82 } 86 }
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
@@ -17,6 +17,7 @@ import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGarden @@ -17,6 +17,7 @@ import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGarden
17 import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; 17 import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO;
18 import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderPageReqVO; 18 import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderPageReqVO;
19 import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; 19 import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO;
  20 +import com.zteits.urbanops.module.workorder.convert.garden.BpmGardenWorkOrderConverter;
20 import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; 21 import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO;
21 import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; 22 import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO;
22 import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; 23 import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO;
@@ -46,7 +47,6 @@ import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.MAIN @@ -46,7 +47,6 @@ import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.MAIN
46 @Service 47 @Service
47 @Validated 48 @Validated
48 public class BpmGardenServiceImpl implements BpmGardenService{ 49 public class BpmGardenServiceImpl implements BpmGardenService{
49 -  
50 @Resource 50 @Resource
51 private AttachmentMapper attachmentMapper; 51 private AttachmentMapper attachmentMapper;
52 @Resource 52 @Resource
@@ -59,6 +59,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ @@ -59,6 +59,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{
59 @Resource 59 @Resource
60 private RoadApi roadApi; 60 private RoadApi roadApi;
61 61
  62 +
62 @Override 63 @Override
63 @Transactional(rollbackFor = Exception.class) 64 @Transactional(rollbackFor = Exception.class)
64 public Long createWorkOrderQuick(AppGardenWorkOrderReqVO createRequestVo) { 65 public Long createWorkOrderQuick(AppGardenWorkOrderReqVO createRequestVo) {
@@ -79,7 +80,9 @@ public class BpmGardenServiceImpl implements BpmGardenService{ @@ -79,7 +80,9 @@ public class BpmGardenServiceImpl implements BpmGardenService{
79 workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); 80 workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine());
80 workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); 81 workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId());
81 workOrder.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); 82 workOrder.setUserName(SecurityFrameworkUtils.getLoginUserNickname());
82 - workOrder.setCommitDate(LocalDateTime.now()); 83 + LocalDateTime now = LocalDateTime.now();
  84 + workOrder.setCommitDate(now);
  85 + workOrder.setFinishDate(now);
83 String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_QUICK); 86 String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_QUICK);
84 workOrder.setOrderNo(workOrderNum); 87 workOrder.setOrderNo(workOrderNum);
85 //workOrder.setOrderName("园林工单"); 88 //workOrder.setOrderName("园林工单");
@@ -92,12 +95,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ @@ -92,12 +95,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{
92 processInstanceVariables.put("workOrder", workOrder); 95 processInstanceVariables.put("workOrder", workOrder);
93 processInstanceVariables.put("imgList", imgList); 96 processInstanceVariables.put("imgList", imgList);
94 processInstanceVariables.put("longRangeImgList", longRangeImgList); 97 processInstanceVariables.put("longRangeImgList", longRangeImgList);
  98 + processInstanceVariables.put("applyUserId", SecurityFrameworkUtils.getLoginUserId());
  99 +
95 String processInstanceId = processInstanceApi.createProcessInstance(SecurityFrameworkUtils.getLoginUserId(), 100 String processInstanceId = processInstanceApi.createProcessInstance(SecurityFrameworkUtils.getLoginUserId(),
96 new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.COMMON_QUICK_PROCESS) 101 new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.COMMON_QUICK_PROCESS)
97 .setVariables(processInstanceVariables).setBusinessKey(String.valueOf(workOrder.getId()))); 102 .setVariables(processInstanceVariables).setBusinessKey(String.valueOf(workOrder.getId())));
98 103
99 // 将工作流的编号,更新到 工单中 104 // 将工作流的编号,更新到 工单中
100 workOrderMapper.updateById(new MainInfoDO().setId(workOrder.getId()).setProcessInstanceId(processInstanceId)); 105 workOrderMapper.updateById(new MainInfoDO().setId(workOrder.getId()).setProcessInstanceId(processInstanceId));
  106 +
  107 +
101 return workOrder.getId(); 108 return workOrder.getId();
102 } 109 }
103 110
@@ -188,34 +195,28 @@ public class BpmGardenServiceImpl implements BpmGardenService{ @@ -188,34 +195,28 @@ public class BpmGardenServiceImpl implements BpmGardenService{
188 attachmentMapper.delete(deleteWrapper); 195 attachmentMapper.delete(deleteWrapper);
189 attachmentMapper.insert(saveDO); 196 attachmentMapper.insert(saveDO);
190 } 197 }
191 -// //街道图片  
192 -// if(ObjectUtils.isNotAllEmpty(streetImgList)){  
193 -// AttachmentDO saveDO = new AttachmentDO();  
194 -// saveDO.setBusiLine(workOrder.getBusiLine());  
195 -// saveDO.setBusiType(BpmCommonConstant.GARDEN_INSPECT_WO_ATTACH2);  
196 -// saveDO.setOrderNo(workOrder.getOrderNo());  
197 -// String filePaths = String.join(",",streetImgList);  
198 -// saveDO.setFileNames(filePaths);  
199 -// LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>()  
200 -// .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine())  
201 -// .eq(AttachmentDO::getBusiType, BpmCommonConstant.GARDEN_INSPECT_WO_ATTACH2)  
202 -// .eq(AttachmentDO::getOrderNo, workOrder.getOrderNo());  
203 -// attachmentMapper.delete(deleteWrapper);  
204 -// attachmentMapper.insert(saveDO);  
205 -// }  
206 - List<String> resultImgs = new java.util.ArrayList<>();  
207 - if (ObjectUtils.isNotAllEmpty(streetImgList)) {  
208 - resultImgs.addAll(streetImgList);  
209 - }  
210 - if (ObjectUtils.isNotAllEmpty(longRangeImgList)) {  
211 - resultImgs.addAll(longRangeImgList); 198 + //街道图片
  199 + if(ObjectUtils.isNotAllEmpty(streetImgList)){
  200 + AttachmentDO saveDO = new AttachmentDO();
  201 + saveDO.setBusiLine(workOrder.getBusiLine());
  202 + saveDO.setBusiType(BpmCommonConstant.HANDLE_IMG_GROUP);
  203 + saveDO.setOrderNo(workOrder.getOrderNo());
  204 + String filePaths = String.join(",",streetImgList);
  205 + saveDO.setFileNames(filePaths);
  206 + LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>()
  207 + .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine())
  208 + .eq(AttachmentDO::getBusiType, BpmCommonConstant.HANDLE_IMG_GROUP)
  209 + .eq(AttachmentDO::getOrderNo, workOrder.getOrderNo());
  210 + attachmentMapper.delete(deleteWrapper);
  211 + attachmentMapper.insert(saveDO);
212 } 212 }
213 - if(ObjectUtils.isNotAllEmpty(resultImgs)){ 213 +
  214 + if(ObjectUtils.isNotAllEmpty(longRangeImgList)){
214 AttachmentDO saveDO = new AttachmentDO(); 215 AttachmentDO saveDO = new AttachmentDO();
215 saveDO.setBusiLine(workOrder.getBusiLine()); 216 saveDO.setBusiLine(workOrder.getBusiLine());
216 saveDO.setBusiType(BpmCommonConstant.RESULT_IMG_GROUP); 217 saveDO.setBusiType(BpmCommonConstant.RESULT_IMG_GROUP);
217 saveDO.setOrderNo(workOrder.getOrderNo()); 218 saveDO.setOrderNo(workOrder.getOrderNo());
218 - String filePaths = String.join(",",resultImgs); 219 + String filePaths = String.join(",",longRangeImgList);
219 saveDO.setFileNames(filePaths); 220 saveDO.setFileNames(filePaths);
220 LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() 221 LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>()
221 .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine()) 222 .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine())
@@ -228,25 +229,6 @@ public class BpmGardenServiceImpl implements BpmGardenService{ @@ -228,25 +229,6 @@ public class BpmGardenServiceImpl implements BpmGardenService{
228 229
229 } 230 }
230 231
231 - private List<String> attachmentGet(String busiLine, String busiType, String orderNo) {  
232 - LambdaQueryWrapper<AttachmentDO> queryWrapper = new LambdaQueryWrapper<AttachmentDO>()  
233 - .eq(AttachmentDO::getBusiLine, busiLine)  
234 - .eq(AttachmentDO::getBusiType, busiType)  
235 - .eq(AttachmentDO::getOrderNo, orderNo);  
236 - List<AttachmentDO> attachments = attachmentMapper.selectList(queryWrapper);  
237 - if (attachments == null || attachments.isEmpty()) {  
238 - return List.of();  
239 - }  
240 - return attachments.stream()  
241 - .map(AttachmentDO::getFileNames)  
242 - .filter(s -> s != null && !s.isEmpty())  
243 - .flatMap(s -> Arrays.stream(s.split(",")).map(String::trim))  
244 - .filter(s -> !s.isEmpty())  
245 - .distinct()  
246 - .collect(Collectors.toList());  
247 - }  
248 -  
249 -  
250 @Override 232 @Override
251 public void updateWorkOrderStatus(Long id, Integer status) { 233 public void updateWorkOrderStatus(Long id, Integer status) {
252 validateExists(id); 234 validateExists(id);
@@ -261,18 +243,14 @@ public class BpmGardenServiceImpl implements BpmGardenService{ @@ -261,18 +243,14 @@ public class BpmGardenServiceImpl implements BpmGardenService{
261 @Override 243 @Override
262 public BpmGardenWorkOrderDO getWorkOrder(Long id) { 244 public BpmGardenWorkOrderDO getWorkOrder(Long id) {
263 MainInfoDO workOrder = workOrderMapper.selectById(id); 245 MainInfoDO workOrder = workOrderMapper.selectById(id);
264 - BpmGardenWorkOrderDO targetVo = BeanUtils.toBean(workOrder, BpmGardenWorkOrderDO.class);  
265 - targetVo.setProblemImgsList(attachmentGet(workOrder.getBusiLine(), BpmCommonConstant.PROBLEM_IMG_GROUP, workOrder.getOrderNo()));  
266 - targetVo.setCompleteImgsList(attachmentGet(workOrder.getBusiLine(), BpmCommonConstant.RESULT_IMG_GROUP, workOrder.getOrderNo()));  
267 - return targetVo; 246 + return BpmGardenWorkOrderConverter.INSTANCE.convert(workOrder, attachmentMapper);
268 } 247 }
269 248
270 @Override 249 @Override
271 public PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, BpmGardenWorkOrderPageReqVO pageVO) { 250 public PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, BpmGardenWorkOrderPageReqVO pageVO) {
272 MainInfoPageReqVO mainInfoPageReqVo = BeanUtils.toBean(pageVO,MainInfoPageReqVO.class); 251 MainInfoPageReqVO mainInfoPageReqVo = BeanUtils.toBean(pageVO,MainInfoPageReqVO.class);
273 PageResult<MainInfoDO> pageList = workOrderMapper.selectPage(loginUserId, mainInfoPageReqVo); 252 PageResult<MainInfoDO> pageList = workOrderMapper.selectPage(loginUserId, mainInfoPageReqVo);
274 - PageResult<BpmGardenWorkOrderDO> targetList = BeanUtils.toBean(pageList,BpmGardenWorkOrderDO.class);  
275 - return targetList; 253 + return BpmGardenWorkOrderConverter.INSTANCE.convertPage(pageList, attachmentMapper);
276 } 254 }
277 255
278 @Override 256 @Override
@@ -303,8 +281,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ @@ -303,8 +281,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{
303 } 281 }
304 } 282 }
305 PageResult<MainInfoDO> pageList = workOrderMapper.selectPage(loginUserId, mainInfoPageReqVo); 283 PageResult<MainInfoDO> pageList = workOrderMapper.selectPage(loginUserId, mainInfoPageReqVo);
306 - PageResult<BpmGardenWorkOrderDO> targetList = BeanUtils.toBean(pageList,BpmGardenWorkOrderDO.class);  
307 - return targetList; 284 + return BpmGardenWorkOrderConverter.INSTANCE.convertPage(pageList, attachmentMapper);
308 } 285 }
309 286
310 287
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/AutoCompleteTaskListener.java 0 → 100644
  1 +package com.zteits.urbanops.module.workorder.service.garden.listener;
  2 +
  3 +import com.zteits.urbanops.module.bpm.framework.flowable.core.util.FlowableUtils;
  4 +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService;
  5 +import jakarta.annotation.Resource;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.flowable.engine.TaskService;
  8 +import org.flowable.engine.impl.context.Context;
  9 +import org.flowable.task.service.delegate.DelegateTask;
  10 +import org.flowable.task.service.delegate.TaskListener;
  11 +import org.springframework.stereotype.Component;
  12 +
  13 +/**
  14 + * @author yanhuiqing
  15 + * @version 1.0
  16 + * @description: 自动触发
  17 + * @date 2025/12/11 11:17
  18 + */
  19 +@Slf4j
  20 +@Component
  21 +public class AutoCompleteTaskListener implements TaskListener {
  22 +
  23 + @Resource
  24 + private BpmGardenService gardenService;
  25 + @Override
  26 + public void notify(DelegateTask delegateTask) {
  27 + // 仅处理任务创建事件
  28 + if (!"create".equals(delegateTask.getEventName())) {
  29 + return;
  30 + }
  31 + try {
  32 + Thread.sleep(5000); // 延迟200ms,确保任务持久化
  33 + } catch (InterruptedException e) {
  34 + throw new RuntimeException(e);
  35 + }
  36 + Long assigneeId = Long.parseLong(delegateTask.getAssignee());
  37 + //FlowableUtils.executeAuthenticatedUserId(assigneeId, () -> {
  38 + // 完成任务(在认证上下文内执行)
  39 + TaskService taskService = Context.getProcessEngineConfiguration().getTaskService();
  40 + taskService.complete(delegateTask.getId());
  41 + // return assigneeId;
  42 + //});
  43 +
  44 + // 1. 获取发起人变量(芋道流程中配置的initiator)
  45 + //String initiator = (String) delegateTask.getVariable("initiator");
  46 + // 2. 当前任务处理人(即发起人)
  47 + //String currentAssignee = delegateTask.getAssignee();
  48 +
  49 + // 3. 校验:处理人是发起人则自动完成任务
  50 + // if (initiator != null && initiator.equals(currentAssignee)) {
  51 +// TaskService taskService = Context.getProcessEngineConfiguration().getTaskService();
  52 + // 添加备注变量
  53 + // delegateTask.setVariable("autoCompleteReason", "发起人自动完成任务");
  54 + // 完成任务,触发流程流转到结束节点
  55 + // taskService.complete(delegateTask.getId());
  56 + // }
  57 + }
  58 +}