Commit 3fe9c3e6bcd2c9bfaaf0fe309fb7280aeef977fe
1 parent
53ec7c1b
AI工单 审批流程
Showing
8 changed files
with
389 additions
and
7 deletions
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderAIReqVO.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 AI端请求参数 | ||
| 17 | + * @date 2025/12/6 10:17 | ||
| 18 | + */ | ||
| 19 | +@Schema(description = "APP-园林AI工单请求创建 Request VO") | ||
| 20 | +@Data | ||
| 21 | +public class AppGardenWorkOrderAIReqVO { | ||
| 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/AutoUpdateWorkerOrderAIBuzStatus.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 AutoUpdateWorkerOrderAIBuzStatus { | ||
| 16 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderAIController.java
| @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.workorder.controller.app.garden; | @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.workorder.controller.app.garden; | ||
| 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.framework.common.util.object.ObjectUtils; |
| 5 | 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.AutoUpdateWorkerOrderAIBuzStatus; | ||
| 6 | import com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderInspectorBuzStatus; | 7 | import com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderInspectorBuzStatus; |
| 7 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppUniversalApprovalReqVO; | 8 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppUniversalApprovalReqVO; |
| 8 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.operator.AppGardenTaskReturnExtReqVO; | 9 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.operator.AppGardenTaskReturnExtReqVO; |
| @@ -11,6 +12,7 @@ import com.zteits.urbanops.module.workorder.controller.app.garden.vo.operator.Ap | @@ -11,6 +12,7 @@ import com.zteits.urbanops.module.workorder.controller.app.garden.vo.operator.Ap | ||
| 11 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskApproveReqVO; | 12 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskApproveReqVO; |
| 12 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskInspectorApproveReqVO; | 13 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskInspectorApproveReqVO; |
| 13 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRegionMgrApproveReqVO; | 14 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRegionMgrApproveReqVO; |
| 15 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderAIReqVO; | ||
| 14 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; | 16 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; |
| 15 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | 17 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 16 | import com.zteits.urbanops.module.workorder.enums.AIOperateTypeEnum; | 18 | import com.zteits.urbanops.module.workorder.enums.AIOperateTypeEnum; |
| @@ -67,13 +69,13 @@ public class AppGardenWorkOrderAIController { | @@ -67,13 +69,13 @@ public class AppGardenWorkOrderAIController { | ||
| 67 | @PostMapping("/create") | 69 | @PostMapping("/create") |
| 68 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:create')") | 70 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:create')") |
| 69 | @Operation(summary = "app-AI工单派发人员创建工单信息") | 71 | @Operation(summary = "app-AI工单派发人员创建工单信息") |
| 70 | - public CommonResult<Long> createMainInfo(@Valid @RequestBody AppGardenWorkOrderInspectorReqVO createReqVO) { | 72 | + public CommonResult<Long> createMainInfo(@Valid @RequestBody AppGardenWorkOrderAIReqVO createReqVO) { |
| 71 | return success(aiService.createWorkOrder(createReqVO)); | 73 | return success(aiService.createWorkOrder(createReqVO)); |
| 72 | } | 74 | } |
| 73 | 75 | ||
| 74 | @Operation(summary = "app-统一审批入口") | 76 | @Operation(summary = "app-统一审批入口") |
| 75 | @PostMapping("/universalApproval") | 77 | @PostMapping("/universalApproval") |
| 76 | - @AutoUpdateWorkerOrderInspectorBuzStatus | 78 | + @AutoUpdateWorkerOrderAIBuzStatus |
| 77 | @Transactional(rollbackFor = Exception.class) | 79 | @Transactional(rollbackFor = Exception.class) |
| 78 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") | 80 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") |
| 79 | public CommonResult<Boolean> universalApproval(@Valid @RequestBody AppUniversalApprovalReqVO reqVO) { | 81 | public CommonResult<Boolean> universalApproval(@Valid @RequestBody AppUniversalApprovalReqVO reqVO) { |
| @@ -240,7 +242,7 @@ public class AppGardenWorkOrderAIController { | @@ -240,7 +242,7 @@ public class AppGardenWorkOrderAIController { | ||
| 240 | inspectReqVO.setId(reqVO.getTaskId()); | 242 | inspectReqVO.setId(reqVO.getTaskId()); |
| 241 | inspectReqVO.setReturnImgs(reqVO.getReturnImgs()); | 243 | inspectReqVO.setReturnImgs(reqVO.getReturnImgs()); |
| 242 | gardenService.approveTask(inspectReqVO); | 244 | gardenService.approveTask(inspectReqVO); |
| 243 | - log.info("当前操作:"+AIOperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); | 245 | + log.info("当前操作:"+AIOperateTypeEnum.YL_INSPECTOR_CHECK_PASS.getDesc()+AIOperateTypeEnum.YL_INSPECTOR_CHECK_REJECT.getDesc()+"<--结束"); |
| 244 | return success(true); | 246 | return success(true); |
| 245 | default: | 247 | default: |
| 246 | throw exception(APP_OPERATOR_NOT_EXISTS); | 248 | throw exception(APP_OPERATOR_NOT_EXISTS); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderInspectorController.java
| @@ -232,7 +232,7 @@ public class AppGardenWorkOrderInspectorController { | @@ -232,7 +232,7 @@ public class AppGardenWorkOrderInspectorController { | ||
| 232 | log.info("当前操作:"+InspectorOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"<--结束"); | 232 | log.info("当前操作:"+InspectorOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"<--结束"); |
| 233 | return success(true); | 233 | return success(true); |
| 234 | case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://督察员验收通过,督察员验收不通过 | 234 | case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://督察员验收通过,督察员验收不通过 |
| 235 | - log.info("当前操作:全域巡查员验收通过 或全域巡查员验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); | 235 | + log.info("当前操作:全域督察员验收通过 或全域督察员验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); |
| 236 | AppGardenTaskApproveReqVO inspectReqVO = new AppGardenTaskApproveReqVO(); | 236 | AppGardenTaskApproveReqVO inspectReqVO = new AppGardenTaskApproveReqVO(); |
| 237 | Integer verifyStatus = reqVO.getAgree(); | 237 | Integer verifyStatus = reqVO.getAgree(); |
| 238 | if (verifyStatus == null || (verifyStatus != 0 && verifyStatus != 1)) { | 238 | if (verifyStatus == null || (verifyStatus != 0 && verifyStatus != 1)) { |
| @@ -243,7 +243,7 @@ public class AppGardenWorkOrderInspectorController { | @@ -243,7 +243,7 @@ public class AppGardenWorkOrderInspectorController { | ||
| 243 | inspectReqVO.setId(reqVO.getTaskId()); | 243 | inspectReqVO.setId(reqVO.getTaskId()); |
| 244 | inspectReqVO.setReturnImgs(reqVO.getReturnImgs()); | 244 | inspectReqVO.setReturnImgs(reqVO.getReturnImgs()); |
| 245 | gardenService.approveTask(inspectReqVO); | 245 | gardenService.approveTask(inspectReqVO); |
| 246 | - log.info("当前操作:"+InspectorOperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); | 246 | + log.info("当前操作:"+InspectorOperateTypeEnum.YL_INSPECTOR_CHECK_PASS.getDesc()+InspectorOperateTypeEnum.YL_INSPECTOR_CHECK_REJECT.getDesc()+"<--结束"); |
| 247 | return success(true); | 247 | return success(true); |
| 248 | default: | 248 | default: |
| 249 | throw exception(APP_OPERATOR_NOT_EXISTS); | 249 | throw exception(APP_OPERATOR_NOT_EXISTS); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/AIBuzStatusUpdateAspect.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.AIOperateTypeEnum; | ||
| 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.APP_WORKER_LEVEL_ID_NOT_EXISTS; | ||
| 35 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.APP_WORK_ROAD_NOT_EXISTS; | ||
| 36 | + | ||
| 37 | +/** | ||
| 38 | + * 类描述:切面更新工单表业务状态 | ||
| 39 | + * 创建人:yanhuiqing | ||
| 40 | + * 创建时间:2025/12/21 14:53 | ||
| 41 | + * 修改人:yanhuiqing | ||
| 42 | + * 修改时间:2025/12/21 14:53 | ||
| 43 | + * 修改备注: | ||
| 44 | + * | ||
| 45 | + * @author yanhuiqing | ||
| 46 | + * @version 1.0 | ||
| 47 | + */ | ||
| 48 | +@Aspect | ||
| 49 | +@Component | ||
| 50 | +@RequiredArgsConstructor | ||
| 51 | +public class AIBuzStatusUpdateAspect { | ||
| 52 | + | ||
| 53 | + @Resource | ||
| 54 | + private MainInfoMapper mainInfoMapper; | ||
| 55 | + | ||
| 56 | + @Resource | ||
| 57 | + private final RoadApi roadApi; | ||
| 58 | + | ||
| 59 | + @Resource | ||
| 60 | + private BpmGardenService gardenService; | ||
| 61 | + | ||
| 62 | + @Resource | ||
| 63 | + private final DictDataCommonApi dictDataCommonApi; | ||
| 64 | + | ||
| 65 | + @Resource | ||
| 66 | + private RoleApi roleApi; | ||
| 67 | + | ||
| 68 | + // 切点:标注了@AutoUpdateBuzStatus的方法 | ||
| 69 | + @Pointcut("@annotation(com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderAIBuzStatus)") | ||
| 70 | + public void buzStatusUpdatePointcut() {} | ||
| 71 | + | ||
| 72 | + @Around("buzStatusUpdatePointcut()") | ||
| 73 | + @Transactional(rollbackFor = Exception.class) | ||
| 74 | + public Object around(ProceedingJoinPoint joinPoint) throws Throwable { | ||
| 75 | + // 1. 获取方法参数(AppUniversalApprovalReqVO) | ||
| 76 | + Object[] args = joinPoint.getArgs(); | ||
| 77 | + AppUniversalApprovalReqVO reqVO = null; | ||
| 78 | + for (Object arg : args) { | ||
| 79 | + if (arg instanceof AppUniversalApprovalReqVO) { | ||
| 80 | + reqVO = (AppUniversalApprovalReqVO) arg; | ||
| 81 | + break; | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + if (reqVO == null) { | ||
| 85 | + throw new IllegalArgumentException("方法参数中未找到AppUniversalApprovalReqVO"); | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + // 2. 解析操作类型 | ||
| 89 | + AIOperateTypeEnum operateType = AIOperateTypeEnum.getByCode(reqVO.getOperateType()); | ||
| 90 | + Long workerDataId = reqVO.getWorkerDataId(); | ||
| 91 | + Integer buzStatus = operateType.getCode(); | ||
| 92 | + | ||
| 93 | + // 3. 执行原有方法 | ||
| 94 | + Object result = joinPoint.proceed(); | ||
| 95 | + MainInfoDO dbData = mainInfoMapper.selectById(workerDataId); | ||
| 96 | + MainInfoDO targeVO = new MainInfoDO(); | ||
| 97 | + targeVO.setId(workerDataId); | ||
| 98 | + targeVO.setOrderNo(dbData.getOrderNo()); | ||
| 99 | + targeVO.setBusiLine(dbData.getBusiLine()); | ||
| 100 | + //大区经理分配 | ||
| 101 | + if(AIOperateTypeEnum.AI_REGION_MANAGER_ASSIGN.getCode().equals(reqVO.getOperateType())){ | ||
| 102 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | ||
| 103 | + if(null == roadStreetRespDTO){ | ||
| 104 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | ||
| 105 | + } | ||
| 106 | + targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | ||
| 107 | + targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | ||
| 108 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | ||
| 109 | + if(null == dictData){ | ||
| 110 | + throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | ||
| 111 | + } | ||
| 112 | + targeVO.setCuringLevelId(Integer.valueOf(dictData.getValue())); | ||
| 113 | + targeVO.setCuringLevelName(dictData.getLabel()); | ||
| 114 | + targeVO.setBusiLine(reqVO.getBusiLine()); | ||
| 115 | + | ||
| 116 | + targeVO.setRoadName(reqVO.getRoadName()); | ||
| 117 | + targeVO.setRoadId(reqVO.getRoadId()); | ||
| 118 | + targeVO.setPressingType(reqVO.getPressingType()); | ||
| 119 | + targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + //大区经理退回 | ||
| 123 | + if(AIOperateTypeEnum.AI_REGION_MANAGER_RETURN.getCode().equals(reqVO.getOperateType())){ | ||
| 124 | + | ||
| 125 | + } | ||
| 126 | + //重新发起需更新表单数据 | ||
| 127 | + if(AIOperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode().equals(operateType.getCode())){ | ||
| 128 | + targeVO = BeanUtils.toBean(reqVO,MainInfoDO.class); | ||
| 129 | + targeVO.setId(reqVO.getWorkerDataId()); | ||
| 130 | + targeVO.setOrderNo(dbData.getOrderNo()); | ||
| 131 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | ||
| 132 | + if(null == roadStreetRespDTO){ | ||
| 133 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | ||
| 134 | + } | ||
| 135 | + targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | ||
| 136 | + targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | ||
| 137 | + targeVO.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | ||
| 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 | + targeVO.setCuringLevelId(Integer.valueOf(dictData.getValue())); | ||
| 144 | + targeVO.setCuringLevelName(dictData.getLabel()); | ||
| 145 | + targeVO.setCommitDate(LocalDateTime.now()); | ||
| 146 | + targeVO.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | ||
| 147 | + | ||
| 148 | + targeVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | ||
| 149 | + List<RoleRespVO> roleList = roleApi.getRoleListByUsrId(SecurityFrameworkUtils.getLoginUserId()); | ||
| 150 | + targeVO.setWoSourceId(roleList.get(0).getCode()); | ||
| 151 | + targeVO.setWoSourceName(roleList.get(0).getName()); | ||
| 152 | + String busiLine = reqVO.getBusiLine(); | ||
| 153 | + if(StringUtil.isEmpty(busiLine)){ | ||
| 154 | + busiLine = SecurityFrameworkUtils.getBusiLine(); | ||
| 155 | + } | ||
| 156 | + targeVO.setBusiLine(busiLine); | ||
| 157 | + targeVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); | ||
| 158 | + targeVO.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); | ||
| 159 | + if(ObjectUtils.isNotAllEmpty(reqVO.getExpectedFinishDate())){ | ||
| 160 | + targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | ||
| 164 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | ||
| 165 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + //养护组长分配需更新表单数据 | ||
| 169 | + if(AIOperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getCode().equals(operateType.getCode())){ | ||
| 170 | + targeVO.setWorkerId(reqVO.getNextAssignee()); | ||
| 171 | + } | ||
| 172 | + //养护组长验收不通过 需更新表单数据 | ||
| 173 | + if(AIOperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getCode().equals(operateType.getCode())){ | ||
| 174 | + | ||
| 175 | + List<String> returnImgs = reqVO.getReturnImgs(); | ||
| 176 | + if(ObjectUtils.isNotAllEmpty(returnImgs) && returnImgs.size()>0){ | ||
| 177 | + gardenService.attachmentInsertOrUpdate(returnImgs,BpmCommonConstant.GARDEN_TEAMLEADER_RETURN_IMG,targeVO); | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + //养护员实施 需更新表单数据 | ||
| 181 | + if(AIOperateTypeEnum.YL_WORKER_IMPLEMENT.getCode().equals(operateType.getCode())){ | ||
| 182 | + //实施更新为实施人员部门 | ||
| 183 | + targeVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | ||
| 184 | + //实施 审批已经执行 此处就无需执行 | ||
| 185 | + /* | ||
| 186 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | ||
| 187 | + List<String> startImgs = reqVO.getStartImgs(); | ||
| 188 | + List<String> processingImgs = reqVO.getProcessingImgs(); | ||
| 189 | + List<String> endImgs = reqVO.getEndImgs(); | ||
| 190 | + List<String> personImgs = reqVO.getPersonImgs(); | ||
| 191 | + List<String> materialImgs = reqVO.getMaterialImgs(); | ||
| 192 | + | ||
| 193 | + targeVO.setHandleResult(reqVO.getHandleResult()); | ||
| 194 | + targeVO.setCoHandlers(reqVO.getCoHandlers()); | ||
| 195 | + targeVO.setWorkerId(SecurityFrameworkUtils.getLoginUserId()); | ||
| 196 | + targeVO.setWorkerName(SecurityFrameworkUtils.getLoginUserNickname()); | ||
| 197 | + targeVO.setWorkerCompanyId(SecurityFrameworkUtils.getCompanyId()); | ||
| 198 | + mainInfoMapper.updateById(targeVO); | ||
| 199 | + | ||
| 200 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | ||
| 201 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | ||
| 202 | + } | ||
| 203 | + if(ObjectUtils.isNotAllEmpty(startImgs) && startImgs.size()>0){ | ||
| 204 | + gardenService.attachmentInsertOrUpdate(startImgs,BpmCommonConstant.START_IMG_GROUP,targeVO); | ||
| 205 | + } | ||
| 206 | + if(ObjectUtils.isNotAllEmpty(processingImgs) && processingImgs.size()>0){ | ||
| 207 | + gardenService.attachmentInsertOrUpdate(processingImgs,BpmCommonConstant.PROCESS_IMG_GROUP,targeVO); | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + if(ObjectUtils.isNotAllEmpty(endImgs) && endImgs.size()>0){ | ||
| 211 | + gardenService.attachmentInsertOrUpdate(endImgs,BpmCommonConstant.END_IMG_GROUP,targeVO); | ||
| 212 | + } | ||
| 213 | + if(ObjectUtils.isNotAllEmpty(personImgs) && personImgs.size()>0){ | ||
| 214 | + gardenService.attachmentInsertOrUpdate(personImgs,BpmCommonConstant.PERSON_IMG_GROUP,targeVO); | ||
| 215 | + } | ||
| 216 | + if(ObjectUtils.isNotAllEmpty(materialImgs) && materialImgs.size()>0){ | ||
| 217 | + gardenService.attachmentInsertOrUpdate(materialImgs,BpmCommonConstant.MATERIAL_IMG_GROUP,targeVO); | ||
| 218 | + }*/ | ||
| 219 | + } | ||
| 220 | + // 4. 自动更新buz_status | ||
| 221 | + targeVO.setBuzStatus(buzStatus.toString()); | ||
| 222 | + mainInfoMapper.updateById(targeVO); | ||
| 223 | + | ||
| 224 | + return result; | ||
| 225 | + } | ||
| 226 | +} | ||
| 0 | \ No newline at end of file | 227 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/EventSourceEnum.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/30 19:22 | ||
| 13 | + * 修改人:yanhuiqing | ||
| 14 | + * 修改时间:2025/12/30 19:22 | ||
| 15 | + * 修改备注: | ||
| 16 | + * | ||
| 17 | + * @author yanhuiqing | ||
| 18 | + * @version 1.0 | ||
| 19 | + */ | ||
| 20 | +@Schema(description = "工单来源类型枚举") | ||
| 21 | +@Getter | ||
| 22 | +public enum EventSourceEnum { | ||
| 23 | + PATROL(1, "巡查"), | ||
| 24 | + TOURISTS(2, "游客居民"), | ||
| 25 | + ONEFIVE(3, "12345"), | ||
| 26 | + GRID(4, "网格"), | ||
| 27 | + REGION(5, "大区经理"), | ||
| 28 | + AI(6, "AI"); | ||
| 29 | + | ||
| 30 | + @JsonValue // 序列化时返回code(前端接收数字) | ||
| 31 | + private final Integer code; | ||
| 32 | + private final String desc; | ||
| 33 | + | ||
| 34 | + EventSourceEnum(Integer code, String desc) { | ||
| 35 | + this.code = code; | ||
| 36 | + this.desc = desc; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + // 根据code获取枚举(业务层转换用) | ||
| 40 | + public static EventSourceEnum getByCode(Integer code) { | ||
| 41 | + return Arrays.stream(values()) | ||
| 42 | + .filter(e -> e.getCode().equals(code)) | ||
| 43 | + .findFirst() | ||
| 44 | + .orElseThrow(() -> new IllegalArgumentException("无效的同意类型:" + code)); | ||
| 45 | + } | ||
| 46 | +} | ||
| 0 | \ No newline at end of file | 47 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmAIService.java
| @@ -2,6 +2,7 @@ package com.zteits.urbanops.module.workorder.service.garden; | @@ -2,6 +2,7 @@ package com.zteits.urbanops.module.workorder.service.garden; | ||
| 2 | 2 | ||
| 3 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskInspectorApproveReqVO; | 3 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskInspectorApproveReqVO; |
| 4 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRegionMgrApproveReqVO; | 4 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.AppGardenTaskRegionMgrApproveReqVO; |
| 5 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderAIReqVO; | ||
| 5 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; | 6 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; |
| 6 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 7 | 8 | ||
| @@ -23,7 +24,7 @@ public interface BpmAIService { | @@ -23,7 +24,7 @@ public interface BpmAIService { | ||
| 23 | * @param createRequestVo | 24 | * @param createRequestVo |
| 24 | * @return | 25 | * @return |
| 25 | */ | 26 | */ |
| 26 | - Long createWorkOrder(@Valid AppGardenWorkOrderInspectorReqVO createRequestVo); | 27 | + Long createWorkOrder(@Valid AppGardenWorkOrderAIReqVO createRequestVo); |
| 27 | 28 | ||
| 28 | /** | 29 | /** |
| 29 | * 全域督察员工单分配 | 30 | * 全域督察员工单分配 |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmAIServiceImpl.java
| @@ -27,8 +27,10 @@ import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | @@ -27,8 +27,10 @@ import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | ||
| 27 | import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; | 27 | import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; |
| 28 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper; | 28 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper; |
| 29 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | 29 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; |
| 30 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderAIReqVO; | ||
| 30 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; | 31 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; |
| 31 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; | 32 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 33 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | ||
| 32 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; | 34 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; |
| 33 | import jakarta.annotation.Resource; | 35 | import jakarta.annotation.Resource; |
| 34 | import jodd.util.StringUtil; | 36 | import jodd.util.StringUtil; |
| @@ -102,7 +104,7 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -102,7 +104,7 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 102 | @Resource | 104 | @Resource |
| 103 | private DictDataCommonApi dictDataCommonApi; | 105 | private DictDataCommonApi dictDataCommonApi; |
| 104 | @Override | 106 | @Override |
| 105 | - public Long createWorkOrder(AppGardenWorkOrderInspectorReqVO createRequestVo) { | 107 | + public Long createWorkOrder(AppGardenWorkOrderAIReqVO createRequestVo) { |
| 106 | List<RoleRespVO> roleList = roleApi.getRoleListByUsrId(SecurityFrameworkUtils.getLoginUserId()); | 108 | List<RoleRespVO> roleList = roleApi.getRoleListByUsrId(SecurityFrameworkUtils.getLoginUserId()); |
| 107 | if(null == roleList || roleList.size()==0){ | 109 | if(null == roleList || roleList.size()==0){ |
| 108 | throw exception(APP_USER_ROLE_NOT_EXISTS); | 110 | throw exception(APP_USER_ROLE_NOT_EXISTS); |
| @@ -144,6 +146,8 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -144,6 +146,8 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 144 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | 146 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 145 | 147 | ||
| 146 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); | 148 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 149 | + workOrder.setSourceId(EventSourceEnum.AI.getCode()); | ||
| 150 | + workOrder.setSourceName(EventSourceEnum.AI.getDesc()); | ||
| 147 | workOrder.setWoSourceId(roleList.get(0).getCode()); | 151 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 148 | workOrder.setWoSourceName(roleList.get(0).getName()); | 152 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 149 | String busiLine = createRequestVo.getBusiLine(); | 153 | String busiLine = createRequestVo.getBusiLine(); |