Commit 3d5024419b7fa21b75bdc2adf7ac3108a7703171
1 parent
87f0d8b0
APP端待办接口重构
Showing
8 changed files
with
562 additions
and
4 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoHasTaskPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import jakarta.validation.constraints.NotNull; | |
| 6 | +import lombok.Data; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 类描述:工单工作流分页请求 reqVO | |
| 15 | + * 创建人:yanhuiqing | |
| 16 | + * 创建时间:2025/12/15 21:41 | |
| 17 | + * 修改人:yanhuiqing | |
| 18 | + * 修改时间:2025/12/15 21:41 | |
| 19 | + * 修改备注: | |
| 20 | + * | |
| 21 | + * @author yanhuiqing | |
| 22 | + * @version 1.0 | |
| 23 | + */ | |
| 24 | +@Schema(description = "管理后台 - 工单工作流信息分页 Request VO") | |
| 25 | +@Data | |
| 26 | +public class MainInfoHasTaskPageReqVO extends PageParam { | |
| 27 | + @NotNull | |
| 28 | + @Schema(description = "任务指派人", example = "admin") | |
| 29 | + private Long userId; | |
| 30 | + @Schema(description = "流程定义key", example = "quik_local_test") | |
| 31 | + private String key; | |
| 32 | + @Schema(description = "开始时间") | |
| 33 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 34 | + private LocalDateTime[] startTime; | |
| 35 | + @Schema(description = "结束时间") | |
| 36 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 37 | + private LocalDateTime[] endTime; | |
| 38 | + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ") | |
| 39 | + private String busiLine; | |
| 40 | + @Schema(description = "工单号") | |
| 41 | + private String orderNo; | |
| 42 | + @Schema(description = "工单名称", example = "张三") | |
| 43 | + private String orderName; | |
| 44 | + @Schema(description = "工单描述", example = "你说的对") | |
| 45 | + private String remark; | |
| 46 | + @Schema(description = "道路名称", example = "王五") | |
| 47 | + private String roadName; | |
| 48 | + @Schema(description = "街道名称", example = "芋艿") | |
| 49 | + private String streetName; | |
| 50 | + @Schema(description = "养护级别ID", example = "1") | |
| 51 | + private Integer curingLevelId; | |
| 52 | +} | |
| 0 | 53 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderController.java
| ... | ... | @@ -104,7 +104,7 @@ public class AppGardenWorkOrderController { |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | @PutMapping("/return") |
| 107 | - @Operation(summary = "退回任务", description = "用于【流程详情】的【退回】按钮") | |
| 107 | + @Operation(summary = " app - 退回任务", description = "用于【流程详情】的【退回】按钮") | |
| 108 | 108 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") |
| 109 | 109 | public CommonResult<Boolean> returnTask(@Valid @RequestBody AppGardenTaskReturnReqVO reqVO) { |
| 110 | 110 | gardenService.returnTask(reqVO); |
| ... | ... | @@ -112,7 +112,7 @@ public class AppGardenWorkOrderController { |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | @PutMapping("/withdraw") |
| 115 | - @Operation(summary = "撤回任务") | |
| 115 | + @Operation(summary = "app - 撤回任务") | |
| 116 | 116 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") |
| 117 | 117 | public CommonResult<Boolean> withdrawTask(@RequestParam("taskId") String taskId) { |
| 118 | 118 | gardenService.withdrawTask(taskId); |
| ... | ... | @@ -120,7 +120,7 @@ public class AppGardenWorkOrderController { |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | @PutMapping("/delegate") |
| 123 | - @Operation(summary = "委派任务", description = "用于【流程详情】的【委派】按钮") | |
| 123 | + @Operation(summary = "app - 委派任务", description = "用于【流程详情】的【委派】按钮") | |
| 124 | 124 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") |
| 125 | 125 | public CommonResult<Boolean> delegateTask(@Valid @RequestBody AppGardenTaskDelegateReqVO reqVO) { |
| 126 | 126 | gardenService.delegateTask(reqVO); |
| ... | ... | @@ -128,7 +128,7 @@ public class AppGardenWorkOrderController { |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | @PutMapping("/transfer") |
| 131 | - @Operation(summary = "转派任务", description = "用于【流程详情】的【转派】按钮") | |
| 131 | + @Operation(summary = "app - 转派任务", description = "用于【流程详情】的【转派】按钮") | |
| 132 | 132 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") |
| 133 | 133 | public CommonResult<Boolean> transferTask(@Valid @RequestBody AppGardenTaskTransferReqVO reqVO) { |
| 134 | 134 | gardenService.transferTask(reqVO); |
| ... | ... | @@ -149,4 +149,19 @@ public class AppGardenWorkOrderController { |
| 149 | 149 | PageResult<AppGardenTaskRespVO> pageResult = gardenService.getTaskTodoPage(pageVO); |
| 150 | 150 | return success(pageResult); |
| 151 | 151 | } |
| 152 | + | |
| 153 | + @GetMapping("doneBuzSimplePage") | |
| 154 | + @Operation(summary = "app - 获取工单业务已办任务分页") | |
| 155 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:query')") | |
| 156 | + public CommonResult<PageResult<AppGardenWorkOrderRespVO>> getTaskDoneBuzSimplePage(@Valid AppGardenWorkOrderPageReqVO pageVO) { | |
| 157 | + PageResult<AppGardenWorkOrderRespVO> pageResult = gardenService.getTaskDoneBuzSimplePage(pageVO); | |
| 158 | + return success(pageResult); | |
| 159 | + } | |
| 160 | + @GetMapping("todoBuzSimplePage") | |
| 161 | + @Operation(summary = "app - 获取工单业务待办任务分页") | |
| 162 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:query')") | |
| 163 | + public CommonResult<PageResult<AppGardenWorkOrderRespVO>> getTaskTodoBuzSimplePage(@Valid AppGardenWorkOrderPageReqVO pageVO) { | |
| 164 | + PageResult<AppGardenWorkOrderRespVO> pageResult = gardenService.getTaskTodoBuzSimplePage(pageVO); | |
| 165 | + return success(pageResult); | |
| 166 | + } | |
| 152 | 167 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/AppGardenWorkOrderRespVO.java
| ... | ... | @@ -4,6 +4,7 @@ import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInf |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | 6 | |
| 7 | +import java.time.LocalDateTime; | |
| 7 | 8 | import java.util.List; |
| 8 | 9 | |
| 9 | 10 | /** |
| ... | ... | @@ -21,4 +22,22 @@ public class AppGardenWorkOrderRespVO extends MainInfoRespVO { |
| 21 | 22 | |
| 22 | 23 | @Schema(description = "处理完成照片", example = "9184") |
| 23 | 24 | private List<String> completeImgsList; |
| 25 | + | |
| 26 | + @Schema(description = "任务id") | |
| 27 | + private String taskId; | |
| 28 | + | |
| 29 | + @Schema(description = "任务名称") | |
| 30 | + private String taskName; | |
| 31 | + | |
| 32 | + @Schema(description = "流程定义名称") | |
| 33 | + private String processDefinitionName; | |
| 34 | + | |
| 35 | + @Schema(description = "任务开始时间") | |
| 36 | + private LocalDateTime startTime; | |
| 37 | + | |
| 38 | + @Schema(description = "任务结束时间") | |
| 39 | + private LocalDateTime endTime; | |
| 40 | + | |
| 41 | + @Schema(description = "流程定义key") | |
| 42 | + private String key_; | |
| 24 | 43 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/convert/garden/AppGardenTaskConvert.java
| 1 | 1 | package com.zteits.urbanops.module.workorder.convert.garden; |
| 2 | 2 | |
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
| 3 | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | 5 | import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; |
| 5 | 6 | import com.zteits.urbanops.framework.common.util.date.DateUtils; |
| ... | ... | @@ -11,7 +12,12 @@ import com.zteits.urbanops.module.bpm.dal.dataobject.definition.BpmProcessDefini |
| 11 | 12 | import com.zteits.urbanops.module.bpm.framework.flowable.core.util.FlowableUtils; |
| 12 | 13 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 13 | 14 | import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 15 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | |
| 16 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderRespVO; | |
| 14 | 17 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRespVO; |
| 18 | +import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; | |
| 19 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoExtDO; | |
| 20 | +import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; | |
| 15 | 21 | import org.flowable.engine.history.HistoricProcessInstance; |
| 16 | 22 | import org.flowable.engine.runtime.ProcessInstance; |
| 17 | 23 | import org.flowable.task.api.Task; |
| ... | ... | @@ -19,8 +25,11 @@ import org.flowable.task.api.history.HistoricTaskInstance; |
| 19 | 25 | import org.mapstruct.Mapper; |
| 20 | 26 | import org.mapstruct.factory.Mappers; |
| 21 | 27 | |
| 28 | +import java.util.Arrays; | |
| 29 | +import java.util.Collections; | |
| 22 | 30 | import java.util.List; |
| 23 | 31 | import java.util.Map; |
| 32 | +import java.util.stream.Collectors; | |
| 24 | 33 | |
| 25 | 34 | import static com.zteits.urbanops.framework.common.util.collection.MapUtils.findAndThen; |
| 26 | 35 | |
| ... | ... | @@ -88,4 +97,80 @@ public interface AppGardenTaskConvert { |
| 88 | 97 | return new PageResult<>(taskVOList, pageResult.getTotal()); |
| 89 | 98 | } |
| 90 | 99 | |
| 100 | + default PageResult<AppGardenWorkOrderRespVO> buildBuziTaskPage(PageResult<MainInfoExtDO> pageResult, AttachmentMapper attachmentMapper){ | |
| 101 | + // 1. 源分页对象为空,返回空分页 | |
| 102 | + if (pageResult == null) { | |
| 103 | + return PageResult.empty(); | |
| 104 | + } | |
| 105 | + | |
| 106 | + // 2. 转换列表数据,保留分页参数(总数、页码、页大小等) | |
| 107 | + List<AppGardenWorkOrderRespVO> targetList = convertList(pageResult.getList(), attachmentMapper); | |
| 108 | + return new PageResult<>(targetList, pageResult.getTotal()); | |
| 109 | + } | |
| 110 | + | |
| 111 | + default List<AppGardenWorkOrderRespVO> convertList(List<MainInfoExtDO> sourceList, AttachmentMapper attachmentMapper) { | |
| 112 | + // 1. 源列表为空,返回空列表(避免NPE) | |
| 113 | + if (sourceList == null || sourceList.isEmpty()) { | |
| 114 | + return Collections.emptyList(); | |
| 115 | + } | |
| 116 | + | |
| 117 | + // 2. 遍历源列表,调用单对象转换方法 | |
| 118 | + return sourceList.stream() | |
| 119 | + .map(source -> convert(source, attachmentMapper)) | |
| 120 | + .collect(Collectors.toList()); | |
| 121 | + } | |
| 122 | + | |
| 123 | + /** | |
| 124 | + * MainInfoExtDO → AppGardenWorkOrderRespVO | |
| 125 | + * @param source 源对象 | |
| 126 | + * @param attachmentMapper 附件Mapper,用于查询图片列表 | |
| 127 | + * @return 目标对象 | |
| 128 | + */ | |
| 129 | + default AppGardenWorkOrderRespVO convert(MainInfoExtDO source, AttachmentMapper attachmentMapper) { | |
| 130 | + // 1. 源对象为空,直接返回null | |
| 131 | + if (source == null) { | |
| 132 | + return null; | |
| 133 | + } | |
| 134 | + | |
| 135 | + AppGardenWorkOrderRespVO target = new AppGardenWorkOrderRespVO(); | |
| 136 | + org.springframework.beans.BeanUtils.copyProperties(source, target); | |
| 137 | + | |
| 138 | + // 3. 手动赋值扩展字段:查询问题图片列表和完成图片列表 | |
| 139 | + List<String> problemImgsList = queryAttachment( | |
| 140 | + source.getBusiLine(), | |
| 141 | + BpmCommonConstant.PROBLEM_IMG_GROUP, | |
| 142 | + source.getOrderNo(), | |
| 143 | + attachmentMapper | |
| 144 | + ); | |
| 145 | + List<String> completeImgsList = queryAttachment( | |
| 146 | + source.getBusiLine(), | |
| 147 | + BpmCommonConstant.RESULT_IMG_GROUP, | |
| 148 | + source.getOrderNo(), | |
| 149 | + attachmentMapper | |
| 150 | + ); | |
| 151 | + target.setProblemImgsList(problemImgsList); | |
| 152 | + target.setCompleteImgsList(completeImgsList); | |
| 153 | + | |
| 154 | + return target; | |
| 155 | + } | |
| 156 | + | |
| 157 | + default List<String> queryAttachment(String busiLine, String busiType, String orderNo, AttachmentMapper attachmentMapper) { | |
| 158 | + | |
| 159 | + LambdaQueryWrapper<AttachmentDO> queryWrapper = new LambdaQueryWrapper<AttachmentDO>() | |
| 160 | + .eq(AttachmentDO::getBusiLine, busiLine) | |
| 161 | + .eq(AttachmentDO::getBusiType, busiType) | |
| 162 | + .eq(AttachmentDO::getOrderNo, orderNo); | |
| 163 | + List<AttachmentDO> attachments = attachmentMapper.selectList(queryWrapper); | |
| 164 | + if (attachments == null || attachments.isEmpty()) { | |
| 165 | + return List.of(); | |
| 166 | + } | |
| 167 | + return attachments.stream() | |
| 168 | + .map(AttachmentDO::getFileNames) | |
| 169 | + .filter(s -> s != null && !s.isEmpty()) | |
| 170 | + .flatMap(s -> Arrays.stream(s.split(",")).map(String::trim)) | |
| 171 | + .filter(s -> !s.isEmpty()) | |
| 172 | + .distinct() | |
| 173 | + .collect(Collectors.toList()); | |
| 174 | + } | |
| 175 | + | |
| 91 | 176 | } |
| 92 | 177 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoExtDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.dal.dataobject.maininfo; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 5 | +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 6 | +import lombok.*; | |
| 7 | + | |
| 8 | +import java.math.BigDecimal; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 类描述:工单扩展信息,支持工作流任务信息 DO | |
| 13 | + * 创建人:yanhuiqing | |
| 14 | + * 创建时间:2025/12/15 17:37 | |
| 15 | + * 修改人:yanhuiqing | |
| 16 | + * 修改时间:2025/12/15 17:37 | |
| 17 | + * 修改备注: | |
| 18 | + * | |
| 19 | + * @author yanhuiqing | |
| 20 | + * @version 1.0 | |
| 21 | + */ | |
| 22 | + | |
| 23 | +@Data | |
| 24 | +@EqualsAndHashCode(callSuper = true) | |
| 25 | +@ToString(callSuper = true) | |
| 26 | +@Builder | |
| 27 | +@NoArgsConstructor | |
| 28 | +@AllArgsConstructor | |
| 29 | +public class MainInfoExtDO extends BaseDO { | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * ID | |
| 33 | + */ | |
| 34 | + private Long id; | |
| 35 | + /** | |
| 36 | + * 业务线:yl 园林,wy 物业,sz 市政 | |
| 37 | + */ | |
| 38 | + private String busiLine; | |
| 39 | + /** | |
| 40 | + * 工单号 | |
| 41 | + */ | |
| 42 | + private String orderNo; | |
| 43 | + /** | |
| 44 | + * 工单名称 | |
| 45 | + */ | |
| 46 | + private String orderName; | |
| 47 | + /** | |
| 48 | + * 来源ID | |
| 49 | + */ | |
| 50 | + private Integer sourceId; | |
| 51 | + /** | |
| 52 | + * 来源名称 | |
| 53 | + */ | |
| 54 | + private String sourceName; | |
| 55 | + /** | |
| 56 | + * 道路ID | |
| 57 | + */ | |
| 58 | + private Long roadId; | |
| 59 | + /** | |
| 60 | + * 道路名称 | |
| 61 | + */ | |
| 62 | + private String roadName; | |
| 63 | + /** | |
| 64 | + * 街道ID | |
| 65 | + */ | |
| 66 | + private String streetId; | |
| 67 | + /** | |
| 68 | + * 街道名称 | |
| 69 | + */ | |
| 70 | + private String streetName; | |
| 71 | + /** | |
| 72 | + * 养护级别ID | |
| 73 | + */ | |
| 74 | + private Integer curingLevelId; | |
| 75 | + /** | |
| 76 | + * 养护级别 | |
| 77 | + */ | |
| 78 | + private String curingLevelName; | |
| 79 | + /** | |
| 80 | + * 提交日期 | |
| 81 | + */ | |
| 82 | + private LocalDateTime commitDate; | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * 完成时间 | |
| 86 | + */ | |
| 87 | + private LocalDateTime finishDate; | |
| 88 | + /** | |
| 89 | + * 紧急程度:1:特急;2:紧急;3:一般 | |
| 90 | + */ | |
| 91 | + private Integer pressingType; | |
| 92 | + /** | |
| 93 | + * 提交用户ID | |
| 94 | + */ | |
| 95 | + private Long userId; | |
| 96 | + /** | |
| 97 | + * 提交用户名称 | |
| 98 | + */ | |
| 99 | + private String userName; | |
| 100 | + /** | |
| 101 | + * 部门id | |
| 102 | + */ | |
| 103 | + private Long companyId; | |
| 104 | + /** | |
| 105 | + * 经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯 | |
| 106 | + */ | |
| 107 | + private Integer latLonType; | |
| 108 | + /** | |
| 109 | + * 经度 | |
| 110 | + */ | |
| 111 | + private BigDecimal lat; | |
| 112 | + /** | |
| 113 | + * 维度 | |
| 114 | + */ | |
| 115 | + private BigDecimal lon; | |
| 116 | + /** | |
| 117 | + * 经纬度地址 | |
| 118 | + */ | |
| 119 | + private String lonLatAddress; | |
| 120 | + /** | |
| 121 | + * 三方工单ID | |
| 122 | + */ | |
| 123 | + private String thirdWorkNo; | |
| 124 | + /** | |
| 125 | + * 三方工单结果上报状态:1:待推送;2:推送成功;3:推送失败 | |
| 126 | + */ | |
| 127 | + private Integer thirdPushState; | |
| 128 | + /** | |
| 129 | + * 业务状态 | |
| 130 | + */ | |
| 131 | + private String buzStatus; | |
| 132 | + /** | |
| 133 | + * 审批状态 | |
| 134 | + */ | |
| 135 | + private Integer status; | |
| 136 | + /** | |
| 137 | + * 流程实例的编号 | |
| 138 | + */ | |
| 139 | + private String processInstanceId; | |
| 140 | + /** | |
| 141 | + * 工单描述 | |
| 142 | + */ | |
| 143 | + private String remark; | |
| 144 | + /** | |
| 145 | + * 工单完成结果描述 | |
| 146 | + */ | |
| 147 | + private String handleResult; | |
| 148 | + /** | |
| 149 | + * 任务id | |
| 150 | + */ | |
| 151 | + private String taskId; | |
| 152 | + /** | |
| 153 | + * 任务名称 | |
| 154 | + */ | |
| 155 | + private String taskName; | |
| 156 | + /** | |
| 157 | + * 流程定义名称 | |
| 158 | + */ | |
| 159 | + private String processDefinitionName; | |
| 160 | + /** | |
| 161 | + * 任务开始时间 | |
| 162 | + */ | |
| 163 | + private LocalDateTime startTime; | |
| 164 | + /** | |
| 165 | + * 任务结束时间 | |
| 166 | + */ | |
| 167 | + private LocalDateTime endTime; | |
| 168 | + /** | |
| 169 | + * 流程定义key | |
| 170 | + */ | |
| 171 | + private String key_; | |
| 172 | + | |
| 173 | + | |
| 174 | +} | |
| 0 | 175 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoExtMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.dal.mysql.maininfo; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.core.conditions.Wrapper; | |
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 7 | +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import com.zteits.urbanops.framework.mybatis.core.util.MyBatisUtils; | |
| 9 | +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoHasTaskPageReqVO; | |
| 10 | +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; | |
| 11 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | |
| 12 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoExtDO; | |
| 13 | +import org.apache.ibatis.annotations.*; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * 类描述:工单工作流扩展Mapper | |
| 17 | + * 创建人:yanhuiqing | |
| 18 | + * 创建时间:2025/12/15 17:27 | |
| 19 | + * 修改人:yanhuiqing | |
| 20 | + * 修改时间:2025/12/15 17:27 | |
| 21 | + * 修改备注: | |
| 22 | + * | |
| 23 | + * @author yanhuiqing | |
| 24 | + * @version 1.0 | |
| 25 | + */ | |
| 26 | +@Mapper | |
| 27 | +public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> { | |
| 28 | + @Select("select m.*," + | |
| 29 | + " t.ID_ AS task_id," + | |
| 30 | + " t.NAME_ AS task_name," + | |
| 31 | + " pd.NAME_ AS process_definition_name," + | |
| 32 | + " t.START_TIME_ ," + | |
| 33 | + " t.END_TIME_ ," + | |
| 34 | + " pd.KEY_ " + | |
| 35 | + " FROM act_hi_taskinst t" + | |
| 36 | + " LEFT JOIN act_re_procdef pd ON t.PROC_DEF_ID_ = pd.ID_" + | |
| 37 | + " LEFT JOIN workorder_main_info m ON t.PROC_INST_ID_ = m.process_instance_id" + | |
| 38 | + " WHERE 1=1" + | |
| 39 | + " AND t.END_TIME_ IS NOT NULL " + | |
| 40 | + " <if test='query.userId != null'>AND t.ASSIGNEE_ = #{query.userId}</if> "+ | |
| 41 | + " <if test='query.key != null'>AND pd.KEY_ = #{query.key}</if> "+ | |
| 42 | + " AND m.deleted = 0"+ | |
| 43 | + " <if test='query.startTime != null'> " + | |
| 44 | + " AND t.START_TIME_ >= #{query.startTime} " + | |
| 45 | + " </if> " + | |
| 46 | + " <if test='query.endTime != null'> " + | |
| 47 | + " AND t.END_TIME_ <= #{query.endTime} " + | |
| 48 | + " </if> " + | |
| 49 | + " <if test='query.busiLine != null'>AND m.busi_line = #{query.busiLine}</if> "+ | |
| 50 | + " <if test='query.orderNo != null and query.orderNo != '''>AND m.order_no LIKE CONCAT('%', #{query.orderNo}, '%')</if> "+ | |
| 51 | + " <if test='query.orderName != null and query.orderName != '''>AND m.order_name LIKE CONCAT('%', #{query.orderName}, '%')</if> "+ | |
| 52 | + " <if test='query.remark != null and query.remark != '''>AND m.remark LIKE CONCAT('%', #{query.remark}, '%')</if> "+ | |
| 53 | + " <if test='query.roadName != null and query.roadName != '''>AND m.road_name LIKE CONCAT('%', #{query.roadName}, '%')</if> "+ | |
| 54 | + " <if test='query.streetName != null'>AND m.order_no = #{query.orderNo}</if> "+ | |
| 55 | + " <if test='query.curingLevelId != null'>AND m.curing_level_id = #{query.curingLevelId}</if> "+ | |
| 56 | + " ORDER BY t.END_TIME_ desc " | |
| 57 | + | |
| 58 | + ) | |
| 59 | + @Results({ | |
| 60 | + @Result(column = "id", property = "id"), | |
| 61 | + @Result(column = "busi_line", property = "busiLine"), | |
| 62 | + @Result(column = "order_no", property = "orderNo"), | |
| 63 | + @Result(column = "order_name", property = "orderName"), | |
| 64 | + @Result(column = "source_id", property = "sourceId"), | |
| 65 | + @Result(column = "source_name", property = "sourceName"), | |
| 66 | + @Result(column = "road_id", property = "roadId"), | |
| 67 | + @Result(column = "road_name", property = "roadName"), | |
| 68 | + @Result(column = "street_id", property = "streetId"), | |
| 69 | + @Result(column = "street_name", property = "streetName"), | |
| 70 | + @Result(column = "curing_level_id", property = "curingLevelId"), | |
| 71 | + @Result(column = "curing_level_name", property = "curingLevelName"), | |
| 72 | + @Result(column = "commit_date", property = "commitDate"), | |
| 73 | + @Result(column = "finish_date", property = "finishDate"), | |
| 74 | + @Result(column = "pressing_type", property = "pressingType"), | |
| 75 | + @Result(column = "user_id", property = "userId"), | |
| 76 | + @Result(column = "user_name", property = "userName"), | |
| 77 | + @Result(column = "company_id", property = "companyId"), | |
| 78 | + @Result(column = "lat_lon_type", property = "latLonType"), | |
| 79 | + @Result(column = "lat", property = "lat"), | |
| 80 | + @Result(column = "lon", property = "lon"), | |
| 81 | + @Result(column = "lon_lat_address", property = "lonLatAddress"), | |
| 82 | + @Result(column = "third_work_no", property = "thirdWorkNo"), | |
| 83 | + @Result(column = "third_push_state", property = "thirdPushState"), | |
| 84 | + @Result(column = "buz_status", property = "buzStatus"), | |
| 85 | + @Result(column = "status", property = "status"), | |
| 86 | + @Result(column = "process_instance_id", property = "processInstanceId"), | |
| 87 | + @Result(column = "remark", property = "remark"), | |
| 88 | + @Result(column = "handle_result", property = "handleResult"), | |
| 89 | + @Result(column = "creator", property = "creator"), | |
| 90 | + @Result(column = "create_time", property = "createTime"), | |
| 91 | + @Result(column = "updater", property = "updater"), | |
| 92 | + @Result(column = "update_time", property = "updateTime"), | |
| 93 | + @Result(column = "deleted", property = "deleted"), | |
| 94 | + | |
| 95 | + @Result(column = "task_id", property = "taskId"), | |
| 96 | + @Result(column = "task_name", property = "taskName"), | |
| 97 | + @Result(column = "process_definition_name", property = "processDefinitionName"), | |
| 98 | + @Result(column = "START_TIME_", property = "startTime"), | |
| 99 | + @Result(column = "END_TIME_", property = "endTime"), | |
| 100 | + @Result(column = "KEY_", property = "key_") | |
| 101 | + }) | |
| 102 | + IPage<MainInfoExtDO> selectDoneExtPage(IPage<MainInfoExtDO> page, @Param("query") MainInfoHasTaskPageReqVO reqVO); | |
| 103 | + | |
| 104 | + default PageResult<MainInfoExtDO> selectWorkOrderDonePage(PageParam pageParam, @Param("query") MainInfoHasTaskPageReqVO reqVO) { | |
| 105 | + IPage<MainInfoExtDO> mpPage = MyBatisUtils.buildPage(pageParam); | |
| 106 | + mpPage = selectDoneExtPage(mpPage, reqVO); | |
| 107 | + return new PageResult<>(mpPage.getRecords(), mpPage.getTotal()); | |
| 108 | + } | |
| 109 | + | |
| 110 | + @Select("select m.*," + | |
| 111 | + " t.ID_ AS task_id," + | |
| 112 | + " t.NAME_ AS task_name," + | |
| 113 | + " pd.NAME_ AS process_definition_name," + | |
| 114 | + " t.CREATE_TIME_ as START_TIME_," + | |
| 115 | + " t.DUE_DATE_ as END_TIME_," + | |
| 116 | + " pd.KEY_ " + | |
| 117 | + " FROM act_ru_task t" + | |
| 118 | + " LEFT JOIN act_re_procdef pd ON t.PROC_DEF_ID_ = pd.ID_" + | |
| 119 | + " LEFT JOIN workorder_main_info m ON t.PROC_INST_ID_ = m.process_instance_id" + | |
| 120 | + " WHERE 1=1" + | |
| 121 | + " AND t.END_TIME_ IS NOT NULL " + | |
| 122 | + " <if test='query.userId != null'>AND t.ASSIGNEE_ = #{query.userId}</if> "+ | |
| 123 | + " <if test='query.key != null'>AND pd.KEY_ = #{query.key}</if> "+ | |
| 124 | + " AND t.SUSPENSION_STATE_ = 1 "+ | |
| 125 | + " AND m.deleted = 0"+ | |
| 126 | + " <if test='query.startTime != null'> " + | |
| 127 | + " AND t.CREATE_TIME_ >= #{query.startTime} " + | |
| 128 | + " </if> " + | |
| 129 | + " <if test='query.busiLine != null'>AND m.busi_line = #{query.busiLine}</if> "+ | |
| 130 | + " <if test='query.orderNo != null and query.orderNo != '''>AND m.order_no LIKE CONCAT('%', #{query.orderNo}, '%')</if> "+ | |
| 131 | + " <if test='query.orderName != null and query.orderName != '''>AND m.order_name LIKE CONCAT('%', #{query.orderName}, '%')</if> "+ | |
| 132 | + " <if test='query.remark != null and query.remark != '''>AND m.remark LIKE CONCAT('%', #{query.remark}, '%')</if> "+ | |
| 133 | + " <if test='query.roadName != null and query.roadName != '''>AND m.road_name LIKE CONCAT('%', #{query.roadName}, '%')</if> "+ | |
| 134 | + " <if test='query.streetName != null'>AND m.order_no = #{query.orderNo}</if> "+ | |
| 135 | + " <if test='query.curingLevelId != null'>AND m.curing_level_id = #{query.curingLevelId}</if> "+ | |
| 136 | + " ORDER BY t.CREATE_TIME_ desc " | |
| 137 | + | |
| 138 | + ) | |
| 139 | + @Results({ | |
| 140 | + @Result(column = "id", property = "id"), | |
| 141 | + @Result(column = "busi_line", property = "busiLine"), | |
| 142 | + @Result(column = "order_no", property = "orderNo"), | |
| 143 | + @Result(column = "order_name", property = "orderName"), | |
| 144 | + @Result(column = "source_id", property = "sourceId"), | |
| 145 | + @Result(column = "source_name", property = "sourceName"), | |
| 146 | + @Result(column = "road_id", property = "roadId"), | |
| 147 | + @Result(column = "road_name", property = "roadName"), | |
| 148 | + @Result(column = "street_id", property = "streetId"), | |
| 149 | + @Result(column = "street_name", property = "streetName"), | |
| 150 | + @Result(column = "curing_level_id", property = "curingLevelId"), | |
| 151 | + @Result(column = "curing_level_name", property = "curingLevelName"), | |
| 152 | + @Result(column = "commit_date", property = "commitDate"), | |
| 153 | + @Result(column = "finish_date", property = "finishDate"), | |
| 154 | + @Result(column = "pressing_type", property = "pressingType"), | |
| 155 | + @Result(column = "user_id", property = "userId"), | |
| 156 | + @Result(column = "user_name", property = "userName"), | |
| 157 | + @Result(column = "company_id", property = "companyId"), | |
| 158 | + @Result(column = "lat_lon_type", property = "latLonType"), | |
| 159 | + @Result(column = "lat", property = "lat"), | |
| 160 | + @Result(column = "lon", property = "lon"), | |
| 161 | + @Result(column = "lon_lat_address", property = "lonLatAddress"), | |
| 162 | + @Result(column = "third_work_no", property = "thirdWorkNo"), | |
| 163 | + @Result(column = "third_push_state", property = "thirdPushState"), | |
| 164 | + @Result(column = "buz_status", property = "buzStatus"), | |
| 165 | + @Result(column = "status", property = "status"), | |
| 166 | + @Result(column = "process_instance_id", property = "processInstanceId"), | |
| 167 | + @Result(column = "remark", property = "remark"), | |
| 168 | + @Result(column = "handle_result", property = "handleResult"), | |
| 169 | + @Result(column = "creator", property = "creator"), | |
| 170 | + @Result(column = "create_time", property = "createTime"), | |
| 171 | + @Result(column = "updater", property = "updater"), | |
| 172 | + @Result(column = "update_time", property = "updateTime"), | |
| 173 | + @Result(column = "deleted", property = "deleted"), | |
| 174 | + | |
| 175 | + @Result(column = "task_id", property = "taskId"), | |
| 176 | + @Result(column = "task_name", property = "taskName"), | |
| 177 | + @Result(column = "process_definition_name", property = "processDefinitionName"), | |
| 178 | + @Result(column = "START_TIME_", property = "startTime"), | |
| 179 | + @Result(column = "END_TIME_", property = "endTime"), | |
| 180 | + @Result(column = "KEY_", property = "key_") | |
| 181 | + }) | |
| 182 | + IPage<MainInfoExtDO> selectTodoExtPage(IPage<MainInfoExtDO> page, @Param("query") MainInfoHasTaskPageReqVO reqVO); | |
| 183 | + | |
| 184 | + default PageResult<MainInfoExtDO> selectWorkOrderTodoPage(PageParam pageParam, @Param("query") MainInfoHasTaskPageReqVO reqVO) { | |
| 185 | + IPage<MainInfoExtDO> mpPage = MyBatisUtils.buildPage(pageParam); | |
| 186 | + mpPage = selectTodoExtPage(mpPage, reqVO); | |
| 187 | + return new PageResult<>(mpPage.getRecords(), mpPage.getTotal()); | |
| 188 | + } | |
| 189 | +} | |
| 0 | 190 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java
| ... | ... | @@ -2,12 +2,14 @@ package com.zteits.urbanops.module.workorder.dal.mysql.maininfo; |
| 2 | 2 | |
| 3 | 3 | import java.util.*; |
| 4 | 4 | |
| 5 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 5 | 6 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 7 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | 8 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | 9 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| 9 | 10 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 11 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.*; |
| 12 | +import org.apache.poi.ss.formula.functions.T; | |
| 11 | 13 | |
| 12 | 14 | /** |
| 13 | 15 | * 工单信息 Mapper |
| ... | ... | @@ -85,4 +87,12 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { |
| 85 | 87 | .orderByDesc(MainInfoDO::getId)); |
| 86 | 88 | } |
| 87 | 89 | |
| 90 | + default List<MainInfoDO> selectListIn(String field, Collection<?> values) { | |
| 91 | + // 空集合判断:避免 SQL 中出现 IN () 语法错误 | |
| 92 | + if (values == null || values.isEmpty()) { | |
| 93 | + return List.of(); // 返回空列表(JDK9+),也可以用 new ArrayList<>() | |
| 94 | + } | |
| 95 | + return selectList(new QueryWrapper<MainInfoDO>().in(field, values)); | |
| 96 | + } | |
| 97 | + | |
| 88 | 98 | } |
| 89 | 99 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenService.java
| ... | ... | @@ -119,4 +119,18 @@ public interface BpmGardenService { |
| 119 | 119 | * @return |
| 120 | 120 | */ |
| 121 | 121 | AppGardenApprovalDetailRespVO getApprovalDetail(AppGardenApprovalDetailReqVO reqVO); |
| 122 | + | |
| 123 | + /** | |
| 124 | + * 工单业务已完结 列表 -app 端 | |
| 125 | + * @param pageVO | |
| 126 | + * @return | |
| 127 | + */ | |
| 128 | + PageResult<AppGardenWorkOrderRespVO> getTaskDoneBuzSimplePage(AppGardenWorkOrderPageReqVO pageVO); | |
| 129 | + | |
| 130 | + /** | |
| 131 | + * 工单业务待办 列表 -app端 | |
| 132 | + * @param pageVO | |
| 133 | + * @return | |
| 134 | + */ | |
| 135 | + PageResult<AppGardenWorkOrderRespVO> getTaskTodoBuzSimplePage(AppGardenWorkOrderPageReqVO pageVO); | |
| 122 | 136 | } | ... | ... |