Commit cdb07079b0d5c9b4928d8cf36aeaed0c32f7f231
Merge remote-tracking branch 'origin/dev' into dev
Showing
16 changed files
with
1068 additions
and
5 deletions
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/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderInspectorReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.dto; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotEmpty; | |
| 5 | +import jakarta.validation.constraints.NotNull; | |
| 6 | +import lombok.Data; | |
| 7 | +import org.hibernate.validator.constraints.Length; | |
| 8 | + | |
| 9 | +import java.math.BigDecimal; | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * @author yanhuiqing | |
| 15 | + * @version 1.0 | |
| 16 | + * @description: app 督察员端请求参数 | |
| 17 | + * @date 2025/12/6 10:17 | |
| 18 | + */ | |
| 19 | +@Schema(description = "APP-园林工单请求创建 Request VO") | |
| 20 | +@Data | |
| 21 | +public class AppGardenWorkOrderInspectorReqVO { | |
| 22 | + | |
| 23 | + | |
| 24 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | |
| 25 | + @NotNull(message = "道路ID不能为空") | |
| 26 | + private Long roadId; | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 工单类型 Q:快速工单,C:普通工单,O:其他工单 | |
| 30 | + */ | |
| 31 | + private String orderType; | |
| 32 | + | |
| 33 | + @Schema(description = "道路名称", example = "测试道路") | |
| 34 | + private String roadName; | |
| 35 | + | |
| 36 | + @Schema(description = "问题图片", example = "9184") | |
| 37 | + private List<String> problemsImgs; | |
| 38 | + | |
| 39 | + @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | |
| 40 | + @NotEmpty(message = "工单描述不能为空") | |
| 41 | + @Length(max = 500) | |
| 42 | + private String remark; | |
| 43 | + | |
| 44 | + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") | |
| 45 | + private Integer latLonType; | |
| 46 | + | |
| 47 | + @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 48 | + @NotNull(message = "经度不能为空") | |
| 49 | + private BigDecimal lat; | |
| 50 | + | |
| 51 | + @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 52 | + @NotNull(message = "维度不能为空") | |
| 53 | + private BigDecimal lon; | |
| 54 | + | |
| 55 | + @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 56 | + @NotEmpty(message = "经纬度地址不能为空") | |
| 57 | + private String lonLatAddress; | |
| 58 | + | |
| 59 | + @Schema(description = " 紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 60 | + @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般") | |
| 61 | + private Integer pressingType; | |
| 62 | + | |
| 63 | + @Schema(description = "工单名称", example = "绿地卫生") | |
| 64 | + private String orderName; | |
| 65 | + | |
| 66 | + @Schema(description = "来源ID 工单来源 1、巡查,2、游客居民,3、12345,4、网格", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 67 | + //@NotNull(message = "来源ID不能为空") | |
| 68 | + private Integer sourceId; | |
| 69 | + | |
| 70 | + @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "园林") | |
| 71 | + //@NotEmpty(message = "来源名称不能为空") | |
| 72 | + private String sourceName; | |
| 73 | + | |
| 74 | + @Schema(description = "三方工单ID") | |
| 75 | + private String thirdWorkNo; | |
| 76 | + | |
| 77 | + @Schema(description = "希望完成时间", example = "1766505427000") // Swagger文档示例 | |
| 78 | + private LocalDateTime expectedFinishDate; | |
| 79 | + | |
| 80 | + @NotNull | |
| 81 | + @Schema(description = "工单业务线", example = "yl") | |
| 82 | + private String busiLine; | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | +} | |
| 87 | + | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/annotation/AutoUpdateWorkerOrderInspectorBuzStatus.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.annotation; | |
| 2 | + | |
| 3 | +import java.lang.annotation.*; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * 创 建 人:yanhuiqing | |
| 7 | + * 创建时间:2025/12/21 14:50 | |
| 8 | + * 类描述:自动更新工单表业务状态 | |
| 9 | + * | |
| 10 | + * @author yanhuiqing | |
| 11 | + */ | |
| 12 | +@Target({ElementType.METHOD}) | |
| 13 | +@Retention(RetentionPolicy.RUNTIME) | |
| 14 | +@Documented | |
| 15 | +public @interface AutoUpdateWorkerOrderInspectorBuzStatus { | |
| 16 | +} | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
| ... | ... | @@ -64,6 +64,8 @@ public class BpmCommonConstant { |
| 64 | 64 | * 流转通过 |
| 65 | 65 | */ |
| 66 | 66 | public static final String BMP_COMMON_PROD_ISPASS = "isPass"; |
| 67 | + | |
| 68 | + public static final String BPM_COMMON_PROD_ISSANHAI = "isSanhai"; | |
| 67 | 69 | /** |
| 68 | 70 | * 是否全域的大区经理 key |
| 69 | 71 | */ |
| ... | ... | @@ -170,6 +172,8 @@ public class BpmCommonConstant { |
| 170 | 172 | */ |
| 171 | 173 | public static final String REGIONAL_MANAGER = "regional_manager"; |
| 172 | 174 | |
| 175 | + public static final String INSPECTOR_GLOBAL = "Inspector_global"; | |
| 176 | + | |
| 173 | 177 | /*养护级别-字典key*/ |
| 174 | 178 | public static final String CONSERVE_LEVEL = "conserve_level"; |
| 175 | 179 | //--------------------------------------------------------------------------------- | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderInspectorController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 4 | +import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | |
| 5 | +import com.zteits.urbanops.module.garden.api.road.RoadApi; | |
| 6 | +import com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderInspectorBuzStatus; | |
| 7 | +import com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderUniversalBuzStatus; | |
| 8 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppUniversalApprovalReqVO; | |
| 9 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.operator.AppGardenTaskReturnExtReqVO; | |
| 10 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.operator.AppGardenTaskTeamLeaderAssignReqVO; | |
| 11 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.operator.AppGardenTaskWorkerExcuteReqVO; | |
| 12 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskApproveReqVO; | |
| 13 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskInspectorApproveReqVO; | |
| 14 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRegionMgrApproveReqVO; | |
| 15 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; | |
| 16 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | |
| 17 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; | |
| 18 | +import com.zteits.urbanops.module.workorder.enums.InspectorOperateTypeEnum; | |
| 19 | +import com.zteits.urbanops.module.workorder.enums.InspectorOperateTypeEnum; | |
| 20 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | |
| 21 | +import com.zteits.urbanops.module.workorder.service.garden.BpmInspectorService; | |
| 22 | +import com.zteits.urbanops.module.workorder.service.garden.BpmUniversalService; | |
| 23 | +import io.swagger.v3.oas.annotations.Operation; | |
| 24 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 25 | +import jakarta.annotation.Resource; | |
| 26 | +import jakarta.validation.Valid; | |
| 27 | +import lombok.extern.slf4j.Slf4j; | |
| 28 | +import org.springframework.transaction.annotation.Transactional; | |
| 29 | +import org.springframework.web.bind.annotation.PostMapping; | |
| 30 | +import org.springframework.web.bind.annotation.RequestBody; | |
| 31 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 32 | +import org.springframework.web.bind.annotation.RestController; | |
| 33 | + | |
| 34 | +import java.util.List; | |
| 35 | + | |
| 36 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 37 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 38 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; | |
| 39 | + | |
| 40 | +/** | |
| 41 | + * 类描述:园林 全域工单管理督察员入口 | |
| 42 | + * 创建人:yanhuiqing | |
| 43 | + * 创建时间:2025/12/25 15:30 | |
| 44 | + * 修改人:yanhuiqing | |
| 45 | + * 修改时间:2025/12/25 15:30 | |
| 46 | + * 修改备注: | |
| 47 | + * | |
| 48 | + * @author yanhuiqing | |
| 49 | + * @version 1.0 | |
| 50 | + */ | |
| 51 | +@Tag(name = "APP - 全域工单bpm") | |
| 52 | +@RestController | |
| 53 | +@Slf4j | |
| 54 | +@RequestMapping("/bpm/inspector/workorder") | |
| 55 | +public class AppGardenWorkOrderInspectorController { | |
| 56 | + @Resource | |
| 57 | + private BpmGardenService gardenService; | |
| 58 | + | |
| 59 | + @Resource | |
| 60 | + private BpmInspectorService inspectorService; | |
| 61 | + @Resource | |
| 62 | + private RoadApi roadApi; | |
| 63 | + @PostMapping("/createQuick") | |
| 64 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:create')") | |
| 65 | + @Operation(summary = "app-创建快速工单信息") | |
| 66 | + public CommonResult<Long> createMainInfoQuick(@Valid @RequestBody AppGardenWorkOrderReqVO createReqVO) { | |
| 67 | + return success(gardenService.createWorkOrderQuick(createReqVO)); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @PostMapping("/create") | |
| 71 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:create')") | |
| 72 | + @Operation(summary = "app-全域巡查员创建工单信息") | |
| 73 | + public CommonResult<Long> createMainInfo(@Valid @RequestBody AppGardenWorkOrderInspectorReqVO createReqVO) { | |
| 74 | + return success(inspectorService.createWorkOrder(createReqVO)); | |
| 75 | + } | |
| 76 | + | |
| 77 | + @Operation(summary = "app-统一审批入口") | |
| 78 | + @PostMapping("/universalApproval") | |
| 79 | + @AutoUpdateWorkerOrderInspectorBuzStatus | |
| 80 | + @Transactional(rollbackFor = Exception.class) | |
| 81 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") | |
| 82 | + public CommonResult<Boolean> universalApproval(@Valid @RequestBody AppUniversalApprovalReqVO reqVO) { | |
| 83 | + | |
| 84 | + log.info("【全域督察员审批】接收前端请求,入参:curTaskKey={}, taskId={}, operateType={}, agree={}, reason={}", | |
| 85 | + reqVO.getTaskKey(), reqVO.getTaskId(), reqVO.getOperateType(), reqVO.getAgree(), reqVO.getReason()); | |
| 86 | + | |
| 87 | + InspectorOperateTypeEnum operateType = InspectorOperateTypeEnum.getByCode(reqVO.getOperateType()); | |
| 88 | + | |
| 89 | + switch (operateType) { | |
| 90 | + case SH_REGION_MANAGER_ASSIGN://大区经理分配 | |
| 91 | + log.info("当前操作:"+InspectorOperateTypeEnum.SH_REGION_MANAGER_ASSIGN.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.SH_REGION_MANAGER_ASSIGN.getCode()+"-->"); | |
| 92 | + AppGardenTaskRegionMgrApproveReqVO regionPassReqVO = new AppGardenTaskRegionMgrApproveReqVO(); | |
| 93 | + Integer passStatus = reqVO.getAgree(); | |
| 94 | + if (passStatus == null || (passStatus != 0 && passStatus != 1)) { | |
| 95 | + throw exception(APP_AGREE_CHOOSE); | |
| 96 | + } | |
| 97 | + regionPassReqVO.setBusiLine(reqVO.getBusiLine()); | |
| 98 | + regionPassReqVO.setRoadId(reqVO.getRoadId()); | |
| 99 | + regionPassReqVO.setAgree(passStatus); | |
| 100 | + regionPassReqVO.setReason(reqVO.getReason()); | |
| 101 | + regionPassReqVO.setId(reqVO.getTaskId()); | |
| 102 | + regionPassReqVO.setReturnImgs(reqVO.getReturnImgs()); | |
| 103 | + inspectorService.approveTask2TeamLeader(regionPassReqVO); | |
| 104 | + log.info("当前操作:"+InspectorOperateTypeEnum.SH_REGION_MANAGER_ASSIGN.getDesc()+"<--结束"); | |
| 105 | + return success(true); | |
| 106 | + case SH_REGION_MANAGER_RETURN://大区经理退回 | |
| 107 | + log.info("当前操作:"+InspectorOperateTypeEnum.SH_REGION_MANAGER_RETURN.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.SH_REGION_MANAGER_RETURN.getCode()+"-->"); | |
| 108 | + AppGardenTaskRegionMgrApproveReqVO regionArroveReqVO = new AppGardenTaskRegionMgrApproveReqVO(); | |
| 109 | + Integer regionStatus = reqVO.getAgree(); | |
| 110 | + if (regionStatus == null || (regionStatus != 0 && regionStatus != 1)) { | |
| 111 | + throw exception(APP_AGREE_CHOOSE); | |
| 112 | + } | |
| 113 | + regionArroveReqVO.setAgree(regionStatus); | |
| 114 | + regionArroveReqVO.setReason(reqVO.getReason()); | |
| 115 | + regionArroveReqVO.setId(reqVO.getTaskId()); | |
| 116 | + regionArroveReqVO.setReturnImgs(reqVO.getReturnImgs()); | |
| 117 | + inspectorService.approveTask2TeamLeader(regionArroveReqVO); | |
| 118 | + log.info("当前操作:"+InspectorOperateTypeEnum.SH_REGION_MANAGER_RETURN.getDesc()+"<--结束"); | |
| 119 | + return success(true); | |
| 120 | + case YL_WORKER_RETURN:// 养护员退回 | |
| 121 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_WORKER_RETURN.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.YL_WORKER_RETURN.getCode()+"-->"); | |
| 122 | + AppGardenTaskReturnExtReqVO retReqVO = new AppGardenTaskReturnExtReqVO(); | |
| 123 | + retReqVO.setId(reqVO.getTaskId()); | |
| 124 | + retReqVO.setCurTaskKey(reqVO.getTaskKey()); | |
| 125 | + retReqVO.setReason(reqVO.getReason()); | |
| 126 | + retReqVO.setWorkerDataId(reqVO.getWorkerDataId()); | |
| 127 | + retReqVO.setReturnImgs(reqVO.getReturnImgs()); | |
| 128 | + gardenService.returnPreviousNode(retReqVO); | |
| 129 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_WORKER_RETURN.getDesc()+"<--结束"); | |
| 130 | + return success(true); | |
| 131 | + case YL_WORKER_IMPLEMENT://养护员实施 需修改更新工单数据 见切面 | |
| 132 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_WORKER_IMPLEMENT.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.YL_WORKER_IMPLEMENT.getCode()+"-->"); | |
| 133 | + AppGardenTaskWorkerExcuteReqVO workerExcuteReqVO = new AppGardenTaskWorkerExcuteReqVO(); | |
| 134 | + workerExcuteReqVO.setWorkerDataId(reqVO.getWorkerDataId()); | |
| 135 | + workerExcuteReqVO.setId(reqVO.getTaskId()); | |
| 136 | + workerExcuteReqVO.setCoHandlers(reqVO.getCoHandlers()); | |
| 137 | + workerExcuteReqVO.setHandleResult(reqVO.getHandleResult()); | |
| 138 | + workerExcuteReqVO.setProblemsImgs(reqVO.getProblemsImgs()); | |
| 139 | + workerExcuteReqVO.setStartImgs(reqVO.getStartImgs()); | |
| 140 | + workerExcuteReqVO.setProcessingImgs(reqVO.getProcessingImgs()); | |
| 141 | + workerExcuteReqVO.setEndImgs(reqVO.getEndImgs()); | |
| 142 | + workerExcuteReqVO.setPersonImgs(reqVO.getPersonImgs()); | |
| 143 | + workerExcuteReqVO.setMaterialImgs(reqVO.getMaterialImgs()); | |
| 144 | + gardenService.ylWorkerExcuteWOrder(workerExcuteReqVO); | |
| 145 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_WORKER_IMPLEMENT.getDesc()+"<--结束"); | |
| 146 | + return success(true); | |
| 147 | + case YL_TEAM_LEADER_CONFIRM_PASS://养护组长验收通过 | |
| 148 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_PASS.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_PASS.getCode()+"-->"); | |
| 149 | + AppGardenTaskApproveReqVO approveReqVO = new AppGardenTaskApproveReqVO(); | |
| 150 | + approveReqVO.setReason(reqVO.getReason()); | |
| 151 | + approveReqVO.setId(reqVO.getTaskId()); | |
| 152 | + gardenService.approveTask(approveReqVO); | |
| 153 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_PASS.getDesc()+"<--结束"); | |
| 154 | + return success(true); | |
| 155 | + case YL_TEAM_LEADER_CONFIRM_REJECT://养护组长验收不通过 需修改更新工单数据 见切面 | |
| 156 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getCode()+"-->"); | |
| 157 | + AppGardenTaskReturnExtReqVO rejReqVO = new AppGardenTaskReturnExtReqVO(); | |
| 158 | + rejReqVO.setId(reqVO.getTaskId()); | |
| 159 | + rejReqVO.setCurTaskKey(reqVO.getTaskKey()); | |
| 160 | + rejReqVO.setReason(reqVO.getReason()); | |
| 161 | + rejReqVO.setWorkerDataId(reqVO.getWorkerDataId()); | |
| 162 | + List<String> returnImgs = reqVO.getReturnImgs(); | |
| 163 | + rejReqVO.setReturnImgs(returnImgs); | |
| 164 | + gardenService.returnPreviousNode(rejReqVO); | |
| 165 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getDesc()+"<--结束"); | |
| 166 | + return success(true); | |
| 167 | + case YL_TEAM_LEADER_ASSIGN: //养护组长分配 需修改更新工单数据 见切面 | |
| 168 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getCode()+"-->"); | |
| 169 | + AppGardenTaskTeamLeaderAssignReqVO assignReqVO = new AppGardenTaskTeamLeaderAssignReqVO(); | |
| 170 | + assignReqVO.setId(reqVO.getTaskId()); | |
| 171 | + assignReqVO.setReason(reqVO.getReason()); | |
| 172 | + Long userId = reqVO.getNextAssignee(); | |
| 173 | + if(!ObjectUtils.isNotAllEmpty(userId)){ | |
| 174 | + throw exception(APP_WORKER_NOT_EXISTS); | |
| 175 | + } | |
| 176 | + assignReqVO.setNextAssignee(reqVO.getNextAssignee()); | |
| 177 | + Integer status = reqVO.getAgree(); | |
| 178 | + if (status == null || (status != 0 && status != 1)) { | |
| 179 | + throw exception(APP_AGREE_CHOOSE); | |
| 180 | + } | |
| 181 | + assignReqVO.setAgree(status); | |
| 182 | + gardenService.ylTeamLeaderAssignWOrder(assignReqVO); | |
| 183 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"<--结束"); | |
| 184 | + return success(true); | |
| 185 | + | |
| 186 | + case YL_TEAM_LEADER_RETURN://养护组长退回 | |
| 187 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_RETURN.getCode()+"-->"); | |
| 188 | + AppGardenTaskInspectorApproveReqVO returnApproveReqVO = new AppGardenTaskInspectorApproveReqVO(); | |
| 189 | + Integer approveStatus = reqVO.getAgree(); | |
| 190 | + if (approveStatus == null || (approveStatus != 0 && approveStatus != 1)) { | |
| 191 | + throw exception(APP_AGREE_CHOOSE); | |
| 192 | + } | |
| 193 | + returnApproveReqVO.setAgree(approveStatus); | |
| 194 | + returnApproveReqVO.setReason(reqVO.getReason()); | |
| 195 | + returnApproveReqVO.setId(reqVO.getTaskId()); | |
| 196 | + returnApproveReqVO.setReturnImgs(reqVO.getReturnImgs()); | |
| 197 | + returnApproveReqVO.setRoadId(reqVO.getRoadId()); | |
| 198 | + inspectorService.approveTask(returnApproveReqVO); | |
| 199 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"<--结束"); | |
| 200 | + return success(true); | |
| 201 | + case YL_INSPECTOR_START_FINISH : //督察员结束工单 | |
| 202 | + log.info("当前操作:督察员结束工单(不同意)开始,是否同意:"+reqVO.getAgree()+"-->"); | |
| 203 | + AppGardenTaskApproveReqVO inspectStartReqVO = new AppGardenTaskApproveReqVO(); | |
| 204 | + Integer revokeStatus = reqVO.getAgree(); | |
| 205 | + if (revokeStatus == null || (revokeStatus != 0 && revokeStatus != 1)) { | |
| 206 | + throw exception(APP_AGREE_CHOOSE); | |
| 207 | + } | |
| 208 | + inspectStartReqVO.setAgree(revokeStatus); | |
| 209 | + inspectStartReqVO.setReason(reqVO.getReason()); | |
| 210 | + inspectStartReqVO.setId(reqVO.getTaskId()); | |
| 211 | + inspectStartReqVO.setReturnImgs(reqVO.getReturnImgs()); | |
| 212 | + gardenService.approveTask(inspectStartReqVO); | |
| 213 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); | |
| 214 | + return success(true); | |
| 215 | + case YL_INSPECTOR_START_RELAUNCH : //全域督察员重新发起 需修改更新工单数据 见切面 | |
| 216 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"开始,操作类型:"+InspectorOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode()+"-->"); | |
| 217 | + AppGardenTaskInspectorApproveReqVO reStartReqVO = new AppGardenTaskInspectorApproveReqVO(); | |
| 218 | + Integer reStatus = reqVO.getAgree(); | |
| 219 | + if (reStatus == null || (reStatus != 0 && reStatus != 1)) { | |
| 220 | + throw exception(APP_AGREE_CHOOSE); | |
| 221 | + } | |
| 222 | + Long id = reqVO.getWorkerDataId(); | |
| 223 | + if (id == null) { | |
| 224 | + throw exception(APP_WORKER_ID_NOT_EMPTY); | |
| 225 | + } | |
| 226 | + reStartReqVO.setWorkerDataId(id); | |
| 227 | + reStartReqVO.setAgree(reStatus); | |
| 228 | + reStartReqVO.setReason(reqVO.getReason()); | |
| 229 | + reStartReqVO.setId(reqVO.getTaskId()); | |
| 230 | + reStartReqVO.setRoadId(reqVO.getRoadId()); | |
| 231 | + inspectorService.approveTask(reStartReqVO); | |
| 232 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"<--结束"); | |
| 233 | + return success(true); | |
| 234 | + case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://督察员验收通过,督察员验收不通过 | |
| 235 | + log.info("当前操作:全域巡查员验收通过 或全域巡查员验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); | |
| 236 | + AppGardenTaskApproveReqVO inspectReqVO = new AppGardenTaskApproveReqVO(); | |
| 237 | + Integer verifyStatus = reqVO.getAgree(); | |
| 238 | + if (verifyStatus == null || (verifyStatus != 0 && verifyStatus != 1)) { | |
| 239 | + throw exception(APP_AGREE_CHOOSE); | |
| 240 | + } | |
| 241 | + inspectReqVO.setAgree(verifyStatus); | |
| 242 | + inspectReqVO.setReason(reqVO.getReason()); | |
| 243 | + inspectReqVO.setId(reqVO.getTaskId()); | |
| 244 | + inspectReqVO.setReturnImgs(reqVO.getReturnImgs()); | |
| 245 | + gardenService.approveTask(inspectReqVO); | |
| 246 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); | |
| 247 | + return success(true); | |
| 248 | + default: | |
| 249 | + throw exception(APP_OPERATOR_NOT_EXISTS); | |
| 250 | + } | |
| 251 | + } | |
| 252 | + | |
| 253 | +} | |
| 0 | 254 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderUniversalController.java
| ... | ... | @@ -77,7 +77,7 @@ public class AppGardenWorkOrderUniversalController { |
| 77 | 77 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") |
| 78 | 78 | public CommonResult<Boolean> universalApproval(@Valid @RequestBody AppUniversalApprovalReqVO reqVO) { |
| 79 | 79 | |
| 80 | - log.info("【园林大区经理审批】接收前端请求,入参:curTaskKey={}, taskId={}, operateType={}, agree={}, reason={}", | |
| 80 | + log.info("【全域巡查员审批】接收前端请求,入参:curTaskKey={}, taskId={}, operateType={}, agree={}, reason={}", | |
| 81 | 81 | reqVO.getTaskKey(), reqVO.getTaskId(), reqVO.getOperateType(), reqVO.getAgree(), reqVO.getReason()); |
| 82 | 82 | |
| 83 | 83 | UniversalOperateTypeEnum operateType = UniversalOperateTypeEnum.getByCode(reqVO.getOperateType()); |
| ... | ... | @@ -194,7 +194,7 @@ public class AppGardenWorkOrderUniversalController { |
| 194 | 194 | log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"<--结束"); |
| 195 | 195 | return success(true); |
| 196 | 196 | case YL_INSPECTOR_START_FINISH : //巡查员结束工单 |
| 197 | - log.info("当前操作:养护组长结束工单(不同意)或大区经理重新发起(同意)开始,是否同意:"+reqVO.getAgree()+"-->"); | |
| 197 | + log.info("当前操作:全域巡查员结束工单(不同意)开始,是否同意:"+reqVO.getAgree()+"-->"); | |
| 198 | 198 | AppGardenTaskApproveReqVO inspectStartReqVO = new AppGardenTaskApproveReqVO(); |
| 199 | 199 | Integer revokeStatus = reqVO.getAgree(); |
| 200 | 200 | if (revokeStatus == null || (revokeStatus != 0 && revokeStatus != 1)) { | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/InspectorBuzStatusUpdateAspect.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.aop; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.biz.system.dict.DictDataCommonApi; | |
| 4 | +import com.zteits.urbanops.framework.common.biz.system.dict.dto.DictDataRespDTO; | |
| 5 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 6 | +import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | |
| 7 | +import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | |
| 8 | +import com.zteits.urbanops.module.garden.api.road.RoadApi; | |
| 9 | +import com.zteits.urbanops.module.garden.dto.road.RoadStreetRespDTO; | |
| 10 | +import com.zteits.urbanops.module.system.api.permission.RoleApi; | |
| 11 | +import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleRespVO; | |
| 12 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | |
| 13 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppUniversalApprovalReqVO; | |
| 14 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | |
| 15 | +import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | |
| 16 | +import com.zteits.urbanops.module.workorder.enums.InspectorOperateTypeEnum; | |
| 17 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | |
| 18 | +import jakarta.annotation.Resource; | |
| 19 | +import jodd.util.StringUtil; | |
| 20 | +import lombok.RequiredArgsConstructor; | |
| 21 | +import org.aspectj.lang.ProceedingJoinPoint; | |
| 22 | +import org.aspectj.lang.annotation.Around; | |
| 23 | +import org.aspectj.lang.annotation.Aspect; | |
| 24 | +import org.aspectj.lang.annotation.Pointcut; | |
| 25 | +import org.springframework.stereotype.Component; | |
| 26 | +import org.springframework.transaction.annotation.Transactional; | |
| 27 | + | |
| 28 | +import java.time.LocalDateTime; | |
| 29 | +import java.util.List; | |
| 30 | + | |
| 31 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 32 | +import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.CONSERVE_LEVEL; | |
| 33 | +import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.ORDER_STATUS_INIT; | |
| 34 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; | |
| 35 | + | |
| 36 | +/** | |
| 37 | + * 类描述:切面更新工单表业务状态 | |
| 38 | + * 创建人:yanhuiqing | |
| 39 | + * 创建时间:2025/12/21 14:53 | |
| 40 | + * 修改人:yanhuiqing | |
| 41 | + * 修改时间:2025/12/21 14:53 | |
| 42 | + * 修改备注: | |
| 43 | + * | |
| 44 | + * @author yanhuiqing | |
| 45 | + * @version 1.0 | |
| 46 | + */ | |
| 47 | +@Aspect | |
| 48 | +@Component | |
| 49 | +@RequiredArgsConstructor | |
| 50 | +public class InspectorBuzStatusUpdateAspect { | |
| 51 | + | |
| 52 | + @Resource | |
| 53 | + private MainInfoMapper mainInfoMapper; | |
| 54 | + | |
| 55 | + @Resource | |
| 56 | + private final RoadApi roadApi; | |
| 57 | + | |
| 58 | + @Resource | |
| 59 | + private BpmGardenService gardenService; | |
| 60 | + | |
| 61 | + @Resource | |
| 62 | + private final DictDataCommonApi dictDataCommonApi; | |
| 63 | + | |
| 64 | + @Resource | |
| 65 | + private RoleApi roleApi; | |
| 66 | + | |
| 67 | + // 切点:标注了@AutoUpdateBuzStatus的方法 | |
| 68 | + @Pointcut("@annotation(com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderInspectorBuzStatus)") | |
| 69 | + public void buzStatusUpdatePointcut() {} | |
| 70 | + | |
| 71 | + @Around("buzStatusUpdatePointcut()") | |
| 72 | + @Transactional(rollbackFor = Exception.class) | |
| 73 | + public Object around(ProceedingJoinPoint joinPoint) throws Throwable { | |
| 74 | + // 1. 获取方法参数(AppUniversalApprovalReqVO) | |
| 75 | + Object[] args = joinPoint.getArgs(); | |
| 76 | + AppUniversalApprovalReqVO reqVO = null; | |
| 77 | + for (Object arg : args) { | |
| 78 | + if (arg instanceof AppUniversalApprovalReqVO) { | |
| 79 | + reqVO = (AppUniversalApprovalReqVO) arg; | |
| 80 | + break; | |
| 81 | + } | |
| 82 | + } | |
| 83 | + if (reqVO == null) { | |
| 84 | + throw new IllegalArgumentException("方法参数中未找到AppUniversalApprovalReqVO"); | |
| 85 | + } | |
| 86 | + | |
| 87 | + // 2. 解析操作类型 | |
| 88 | + InspectorOperateTypeEnum operateType = InspectorOperateTypeEnum.getByCode(reqVO.getOperateType()); | |
| 89 | + Long workerDataId = reqVO.getWorkerDataId(); | |
| 90 | + Integer buzStatus = operateType.getCode(); | |
| 91 | + | |
| 92 | + // 3. 执行原有方法 | |
| 93 | + Object result = joinPoint.proceed(); | |
| 94 | + MainInfoDO dbData = mainInfoMapper.selectById(workerDataId); | |
| 95 | + MainInfoDO targeVO = new MainInfoDO(); | |
| 96 | + targeVO.setId(workerDataId); | |
| 97 | + targeVO.setOrderNo(dbData.getOrderNo()); | |
| 98 | + targeVO.setBusiLine(dbData.getBusiLine()); | |
| 99 | + //大区经理分配 | |
| 100 | + if(InspectorOperateTypeEnum.SH_REGION_MANAGER_ASSIGN.getCode().equals(reqVO.getOperateType())){ | |
| 101 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | |
| 102 | + if(null == roadStreetRespDTO){ | |
| 103 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | |
| 104 | + } | |
| 105 | + targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | |
| 106 | + targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | |
| 107 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | |
| 108 | + if(null == dictData){ | |
| 109 | + throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | |
| 110 | + } | |
| 111 | + targeVO.setCuringLevelId(Integer.valueOf(dictData.getValue())); | |
| 112 | + targeVO.setCuringLevelName(dictData.getLabel()); | |
| 113 | + targeVO.setBusiLine(reqVO.getBusiLine()); | |
| 114 | + | |
| 115 | + targeVO.setRoadName(reqVO.getRoadName()); | |
| 116 | + targeVO.setRoadId(reqVO.getRoadId()); | |
| 117 | + targeVO.setPressingType(reqVO.getPressingType()); | |
| 118 | + targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); | |
| 119 | + } | |
| 120 | + | |
| 121 | + //大区经理退回 | |
| 122 | + if(InspectorOperateTypeEnum.SH_REGION_MANAGER_RETURN.getCode().equals(reqVO.getOperateType())){ | |
| 123 | + | |
| 124 | + } | |
| 125 | + //重新发起需更新表单数据 | |
| 126 | + if(InspectorOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode().equals(operateType.getCode())){ | |
| 127 | + targeVO = BeanUtils.toBean(reqVO,MainInfoDO.class); | |
| 128 | + targeVO.setId(reqVO.getWorkerDataId()); | |
| 129 | + targeVO.setOrderNo(dbData.getOrderNo()); | |
| 130 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | |
| 131 | + if(null == roadStreetRespDTO){ | |
| 132 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | |
| 133 | + } | |
| 134 | + targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | |
| 135 | + targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | |
| 136 | + targeVO.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | |
| 137 | + | |
| 138 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | |
| 139 | + if(null == dictData){ | |
| 140 | + throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | |
| 141 | + } | |
| 142 | + targeVO.setCuringLevelId(Integer.valueOf(dictData.getValue())); | |
| 143 | + targeVO.setCuringLevelName(dictData.getLabel()); | |
| 144 | + targeVO.setCommitDate(LocalDateTime.now()); | |
| 145 | + targeVO.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | |
| 146 | + | |
| 147 | + targeVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | |
| 148 | + List<RoleRespVO> roleList = roleApi.getRoleListByUsrId(SecurityFrameworkUtils.getLoginUserId()); | |
| 149 | + targeVO.setWoSourceId(roleList.get(0).getCode()); | |
| 150 | + targeVO.setWoSourceName(roleList.get(0).getName()); | |
| 151 | + String busiLine = reqVO.getBusiLine(); | |
| 152 | + if(StringUtil.isEmpty(busiLine)){ | |
| 153 | + busiLine = SecurityFrameworkUtils.getBusiLine(); | |
| 154 | + } | |
| 155 | + targeVO.setBusiLine(busiLine); | |
| 156 | + targeVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 157 | + targeVO.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); | |
| 158 | + if(ObjectUtils.isNotAllEmpty(reqVO.getExpectedFinishDate())){ | |
| 159 | + targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); | |
| 160 | + } | |
| 161 | + | |
| 162 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | |
| 163 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | |
| 164 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | |
| 165 | + } | |
| 166 | + } | |
| 167 | + //养护组长分配需更新表单数据 | |
| 168 | + if(InspectorOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getCode().equals(operateType.getCode())){ | |
| 169 | + targeVO.setWorkerId(reqVO.getNextAssignee()); | |
| 170 | + } | |
| 171 | + //养护组长验收不通过 需更新表单数据 | |
| 172 | + if(InspectorOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getCode().equals(operateType.getCode())){ | |
| 173 | + | |
| 174 | + List<String> returnImgs = reqVO.getReturnImgs(); | |
| 175 | + if(ObjectUtils.isNotAllEmpty(returnImgs) && returnImgs.size()>0){ | |
| 176 | + gardenService.attachmentInsertOrUpdate(returnImgs,BpmCommonConstant.GARDEN_TEAMLEADER_RETURN_IMG,targeVO); | |
| 177 | + } | |
| 178 | + } | |
| 179 | + //养护员实施 需更新表单数据 | |
| 180 | + if(InspectorOperateTypeEnum.YL_WORKER_IMPLEMENT.getCode().equals(operateType.getCode())){ | |
| 181 | + //实施更新为实施人员部门 | |
| 182 | + targeVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | |
| 183 | + //实施 审批已经执行 此处就无需执行 | |
| 184 | + /* | |
| 185 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | |
| 186 | + List<String> startImgs = reqVO.getStartImgs(); | |
| 187 | + List<String> processingImgs = reqVO.getProcessingImgs(); | |
| 188 | + List<String> endImgs = reqVO.getEndImgs(); | |
| 189 | + List<String> personImgs = reqVO.getPersonImgs(); | |
| 190 | + List<String> materialImgs = reqVO.getMaterialImgs(); | |
| 191 | + | |
| 192 | + targeVO.setHandleResult(reqVO.getHandleResult()); | |
| 193 | + targeVO.setCoHandlers(reqVO.getCoHandlers()); | |
| 194 | + targeVO.setWorkerId(SecurityFrameworkUtils.getLoginUserId()); | |
| 195 | + targeVO.setWorkerName(SecurityFrameworkUtils.getLoginUserNickname()); | |
| 196 | + targeVO.setWorkerCompanyId(SecurityFrameworkUtils.getCompanyId()); | |
| 197 | + mainInfoMapper.updateById(targeVO); | |
| 198 | + | |
| 199 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | |
| 200 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | |
| 201 | + } | |
| 202 | + if(ObjectUtils.isNotAllEmpty(startImgs) && startImgs.size()>0){ | |
| 203 | + gardenService.attachmentInsertOrUpdate(startImgs,BpmCommonConstant.START_IMG_GROUP,targeVO); | |
| 204 | + } | |
| 205 | + if(ObjectUtils.isNotAllEmpty(processingImgs) && processingImgs.size()>0){ | |
| 206 | + gardenService.attachmentInsertOrUpdate(processingImgs,BpmCommonConstant.PROCESS_IMG_GROUP,targeVO); | |
| 207 | + } | |
| 208 | + | |
| 209 | + if(ObjectUtils.isNotAllEmpty(endImgs) && endImgs.size()>0){ | |
| 210 | + gardenService.attachmentInsertOrUpdate(endImgs,BpmCommonConstant.END_IMG_GROUP,targeVO); | |
| 211 | + } | |
| 212 | + if(ObjectUtils.isNotAllEmpty(personImgs) && personImgs.size()>0){ | |
| 213 | + gardenService.attachmentInsertOrUpdate(personImgs,BpmCommonConstant.PERSON_IMG_GROUP,targeVO); | |
| 214 | + } | |
| 215 | + if(ObjectUtils.isNotAllEmpty(materialImgs) && materialImgs.size()>0){ | |
| 216 | + gardenService.attachmentInsertOrUpdate(materialImgs,BpmCommonConstant.MATERIAL_IMG_GROUP,targeVO); | |
| 217 | + }*/ | |
| 218 | + } | |
| 219 | + // 4. 自动更新buz_status | |
| 220 | + targeVO.setBuzStatus(buzStatus.toString()); | |
| 221 | + mainInfoMapper.updateById(targeVO); | |
| 222 | + | |
| 223 | + return result; | |
| 224 | + } | |
| 225 | +} | |
| 0 | 226 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/UniversalBuzStatusUpdateAspect.java
| ... | ... | @@ -30,6 +30,7 @@ import java.util.List; |
| 30 | 30 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 31 | 31 | import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.CONSERVE_LEVEL; |
| 32 | 32 | import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.APP_WORKER_LEVEL_ID_NOT_EXISTS; |
| 33 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.APP_WORK_ROAD_NOT_EXISTS; | |
| 33 | 34 | |
| 34 | 35 | /** |
| 35 | 36 | * 类描述:切面更新工单表业务状态 |
| ... | ... | @@ -94,6 +95,9 @@ public class UniversalBuzStatusUpdateAspect { |
| 94 | 95 | //大区经理分配 |
| 95 | 96 | if(UniversalOperateTypeEnum.REGION_MANAGER_ASSIGN.getCode().equals(reqVO.getOperateType())){ |
| 96 | 97 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); |
| 98 | + if(null == roadStreetRespDTO){ | |
| 99 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | |
| 100 | + } | |
| 97 | 101 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); |
| 98 | 102 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); |
| 99 | 103 | DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/task/AppGardenTaskInspectorApproveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.vo.task; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.module.workorder.controller.app.garden.group.RelaunchGroup; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import jakarta.validation.constraints.NotEmpty; | |
| 6 | +import jakarta.validation.constraints.NotNull; | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 类描述:园林APP端工单任务审批通过VO | |
| 13 | + * 创建人:yanhuiqing | |
| 14 | + * 创建时间:2025/12/13 21:33 | |
| 15 | + * 修改人:yanhuiqing | |
| 16 | + * 修改时间:2025/12/13 21:33 | |
| 17 | + * 修改备注: | |
| 18 | + * | |
| 19 | + * @author yanhuiqing | |
| 20 | + * @version 1.0 | |
| 21 | + */ | |
| 22 | +@Schema(description = "APP - 通过流程任务的 Request VO") | |
| 23 | +@Data | |
| 24 | +public class AppGardenTaskInspectorApproveReqVO { | |
| 25 | + | |
| 26 | + @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 27 | + @NotEmpty(message = "任务编号不能为空") | |
| 28 | + private String id; | |
| 29 | + | |
| 30 | + @Schema(description = "审批意见", example = "通过!") | |
| 31 | + private String reason; | |
| 32 | + | |
| 33 | + @Schema(description = "同意选择类型:0 同意,1 不同意", example = "0") | |
| 34 | + //@NotNull(message = "同意选择类型不能为空") | |
| 35 | + private Integer agree; | |
| 36 | + | |
| 37 | + @Schema(description = "工单的数据id", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 38 | + //@NotEmpty(message = "工单的数据id不能为空") | |
| 39 | + private Long workerDataId; | |
| 40 | + | |
| 41 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | |
| 42 | + @NotNull(message = "道路ID不能为空", groups = RelaunchGroup.class) | |
| 43 | + private Long roadId; | |
| 44 | + | |
| 45 | + @Schema(description = "道路名称", example = "测试道路") | |
| 46 | + private String roadName; | |
| 47 | + | |
| 48 | + @Schema(description = "退回时的拍照图片") | |
| 49 | + private List<String> returnImgs; | |
| 50 | + | |
| 51 | +} | |
| 0 | 52 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
| ... | ... | @@ -35,9 +35,9 @@ public interface ErrorCodeConstants { |
| 35 | 35 | |
| 36 | 36 | ErrorCode APP_WORK_ORADER_NO_NOT_EXISTS = new ErrorCode(1-900-002-003, "工单编号不能为空!"); |
| 37 | 37 | |
| 38 | - ErrorCode APP_WORK_ORADER_ROLE_ILLEGLE = new ErrorCode(1-900-002-004, "该登录人即是 大区经理 角色,又是 全域督察员,无法发起流程!"); | |
| 38 | + ErrorCode APP_WORK_ORADER_ROLE_ILLEGLE = new ErrorCode(1-900-002-004, "该登录人即是 大区经理 角色,又是 全域巡查员,无法发起流程!"); | |
| 39 | 39 | |
| 40 | - ErrorCode APP_WORK_ORADER_ROLE_NOT_EXSITS = new ErrorCode(1-900-002-005, "该登录人即不是 大区经理 角色,又不是 全域督察员,无法发起流程!"); | |
| 40 | + ErrorCode APP_WORK_ORADER_ROLE_NOT_EXSITS = new ErrorCode(1-900-002-005, "该登录人即不是 大区经理 角色,又不是 全域巡查员,无法发起流程!"); | |
| 41 | 41 | |
| 42 | 42 | ErrorCode APP_UNIVERSAL_USER_ROLE_ERROR = new ErrorCode(1-900-002-006, "该登录人不是 全域巡查员,无法发起流程!"); |
| 43 | 43 | |
| ... | ... | @@ -46,5 +46,11 @@ public interface ErrorCodeConstants { |
| 46 | 46 | ErrorCode EVENT_INFO_NOT_EXISTS = new ErrorCode(1-900-003-001, "工单事件不存在"); |
| 47 | 47 | |
| 48 | 48 | ErrorCode EVENT_MAPPING_INFO_NOT_EXISTS = new ErrorCode(1-900-004-001, "工单事件映射不存在"); |
| 49 | + | |
| 50 | + ErrorCode APP_INSPECTOR_USER_ROLE_ERROR = new ErrorCode(1-900-004-001, "该登录人不是 全域督查员,无法发起流程!"); | |
| 51 | + | |
| 52 | + ErrorCode APP_WORK_INSPECTOR_ROLE_ILLEGLE = new ErrorCode(1-900-004-00, "该登录人即是 大区经理 角色,又是 全域督察员,无法发起流程!"); | |
| 53 | + | |
| 54 | + ErrorCode APP_WORK_ROAD_NOT_EXISTS = new ErrorCode(1-900-004-001, "道路信息不存在"); | |
| 49 | 55 | } |
| 50 | 56 | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/InspectorOperateTypeEnum.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.enums; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonValue; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.Getter; | |
| 6 | + | |
| 7 | +import java.util.Arrays; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 类描述:全域督察员审批操作类型枚举 | |
| 11 | + * 创建人:yanhuiqing | |
| 12 | + * 创建时间:2025/12/29 9:56 | |
| 13 | + * 修改人:yanhuiqing | |
| 14 | + * 修改时间:2025/12/29 9:56 | |
| 15 | + * 修改备注: | |
| 16 | + * | |
| 17 | + * @author yanhuiqing | |
| 18 | + * @version 1.0 | |
| 19 | + */ | |
| 20 | +@Schema(description = "全域督察员操作类型枚举") | |
| 21 | +@Getter | |
| 22 | +public enum InspectorOperateTypeEnum { | |
| 23 | + SH_REGION_MANAGER_ASSIGN(60,"大区经理分配"), | |
| 24 | + SH_REGION_MANAGER_RETURN(70,"大区经理退回"), | |
| 25 | + YL_TEAM_LEADER_ASSIGN(110, "养护组长分配"), | |
| 26 | + YL_TEAM_LEADER_RETURN(210, "养护组长退回"), | |
| 27 | + YL_WORKER_IMPLEMENT(120, "养护员实施"), | |
| 28 | + YL_WORKER_RETURN(220, "养护员退回"), | |
| 29 | + YL_TEAM_LEADER_CONFIRM_PASS(130, "养护组长验收通过"), | |
| 30 | + YL_TEAM_LEADER_CONFIRM_REJECT(230, "养护组长验收不通过"), | |
| 31 | + YL_INSPECTOR_CHECK_PASS(140, "全域督察员验收通过"), | |
| 32 | + YL_INSPECTOR_CHECK_REJECT(240, "全域督察员验收不通过"), | |
| 33 | + YL_INSPECTOR_START_FINISH(200, "全域督察员结束工单(不同意)"), | |
| 34 | + YL_INSPECTOR_START_RELAUNCH(100, "全域督察员重新发起(同意)"); | |
| 35 | + | |
| 36 | + @JsonValue // 序列化时返回code(前端接收数字) | |
| 37 | + private final Integer code; | |
| 38 | + private final String desc; | |
| 39 | + | |
| 40 | + InspectorOperateTypeEnum(Integer code, String desc) { | |
| 41 | + this.code = code; | |
| 42 | + this.desc = desc; | |
| 43 | + } | |
| 44 | + | |
| 45 | + // 根据code获取枚举(业务层转换用) | |
| 46 | + public static InspectorOperateTypeEnum getByCode(Integer code) { | |
| 47 | + return Arrays.stream(values()) | |
| 48 | + .filter(e -> e.getCode().equals(code)) | |
| 49 | + .findFirst() | |
| 50 | + .orElseThrow(() -> new IllegalArgumentException("无效的操作类型:" + code)); | |
| 51 | + } | |
| 52 | +} | |
| 0 | 53 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
| ... | ... | @@ -138,6 +138,9 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 138 | 138 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| 139 | 139 | |
| 140 | 140 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); |
| 141 | + if(null == roadStreetRespDTO){ | |
| 142 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | |
| 143 | + } | |
| 141 | 144 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 142 | 145 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 143 | 146 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmInspectorService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.service.garden; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskApproveReqVO; | |
| 4 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskInspectorApproveReqVO; | |
| 5 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRegionMgrApproveReqVO; | |
| 6 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; | |
| 7 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; | |
| 8 | +import jakarta.validation.Valid; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 类描述:全域督察员工单处理server | |
| 12 | + * 创建人:yanhuiqing | |
| 13 | + * 创建时间:2025/12/25 16:40 | |
| 14 | + * 修改人:yanhuiqing | |
| 15 | + * 修改时间:2025/12/25 16:40 | |
| 16 | + * 修改备注: | |
| 17 | + * | |
| 18 | + * @author yanhuiqing | |
| 19 | + * @version 1.0 | |
| 20 | + */ | |
| 21 | +public interface BpmInspectorService { | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 全域督察员工单申请 app service 接口 | |
| 25 | + * @param createRequestVo | |
| 26 | + * @return | |
| 27 | + */ | |
| 28 | + Long createWorkOrder(@Valid AppGardenWorkOrderInspectorReqVO createRequestVo); | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 全域督察员工单分配 | |
| 32 | + * @param regionPassReqVO | |
| 33 | + */ | |
| 34 | + void approveTask2TeamLeader(AppGardenTaskRegionMgrApproveReqVO regionPassReqVO); | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 养护组长退回 分情况 | |
| 38 | + * @param returnApproveReqVO | |
| 39 | + */ | |
| 40 | + void approveTask(AppGardenTaskInspectorApproveReqVO returnApproveReqVO); | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 判定是否三海地区 通过公司id | |
| 44 | + * @param companyId | |
| 45 | + * @return | |
| 46 | + */ | |
| 47 | + boolean isSanhai(Long companyId); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 判断是否三海地区通过 道路id | |
| 51 | + * @param roadId | |
| 52 | + * @return | |
| 53 | + */ | |
| 54 | + boolean isSanhaiByRoadId(Long roadId); | |
| 55 | +} | |
| 0 | 56 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmInspectorServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.service.garden; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.biz.system.dict.DictDataCommonApi; | |
| 4 | +import com.zteits.urbanops.framework.common.biz.system.dict.dto.DictDataRespDTO; | |
| 5 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 6 | +import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | |
| 7 | +import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | |
| 8 | +import com.zteits.urbanops.module.bpm.api.task.BpmProcessInstanceApi; | |
| 9 | +import com.zteits.urbanops.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; | |
| 10 | +import com.zteits.urbanops.module.bpm.controller.admin.task.vo.task.BpmTaskApproveReqVO; | |
| 11 | +import com.zteits.urbanops.module.bpm.enums.task.BpmTaskStatusEnum; | |
| 12 | +import com.zteits.urbanops.module.bpm.framework.flowable.core.enums.BpmnVariableConstants; | |
| 13 | +import com.zteits.urbanops.module.bpm.service.definition.BpmProcessDefinitionService; | |
| 14 | +import com.zteits.urbanops.module.bpm.service.task.BpmProcessInstanceService; | |
| 15 | +import com.zteits.urbanops.module.bpm.service.task.BpmTaskService; | |
| 16 | +import com.zteits.urbanops.module.garden.api.road.RoadApi; | |
| 17 | +import com.zteits.urbanops.module.garden.dto.road.RoadStreetRespDTO; | |
| 18 | +import com.zteits.urbanops.module.system.api.permission.RoleApi; | |
| 19 | +import com.zteits.urbanops.module.system.api.user.AdminUserApi; | |
| 20 | +import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; | |
| 21 | +import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleRespVO; | |
| 22 | +import com.zteits.urbanops.module.workorder.api.WorkOrderApi; | |
| 23 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | |
| 24 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskApproveReqVO; | |
| 25 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskInspectorApproveReqVO; | |
| 26 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRegionMgrApproveReqVO; | |
| 27 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | |
| 28 | +import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; | |
| 29 | +import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper; | |
| 30 | +import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | |
| 31 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; | |
| 32 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; | |
| 33 | +import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; | |
| 34 | +import com.zteits.urbanops.module.workorder.util.RoleListUtils; | |
| 35 | +import jakarta.annotation.Resource; | |
| 36 | +import jodd.util.StringUtil; | |
| 37 | +import org.flowable.engine.RuntimeService; | |
| 38 | +import org.flowable.engine.runtime.ProcessInstance; | |
| 39 | +import org.springframework.stereotype.Service; | |
| 40 | +import org.springframework.validation.annotation.Validated; | |
| 41 | + | |
| 42 | +import java.time.LocalDateTime; | |
| 43 | +import java.util.ArrayList; | |
| 44 | +import java.util.HashMap; | |
| 45 | +import java.util.List; | |
| 46 | +import java.util.Map; | |
| 47 | +import java.util.stream.Collectors; | |
| 48 | + | |
| 49 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 50 | +import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.*; | |
| 51 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; | |
| 52 | + | |
| 53 | +/** | |
| 54 | + * 类描述:全域 督察员app端工单服务实现类 | |
| 55 | + * 创建人:yanhuiqing | |
| 56 | + * 创建时间:2025/12/25 16:42 | |
| 57 | + * 修改人:yanhuiqing | |
| 58 | + * 修改时间:2025/12/25 16:42 | |
| 59 | + * 修改备注: | |
| 60 | + * | |
| 61 | + * @author yanhuiqing | |
| 62 | + * @version 1.0 | |
| 63 | + */ | |
| 64 | +@Service | |
| 65 | +@Validated | |
| 66 | +public class BpmInspectorServiceImpl implements BpmInspectorService{ | |
| 67 | + | |
| 68 | + @Resource | |
| 69 | + private AttachmentMapper attachmentMapper; | |
| 70 | + @Resource | |
| 71 | + private MainInfoMapper workOrderMapper; | |
| 72 | + | |
| 73 | + @Resource | |
| 74 | + private MainInfoExtMapper workOrderExtMapper; | |
| 75 | + @Resource | |
| 76 | + private BpmProcessInstanceApi processInstanceApi; | |
| 77 | + | |
| 78 | + @Resource | |
| 79 | + private BpmProcessDefinitionService processDefinitionService; | |
| 80 | + @Resource | |
| 81 | + private WorkOrderApi workOrderApi; | |
| 82 | + | |
| 83 | + @Resource | |
| 84 | + private RoadApi roadApi; | |
| 85 | + | |
| 86 | + @Resource | |
| 87 | + private BpmTaskService taskService; | |
| 88 | + | |
| 89 | + @Resource | |
| 90 | + private AdminUserApi adminUserApi; | |
| 91 | + | |
| 92 | + @Resource | |
| 93 | + private RoleApi roleApi; | |
| 94 | + | |
| 95 | + @Resource | |
| 96 | + private BpmGardenService bpmGardenService; | |
| 97 | + | |
| 98 | + @Resource | |
| 99 | + private BpmProcessInstanceService processInstanceService; | |
| 100 | + | |
| 101 | + @Resource | |
| 102 | + private RuntimeService runtimeService; | |
| 103 | + | |
| 104 | + @Resource | |
| 105 | + private DictDataCommonApi dictDataCommonApi; | |
| 106 | + @Override | |
| 107 | + public Long createWorkOrder(AppGardenWorkOrderInspectorReqVO createRequestVo) { | |
| 108 | + List<RoleRespVO> roleList = roleApi.getRoleListByUsrId(SecurityFrameworkUtils.getLoginUserId()); | |
| 109 | + if(null == roleList || roleList.size()==0){ | |
| 110 | + throw exception(APP_USER_ROLE_NOT_EXISTS); | |
| 111 | + } | |
| 112 | + | |
| 113 | + if(!RoleListUtils.containsCode(roleList,INSPECTOR_GLOBAL)){ | |
| 114 | + throw exception(APP_INSPECTOR_USER_ROLE_ERROR); | |
| 115 | + } | |
| 116 | + //校验人员不能有 双重角色 | |
| 117 | + if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, INSPECTOR_GLOBAL)){ | |
| 118 | + throw exception(APP_WORK_INSPECTOR_ROLE_ILLEGLE); | |
| 119 | + } | |
| 120 | + | |
| 121 | + List<String> problemsImgsList = createRequestVo.getProblemsImgs(); | |
| 122 | + MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) | |
| 123 | + .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); | |
| 124 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); | |
| 125 | + if(null == roadStreetRespDTO){ | |
| 126 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | |
| 127 | + } | |
| 128 | + workOrder.setStreetId(roadStreetRespDTO.getStreetId()); | |
| 129 | + workOrder.setStreetName(roadStreetRespDTO.getStreetName()); | |
| 130 | + workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | |
| 131 | + if(StringUtil.isEmpty(createRequestVo.getOrderType())){ | |
| 132 | + workOrder.setOrderType(BpmCommonConstant.ORDER_TYPE_C); | |
| 133 | + }else{ | |
| 134 | + if(createRequestVo.getOrderType().equals(BpmCommonConstant.ORDER_TYPE_Q)){ | |
| 135 | + throw exception(APP_WORK_ORADER_ERROR); | |
| 136 | + } | |
| 137 | + workOrder.setOrderType(createRequestVo.getOrderType()); | |
| 138 | + } | |
| 139 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | |
| 140 | + if(null == dictData){ | |
| 141 | + throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | |
| 142 | + } | |
| 143 | + workOrder.setCuringLevelId(Integer.valueOf(dictData.getValue())); | |
| 144 | + workOrder.setCuringLevelName(dictData.getLabel()); | |
| 145 | + workOrder.setCommitDate(LocalDateTime.now()); | |
| 146 | + workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | |
| 147 | + | |
| 148 | + workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); | |
| 149 | + workOrder.setWoSourceId(roleList.get(0).getCode()); | |
| 150 | + workOrder.setWoSourceName(roleList.get(0).getName()); | |
| 151 | + String busiLine = createRequestVo.getBusiLine(); | |
| 152 | + if(StringUtil.isEmpty(busiLine)){ | |
| 153 | + busiLine = SecurityFrameworkUtils.getBusiLine(); | |
| 154 | + } | |
| 155 | + workOrder.setBusiLine(busiLine); | |
| 156 | + workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 157 | + workOrder.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); | |
| 158 | + if(ObjectUtils.isNotAllEmpty(createRequestVo.getExpectedFinishDate())){ | |
| 159 | + workOrder.setExpectedFinishDate(createRequestVo.getExpectedFinishDate()); | |
| 160 | + } | |
| 161 | + String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_INSPECTOR); | |
| 162 | + workOrder.setOrderNo(workOrderNum); | |
| 163 | + | |
| 164 | + workOrderMapper.insert(workOrder); | |
| 165 | + if(ObjectUtils.isNotAllEmpty(problemsImgsList) && problemsImgsList.size()>0){ | |
| 166 | + bpmGardenService.attachmentInsertOrUpdate(problemsImgsList,BpmCommonConstant.PROBLEM_IMG_GROUP,workOrder); | |
| 167 | + } | |
| 168 | + // 发起 BPM 流程 | |
| 169 | + Long userId = SecurityFrameworkUtils.getLoginUserId(); | |
| 170 | + Map<String, Object> processInstanceVariables = new HashMap<>(); | |
| 171 | + //是否三海路段 | |
| 172 | + boolean isSanhai = this.isSanhai(roadStreetRespDTO.getCompanyId()); | |
| 173 | + processInstanceVariables.put(BPM_COMMON_PROD_ROADID, workOrder.getRoadId()); | |
| 174 | + processInstanceVariables.put(BPM_COMMON_PROD_APPLYUSERID, userId); | |
| 175 | + processInstanceVariables.put(BPM_COMMON_PROD_ISSANHAI,isSanhai); | |
| 176 | + processInstanceVariables.put(BPM_COMMON_PROD_ISNEED,null); | |
| 177 | + processInstanceVariables.put(BMP_COMMON_PROD_ISPASS,null); | |
| 178 | + | |
| 179 | + if(!isSanhai){//非三海初始化 业务线班组长信息 | |
| 180 | + String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); | |
| 181 | + if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 | |
| 182 | + roleCode = BpmCommonConstant.TEAM_LEADER_YL; | |
| 183 | + } | |
| 184 | + List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(workOrder.getRoadId(),roleCode,createRequestVo.getBusiLine()); | |
| 185 | + if(org.springframework.util.ObjectUtils.isEmpty(userList)){ | |
| 186 | + throw exception(TEAM_LEADER_YL_NOT_EXISTS); | |
| 187 | + } | |
| 188 | + // 提取id到List<Long> | |
| 189 | + List<Long> idList = userList.stream() | |
| 190 | + // 映射:将AdminUserRespDTO对象转为其id属性 | |
| 191 | + .map(AdminUserRespDTO::getId) | |
| 192 | + // 收集结果到List | |
| 193 | + .collect(Collectors.toList()); | |
| 194 | + processInstanceVariables.put(BPM_COMMON_PROD_LEADERID, idList.get(0)); | |
| 195 | + } | |
| 196 | + | |
| 197 | + String processInstanceId = processInstanceApi.createProcessInstance(userId, | |
| 198 | + new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_UNIVERSE_INSPECTOR_WO) | |
| 199 | + .setVariables(processInstanceVariables).setBusinessKey(String.valueOf(workOrder.getId()))); | |
| 200 | + | |
| 201 | + // 将工作流的编号,更新到 工单中 | |
| 202 | + workOrderMapper.updateById(new MainInfoDO().setId(workOrder.getId()).setProcessInstanceId(processInstanceId)); | |
| 203 | + return workOrder.getId(); | |
| 204 | + } | |
| 205 | + | |
| 206 | + @Override | |
| 207 | + public void approveTask2TeamLeader(AppGardenTaskRegionMgrApproveReqVO reqVO) { | |
| 208 | + BpmTaskApproveReqVO targetVO = BeanUtils.toBean(reqVO,BpmTaskApproveReqVO.class); | |
| 209 | + Map<String, Object> variables = new HashMap<>(); | |
| 210 | + //审批通过 | |
| 211 | + variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS,BpmTaskStatusEnum.APPROVE.getStatus()); | |
| 212 | + Integer status = reqVO.getAgree(); | |
| 213 | + if(status == null || status == 1){//status == null 此处是为了兼容老接口,防止前段少改造 | |
| 214 | + variables.put(BMP_COMMON_PROD_ISPASS,false); | |
| 215 | + variables.put(BPM_COMMON_PROD_ISREVOKE,null);//不通过后 初始化重新发起变量 | |
| 216 | + }else { | |
| 217 | + variables.put(BMP_COMMON_PROD_ISPASS,true); | |
| 218 | + variables.put(BPM_COMMON_PROD_ISNEED,null); | |
| 219 | + String instanceId = taskService.getTask(reqVO.getId()).getProcessInstanceId(); | |
| 220 | + ProcessInstance processInstance = processInstanceService.getProcessInstance(instanceId); | |
| 221 | + Map<String, Object> processInstanceVariables = processInstance.getProcessVariables(); | |
| 222 | + //String busiLine = (String)processInstanceVariables.get(BPM_COMMON_PROD_BUSILINE); | |
| 223 | + //Long roadId = (Long) processInstanceVariables.get(BPM_COMMON_PROD_ROADID); | |
| 224 | + String busiLine = reqVO.getBusiLine(); | |
| 225 | + Long roadId = reqVO.getRoadId(); | |
| 226 | + String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); | |
| 227 | + | |
| 228 | + if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 | |
| 229 | + roleCode = BpmCommonConstant.TEAM_LEADER_YL; | |
| 230 | + } | |
| 231 | + List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(roadId,roleCode,busiLine); | |
| 232 | + if(org.springframework.util.ObjectUtils.isEmpty(userList)){ | |
| 233 | + throw exception(TEAM_LEADER_YL_NOT_EXISTS); | |
| 234 | + } | |
| 235 | + // 提取id到List<Long> | |
| 236 | + List<Long> idList = userList.stream() | |
| 237 | + // 映射:将AdminUserRespDTO对象转为其id属性 | |
| 238 | + .map(AdminUserRespDTO::getId) | |
| 239 | + // 收集结果到List | |
| 240 | + .collect(Collectors.toList()); | |
| 241 | + processInstanceVariables.put(BPM_COMMON_PROD_LEADERID, idList.get(0));//养护组长分配 | |
| 242 | + //流程变量重新赋值 | |
| 243 | + runtimeService.setVariables(instanceId,processInstanceVariables); | |
| 244 | + | |
| 245 | + } | |
| 246 | + | |
| 247 | + targetVO.setVariables(variables); | |
| 248 | + //TODO 审批候选人需要赋值 | |
| 249 | + Map<String, List<Long>> nextAssignees = new HashMap<>(); | |
| 250 | + targetVO.setNextAssignees(nextAssignees); | |
| 251 | + targetVO.setAttattmentUrls(reqVO.getReturnImgs()); | |
| 252 | + taskService.approveTask(SecurityFrameworkUtils.getLoginUserId(),targetVO); | |
| 253 | + } | |
| 254 | + | |
| 255 | + @Override | |
| 256 | + public void approveTask(AppGardenTaskInspectorApproveReqVO reqVO) { | |
| 257 | + BpmTaskApproveReqVO targetVO = BeanUtils.toBean(reqVO,BpmTaskApproveReqVO.class); | |
| 258 | + Map<String, Object> variables = new HashMap<>(); | |
| 259 | + //审批通过 | |
| 260 | + variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS,BpmTaskStatusEnum.APPROVE.getStatus()); | |
| 261 | + Integer status = reqVO.getAgree(); | |
| 262 | + if(status == null || status == 1){//status == null 此处是为了兼容老接口,防止前段少改造 | |
| 263 | + variables.put(BPM_COMMON_PROD_ISNEED,false); | |
| 264 | + variables.put(BPM_COMMON_PROD_ISREVOKE,false); | |
| 265 | + variables.put(BPM_COMMON_PROD_ISVERIFY,false); | |
| 266 | + //退回时判断 三海区域 | |
| 267 | + boolean isSanhai = isSanhaiByRoadId(reqVO.getRoadId()); | |
| 268 | + variables.put(BPM_COMMON_PROD_ISSANHAI,isSanhai); | |
| 269 | + }else { | |
| 270 | + variables.put(BPM_COMMON_PROD_ISNEED,true); | |
| 271 | + variables.put(BPM_COMMON_PROD_ISREVOKE,true); | |
| 272 | + variables.put(BPM_COMMON_PROD_ISVERIFY,true); | |
| 273 | + } | |
| 274 | + //TODO 重新发起需更新工单数据库 | |
| 275 | + | |
| 276 | + targetVO.setVariables(variables); | |
| 277 | + //TODO 审批候选人需要赋值 | |
| 278 | + Map<String, List<Long>> nextAssignees = new HashMap<>(); | |
| 279 | + targetVO.setNextAssignees(nextAssignees); | |
| 280 | + targetVO.setAttattmentUrls(reqVO.getReturnImgs()); | |
| 281 | + taskService.approveTask(SecurityFrameworkUtils.getLoginUserId(),targetVO); | |
| 282 | + } | |
| 283 | + | |
| 284 | + @Override | |
| 285 | + public boolean isSanhai(Long companyId) { | |
| 286 | + List<Long> sanHaiRoadId = new ArrayList<>(); | |
| 287 | + sanHaiRoadId.add(115L); // TODO 目前写死 | |
| 288 | + //是否三海路段 | |
| 289 | + boolean isSanhai = sanHaiRoadId.contains(companyId); | |
| 290 | + return isSanhai; | |
| 291 | + } | |
| 292 | + | |
| 293 | + @Override | |
| 294 | + public boolean isSanhaiByRoadId(Long roadId) { | |
| 295 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(roadId); | |
| 296 | + if(null == roadStreetRespDTO){ | |
| 297 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | |
| 298 | + } | |
| 299 | + return isSanhai(roadStreetRespDTO.getCompanyId()); | |
| 300 | + } | |
| 301 | + | |
| 302 | +} | |
| 0 | 303 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmRegionMgrServiceImpl.java
| ... | ... | @@ -105,7 +105,9 @@ public class BpmRegionMgrServiceImpl implements BpmRegionMgrService{ |
| 105 | 105 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 106 | 106 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| 107 | 107 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); |
| 108 | - | |
| 108 | + if(null == roadStreetRespDTO){ | |
| 109 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | |
| 110 | + } | |
| 109 | 111 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 110 | 112 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 111 | 113 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmUniversalServiceImpl.java
| ... | ... | @@ -156,6 +156,7 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ |
| 156 | 156 | processInstanceVariables.put(BPM_COMMON_PROD_APPLYUSERID, userId); |
| 157 | 157 | processInstanceVariables.put(BMP_COMMON_PROD_ISPASS,null); |
| 158 | 158 | |
| 159 | + | |
| 159 | 160 | String processInstanceId = processInstanceApi.createProcessInstance(userId, |
| 160 | 161 | // new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO) |
| 161 | 162 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_UNIVERSE_WO) | ... | ... |