Commit 5c22d0b6292b0b3598d563728ffa678ca02e0cc3
1 parent
b96d5490
全域巡查员流程 和业务线变动改造
Showing
19 changed files
with
835 additions
and
66 deletions
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderUniversalReqVO.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 AppGardenWorkOrderUniversalReqVO { | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 工单类型 Q:快速工单,C:普通工单,O:其他工单 | ||
| 26 | + */ | ||
| 27 | + private String orderType; | ||
| 28 | + | ||
| 29 | + @Schema(description = "问题图片", example = "9184") | ||
| 30 | + private List<String> problemsImgs; | ||
| 31 | + | ||
| 32 | + @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | ||
| 33 | + @NotEmpty(message = "工单描述不能为空") | ||
| 34 | + @Length(max = 500) | ||
| 35 | + private String remark; | ||
| 36 | + | ||
| 37 | + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") | ||
| 38 | + private Integer latLonType; | ||
| 39 | + | ||
| 40 | + @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 41 | + @NotNull(message = "经度不能为空") | ||
| 42 | + private BigDecimal lat; | ||
| 43 | + | ||
| 44 | + @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 45 | + @NotNull(message = "维度不能为空") | ||
| 46 | + private BigDecimal lon; | ||
| 47 | + | ||
| 48 | + @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 49 | + @NotEmpty(message = "经纬度地址不能为空") | ||
| 50 | + private String lonLatAddress; | ||
| 51 | + | ||
| 52 | + @Schema(description = "工单名称", example = "绿地卫生") | ||
| 53 | + private String orderName; | ||
| 54 | + | ||
| 55 | + @Schema(description = "来源ID 工单来源 1、巡查,2、游客居民,3、12345,4、网格", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 56 | + //@NotNull(message = "来源ID不能为空") | ||
| 57 | + private Integer sourceId; | ||
| 58 | + | ||
| 59 | + @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "园林") | ||
| 60 | + //@NotEmpty(message = "来源名称不能为空") | ||
| 61 | + private String sourceName; | ||
| 62 | + | ||
| 63 | + @Schema(description = "三方工单ID") | ||
| 64 | + private String thirdWorkNo; | ||
| 65 | + | ||
| 66 | + | ||
| 67 | +} | ||
| 68 | + |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/road/RoadApiImpl.java
| @@ -63,7 +63,7 @@ public class RoadApiImpl implements RoadApi { | @@ -63,7 +63,7 @@ public class RoadApiImpl implements RoadApi { | ||
| 63 | 63 | ||
| 64 | @Override | 64 | @Override |
| 65 | public RoadStreetRespDTO getRoadInfoById(Long id) { | 65 | public RoadStreetRespDTO getRoadInfoById(Long id) { |
| 66 | - RoadRespVO roadRespVO = roadService.getRoad(id); | 66 | + RoadRespVO roadRespVO = roadService.getUniqueRoad(id); |
| 67 | return BeanUtils.toBean(roadRespVO, RoadStreetRespDTO.class); | 67 | return BeanUtils.toBean(roadRespVO, RoadStreetRespDTO.class); |
| 68 | } | 68 | } |
| 69 | } | 69 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadService.java
| @@ -66,4 +66,11 @@ public interface RoadService { | @@ -66,4 +66,11 @@ public interface RoadService { | ||
| 66 | */ | 66 | */ |
| 67 | List<RoadDO> getRoadList(RoadListReqVO reqVO); | 67 | List<RoadDO> getRoadList(RoadListReqVO reqVO); |
| 68 | 68 | ||
| 69 | + /** | ||
| 70 | + * 只获取道路信息 | ||
| 71 | + * | ||
| 72 | + * @param id 编号 | ||
| 73 | + * @return 道路管理 | ||
| 74 | + */ | ||
| 75 | + RoadRespVO getUniqueRoad(Long id); | ||
| 69 | } | 76 | } |
| 70 | \ No newline at end of file | 77 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java
| @@ -111,7 +111,12 @@ public class RoadServiceImpl implements RoadService { | @@ -111,7 +111,12 @@ public class RoadServiceImpl implements RoadService { | ||
| 111 | addDataInspectionPlan(list); | 111 | addDataInspectionPlan(list); |
| 112 | return respVO; | 112 | return respVO; |
| 113 | } | 113 | } |
| 114 | - | 114 | + @Override |
| 115 | + public RoadRespVO getUniqueRoad(Long id) { | ||
| 116 | + RoadDO roadDO = roadMapper.selectById(id); | ||
| 117 | + RoadRespVO respVO = BeanUtils.toBean(roadDO, RoadRespVO.class); | ||
| 118 | + return respVO; | ||
| 119 | + } | ||
| 115 | @Override | 120 | @Override |
| 116 | public PageResult<RoadRespVO> getRoadPage(RoadPageReqVO pageReqVO) { | 121 | public PageResult<RoadRespVO> getRoadPage(RoadPageReqVO pageReqVO) { |
| 117 | PageResult<RoadDO> pageResult = roadInterceptMapper.selectForPage(pageReqVO); | 122 | PageResult<RoadDO> pageResult = roadInterceptMapper.selectForPage(pageReqVO); |
| @@ -161,4 +166,6 @@ public class RoadServiceImpl implements RoadService { | @@ -161,4 +166,6 @@ public class RoadServiceImpl implements RoadService { | ||
| 161 | return roadMapper.selectList(sql); | 166 | return roadMapper.selectList(sql); |
| 162 | } | 167 | } |
| 163 | 168 | ||
| 169 | + | ||
| 170 | + | ||
| 164 | } | 171 | } |
| 165 | \ No newline at end of file | 172 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/annotation/AutoUpdateWorkerOrderUniversalBuzStatus.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 AutoUpdateWorkerOrderUniversalBuzStatus { | ||
| 16 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
| @@ -61,10 +61,16 @@ public class BpmCommonConstant { | @@ -61,10 +61,16 @@ public class BpmCommonConstant { | ||
| 61 | 61 | ||
| 62 | public static final String BPM_COMMON_PROD_ISVERIFY = "isVerify"; | 62 | public static final String BPM_COMMON_PROD_ISVERIFY = "isVerify"; |
| 63 | /** | 63 | /** |
| 64 | + * 流转通过 | ||
| 65 | + */ | ||
| 66 | + public static final String BMP_COMMON_PROD_ISPASS = "isPass"; | ||
| 67 | + /** | ||
| 64 | * 是否全域的大区经理 key | 68 | * 是否全域的大区经理 key |
| 65 | */ | 69 | */ |
| 66 | public static final String BPM_COMMON_PROD_GLOBAL = "isGlobal"; | 70 | public static final String BPM_COMMON_PROD_GLOBAL = "isGlobal"; |
| 67 | 71 | ||
| 72 | + public static final String BPM_COMMON_PROD_BUSILINE = "busiLine"; | ||
| 73 | + | ||
| 68 | 74 | ||
| 69 | //----------------------------------------工单初始化流程变量key---------------------- | 75 | //----------------------------------------工单初始化流程变量key---------------------- |
| 70 | /** | 76 | /** |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderRegionMgrController.java
| @@ -76,7 +76,7 @@ public class AppGardenWorkOrderRegionMgrController { | @@ -76,7 +76,7 @@ public class AppGardenWorkOrderRegionMgrController { | ||
| 76 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") | 76 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") |
| 77 | public CommonResult<Boolean> universalApproval(@Valid @RequestBody AppUniversalApprovalReqVO reqVO) { | 77 | public CommonResult<Boolean> universalApproval(@Valid @RequestBody AppUniversalApprovalReqVO reqVO) { |
| 78 | 78 | ||
| 79 | - log.info("【园林统一审批】接收前端请求,入参:curTaskKey={}, taskId={}, operateType={}, agree={}, reason={}", | 79 | + log.info("【园林大区经理审批】接收前端请求,入参:curTaskKey={}, taskId={}, operateType={}, agree={}, reason={}", |
| 80 | reqVO.getTaskKey(), reqVO.getTaskId(), reqVO.getOperateType(), reqVO.getAgree(), reqVO.getReason()); | 80 | reqVO.getTaskKey(), reqVO.getTaskId(), reqVO.getOperateType(), reqVO.getAgree(), reqVO.getReason()); |
| 81 | 81 | ||
| 82 | OperateTypeEnum operateType = OperateTypeEnum.getByCode(reqVO.getOperateType()); | 82 | OperateTypeEnum operateType = OperateTypeEnum.getByCode(reqVO.getOperateType()); |
| @@ -162,8 +162,8 @@ public class AppGardenWorkOrderRegionMgrController { | @@ -162,8 +162,8 @@ public class AppGardenWorkOrderRegionMgrController { | ||
| 162 | gardenService.approveTask(returnApproveReqVO); | 162 | gardenService.approveTask(returnApproveReqVO); |
| 163 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"<--结束"); | 163 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"<--结束"); |
| 164 | return success(true); | 164 | return success(true); |
| 165 | - case YL_INSPECTOR_START_FINISH : //巡查员结束工单 | ||
| 166 | - log.info("当前操作:养护组长结束工单(不同意)或巡查员重新发起(同意)开始,是否同意:"+reqVO.getAgree()+"-->"); | 165 | + case YL_INSPECTOR_START_FINISH : //大区经理结束工单 |
| 166 | + log.info("当前操作:养护组长结束工单(不同意)或大区经理重新发起(同意)开始,是否同意:"+reqVO.getAgree()+"-->"); | ||
| 167 | AppGardenTaskApproveReqVO inspectStartReqVO = new AppGardenTaskApproveReqVO(); | 167 | AppGardenTaskApproveReqVO inspectStartReqVO = new AppGardenTaskApproveReqVO(); |
| 168 | Integer revokeStatus = reqVO.getAgree(); | 168 | Integer revokeStatus = reqVO.getAgree(); |
| 169 | if (revokeStatus == null || (revokeStatus != 0 && revokeStatus != 1)) { | 169 | if (revokeStatus == null || (revokeStatus != 0 && revokeStatus != 1)) { |
| @@ -176,7 +176,7 @@ public class AppGardenWorkOrderRegionMgrController { | @@ -176,7 +176,7 @@ public class AppGardenWorkOrderRegionMgrController { | ||
| 176 | gardenService.approveTask(inspectStartReqVO); | 176 | gardenService.approveTask(inspectStartReqVO); |
| 177 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); | 177 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); |
| 178 | return success(true); | 178 | return success(true); |
| 179 | - case YL_INSPECTOR_START_RELAUNCH : //巡查员重新发起 需修改更新工单数据 见切面 | 179 | + case YL_INSPECTOR_START_RELAUNCH : //大区经理重新发起 需修改更新工单数据 见切面 |
| 180 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"开始,操作类型:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode()+"-->"); | 180 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"开始,操作类型:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode()+"-->"); |
| 181 | AppGardenTaskApproveReqVO reStartReqVO = new AppGardenTaskApproveReqVO(); | 181 | AppGardenTaskApproveReqVO reStartReqVO = new AppGardenTaskApproveReqVO(); |
| 182 | Integer reStatus = reqVO.getAgree(); | 182 | Integer reStatus = reqVO.getAgree(); |
| @@ -194,8 +194,8 @@ public class AppGardenWorkOrderRegionMgrController { | @@ -194,8 +194,8 @@ public class AppGardenWorkOrderRegionMgrController { | ||
| 194 | gardenService.approveTask(reStartReqVO); | 194 | gardenService.approveTask(reStartReqVO); |
| 195 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"<--结束"); | 195 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"<--结束"); |
| 196 | return success(true); | 196 | return success(true); |
| 197 | - case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://巡查员验收通过,巡查员验收不通过 | ||
| 198 | - log.info("当前操作:巡查员验收通过 或巡查员验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); | 197 | + case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://大区经理验收通过,大区经理验收不通过 |
| 198 | + log.info("当前操作:大区经理验收通过 或大区经理验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); | ||
| 199 | AppGardenTaskApproveReqVO inspectReqVO = new AppGardenTaskApproveReqVO(); | 199 | AppGardenTaskApproveReqVO inspectReqVO = new AppGardenTaskApproveReqVO(); |
| 200 | Integer verifyStatus = reqVO.getAgree(); | 200 | Integer verifyStatus = reqVO.getAgree(); |
| 201 | if (verifyStatus == null || (verifyStatus != 0 && verifyStatus != 1)) { | 201 | if (verifyStatus == null || (verifyStatus != 0 && verifyStatus != 1)) { |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderUniversalController.java
| 1 | package com.zteits.urbanops.module.workorder.controller.app.garden; | 1 | package com.zteits.urbanops.module.workorder.controller.app.garden; |
| 2 | 2 | ||
| 3 | import com.zteits.urbanops.framework.common.pojo.CommonResult; | 3 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 4 | +import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | ||
| 4 | import com.zteits.urbanops.module.garden.api.road.RoadApi; | 5 | import com.zteits.urbanops.module.garden.api.road.RoadApi; |
| 6 | +import com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderBuzStatus; | ||
| 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.AppGardenTaskRegionMgrApproveReqVO; | ||
| 5 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | 14 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 15 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; | ||
| 16 | +import com.zteits.urbanops.module.workorder.enums.UniversalOperateTypeEnum; | ||
| 6 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | 17 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; |
| 7 | import com.zteits.urbanops.module.workorder.service.garden.BpmUniversalService; | 18 | import com.zteits.urbanops.module.workorder.service.garden.BpmUniversalService; |
| 8 | import io.swagger.v3.oas.annotations.Operation; | 19 | import io.swagger.v3.oas.annotations.Operation; |
| @@ -10,12 +21,17 @@ import io.swagger.v3.oas.annotations.tags.Tag; | @@ -10,12 +21,17 @@ import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 10 | import jakarta.annotation.Resource; | 21 | import jakarta.annotation.Resource; |
| 11 | import jakarta.validation.Valid; | 22 | import jakarta.validation.Valid; |
| 12 | import lombok.extern.slf4j.Slf4j; | 23 | import lombok.extern.slf4j.Slf4j; |
| 24 | +import org.springframework.transaction.annotation.Transactional; | ||
| 13 | import org.springframework.web.bind.annotation.PostMapping; | 25 | import org.springframework.web.bind.annotation.PostMapping; |
| 14 | import org.springframework.web.bind.annotation.RequestBody; | 26 | import org.springframework.web.bind.annotation.RequestBody; |
| 15 | import org.springframework.web.bind.annotation.RequestMapping; | 27 | import org.springframework.web.bind.annotation.RequestMapping; |
| 16 | import org.springframework.web.bind.annotation.RestController; | 28 | import org.springframework.web.bind.annotation.RestController; |
| 17 | 29 | ||
| 30 | +import java.util.List; | ||
| 31 | + | ||
| 32 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 18 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | 33 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| 34 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; | ||
| 19 | 35 | ||
| 20 | /** | 36 | /** |
| 21 | * 类描述:园林 全域工单管理入口 | 37 | * 类描述:园林 全域工单管理入口 |
| @@ -49,9 +65,183 @@ public class AppGardenWorkOrderUniversalController { | @@ -49,9 +65,183 @@ public class AppGardenWorkOrderUniversalController { | ||
| 49 | 65 | ||
| 50 | @PostMapping("/create") | 66 | @PostMapping("/create") |
| 51 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:create')") | 67 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:create')") |
| 52 | - @Operation(summary = "app-创建工单信息") | ||
| 53 | - public CommonResult<Long> createMainInfo(@Valid @RequestBody AppGardenWorkOrderReqVO createReqVO) { | 68 | + @Operation(summary = "app-全域巡查员创建工单信息") |
| 69 | + public CommonResult<Long> createMainInfo(@Valid @RequestBody AppGardenWorkOrderUniversalReqVO createReqVO) { | ||
| 54 | return success(universalService.createWorkOrder(createReqVO)); | 70 | return success(universalService.createWorkOrder(createReqVO)); |
| 55 | } | 71 | } |
| 56 | 72 | ||
| 73 | + @Operation(summary = "app-统一审批入口") | ||
| 74 | + @PostMapping("/universalApproval") | ||
| 75 | + @AutoUpdateWorkerOrderUniversalBuzStatus | ||
| 76 | + @Transactional(rollbackFor = Exception.class) | ||
| 77 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") | ||
| 78 | + public CommonResult<Boolean> universalApproval(@Valid @RequestBody AppUniversalApprovalReqVO reqVO) { | ||
| 79 | + | ||
| 80 | + log.info("【园林大区经理审批】接收前端请求,入参:curTaskKey={}, taskId={}, operateType={}, agree={}, reason={}", | ||
| 81 | + reqVO.getTaskKey(), reqVO.getTaskId(), reqVO.getOperateType(), reqVO.getAgree(), reqVO.getReason()); | ||
| 82 | + | ||
| 83 | + UniversalOperateTypeEnum operateType = UniversalOperateTypeEnum.getByCode(reqVO.getOperateType()); | ||
| 84 | + | ||
| 85 | + switch (operateType) { | ||
| 86 | + case REGION_MANAGER_ASSIGN://大区经理审批通过 | ||
| 87 | + log.info("当前操作:"+UniversalOperateTypeEnum.REGION_MANAGER_ASSIGN.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.REGION_MANAGER_ASSIGN.getCode()+"-->"); | ||
| 88 | + AppGardenTaskRegionMgrApproveReqVO regionPassReqVO = new AppGardenTaskRegionMgrApproveReqVO(); | ||
| 89 | + Integer passStatus = reqVO.getAgree(); | ||
| 90 | + if (passStatus == null || (passStatus != 0 && passStatus != 1)) { | ||
| 91 | + throw exception(APP_AGREE_CHOOSE); | ||
| 92 | + } | ||
| 93 | + regionPassReqVO.setBusiLine(reqVO.getBusiLine()); | ||
| 94 | + regionPassReqVO.setRoadId(reqVO.getRoadId()); | ||
| 95 | + regionPassReqVO.setAgree(passStatus); | ||
| 96 | + regionPassReqVO.setReason(reqVO.getReason()); | ||
| 97 | + regionPassReqVO.setId(reqVO.getTaskId()); | ||
| 98 | + regionPassReqVO.setReturnImgs(reqVO.getReturnImgs()); | ||
| 99 | + universalService.approveTask2TeamLeader(regionPassReqVO); | ||
| 100 | + log.info("当前操作:"+UniversalOperateTypeEnum.REGION_MANAGER_ASSIGN.getDesc()+"<--结束"); | ||
| 101 | + return success(true); | ||
| 102 | + case REGION_MANAGER_RETURN://大区经理退回 | ||
| 103 | + log.info("当前操作:"+UniversalOperateTypeEnum.REGION_MANAGER_RETURN.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.REGION_MANAGER_RETURN.getCode()+"-->"); | ||
| 104 | + AppGardenTaskRegionMgrApproveReqVO regionArroveReqVO = new AppGardenTaskRegionMgrApproveReqVO(); | ||
| 105 | + Integer regionStatus = reqVO.getAgree(); | ||
| 106 | + if (regionStatus == null || (regionStatus != 0 && regionStatus != 1)) { | ||
| 107 | + throw exception(APP_AGREE_CHOOSE); | ||
| 108 | + } | ||
| 109 | + regionArroveReqVO.setAgree(regionStatus); | ||
| 110 | + regionArroveReqVO.setReason(reqVO.getReason()); | ||
| 111 | + regionArroveReqVO.setId(reqVO.getTaskId()); | ||
| 112 | + regionArroveReqVO.setReturnImgs(reqVO.getReturnImgs()); | ||
| 113 | + universalService.approveTask2TeamLeader(regionArroveReqVO); | ||
| 114 | + log.info("当前操作:"+UniversalOperateTypeEnum.REGION_MANAGER_RETURN.getDesc()+"<--结束"); | ||
| 115 | + return success(true); | ||
| 116 | + case YL_WORKER_RETURN:// 养护员退回 | ||
| 117 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_WORKER_RETURN.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.YL_WORKER_RETURN.getCode()+"-->"); | ||
| 118 | + AppGardenTaskReturnExtReqVO retReqVO = new AppGardenTaskReturnExtReqVO(); | ||
| 119 | + retReqVO.setId(reqVO.getTaskId()); | ||
| 120 | + retReqVO.setCurTaskKey(reqVO.getTaskKey()); | ||
| 121 | + retReqVO.setReason(reqVO.getReason()); | ||
| 122 | + retReqVO.setWorkerDataId(reqVO.getWorkerDataId()); | ||
| 123 | + retReqVO.setReturnImgs(reqVO.getReturnImgs()); | ||
| 124 | + gardenService.returnPreviousNode(retReqVO); | ||
| 125 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_WORKER_RETURN.getDesc()+"<--结束"); | ||
| 126 | + return success(true); | ||
| 127 | + case YL_WORKER_IMPLEMENT://养护员实施 需修改更新工单数据 见切面 | ||
| 128 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_WORKER_IMPLEMENT.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.YL_WORKER_IMPLEMENT.getCode()+"-->"); | ||
| 129 | + AppGardenTaskWorkerExcuteReqVO workerExcuteReqVO = new AppGardenTaskWorkerExcuteReqVO(); | ||
| 130 | + workerExcuteReqVO.setWorkerDataId(reqVO.getWorkerDataId()); | ||
| 131 | + workerExcuteReqVO.setId(reqVO.getTaskId()); | ||
| 132 | + workerExcuteReqVO.setCoHandlers(reqVO.getCoHandlers()); | ||
| 133 | + workerExcuteReqVO.setHandleResult(reqVO.getHandleResult()); | ||
| 134 | + workerExcuteReqVO.setProblemsImgs(reqVO.getProblemsImgs()); | ||
| 135 | + workerExcuteReqVO.setStartImgs(reqVO.getStartImgs()); | ||
| 136 | + workerExcuteReqVO.setProcessingImgs(reqVO.getProcessingImgs()); | ||
| 137 | + workerExcuteReqVO.setEndImgs(reqVO.getEndImgs()); | ||
| 138 | + workerExcuteReqVO.setPersonImgs(reqVO.getPersonImgs()); | ||
| 139 | + workerExcuteReqVO.setMaterialImgs(reqVO.getMaterialImgs()); | ||
| 140 | + gardenService.ylWorkerExcuteWOrder(workerExcuteReqVO); | ||
| 141 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_WORKER_IMPLEMENT.getDesc()+"<--结束"); | ||
| 142 | + return success(true); | ||
| 143 | + case YL_TEAM_LEADER_CONFIRM_PASS://养护组长验收通过 | ||
| 144 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_PASS.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_PASS.getCode()+"-->"); | ||
| 145 | + AppGardenTaskApproveReqVO approveReqVO = new AppGardenTaskApproveReqVO(); | ||
| 146 | + approveReqVO.setReason(reqVO.getReason()); | ||
| 147 | + approveReqVO.setId(reqVO.getTaskId()); | ||
| 148 | + gardenService.approveTask(approveReqVO); | ||
| 149 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_PASS.getDesc()+"<--结束"); | ||
| 150 | + return success(true); | ||
| 151 | + case YL_TEAM_LEADER_CONFIRM_REJECT://养护组长验收不通过 需修改更新工单数据 见切面 | ||
| 152 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getCode()+"-->"); | ||
| 153 | + AppGardenTaskReturnExtReqVO rejReqVO = new AppGardenTaskReturnExtReqVO(); | ||
| 154 | + rejReqVO.setId(reqVO.getTaskId()); | ||
| 155 | + rejReqVO.setCurTaskKey(reqVO.getTaskKey()); | ||
| 156 | + rejReqVO.setReason(reqVO.getReason()); | ||
| 157 | + rejReqVO.setWorkerDataId(reqVO.getWorkerDataId()); | ||
| 158 | + List<String> returnImgs = reqVO.getReturnImgs(); | ||
| 159 | + rejReqVO.setReturnImgs(returnImgs); | ||
| 160 | + gardenService.returnPreviousNode(rejReqVO); | ||
| 161 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getDesc()+"<--结束"); | ||
| 162 | + return success(true); | ||
| 163 | + case YL_TEAM_LEADER_ASSIGN: //养护组长分配 需修改更新工单数据 见切面 | ||
| 164 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getCode()+"-->"); | ||
| 165 | + AppGardenTaskTeamLeaderAssignReqVO assignReqVO = new AppGardenTaskTeamLeaderAssignReqVO(); | ||
| 166 | + assignReqVO.setId(reqVO.getTaskId()); | ||
| 167 | + assignReqVO.setReason(reqVO.getReason()); | ||
| 168 | + Long userId = reqVO.getNextAssignee(); | ||
| 169 | + if(!ObjectUtils.isNotAllEmpty(userId)){ | ||
| 170 | + throw exception(APP_WORKER_NOT_EXISTS); | ||
| 171 | + } | ||
| 172 | + assignReqVO.setNextAssignee(reqVO.getNextAssignee()); | ||
| 173 | + Integer status = reqVO.getAgree(); | ||
| 174 | + if (status == null || (status != 0 && status != 1)) { | ||
| 175 | + throw exception(APP_AGREE_CHOOSE); | ||
| 176 | + } | ||
| 177 | + assignReqVO.setAgree(status); | ||
| 178 | + gardenService.ylTeamLeaderAssignWOrder(assignReqVO); | ||
| 179 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"<--结束"); | ||
| 180 | + return success(true); | ||
| 181 | + | ||
| 182 | + case YL_TEAM_LEADER_RETURN://养护组长退回 | ||
| 183 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_RETURN.getCode()+"-->"); | ||
| 184 | + AppGardenTaskApproveReqVO returnApproveReqVO = new AppGardenTaskApproveReqVO(); | ||
| 185 | + Integer approveStatus = reqVO.getAgree(); | ||
| 186 | + if (approveStatus == null || (approveStatus != 0 && approveStatus != 1)) { | ||
| 187 | + throw exception(APP_AGREE_CHOOSE); | ||
| 188 | + } | ||
| 189 | + returnApproveReqVO.setAgree(approveStatus); | ||
| 190 | + returnApproveReqVO.setReason(reqVO.getReason()); | ||
| 191 | + returnApproveReqVO.setId(reqVO.getTaskId()); | ||
| 192 | + returnApproveReqVO.setReturnImgs(reqVO.getReturnImgs()); | ||
| 193 | + gardenService.approveTask(returnApproveReqVO); | ||
| 194 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"<--结束"); | ||
| 195 | + return success(true); | ||
| 196 | + case YL_INSPECTOR_START_FINISH : //巡查员结束工单 | ||
| 197 | + log.info("当前操作:养护组长结束工单(不同意)或大区经理重新发起(同意)开始,是否同意:"+reqVO.getAgree()+"-->"); | ||
| 198 | + AppGardenTaskApproveReqVO inspectStartReqVO = new AppGardenTaskApproveReqVO(); | ||
| 199 | + Integer revokeStatus = reqVO.getAgree(); | ||
| 200 | + if (revokeStatus == null || (revokeStatus != 0 && revokeStatus != 1)) { | ||
| 201 | + throw exception(APP_AGREE_CHOOSE); | ||
| 202 | + } | ||
| 203 | + inspectStartReqVO.setAgree(revokeStatus); | ||
| 204 | + inspectStartReqVO.setReason(reqVO.getReason()); | ||
| 205 | + inspectStartReqVO.setId(reqVO.getTaskId()); | ||
| 206 | + inspectStartReqVO.setReturnImgs(reqVO.getReturnImgs()); | ||
| 207 | + gardenService.approveTask(inspectStartReqVO); | ||
| 208 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); | ||
| 209 | + return success(true); | ||
| 210 | + case YL_INSPECTOR_START_RELAUNCH : //全域巡查员重新发起 需修改更新工单数据 见切面 | ||
| 211 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"开始,操作类型:"+UniversalOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode()+"-->"); | ||
| 212 | + AppGardenTaskApproveReqVO reStartReqVO = new AppGardenTaskApproveReqVO(); | ||
| 213 | + Integer reStatus = reqVO.getAgree(); | ||
| 214 | + if (reStatus == null || (reStatus != 0 && reStatus != 1)) { | ||
| 215 | + throw exception(APP_AGREE_CHOOSE); | ||
| 216 | + } | ||
| 217 | + Long id = reqVO.getWorkerDataId(); | ||
| 218 | + if (id == null) { | ||
| 219 | + throw exception(APP_WORKER_ID_NOT_EMPTY); | ||
| 220 | + } | ||
| 221 | + reStartReqVO.setWorkerDataId(id); | ||
| 222 | + reStartReqVO.setAgree(reStatus); | ||
| 223 | + reStartReqVO.setReason(reqVO.getReason()); | ||
| 224 | + reStartReqVO.setId(reqVO.getTaskId()); | ||
| 225 | + gardenService.approveTask(reStartReqVO); | ||
| 226 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"<--结束"); | ||
| 227 | + return success(true); | ||
| 228 | + case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://大区经理验收通过,大区经理验收不通过 | ||
| 229 | + log.info("当前操作:全域巡查员验收通过 或全域巡查员验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); | ||
| 230 | + AppGardenTaskApproveReqVO inspectReqVO = new AppGardenTaskApproveReqVO(); | ||
| 231 | + Integer verifyStatus = reqVO.getAgree(); | ||
| 232 | + if (verifyStatus == null || (verifyStatus != 0 && verifyStatus != 1)) { | ||
| 233 | + throw exception(APP_AGREE_CHOOSE); | ||
| 234 | + } | ||
| 235 | + inspectReqVO.setAgree(verifyStatus); | ||
| 236 | + inspectReqVO.setReason(reqVO.getReason()); | ||
| 237 | + inspectReqVO.setId(reqVO.getTaskId()); | ||
| 238 | + inspectReqVO.setReturnImgs(reqVO.getReturnImgs()); | ||
| 239 | + gardenService.approveTask(inspectReqVO); | ||
| 240 | + log.info("当前操作:"+UniversalOperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); | ||
| 241 | + return success(true); | ||
| 242 | + default: | ||
| 243 | + throw exception(APP_OPERATOR_NOT_EXISTS); | ||
| 244 | + } | ||
| 245 | + } | ||
| 246 | + | ||
| 57 | } | 247 | } |
| 58 | \ No newline at end of file | 248 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/BuzStatusUpdateAspect.java
| @@ -13,6 +13,7 @@ import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppU | @@ -13,6 +13,7 @@ import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppU | ||
| 13 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | 13 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| 14 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | 14 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; |
| 15 | import com.zteits.urbanops.module.workorder.enums.OperateTypeEnum; | 15 | import com.zteits.urbanops.module.workorder.enums.OperateTypeEnum; |
| 16 | +import com.zteits.urbanops.module.workorder.enums.UniversalOperateTypeEnum; | ||
| 16 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | 17 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; |
| 17 | import com.zteits.urbanops.module.workorder.service.maininfo.MainInfoService; | 18 | import com.zteits.urbanops.module.workorder.service.maininfo.MainInfoService; |
| 18 | import jakarta.annotation.Resource; | 19 | import jakarta.annotation.Resource; |
| @@ -83,6 +84,7 @@ public class BuzStatusUpdateAspect { | @@ -83,6 +84,7 @@ public class BuzStatusUpdateAspect { | ||
| 83 | 84 | ||
| 84 | // 2. 解析操作类型 | 85 | // 2. 解析操作类型 |
| 85 | OperateTypeEnum operateType = OperateTypeEnum.getByCode(reqVO.getOperateType()); | 86 | OperateTypeEnum operateType = OperateTypeEnum.getByCode(reqVO.getOperateType()); |
| 87 | + UniversalOperateTypeEnum universalOperateTypeEnum = UniversalOperateTypeEnum.getByCode(reqVO.getOperateType()); | ||
| 86 | Long workerDataId = reqVO.getWorkerDataId(); | 88 | Long workerDataId = reqVO.getWorkerDataId(); |
| 87 | Integer buzStatus = operateType.getCode(); | 89 | Integer buzStatus = operateType.getCode(); |
| 88 | 90 | ||
| @@ -93,11 +95,39 @@ public class BuzStatusUpdateAspect { | @@ -93,11 +95,39 @@ public class BuzStatusUpdateAspect { | ||
| 93 | targeVO.setId(workerDataId); | 95 | targeVO.setId(workerDataId); |
| 94 | targeVO.setOrderNo(dbData.getOrderNo()); | 96 | targeVO.setOrderNo(dbData.getOrderNo()); |
| 95 | targeVO.setBusiLine(dbData.getBusiLine()); | 97 | targeVO.setBusiLine(dbData.getBusiLine()); |
| 98 | + //大区经理分配 | ||
| 99 | + if(UniversalOperateTypeEnum.REGION_MANAGER_ASSIGN.getCode().equals(reqVO.getOperateType())){ | ||
| 100 | + buzStatus = universalOperateTypeEnum.getCode(); | ||
| 101 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | ||
| 102 | + targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | ||
| 103 | + targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | ||
| 104 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | ||
| 105 | + if(null == dictData){ | ||
| 106 | + throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | ||
| 107 | + } | ||
| 108 | + targeVO.setCuringLevelId(Integer.valueOf(dictData.getValue())); | ||
| 109 | + targeVO.setCuringLevelName(dictData.getLabel()); | ||
| 110 | + targeVO.setBusiLine(reqVO.getBusiLine()); | ||
| 111 | + | ||
| 112 | + targeVO.setRoadName(reqVO.getRoadName()); | ||
| 113 | + targeVO.setRoadId(reqVO.getRoadId()); | ||
| 114 | + targeVO.setPressingType(reqVO.getPressingType()); | ||
| 115 | + targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + //大区经理退回 | ||
| 119 | + if(UniversalOperateTypeEnum.REGION_MANAGER_RETURN.getCode().equals(reqVO.getOperateType())){ | ||
| 120 | + buzStatus = universalOperateTypeEnum.getCode(); | ||
| 121 | + } | ||
| 96 | //重新发起需更新表单数据 | 122 | //重新发起需更新表单数据 |
| 97 | if(OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode().equals(operateType.getCode())){ | 123 | if(OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode().equals(operateType.getCode())){ |
| 98 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | 124 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); |
| 99 | targeVO = BeanUtils.toBean(reqVO,MainInfoDO.class); | 125 | targeVO = BeanUtils.toBean(reqVO,MainInfoDO.class); |
| 100 | targeVO.setId(reqVO.getWorkerDataId()); | 126 | targeVO.setId(reqVO.getWorkerDataId()); |
| 127 | + | ||
| 128 | + targeVO.setRoadName(reqVO.getRoadName()); | ||
| 129 | + targeVO.setRoadId(reqVO.getRoadId()); | ||
| 130 | + | ||
| 101 | targeVO.setOrderNo(dbData.getOrderNo()); | 131 | targeVO.setOrderNo(dbData.getOrderNo()); |
| 102 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | 132 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); |
| 103 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | 133 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/UniversalBuzStatusUpdateAspect.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.workorder.api.constant.BpmCommonConstant; | ||
| 11 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppUniversalApprovalReqVO; | ||
| 12 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | ||
| 13 | +import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | ||
| 14 | +import com.zteits.urbanops.module.workorder.enums.OperateTypeEnum; | ||
| 15 | +import com.zteits.urbanops.module.workorder.enums.UniversalOperateTypeEnum; | ||
| 16 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | ||
| 17 | +import jakarta.annotation.Resource; | ||
| 18 | +import jodd.util.StringUtil; | ||
| 19 | +import lombok.RequiredArgsConstructor; | ||
| 20 | +import org.aspectj.lang.ProceedingJoinPoint; | ||
| 21 | +import org.aspectj.lang.annotation.Around; | ||
| 22 | +import org.aspectj.lang.annotation.Aspect; | ||
| 23 | +import org.aspectj.lang.annotation.Pointcut; | ||
| 24 | +import org.springframework.stereotype.Component; | ||
| 25 | +import org.springframework.transaction.annotation.Transactional; | ||
| 26 | + | ||
| 27 | +import java.time.LocalDateTime; | ||
| 28 | +import java.util.List; | ||
| 29 | + | ||
| 30 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 31 | +import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.CONSERVE_LEVEL; | ||
| 32 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.APP_WORKER_LEVEL_ID_NOT_EXISTS; | ||
| 33 | + | ||
| 34 | +/** | ||
| 35 | + * 类描述:切面更新工单表业务状态 | ||
| 36 | + * 创建人:yanhuiqing | ||
| 37 | + * 创建时间:2025/12/21 14:53 | ||
| 38 | + * 修改人:yanhuiqing | ||
| 39 | + * 修改时间:2025/12/21 14:53 | ||
| 40 | + * 修改备注: | ||
| 41 | + * | ||
| 42 | + * @author yanhuiqing | ||
| 43 | + * @version 1.0 | ||
| 44 | + */ | ||
| 45 | +@Aspect | ||
| 46 | +@Component | ||
| 47 | +@RequiredArgsConstructor | ||
| 48 | +public class UniversalBuzStatusUpdateAspect { | ||
| 49 | + | ||
| 50 | + @Resource | ||
| 51 | + private MainInfoMapper mainInfoMapper; | ||
| 52 | + | ||
| 53 | + @Resource | ||
| 54 | + private final RoadApi roadApi; | ||
| 55 | + | ||
| 56 | + @Resource | ||
| 57 | + private BpmGardenService gardenService; | ||
| 58 | + | ||
| 59 | + @Resource | ||
| 60 | + private final DictDataCommonApi dictDataCommonApi; | ||
| 61 | + | ||
| 62 | + // 切点:标注了@AutoUpdateBuzStatus的方法 | ||
| 63 | + @Pointcut("@annotation(com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderUniversalBuzStatus)") | ||
| 64 | + public void buzStatusUpdatePointcut() {} | ||
| 65 | + | ||
| 66 | + @Around("buzStatusUpdatePointcut()") | ||
| 67 | + @Transactional(rollbackFor = Exception.class) | ||
| 68 | + public Object around(ProceedingJoinPoint joinPoint) throws Throwable { | ||
| 69 | + // 1. 获取方法参数(AppUniversalApprovalReqVO) | ||
| 70 | + Object[] args = joinPoint.getArgs(); | ||
| 71 | + AppUniversalApprovalReqVO reqVO = null; | ||
| 72 | + for (Object arg : args) { | ||
| 73 | + if (arg instanceof AppUniversalApprovalReqVO) { | ||
| 74 | + reqVO = (AppUniversalApprovalReqVO) arg; | ||
| 75 | + break; | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + if (reqVO == null) { | ||
| 79 | + throw new IllegalArgumentException("方法参数中未找到AppUniversalApprovalReqVO"); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + // 2. 解析操作类型 | ||
| 83 | + UniversalOperateTypeEnum operateType = UniversalOperateTypeEnum.getByCode(reqVO.getOperateType()); | ||
| 84 | + Long workerDataId = reqVO.getWorkerDataId(); | ||
| 85 | + Integer buzStatus = operateType.getCode(); | ||
| 86 | + | ||
| 87 | + // 3. 执行原有方法 | ||
| 88 | + Object result = joinPoint.proceed(); | ||
| 89 | + MainInfoDO dbData = mainInfoMapper.selectById(workerDataId); | ||
| 90 | + MainInfoDO targeVO = new MainInfoDO(); | ||
| 91 | + targeVO.setId(workerDataId); | ||
| 92 | + targeVO.setOrderNo(dbData.getOrderNo()); | ||
| 93 | + targeVO.setBusiLine(dbData.getBusiLine()); | ||
| 94 | + //大区经理分配 | ||
| 95 | + if(UniversalOperateTypeEnum.REGION_MANAGER_ASSIGN.getCode().equals(reqVO.getOperateType())){ | ||
| 96 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | ||
| 97 | + targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | ||
| 98 | + targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | ||
| 99 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | ||
| 100 | + if(null == dictData){ | ||
| 101 | + throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | ||
| 102 | + } | ||
| 103 | + targeVO.setCuringLevelId(Integer.valueOf(dictData.getValue())); | ||
| 104 | + targeVO.setCuringLevelName(dictData.getLabel()); | ||
| 105 | + targeVO.setBusiLine(reqVO.getBusiLine()); | ||
| 106 | + | ||
| 107 | + targeVO.setRoadName(reqVO.getRoadName()); | ||
| 108 | + targeVO.setRoadId(reqVO.getRoadId()); | ||
| 109 | + targeVO.setPressingType(reqVO.getPressingType()); | ||
| 110 | + targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + //大区经理退回 | ||
| 114 | + if(UniversalOperateTypeEnum.REGION_MANAGER_RETURN.getCode().equals(reqVO.getOperateType())){ | ||
| 115 | + | ||
| 116 | + } | ||
| 117 | + //重新发起需更新表单数据 | ||
| 118 | + if(UniversalOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode().equals(operateType.getCode())){ | ||
| 119 | + targeVO = BeanUtils.toBean(reqVO,MainInfoDO.class); | ||
| 120 | + targeVO.setId(reqVO.getWorkerDataId()); | ||
| 121 | + targeVO.setOrderNo(dbData.getOrderNo()); | ||
| 122 | + targeVO.setCommitDate(LocalDateTime.now()); | ||
| 123 | + if(reqVO.getExpectedFinishDate() != null){ | ||
| 124 | + targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate());//重新发起的期望时间 | ||
| 125 | + } | ||
| 126 | + targeVO.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | ||
| 127 | + | ||
| 128 | + targeVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); | ||
| 129 | + targeVO.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); | ||
| 130 | + if(reqVO.getFinishDate() != null){ | ||
| 131 | + targeVO.setFinishDate(reqVO.getFinishDate()); | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | ||
| 135 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | ||
| 136 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + //养护组长分配需更新表单数据 | ||
| 140 | + if(UniversalOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getCode().equals(operateType.getCode())){ | ||
| 141 | + targeVO.setWorkerId(reqVO.getNextAssignee()); | ||
| 142 | + } | ||
| 143 | + //养护组长验收不通过 需更新表单数据 | ||
| 144 | + if(UniversalOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getCode().equals(operateType.getCode())){ | ||
| 145 | + | ||
| 146 | + List<String> returnImgs = reqVO.getReturnImgs(); | ||
| 147 | + if(ObjectUtils.isNotAllEmpty(returnImgs) && returnImgs.size()>0){ | ||
| 148 | + gardenService.attachmentInsertOrUpdate(returnImgs,BpmCommonConstant.GARDEN_TEAMLEADER_RETURN_IMG,targeVO); | ||
| 149 | + } | ||
| 150 | + } | ||
| 151 | + //养护员实施 需更新表单数据 | ||
| 152 | + if(UniversalOperateTypeEnum.YL_WORKER_IMPLEMENT.getCode().equals(operateType.getCode())){ | ||
| 153 | + //实施更新为实施人员部门 | ||
| 154 | + targeVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | ||
| 155 | + //实施 审批已经执行 此处就无需执行 | ||
| 156 | + /* | ||
| 157 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | ||
| 158 | + List<String> startImgs = reqVO.getStartImgs(); | ||
| 159 | + List<String> processingImgs = reqVO.getProcessingImgs(); | ||
| 160 | + List<String> endImgs = reqVO.getEndImgs(); | ||
| 161 | + List<String> personImgs = reqVO.getPersonImgs(); | ||
| 162 | + List<String> materialImgs = reqVO.getMaterialImgs(); | ||
| 163 | + | ||
| 164 | + targeVO.setHandleResult(reqVO.getHandleResult()); | ||
| 165 | + targeVO.setCoHandlers(reqVO.getCoHandlers()); | ||
| 166 | + targeVO.setWorkerId(SecurityFrameworkUtils.getLoginUserId()); | ||
| 167 | + targeVO.setWorkerName(SecurityFrameworkUtils.getLoginUserNickname()); | ||
| 168 | + targeVO.setWorkerCompanyId(SecurityFrameworkUtils.getCompanyId()); | ||
| 169 | + mainInfoMapper.updateById(targeVO); | ||
| 170 | + | ||
| 171 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | ||
| 172 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | ||
| 173 | + } | ||
| 174 | + if(ObjectUtils.isNotAllEmpty(startImgs) && startImgs.size()>0){ | ||
| 175 | + gardenService.attachmentInsertOrUpdate(startImgs,BpmCommonConstant.START_IMG_GROUP,targeVO); | ||
| 176 | + } | ||
| 177 | + if(ObjectUtils.isNotAllEmpty(processingImgs) && processingImgs.size()>0){ | ||
| 178 | + gardenService.attachmentInsertOrUpdate(processingImgs,BpmCommonConstant.PROCESS_IMG_GROUP,targeVO); | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + if(ObjectUtils.isNotAllEmpty(endImgs) && endImgs.size()>0){ | ||
| 182 | + gardenService.attachmentInsertOrUpdate(endImgs,BpmCommonConstant.END_IMG_GROUP,targeVO); | ||
| 183 | + } | ||
| 184 | + if(ObjectUtils.isNotAllEmpty(personImgs) && personImgs.size()>0){ | ||
| 185 | + gardenService.attachmentInsertOrUpdate(personImgs,BpmCommonConstant.PERSON_IMG_GROUP,targeVO); | ||
| 186 | + } | ||
| 187 | + if(ObjectUtils.isNotAllEmpty(materialImgs) && materialImgs.size()>0){ | ||
| 188 | + gardenService.attachmentInsertOrUpdate(materialImgs,BpmCommonConstant.MATERIAL_IMG_GROUP,targeVO); | ||
| 189 | + }*/ | ||
| 190 | + } | ||
| 191 | + // 4. 自动更新buz_status | ||
| 192 | + targeVO.setBuzStatus(buzStatus.toString()); | ||
| 193 | + mainInfoMapper.updateById(targeVO); | ||
| 194 | + | ||
| 195 | + return result; | ||
| 196 | + } | ||
| 197 | +} | ||
| 0 | \ No newline at end of file | 198 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/task/AppGardenTaskRegionMgrApproveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.vo.task; | ||
| 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 | + | ||
| 8 | +import java.time.LocalDateTime; | ||
| 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 AppGardenTaskRegionMgrApproveReqVO { | ||
| 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不能为空") | ||
| 43 | + private Long roadId; | ||
| 44 | + | ||
| 45 | + @Schema(description = "道路名称", example = "测试道路") | ||
| 46 | + private String roadName; | ||
| 47 | + | ||
| 48 | + @Schema(description = " 紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | ||
| 49 | + @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般") | ||
| 50 | + private Integer pressingType; | ||
| 51 | + | ||
| 52 | + @NotNull | ||
| 53 | + @Schema(description = "工单业务线", example = "yl") | ||
| 54 | + private String busiLine; | ||
| 55 | + | ||
| 56 | + @Schema(description = "希望完成时间", example = "1766505427000") // Swagger文档示例 | ||
| 57 | + private LocalDateTime expectedFinishDate; | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + @Schema(description = "退回时的拍照图片") | ||
| 61 | + private List<String> returnImgs; | ||
| 62 | + | ||
| 63 | +} | ||
| 0 | \ No newline at end of file | 64 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
| @@ -35,7 +35,11 @@ public interface ErrorCodeConstants { | @@ -35,7 +35,11 @@ public interface ErrorCodeConstants { | ||
| 35 | 35 | ||
| 36 | ErrorCode APP_WORK_ORADER_NO_NOT_EXISTS = new ErrorCode(1-900-002-003, "工单编号不能为空!"); | 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 | + | ||
| 42 | + ErrorCode APP_UNIVERSAL_USER_ROLE_ERROR = new ErrorCode(1-900-002-006, "该登录人不是 全域巡查员,无法发起流程!"); | ||
| 43 | + | ||
| 44 | + ErrorCode APP_REGIONMGR_USER_ROLE_ERROR = new ErrorCode(1-900-002-007, "该登录人不是 大区经理,无法发起流程!"); | ||
| 41 | } | 45 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/UniversalOperateTypeEnum.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 UniversalOperateTypeEnum { | ||
| 23 | + REGION_MANAGER_ASSIGN(80,"大区经理分配"), | ||
| 24 | + REGION_MANAGER_RETURN(90,"大区经理退回"), | ||
| 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 | + UniversalOperateTypeEnum(Integer code, String desc) { | ||
| 41 | + this.code = code; | ||
| 42 | + this.desc = desc; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + // 根据code获取枚举(业务层转换用) | ||
| 46 | + public static UniversalOperateTypeEnum 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 | \ No newline at end of file | 53 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmRegionMgrServiceImpl.java
| @@ -25,6 +25,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper | @@ -25,6 +25,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper | ||
| 25 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | 25 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; |
| 26 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | 26 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 27 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; | 27 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 28 | +import com.zteits.urbanops.module.workorder.util.RoleListUtils; | ||
| 28 | import jakarta.annotation.Resource; | 29 | import jakarta.annotation.Resource; |
| 29 | import jodd.util.StringUtil; | 30 | import jodd.util.StringUtil; |
| 30 | import org.flowable.engine.RuntimeService; | 31 | import org.flowable.engine.RuntimeService; |
| @@ -130,6 +131,9 @@ public class BpmRegionMgrServiceImpl implements BpmRegionMgrService{ | @@ -130,6 +131,9 @@ public class BpmRegionMgrServiceImpl implements BpmRegionMgrService{ | ||
| 130 | if(null == roleList || roleList.size()==0){ | 131 | if(null == roleList || roleList.size()==0){ |
| 131 | throw exception(APP_USER_ROLE_NOT_EXISTS); | 132 | throw exception(APP_USER_ROLE_NOT_EXISTS); |
| 132 | } | 133 | } |
| 134 | + if(!RoleListUtils.containsCode(roleList,REGIONAL_MANAGER)){ | ||
| 135 | + throw exception(APP_REGIONMGR_USER_ROLE_ERROR); | ||
| 136 | + } | ||
| 133 | workOrder.setWoSourceId(roleList.get(0).getCode()); | 137 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 134 | workOrder.setWoSourceName(roleList.get(0).getName()); | 138 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 135 | String busiLine = createRequestVo.getBusiLine(); | 139 | String busiLine = createRequestVo.getBusiLine(); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmUniversalService.java
| 1 | package com.zteits.urbanops.module.workorder.service.garden; | 1 | package com.zteits.urbanops.module.workorder.service.garden; |
| 2 | 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.AppGardenTaskRegionMgrApproveReqVO; | ||
| 3 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | 5 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 6 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; | ||
| 4 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 5 | 8 | ||
| 6 | /** | 9 | /** |
| @@ -21,6 +24,12 @@ public interface BpmUniversalService { | @@ -21,6 +24,12 @@ public interface BpmUniversalService { | ||
| 21 | * @param createRequestVo | 24 | * @param createRequestVo |
| 22 | * @return | 25 | * @return |
| 23 | */ | 26 | */ |
| 24 | - Long createWorkOrder(@Valid AppGardenWorkOrderReqVO createRequestVo); | 27 | + Long createWorkOrder(@Valid AppGardenWorkOrderUniversalReqVO createRequestVo); |
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 大区经理审批 -app端 | ||
| 31 | + * @param reqVO | ||
| 32 | + */ | ||
| 33 | + void approveTask2TeamLeader(AppGardenTaskRegionMgrApproveReqVO reqVO); | ||
| 25 | 34 | ||
| 26 | } | 35 | } |
| 27 | \ No newline at end of file | 36 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmUniversalServiceImpl.java
| @@ -7,7 +7,10 @@ import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | @@ -7,7 +7,10 @@ import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | ||
| 7 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | 7 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 8 | import com.zteits.urbanops.module.bpm.api.task.BpmProcessInstanceApi; | 8 | import com.zteits.urbanops.module.bpm.api.task.BpmProcessInstanceApi; |
| 9 | import com.zteits.urbanops.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; | 9 | import com.zteits.urbanops.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; |
| 10 | +import com.zteits.urbanops.module.bpm.controller.admin.task.vo.task.BpmTaskApproveReqVO; | ||
| 10 | import com.zteits.urbanops.module.bpm.enums.task.BpmTaskStatusEnum; | 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.framework.flowable.core.util.FlowableUtils; | ||
| 11 | import com.zteits.urbanops.module.bpm.service.definition.BpmProcessDefinitionService; | 14 | import com.zteits.urbanops.module.bpm.service.definition.BpmProcessDefinitionService; |
| 12 | import com.zteits.urbanops.module.bpm.service.task.BpmProcessInstanceService; | 15 | import com.zteits.urbanops.module.bpm.service.task.BpmProcessInstanceService; |
| 13 | import com.zteits.urbanops.module.bpm.service.task.BpmTaskService; | 16 | import com.zteits.urbanops.module.bpm.service.task.BpmTaskService; |
| @@ -19,16 +22,20 @@ import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; | @@ -19,16 +22,20 @@ import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; | ||
| 19 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleRespVO; | 22 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleRespVO; |
| 20 | import com.zteits.urbanops.module.workorder.api.WorkOrderApi; | 23 | import com.zteits.urbanops.module.workorder.api.WorkOrderApi; |
| 21 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | 24 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; |
| 25 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskApproveReqVO; | ||
| 26 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRegionMgrApproveReqVO; | ||
| 22 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | 27 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| 23 | import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; | 28 | import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; |
| 24 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper; | 29 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper; |
| 25 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | 30 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; |
| 26 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | 31 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 32 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; | ||
| 27 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; | 33 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 28 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; | 34 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; |
| 29 | import jakarta.annotation.Resource; | 35 | import jakarta.annotation.Resource; |
| 30 | import jodd.util.StringUtil; | 36 | import jodd.util.StringUtil; |
| 31 | import org.flowable.engine.RuntimeService; | 37 | import org.flowable.engine.RuntimeService; |
| 38 | +import org.flowable.engine.runtime.ProcessInstance; | ||
| 32 | import org.springframework.stereotype.Service; | 39 | import org.springframework.stereotype.Service; |
| 33 | import org.springframework.validation.annotation.Validated; | 40 | import org.springframework.validation.annotation.Validated; |
| 34 | 41 | ||
| @@ -68,6 +75,9 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | @@ -68,6 +75,9 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | ||
| 68 | private MainInfoExtMapper workOrderExtMapper; | 75 | private MainInfoExtMapper workOrderExtMapper; |
| 69 | @Resource | 76 | @Resource |
| 70 | private BpmProcessInstanceApi processInstanceApi; | 77 | private BpmProcessInstanceApi processInstanceApi; |
| 78 | + | ||
| 79 | + @Resource | ||
| 80 | + private BpmProcessDefinitionService processDefinitionService; | ||
| 71 | @Resource | 81 | @Resource |
| 72 | private WorkOrderApi workOrderApi; | 82 | private WorkOrderApi workOrderApi; |
| 73 | 83 | ||
| @@ -78,9 +88,6 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | @@ -78,9 +88,6 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | ||
| 78 | private BpmTaskService taskService; | 88 | private BpmTaskService taskService; |
| 79 | 89 | ||
| 80 | @Resource | 90 | @Resource |
| 81 | - private BpmProcessDefinitionService processDefinitionService; | ||
| 82 | - | ||
| 83 | - @Resource | ||
| 84 | private AdminUserApi adminUserApi; | 91 | private AdminUserApi adminUserApi; |
| 85 | 92 | ||
| 86 | @Resource | 93 | @Resource |
| @@ -98,15 +105,11 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | @@ -98,15 +105,11 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | ||
| 98 | @Resource | 105 | @Resource |
| 99 | private DictDataCommonApi dictDataCommonApi; | 106 | private DictDataCommonApi dictDataCommonApi; |
| 100 | @Override | 107 | @Override |
| 101 | - public Long createWorkOrder(AppGardenWorkOrderReqVO createRequestVo) { | 108 | + public Long createWorkOrder(AppGardenWorkOrderUniversalReqVO createRequestVo) { |
| 102 | List<String> problemsImgsList = createRequestVo.getProblemsImgs(); | 109 | List<String> problemsImgsList = createRequestVo.getProblemsImgs(); |
| 103 | 110 | ||
| 104 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) | 111 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 105 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); | 112 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| 106 | - RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); | ||
| 107 | - | ||
| 108 | - workOrder.setStreetId(roadStreetRespDTO.getStreetId()); | ||
| 109 | - workOrder.setStreetName(roadStreetRespDTO.getStreetName()); | ||
| 110 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | 113 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| 111 | if(StringUtil.isEmpty(createRequestVo.getOrderType())){ | 114 | if(StringUtil.isEmpty(createRequestVo.getOrderType())){ |
| 112 | workOrder.setOrderType(BpmCommonConstant.ORDER_TYPE_C); | 115 | workOrder.setOrderType(BpmCommonConstant.ORDER_TYPE_C); |
| @@ -116,12 +119,6 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | @@ -116,12 +119,6 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | ||
| 116 | } | 119 | } |
| 117 | workOrder.setOrderType(createRequestVo.getOrderType()); | 120 | workOrder.setOrderType(createRequestVo.getOrderType()); |
| 118 | } | 121 | } |
| 119 | - DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | ||
| 120 | - if(null == dictData){ | ||
| 121 | - throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | ||
| 122 | - } | ||
| 123 | - workOrder.setCuringLevelId(Integer.valueOf(dictData.getValue())); | ||
| 124 | - workOrder.setCuringLevelName(dictData.getLabel()); | ||
| 125 | workOrder.setCommitDate(LocalDateTime.now()); | 122 | workOrder.setCommitDate(LocalDateTime.now()); |
| 126 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | 123 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 127 | 124 | ||
| @@ -130,25 +127,22 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | @@ -130,25 +127,22 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | ||
| 130 | if(null == roleList || roleList.size()==0){ | 127 | if(null == roleList || roleList.size()==0){ |
| 131 | throw exception(APP_USER_ROLE_NOT_EXISTS); | 128 | throw exception(APP_USER_ROLE_NOT_EXISTS); |
| 132 | } | 129 | } |
| 130 | + | ||
| 131 | + if(!RoleListUtils.containsCode(roleList,PARTROL_GLOBAL)){ | ||
| 132 | + throw exception(APP_UNIVERSAL_USER_ROLE_ERROR); | ||
| 133 | + } | ||
| 133 | //校验人员不能有 双重角色 | 134 | //校验人员不能有 双重角色 |
| 134 | - if(RoleListUtils.containsCodeOr(roleList, REGIONAL_MANAGER, PARTROL_GLOBAL)){ | 135 | + if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, PARTROL_GLOBAL)){ |
| 135 | throw exception(APP_WORK_ORADER_ROLE_ILLEGLE); | 136 | throw exception(APP_WORK_ORADER_ROLE_ILLEGLE); |
| 136 | } | 137 | } |
| 137 | - if(!(RoleListUtils.containsCode(roleList,REGIONAL_MANAGER) || RoleListUtils.containsCode(roleList,PARTROL_GLOBAL))){ | ||
| 138 | - throw exception(APP_WORK_ORADER_ROLE_NOT_EXSITS); | ||
| 139 | - } | 138 | + |
| 140 | workOrder.setWoSourceId(roleList.get(0).getCode()); | 139 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 141 | workOrder.setWoSourceName(roleList.get(0).getName()); | 140 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 142 | - String busiLine = createRequestVo.getBusiLine(); | ||
| 143 | - if(StringUtil.isEmpty(busiLine)){ | ||
| 144 | - busiLine = SecurityFrameworkUtils.getBusiLine(); | ||
| 145 | - } | ||
| 146 | - workOrder.setBusiLine(busiLine); | ||
| 147 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); | 141 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); |
| 148 | workOrder.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); | 142 | workOrder.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); |
| 149 | - if(ObjectUtils.isNotAllEmpty(createRequestVo.getExpectedFinishDate())){ | ||
| 150 | - workOrder.setExpectedFinishDate(createRequestVo.getExpectedFinishDate()); | ||
| 151 | - } | 143 | + workOrder.setStreetId(""); |
| 144 | + workOrder.setStreetName(""); | ||
| 145 | + | ||
| 152 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_UNIVERSE); | 146 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_UNIVERSE); |
| 153 | workOrder.setOrderNo(workOrderNum); | 147 | workOrder.setOrderNo(workOrderNum); |
| 154 | workOrderMapper.insert(workOrder); | 148 | workOrderMapper.insert(workOrder); |
| @@ -159,40 +153,66 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | @@ -159,40 +153,66 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | ||
| 159 | Long userId = SecurityFrameworkUtils.getLoginUserId(); | 153 | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| 160 | Map<String, Object> processInstanceVariables = new HashMap<>(); | 154 | Map<String, Object> processInstanceVariables = new HashMap<>(); |
| 161 | 155 | ||
| 162 | - String isGlobal = BPM_COMMON_PROD_GLOBAL; | ||
| 163 | - if(RoleListUtils.containsCode(roleList, REGIONAL_MANAGER)){//大区经理 | ||
| 164 | - processInstanceVariables.put(isGlobal,true); | ||
| 165 | - }else{//全域巡查员 | ||
| 166 | - processInstanceVariables.put(isGlobal,false); | ||
| 167 | - } | ||
| 168 | - | ||
| 169 | - processInstanceVariables.put(BPM_COMMON_PROD_ROADID, workOrder.getRoadId()); | ||
| 170 | processInstanceVariables.put(BPM_COMMON_PROD_APPLYUSERID, userId); | 156 | processInstanceVariables.put(BPM_COMMON_PROD_APPLYUSERID, userId); |
| 171 | - processInstanceVariables.put(BPM_COMMON_PROD_ISNEED,null); | ||
| 172 | - Map<String, List<Long>> startUserSelectAssignees = new HashMap<>(); | ||
| 173 | - String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); | ||
| 174 | - if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 | ||
| 175 | - roleCode = BpmCommonConstant.TEAM_LEADER_YL; | ||
| 176 | - } | ||
| 177 | - List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(workOrder.getRoadId(),roleCode,createRequestVo.getBusiLine()); | ||
| 178 | - if(org.springframework.util.ObjectUtils.isEmpty(userList)){ | ||
| 179 | - throw exception(TEAM_LEADER_YL_NOT_EXISTS); | ||
| 180 | - } | ||
| 181 | - // 提取id到List<Long> | ||
| 182 | - List<Long> idList = userList.stream() | ||
| 183 | - // 映射:将AdminUserRespDTO对象转为其id属性 | ||
| 184 | - .map(AdminUserRespDTO::getId) | ||
| 185 | - // 收集结果到List | ||
| 186 | - .collect(Collectors.toList()); | ||
| 187 | - processInstanceVariables.put(BPM_COMMON_PROD_LEADERID, idList.get(0));//养护组长分配 | 157 | + processInstanceVariables.put(BMP_COMMON_PROD_ISPASS,null); |
| 158 | + | ||
| 188 | String processInstanceId = processInstanceApi.createProcessInstance(userId, | 159 | String processInstanceId = processInstanceApi.createProcessInstance(userId, |
| 189 | // new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO) | 160 | // new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO) |
| 190 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_UNIVERSE_WO) | 161 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_UNIVERSE_WO) |
| 191 | - .setVariables(processInstanceVariables).setBusinessKey(String.valueOf(workOrder.getId())) | ||
| 192 | - .setStartUserSelectAssignees(startUserSelectAssignees)); | 162 | + .setVariables(processInstanceVariables).setBusinessKey(String.valueOf(workOrder.getId()))); |
| 193 | 163 | ||
| 194 | // 将工作流的编号,更新到 工单中 | 164 | // 将工作流的编号,更新到 工单中 |
| 195 | workOrderMapper.updateById(new MainInfoDO().setId(workOrder.getId()).setProcessInstanceId(processInstanceId)); | 165 | workOrderMapper.updateById(new MainInfoDO().setId(workOrder.getId()).setProcessInstanceId(processInstanceId)); |
| 196 | return workOrder.getId(); | 166 | return workOrder.getId(); |
| 197 | } | 167 | } |
| 168 | + | ||
| 169 | + @Override | ||
| 170 | + public void approveTask2TeamLeader(AppGardenTaskRegionMgrApproveReqVO reqVO) { | ||
| 171 | + BpmTaskApproveReqVO targetVO = BeanUtils.toBean(reqVO,BpmTaskApproveReqVO.class); | ||
| 172 | + Map<String, Object> variables = new HashMap<>(); | ||
| 173 | + //审批通过 | ||
| 174 | + variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS,BpmTaskStatusEnum.APPROVE.getStatus()); | ||
| 175 | + Integer status = reqVO.getAgree(); | ||
| 176 | + if(status == null || status == 1){//status == null 此处是为了兼容老接口,防止前段少改造 | ||
| 177 | + variables.put(BMP_COMMON_PROD_ISPASS,false); | ||
| 178 | + variables.put(BPM_COMMON_PROD_ISREVOKE,null);//不通过后 初始化重新发起变量 | ||
| 179 | + }else { | ||
| 180 | + variables.put(BMP_COMMON_PROD_ISPASS,true); | ||
| 181 | + variables.put(BPM_COMMON_PROD_ISNEED,null); | ||
| 182 | + String instanceId = taskService.getTask(reqVO.getId()).getProcessInstanceId(); | ||
| 183 | + ProcessInstance processInstance = processInstanceService.getProcessInstance(instanceId); | ||
| 184 | + Map<String, Object> processInstanceVariables = processInstance.getProcessVariables(); | ||
| 185 | + //String busiLine = (String)processInstanceVariables.get(BPM_COMMON_PROD_BUSILINE); | ||
| 186 | + //Long roadId = (Long) processInstanceVariables.get(BPM_COMMON_PROD_ROADID); | ||
| 187 | + String busiLine = reqVO.getBusiLine(); | ||
| 188 | + Long roadId = reqVO.getRoadId(); | ||
| 189 | + String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); | ||
| 190 | + | ||
| 191 | + if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 | ||
| 192 | + roleCode = BpmCommonConstant.TEAM_LEADER_YL; | ||
| 193 | + } | ||
| 194 | + List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(roadId,roleCode,busiLine); | ||
| 195 | + if(org.springframework.util.ObjectUtils.isEmpty(userList)){ | ||
| 196 | + throw exception(TEAM_LEADER_YL_NOT_EXISTS); | ||
| 197 | + } | ||
| 198 | + // 提取id到List<Long> | ||
| 199 | + List<Long> idList = userList.stream() | ||
| 200 | + // 映射:将AdminUserRespDTO对象转为其id属性 | ||
| 201 | + .map(AdminUserRespDTO::getId) | ||
| 202 | + // 收集结果到List | ||
| 203 | + .collect(Collectors.toList()); | ||
| 204 | + processInstanceVariables.put(BPM_COMMON_PROD_LEADERID, idList.get(0));//养护组长分配 | ||
| 205 | + //流程变量重新赋值 | ||
| 206 | + runtimeService.setVariables(instanceId,processInstanceVariables); | ||
| 207 | + | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + targetVO.setVariables(variables); | ||
| 211 | + //TODO 审批候选人需要赋值 | ||
| 212 | + Map<String, List<Long>> nextAssignees = new HashMap<>(); | ||
| 213 | + targetVO.setNextAssignees(nextAssignees); | ||
| 214 | + targetVO.setAttattmentUrls(reqVO.getReturnImgs()); | ||
| 215 | + taskService.approveTask(SecurityFrameworkUtils.getLoginUserId(),targetVO); | ||
| 216 | + } | ||
| 217 | + | ||
| 198 | } | 218 | } |
| 199 | \ No newline at end of file | 219 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/BpmProcessTaskAutoCompleteRegionMgrListener.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.service.garden.listener; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEvent; | ||
| 4 | +import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEventListener; | ||
| 5 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | ||
| 6 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | ||
| 7 | +import jakarta.annotation.Resource; | ||
| 8 | +import lombok.extern.slf4j.Slf4j; | ||
| 9 | +import org.springframework.stereotype.Component; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author yanhuiqing | ||
| 13 | + * @version 1.0 | ||
| 14 | + * @description: 处理流程的任务自动完成监听器 | ||
| 15 | + * @date 2025/12/6 14:00 | ||
| 16 | + */ | ||
| 17 | +@Component | ||
| 18 | +@Slf4j | ||
| 19 | +public class BpmProcessTaskAutoCompleteRegionMgrListener extends BpmProcessInstanceStatusEventListener { | ||
| 20 | + @Resource | ||
| 21 | + private BpmGardenService gardenService; | ||
| 22 | + @Override | ||
| 23 | + protected String getProcessDefinitionKey() { | ||
| 24 | + | ||
| 25 | + //return BpmCommonConstant.BPM_GARDEN_INSPECT_WO; | ||
| 26 | + return BpmCommonConstant.BPM_REGION_MGR_WO; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + @Override | ||
| 30 | + protected void onEvent(BpmProcessInstanceStatusEvent event) { | ||
| 31 | + log.info("业务ID:"+event.getBusinessKey()+",业务状态"+event.getStatus()); | ||
| 32 | + gardenService.updateWorkOrderStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); | ||
| 33 | + | ||
| 34 | + } | ||
| 35 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/BpmProcessTaskAutoCompleteUniversalListener.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.service.garden.listener; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEvent; | ||
| 4 | +import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEventListener; | ||
| 5 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | ||
| 6 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | ||
| 7 | +import jakarta.annotation.Resource; | ||
| 8 | +import lombok.extern.slf4j.Slf4j; | ||
| 9 | +import org.springframework.stereotype.Component; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author yanhuiqing | ||
| 13 | + * @version 1.0 | ||
| 14 | + * @description: 处理流程的任务自动完成监听器 | ||
| 15 | + * @date 2025/12/6 14:00 | ||
| 16 | + */ | ||
| 17 | +@Component | ||
| 18 | +@Slf4j | ||
| 19 | +public class BpmProcessTaskAutoCompleteUniversalListener extends BpmProcessInstanceStatusEventListener { | ||
| 20 | + @Resource | ||
| 21 | + private BpmGardenService gardenService; | ||
| 22 | + @Override | ||
| 23 | + protected String getProcessDefinitionKey() { | ||
| 24 | + | ||
| 25 | + //return BpmCommonConstant.BPM_GARDEN_INSPECT_WO; | ||
| 26 | + return BpmCommonConstant.BPM_UNIVERSE_WO; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + @Override | ||
| 30 | + protected void onEvent(BpmProcessInstanceStatusEvent event) { | ||
| 31 | + log.info("业务ID:"+event.getBusinessKey()+",业务状态"+event.getStatus()); | ||
| 32 | + gardenService.updateWorkOrderStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); | ||
| 33 | + | ||
| 34 | + } | ||
| 35 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/util/RoleListUtils.java
| @@ -4,6 +4,8 @@ import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.Rol | @@ -4,6 +4,8 @@ import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.Rol | ||
| 4 | 4 | ||
| 5 | import java.util.List; | 5 | import java.util.List; |
| 6 | import java.util.Objects; | 6 | import java.util.Objects; |
| 7 | +import java.util.Set; | ||
| 8 | +import java.util.stream.Collectors; | ||
| 7 | 9 | ||
| 8 | /** | 10 | /** |
| 9 | * 类描述:判断角色包含关系工具类 | 11 | * 类描述:判断角色包含关系工具类 |
| @@ -51,4 +53,28 @@ public class RoleListUtils { | @@ -51,4 +53,28 @@ public class RoleListUtils { | ||
| 51 | .filter(Objects::nonNull) | 53 | .filter(Objects::nonNull) |
| 52 | .anyMatch(code -> code1.equals(code) || code2.equals(code)); | 54 | .anyMatch(code -> code1.equals(code) || code2.equals(code)); |
| 53 | } | 55 | } |
| 56 | + /** | ||
| 57 | + * 方法:判断角色列表中是否同时包含 code = code1 且 code = code2 的元素 | ||
| 58 | + * @param roleList 角色列表(允许为 null/空) | ||
| 59 | + * @param code1 第一个要校验的编码(允许为 null,此时要求列表中存在 null 的 code) | ||
| 60 | + * @param code2 第二个要校验的编码(允许为 null,此时要求列表中存在 null 的 code) | ||
| 61 | + * @return true=同时包含code1和code2;false=不同时包含/列表为空/列表为null | ||
| 62 | + */ | ||
| 63 | + public static boolean containsBothCodes(List<RoleRespVO> roleList, String code1, String code2) { | ||
| 64 | + // 1. 列表为null/空,直接返回false | ||
| 65 | + if (roleList == null || roleList.isEmpty()) { | ||
| 66 | + return false; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + // 2. 提取角色列表中所有非空/空的 code,存入 Set 提高查询效率(去重不影响结果) | ||
| 70 | + Set<String> roleCodeSet = roleList.stream() | ||
| 71 | + .map(RoleRespVO::getCode) // 提取每个角色的 code | ||
| 72 | + .collect(Collectors.toSet()); // 转 Set 去重,优化 contains 性能 | ||
| 73 | + | ||
| 74 | + // 3. 核心逻辑:判断 Set 中同时包含 code1 和 code2(兼容 code1/code2 为 null 的场景) | ||
| 75 | + boolean containsCode1 = roleCodeSet.contains(code1); | ||
| 76 | + boolean containsCode2 = roleCodeSet.contains(code2); | ||
| 77 | + | ||
| 78 | + return containsCode1 && containsCode2; | ||
| 79 | + } | ||
| 54 | } | 80 | } |
| 55 | \ No newline at end of file | 81 | \ No newline at end of file |