Commit d6e770ad32d8df432848d1c5fbdc6358068ca30c
1 parent
bc539300
AOP 拦截 业务 和工作流 解耦
Showing
15 changed files
with
394 additions
and
119 deletions
urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/dto/road/RoadStreetRespDTO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.dto.road; |
| 2 | 2 | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 3 | 4 | import lombok.Data; |
| 4 | 5 | |
| 5 | 6 | /** |
| ... | ... | @@ -20,4 +21,9 @@ public class RoadStreetRespDTO { |
| 20 | 21 | private String streetName; |
| 21 | 22 | |
| 22 | 23 | private String busiLine; |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 养护级别: 10:特级;11:一级:12:二级;13:三级 | |
| 27 | + */ | |
| 28 | + private Integer levelId; | |
| 23 | 29 | } | ... | ... |
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderReqVO.java
| ... | ... | @@ -31,9 +31,6 @@ public class AppGardenWorkOrderReqVO { |
| 31 | 31 | @Schema(description = "问题图片", example = "9184") |
| 32 | 32 | private List<String> imgs; |
| 33 | 33 | |
| 34 | - @Schema(description = "处理完成照片", example = "9184") | |
| 35 | - private List<String> longRangeImgList; | |
| 36 | - | |
| 37 | 34 | @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") |
| 38 | 35 | @NotEmpty(message = "工单描述不能为空") |
| 39 | 36 | @Length(max = 500) |
| ... | ... | @@ -59,8 +56,8 @@ public class AppGardenWorkOrderReqVO { |
| 59 | 56 | @NotEmpty(message = "经纬度地址不能为空") |
| 60 | 57 | private String lonLatAddress; |
| 61 | 58 | |
| 62 | - @Schema(description = " 养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 63 | - @NotNull(message = "养护级别: 10:特级;11:一级:12:二级;13:三级") | |
| 59 | + @Schema(description = " 紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 60 | + @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般") | |
| 64 | 61 | private Integer pressingType; |
| 65 | 62 | |
| 66 | 63 | @Schema(description = "工单名称", example = "绿地卫生") |
| ... | ... | @@ -84,11 +81,6 @@ public class AppGardenWorkOrderReqVO { |
| 84 | 81 | @Schema(description = "工单业务线", example = "yl") |
| 85 | 82 | private String busiLine; |
| 86 | 83 | |
| 87 | - /* @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}") | |
| 88 | - private Map<String, List<Long>> startUserSelectAssignees; | |
| 89 | - | |
| 90 | - @Schema(description = "是否需要养护人员修复,'0' 是,'1' 否") | |
| 91 | - private String isYesOrNo;*/ | |
| 92 | 84 | |
| 93 | 85 | |
| 94 | 86 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/annotation/AutoUpdateWorkerOrderBuzStatus.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 AutoUpdateWorkerOrderBuzStatus { | |
| 16 | +} | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderController.java
| ... | ... | @@ -9,6 +9,7 @@ import com.zteits.urbanops.module.garden.api.road.RoadApi; |
| 9 | 9 | import com.zteits.urbanops.module.garden.dto.road.RoadReqDTO; |
| 10 | 10 | import com.zteits.urbanops.module.garden.dto.road.RoadRespDTO; |
| 11 | 11 | import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 12 | +import com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderBuzStatus; | |
| 12 | 13 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.*; |
| 13 | 14 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppUniversalApprovalReqVO; |
| 14 | 15 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.UserInfoPageReqVO; |
| ... | ... | @@ -248,6 +249,7 @@ public class AppGardenWorkOrderController { |
| 248 | 249 | |
| 249 | 250 | @Operation(summary = "app-统一审批入口") |
| 250 | 251 | @PostMapping("/universalApproval") |
| 252 | + @AutoUpdateWorkerOrderBuzStatus | |
| 251 | 253 | //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:update')") |
| 252 | 254 | public CommonResult<Boolean> universalApproval(@Valid @RequestBody AppUniversalApprovalReqVO reqVO) { |
| 253 | 255 | |
| ... | ... | @@ -268,7 +270,7 @@ public class AppGardenWorkOrderController { |
| 268 | 270 | this.returnPreviousNode(retReqVO); |
| 269 | 271 | log.info("当前操作:"+OperateTypeEnum.YL_WORKER_RETURN.getDesc()+"<--结束"); |
| 270 | 272 | return success(true); |
| 271 | - case YL_WORKER_IMPLEMENT://养护员实施 | |
| 273 | + case YL_WORKER_IMPLEMENT://养护员实施 需修改更新工单数据 见切面 | |
| 272 | 274 | log.info("当前操作:"+OperateTypeEnum.YL_WORKER_IMPLEMENT.getDesc()+"开始,操作类型:"+OperateTypeEnum.YL_WORKER_RETURN.getCode()+"-->"); |
| 273 | 275 | AppGardenTaskWorkerExcuteReqVO workerExcuteReqVO = new AppGardenTaskWorkerExcuteReqVO(); |
| 274 | 276 | workerExcuteReqVO.setWorkerDataId(reqVO.getWorkerDataId()); |
| ... | ... | @@ -292,18 +294,17 @@ public class AppGardenWorkOrderController { |
| 292 | 294 | this.approveTask(approveReqVO); |
| 293 | 295 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_CONFIRM_PASS.getDesc()+"<--结束"); |
| 294 | 296 | return success(true); |
| 295 | - case YL_TEAM_LEADER_CONFIRM_REJECT://养护组长验收不通过 | |
| 297 | + case YL_TEAM_LEADER_CONFIRM_REJECT://养护组长验收不通过 需修改更新工单数据 见切面 | |
| 296 | 298 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getDesc()+"开始,操作类型:"+OperateTypeEnum.YL_WORKER_RETURN.getCode()+"-->"); |
| 297 | 299 | AppGardenTaskReturnExtReqVO rejReqVO = new AppGardenTaskReturnExtReqVO(); |
| 298 | 300 | rejReqVO.setId(reqVO.getTaskId()); |
| 299 | 301 | rejReqVO.setCurTaskKey(reqVO.getTaskKey()); |
| 300 | 302 | rejReqVO.setReason(reqVO.getReason()); |
| 301 | 303 | rejReqVO.setWorkerDataId(reqVO.getWorkerDataId()); |
| 302 | - rejReqVO.setReturnImgs(reqVO.getReturnImgs()); | |
| 303 | 304 | this.returnPreviousNode(rejReqVO); |
| 304 | 305 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getDesc()+"<--结束"); |
| 305 | 306 | return success(true); |
| 306 | - case YL_TEAM_LEADER_ASSIGN: //养护组长分配 | |
| 307 | + case YL_TEAM_LEADER_ASSIGN: //养护组长分配 需修改更新工单数据 见切面 | |
| 307 | 308 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"开始,操作类型:"+OperateTypeEnum.YL_WORKER_RETURN.getCode()+"-->"); |
| 308 | 309 | AppGardenTaskTeamLeaderAssignReqVO assignReqVO = new AppGardenTaskTeamLeaderAssignReqVO(); |
| 309 | 310 | assignReqVO.setId(reqVO.getTaskId()); |
| ... | ... | @@ -318,7 +319,6 @@ public class AppGardenWorkOrderController { |
| 318 | 319 | throw exception(APP_AGREE_CHOOSE); |
| 319 | 320 | } |
| 320 | 321 | assignReqVO.setAgree(status); |
| 321 | - // TODO 需修改更新工单数据 | |
| 322 | 322 | this.ylTeamLeaderAssignWOrder(assignReqVO); |
| 323 | 323 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"<--结束"); |
| 324 | 324 | return success(true); |
| ... | ... | @@ -349,9 +349,8 @@ public class AppGardenWorkOrderController { |
| 349 | 349 | this.approveTask(inspectStartReqVO); |
| 350 | 350 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); |
| 351 | 351 | return success(true); |
| 352 | - case YL_INSPECTOR_START_RELAUNCH : //巡查员重新发起 | |
| 352 | + case YL_INSPECTOR_START_RELAUNCH : //巡查员重新发起 需修改更新工单数据 见切面 | |
| 353 | 353 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"开始,操作类型:"+OperateTypeEnum.YL_WORKER_RETURN.getCode()+"-->"); |
| 354 | - // TODO 需修改更新工单数据 | |
| 355 | 354 | AppGardenTaskApproveReqVO reStartReqVO = new AppGardenTaskApproveReqVO(); |
| 356 | 355 | Integer reStatus = reqVO.getAgree(); |
| 357 | 356 | if (reStatus == null || (reStatus != 0 && reStatus != 1)) { | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/BuzStatusUpdateAspect.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.admin.maininfo.vo.MainInfoSaveReqVO; | |
| 12 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.common.AppUniversalApprovalReqVO; | |
| 13 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | |
| 14 | +import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | |
| 15 | +import com.zteits.urbanops.module.workorder.enums.OperateTypeEnum; | |
| 16 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | |
| 17 | +import com.zteits.urbanops.module.workorder.service.maininfo.MainInfoService; | |
| 18 | +import jakarta.annotation.Resource; | |
| 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 | + | |
| 26 | +import java.time.LocalDateTime; | |
| 27 | +import java.util.List; | |
| 28 | + | |
| 29 | +import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.CONSERVE_LEVEL; | |
| 30 | +import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.ORDER_STATUS_INIT; | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * 类描述:切面更新工单表业务状态 | |
| 34 | + * 创建人:yanhuiqing | |
| 35 | + * 创建时间:2025/12/21 14:53 | |
| 36 | + * 修改人:yanhuiqing | |
| 37 | + * 修改时间:2025/12/21 14:53 | |
| 38 | + * 修改备注: | |
| 39 | + * | |
| 40 | + * @author yanhuiqing | |
| 41 | + * @version 1.0 | |
| 42 | + */ | |
| 43 | +@Aspect | |
| 44 | +@Component | |
| 45 | +@RequiredArgsConstructor | |
| 46 | +public class BuzStatusUpdateAspect { | |
| 47 | + | |
| 48 | + @Resource | |
| 49 | + private MainInfoMapper mainInfoMapper; | |
| 50 | + | |
| 51 | + @Resource | |
| 52 | + private final RoadApi roadApi; | |
| 53 | + | |
| 54 | + @Resource | |
| 55 | + private BpmGardenService gardenService; | |
| 56 | + | |
| 57 | + @Resource | |
| 58 | + private final DictDataCommonApi dictDataCommonApi; | |
| 59 | + | |
| 60 | + // 切点:标注了@AutoUpdateBuzStatus的方法 | |
| 61 | + @Pointcut("@annotation(com.zteits.urbanops.module.workorder.annotation.AutoUpdateWorkerOrderBuzStatus)") | |
| 62 | + public void buzStatusUpdatePointcut() {} | |
| 63 | + | |
| 64 | + @Around("buzStatusUpdatePointcut()") | |
| 65 | + public Object around(ProceedingJoinPoint joinPoint) throws Throwable { | |
| 66 | + // 1. 获取方法参数(AppUniversalApprovalReqVO) | |
| 67 | + Object[] args = joinPoint.getArgs(); | |
| 68 | + AppUniversalApprovalReqVO reqVO = null; | |
| 69 | + for (Object arg : args) { | |
| 70 | + if (arg instanceof AppUniversalApprovalReqVO) { | |
| 71 | + reqVO = (AppUniversalApprovalReqVO) arg; | |
| 72 | + break; | |
| 73 | + } | |
| 74 | + } | |
| 75 | + if (reqVO == null) { | |
| 76 | + throw new IllegalArgumentException("方法参数中未找到AppUniversalApprovalReqVO"); | |
| 77 | + } | |
| 78 | + | |
| 79 | + // 2. 解析操作类型 | |
| 80 | + OperateTypeEnum operateType = OperateTypeEnum.getByCode(reqVO.getOperateType()); | |
| 81 | + Long workerDataId = reqVO.getWorkerDataId(); | |
| 82 | + Integer buzStatus = operateType.getCode(); | |
| 83 | + | |
| 84 | + // 3. 执行原有方法 | |
| 85 | + Object result = joinPoint.proceed(); | |
| 86 | + MainInfoDO dbData = mainInfoMapper.selectById(workerDataId); | |
| 87 | + MainInfoDO targeVO = new MainInfoDO(); | |
| 88 | + targeVO.setId(workerDataId); | |
| 89 | + targeVO.setOrderNo(dbData.getOrderNo()); | |
| 90 | + targeVO.setBusiLine(dbData.getBusiLine()); | |
| 91 | + //重新发起需更新表单数据 | |
| 92 | + if(OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode().equals(operateType.getCode())){ | |
| 93 | + RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | |
| 94 | + | |
| 95 | + targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | |
| 96 | + targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | |
| 97 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, reqVO.getPressingType().toString()); | |
| 98 | + targeVO.setCuringLevelId(Integer.valueOf(dictData.getValue())); | |
| 99 | + targeVO.setCuringLevelName(dictData.getLabel()); | |
| 100 | + targeVO.setCommitDate(LocalDateTime.now()); | |
| 101 | + targeVO.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | |
| 102 | + targeVO.setBusiLine(SecurityFrameworkUtils.getBusiLine()); | |
| 103 | + targeVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 104 | + targeVO.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); | |
| 105 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | |
| 106 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | |
| 107 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | |
| 108 | + } | |
| 109 | + } | |
| 110 | + //养护组长分配需更新表单数据 | |
| 111 | + if(OperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getCode().equals(operateType.getCode())){ | |
| 112 | + targeVO.setWorkerId(reqVO.getNextAssignee()); | |
| 113 | + } | |
| 114 | + //养护组长验收不通过 需更新表单数据 | |
| 115 | + if(OperateTypeEnum.YL_TEAM_LEADER_CONFIRM_REJECT.getCode().equals(operateType.getCode())){ | |
| 116 | + List<String> returnImgs = reqVO.getReturnImgs(); | |
| 117 | + if(ObjectUtils.isNotAllEmpty(returnImgs) && returnImgs.size()>0){ | |
| 118 | + gardenService.attachmentInsertOrUpdate(returnImgs,BpmCommonConstant.GARDEN_TEAMLEADER_RETURN_IMG,targeVO); | |
| 119 | + } | |
| 120 | + } | |
| 121 | + //养护员实施 需更新表单数据 | |
| 122 | + if(OperateTypeEnum.YL_WORKER_IMPLEMENT.getCode().equals(operateType.getCode())){ | |
| 123 | + //实施 审批已经执行 此处就无需执行 | |
| 124 | + /* | |
| 125 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | |
| 126 | + List<String> startImgs = reqVO.getStartImgs(); | |
| 127 | + List<String> processingImgs = reqVO.getProcessingImgs(); | |
| 128 | + List<String> endImgs = reqVO.getEndImgs(); | |
| 129 | + List<String> personImgs = reqVO.getPersonImgs(); | |
| 130 | + List<String> materialImgs = reqVO.getMaterialImgs(); | |
| 131 | + | |
| 132 | + targeVO.setHandleResult(reqVO.getHandleResult()); | |
| 133 | + targeVO.setCoHandlers(reqVO.getCoHandlers()); | |
| 134 | + targeVO.setWorkerId(SecurityFrameworkUtils.getLoginUserId()); | |
| 135 | + targeVO.setWorkerName(SecurityFrameworkUtils.getLoginUserNickname()); | |
| 136 | + targeVO.setWorkerCompanyId(SecurityFrameworkUtils.getCompanyId()); | |
| 137 | + mainInfoMapper.updateById(targeVO); | |
| 138 | + | |
| 139 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | |
| 140 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | |
| 141 | + } | |
| 142 | + if(ObjectUtils.isNotAllEmpty(startImgs) && startImgs.size()>0){ | |
| 143 | + gardenService.attachmentInsertOrUpdate(startImgs,BpmCommonConstant.START_IMG_GROUP,targeVO); | |
| 144 | + } | |
| 145 | + if(ObjectUtils.isNotAllEmpty(processingImgs) && processingImgs.size()>0){ | |
| 146 | + gardenService.attachmentInsertOrUpdate(processingImgs,BpmCommonConstant.PROCESS_IMG_GROUP,targeVO); | |
| 147 | + } | |
| 148 | + | |
| 149 | + if(ObjectUtils.isNotAllEmpty(endImgs) && endImgs.size()>0){ | |
| 150 | + gardenService.attachmentInsertOrUpdate(endImgs,BpmCommonConstant.END_IMG_GROUP,targeVO); | |
| 151 | + } | |
| 152 | + if(ObjectUtils.isNotAllEmpty(personImgs) && personImgs.size()>0){ | |
| 153 | + gardenService.attachmentInsertOrUpdate(personImgs,BpmCommonConstant.PERSON_IMG_GROUP,targeVO); | |
| 154 | + } | |
| 155 | + if(ObjectUtils.isNotAllEmpty(materialImgs) && materialImgs.size()>0){ | |
| 156 | + gardenService.attachmentInsertOrUpdate(materialImgs,BpmCommonConstant.MATERIAL_IMG_GROUP,targeVO); | |
| 157 | + }*/ | |
| 158 | + } | |
| 159 | + // 4. 自动更新buz_status | |
| 160 | + targeVO.setBuzStatus(buzStatus.toString()); | |
| 161 | + mainInfoMapper.updateById(targeVO); | |
| 162 | + | |
| 163 | + return result; | |
| 164 | + } | |
| 165 | +} | |
| 0 | 166 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/group/ApproveGroup.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.group; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 类描述:校验分组:审批/验收操作(组长验收、巡查员验收、巡查员结束工单) | |
| 5 | + * 创建人:yanhuiqing | |
| 6 | + * 创建时间:2025/12/21 16:02 | |
| 7 | + * 修改人:yanhuiqing | |
| 8 | + * 修改时间:2025/12/21 16:02 | |
| 9 | + * 修改备注: | |
| 10 | + * | |
| 11 | + * @author yanhuiqing | |
| 12 | + * @version 1.0 | |
| 13 | + */ | |
| 14 | +public interface ApproveGroup { | |
| 15 | +} | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/group/AssignGroup.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.group; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 类描述:校验分组:养护组长分配(YL_TEAM_LEADER_ASSIGN) | |
| 5 | + * 创建人:yanhuiqing | |
| 6 | + * 创建时间:2025/12/21 16:00 | |
| 7 | + * 修改人:yanhuiqing | |
| 8 | + * 修改时间:2025/12/21 16:00 | |
| 9 | + * 修改备注: | |
| 10 | + * | |
| 11 | + * @author yanhuiqing | |
| 12 | + * @version 1.0 | |
| 13 | + */ | |
| 14 | +public interface AssignGroup { | |
| 15 | +} | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/group/DefaultGroup.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.group; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 类描述:默认分组(所有操作都需要校验的字段,如taskId、operateType) | |
| 5 | + * 创建人:yanhuiqing | |
| 6 | + * 创建时间:2025/12/21 16:04 | |
| 7 | + * 修改人:yanhuiqing | |
| 8 | + * 修改时间:2025/12/21 16:04 | |
| 9 | + * 修改备注: | |
| 10 | + * | |
| 11 | + * @author yanhuiqing | |
| 12 | + * @version 1.0 | |
| 13 | + */ | |
| 14 | +public interface DefaultGroup { | |
| 15 | +} | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/group/ImplementGroup.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.group; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 类描述:校验分组:养护员实施(YL_WORKER_IMPLEMENT) | |
| 5 | + * 创建人:yanhuiqing | |
| 6 | + * 创建时间:2025/12/21 16:01 | |
| 7 | + * 修改人:yanhuiqing | |
| 8 | + * 修改时间:2025/12/21 16:01 | |
| 9 | + * 修改备注: | |
| 10 | + * | |
| 11 | + * @author yanhuiqing | |
| 12 | + * @version 1.0 | |
| 13 | + */ | |
| 14 | +public interface ImplementGroup { | |
| 15 | +} | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/group/RelaunchGroup.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.group; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 类描述:校验分组:巡查员重新发起(YL_INSPECTOR_START_RELAUNCH) | |
| 5 | + * 创建人:yanhuiqing | |
| 6 | + * 创建时间:2025/12/21 16:03 | |
| 7 | + * 修改人:yanhuiqing | |
| 8 | + * 修改时间:2025/12/21 16:03 | |
| 9 | + * 修改备注: | |
| 10 | + * | |
| 11 | + * @author yanhuiqing | |
| 12 | + * @version 1.0 | |
| 13 | + */ | |
| 14 | +public interface RelaunchGroup { | |
| 15 | +} | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/group/ReturnGroup.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.group; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 类描述:校验分组:退回操作(YL_WORKER_RETURN、YL_TEAM_LEADER_RETURN) | |
| 5 | + * 创建人:yanhuiqing | |
| 6 | + * 创建时间:2025/12/21 16:02 | |
| 7 | + * 修改人:yanhuiqing | |
| 8 | + * 修改时间:2025/12/21 16:02 | |
| 9 | + * 修改备注: | |
| 10 | + * | |
| 11 | + * @author yanhuiqing | |
| 12 | + * @version 1.0 | |
| 13 | + */ | |
| 14 | +public interface ReturnGroup { | |
| 15 | +} | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/common/AppUniversalApprovalReqVO.java
| 1 | 1 | package com.zteits.urbanops.module.workorder.controller.app.garden.vo.common; |
| 2 | 2 | |
| 3 | +import com.zteits.urbanops.module.workorder.controller.app.garden.group.DefaultGroup; | |
| 4 | +import com.zteits.urbanops.module.workorder.controller.app.garden.group.RelaunchGroup; | |
| 3 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 6 | import jakarta.validation.constraints.NotEmpty; |
| 5 | 7 | import jakarta.validation.constraints.NotNull; |
| 6 | 8 | import lombok.Data; |
| 9 | +import org.hibernate.validator.constraints.Length; | |
| 10 | + | |
| 11 | +import java.math.BigDecimal; | |
| 12 | +import java.time.LocalDateTime; | |
| 7 | 13 | import java.util.List; |
| 8 | 14 | import java.util.Set; |
| 9 | 15 | |
| ... | ... | @@ -23,28 +29,28 @@ import java.util.Set; |
| 23 | 29 | public class AppUniversalApprovalReqVO { |
| 24 | 30 | // -------------------------- 基础通用参数(所有操作必填) -------------------------- |
| 25 | 31 | @Schema(description = "当前任务的taskKey", requiredMode = Schema.RequiredMode.REQUIRED, example = "ylTeamLeader") |
| 26 | - @NotEmpty(message = "当前任务的taskKey不能为空") | |
| 32 | + @NotEmpty(message = "当前任务的taskKey不能为空",groups = DefaultGroup.class) | |
| 27 | 33 | private String taskKey; |
| 28 | 34 | |
| 29 | 35 | @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1234567890") |
| 30 | - @NotEmpty(message = "任务编号不能为空") | |
| 36 | + @NotEmpty(message = "任务编号不能为空",groups = DefaultGroup.class) | |
| 31 | 37 | private String taskId; |
| 32 | 38 | |
| 33 | 39 | @Schema(description = "操作类型(210:养护组长退回,110:养护组长分配,200:巡查员结束工单,100:巡查员重新发起,220:养护员退回,120:养护员实施,130:养护组长验收通过,230:养护组长验收不通过,140:巡查员验收通过,240:巡查员验收不通过)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 34 | - @NotNull(message = "操作类型不能为空") | |
| 40 | + @NotNull(message = "操作类型不能为空",groups = DefaultGroup.class) | |
| 35 | 41 | private Integer operateType; // 原String改为Integer,适配数字类型 |
| 36 | 42 | |
| 43 | + @Schema(description = "工单的数据id", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 44 | + @NotNull(message = "工单的数据id不能为空") | |
| 45 | + private Long workerDataId; | |
| 46 | + | |
| 37 | 47 | @Schema(description = "同意选择类型:0 同意,1 不同意", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") |
| 38 | - //@NotNull(message = "同意选择类型不能为空") | |
| 39 | 48 | private Integer agree; |
| 40 | 49 | |
| 41 | 50 | @Schema(description = "操作理由(审批/退回理由)", requiredMode = Schema.RequiredMode.REQUIRED, example = "同意该工单处理结果") |
| 42 | 51 | //@NotEmpty(message = "操作理由不能为空") |
| 43 | 52 | private String reason; |
| 44 | 53 | |
| 45 | - @Schema(description = "工单的数据id", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 46 | - //@NotEmpty(message = "工单的数据id不能为空") | |
| 47 | - private Long workerDataId; | |
| 48 | 54 | |
| 49 | 55 | @Schema(description = "退回时的拍照图片") |
| 50 | 56 | private List<String> returnImgs; |
| ... | ... | @@ -60,12 +66,9 @@ public class AppUniversalApprovalReqVO { |
| 60 | 66 | private Set<Long> coHandlers; |
| 61 | 67 | |
| 62 | 68 | @Schema(description = "处理意见(养护员实施操作必填)", example = "已完成绿植修剪,效果符合要求") |
| 63 | - //@NotEmpty(message = "处理意见不能为空", groups = MaintainerImplementGroup.class) | |
| 69 | + //@NotEmpty(message = "处理意见不能为空", groups = RelaunchGroup.class) | |
| 64 | 70 | private String handleResult; |
| 65 | 71 | |
| 66 | - @Schema(description = "开始的问题拍照图片") | |
| 67 | - private List<String> problemsImgs; | |
| 68 | - | |
| 69 | 72 | @Schema(description = "实施开始的拍照图片") |
| 70 | 73 | private List<String> startImgs; |
| 71 | 74 | |
| ... | ... | @@ -80,4 +83,61 @@ public class AppUniversalApprovalReqVO { |
| 80 | 83 | |
| 81 | 84 | @Schema(description = "实施耗材的拍照图片") |
| 82 | 85 | private List<String> materialImgs; |
| 86 | + | |
| 87 | + //-------------------------重新发起需提交表单数据------------------------ | |
| 88 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | |
| 89 | + @NotNull(message = "道路ID不能为空", groups = RelaunchGroup.class) | |
| 90 | + private Long roadId; | |
| 91 | + | |
| 92 | + @Schema(description = "道路名称", example = "测试道路") | |
| 93 | + private String roadName; | |
| 94 | + | |
| 95 | + @Schema(description = "开始的问题拍照图片") | |
| 96 | + private List<String> problemsImgs; | |
| 97 | + | |
| 98 | + @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | |
| 99 | + @NotEmpty(message = "工单描述不能为空", groups = RelaunchGroup.class) | |
| 100 | + @Length(max = 500) | |
| 101 | + private String remark; | |
| 102 | + | |
| 103 | + | |
| 104 | + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") | |
| 105 | + private Integer latLonType; | |
| 106 | + | |
| 107 | + @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 108 | + @NotNull(message = "经度不能为空", groups = RelaunchGroup.class) | |
| 109 | + private BigDecimal lat; | |
| 110 | + | |
| 111 | + @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 112 | + @NotNull(message = "维度不能为空", groups = RelaunchGroup.class) | |
| 113 | + private BigDecimal lon; | |
| 114 | + | |
| 115 | + @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 116 | + @NotEmpty(message = "经纬度地址不能为空", groups = RelaunchGroup.class) | |
| 117 | + private String lonLatAddress; | |
| 118 | + | |
| 119 | + @Schema(description = " 养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 120 | + @NotNull(message = "养护级别: 10:特级;11:一级:12:二级;13:三级", groups = RelaunchGroup.class) | |
| 121 | + private Integer pressingType; | |
| 122 | + | |
| 123 | + @Schema(description = "工单名称", example = "绿地卫生") | |
| 124 | + private String orderName; | |
| 125 | + | |
| 126 | + @Schema(description = "来源ID 工单来源 1、巡查,2、游客居民,3、12345,4、网格", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 127 | + //@NotNull(message = "来源ID不能为空") | |
| 128 | + private Integer sourceId; | |
| 129 | + | |
| 130 | + @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "园林") | |
| 131 | + //@NotEmpty(message = "来源名称不能为空") | |
| 132 | + private String sourceName; | |
| 133 | + | |
| 134 | + @Schema(description = "三方工单ID") | |
| 135 | + private String thirdWorkNo; | |
| 136 | + | |
| 137 | + @Schema(description = "完成时间") | |
| 138 | + private LocalDateTime finishDate; | |
| 139 | + | |
| 140 | + @Schema(description = "工单业务线", example = "yl") | |
| 141 | + private String busiLine; | |
| 142 | + //-------------------------重新发起需提交表单数据------------------------ | |
| 83 | 143 | } |
| 84 | 144 | \ No newline at end of file | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
| ... | ... | @@ -26,4 +26,6 @@ public interface ErrorCodeConstants { |
| 26 | 26 | ErrorCode APP_WORKER_NOT_EXISTS = new ErrorCode(1-900-001-006, "养护员必须指派,不能为空!"); |
| 27 | 27 | |
| 28 | 28 | ErrorCode APP_WORKER_ID_NOT_EMPTY = new ErrorCode(1-900-001-007, "WorkerDataId不能为空!"); |
| 29 | + | |
| 30 | + ErrorCode APP_WORKER_LEVEL_ID_NOT_EXISTS = new ErrorCode(1-900-001-007, "养护级别编码错误,不存在!"); | |
| 29 | 31 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenService.java
| ... | ... | @@ -14,9 +14,13 @@ import com.zteits.urbanops.module.workorder.controller.app.garden.vo.process.App |
| 14 | 14 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.process.AppGardenApprovalDetailRespVO; |
| 15 | 15 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.task.*; |
| 16 | 16 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; |
| 17 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | |
| 17 | 18 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 18 | 19 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; |
| 19 | 20 | import jakarta.validation.Valid; |
| 21 | + | |
| 22 | +import java.util.List; | |
| 23 | + | |
| 20 | 24 | /** |
| 21 | 25 | * @author yanhuiqing |
| 22 | 26 | * @version 1.0 |
| ... | ... | @@ -206,6 +210,12 @@ public interface BpmGardenService { |
| 206 | 210 | */ |
| 207 | 211 | public PageResult<AdminUserRespDTO> getUserByRoadIdAndRoleCode(PageParam param,Long roadId,String roleCode,String busiLine); |
| 208 | 212 | |
| 209 | - | |
| 213 | + /** | |
| 214 | + * 附件更新通用方法 | |
| 215 | + * @param imgList | |
| 216 | + * @param type | |
| 217 | + * @param workOrder | |
| 218 | + */ | |
| 219 | + public void attachmentInsertOrUpdate(List<String> imgList, String type, MainInfoDO workOrder); | |
| 210 | 220 | |
| 211 | 221 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
| ... | ... | @@ -70,8 +70,7 @@ import static com.zteits.urbanops.framework.common.exception.util.ServiceExcepti |
| 70 | 70 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; |
| 71 | 71 | import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertSet; |
| 72 | 72 | import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.*; |
| 73 | -import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.MAIN_INFO_NOT_EXISTS; | |
| 74 | -import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.TEAM_LEADER_YL_NOT_EXISTS; | |
| 73 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; | |
| 75 | 74 | |
| 76 | 75 | /** |
| 77 | 76 | * @author yanhuiqing |
| ... | ... | @@ -125,9 +124,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 125 | 124 | public Long createWorkOrderQuick(AppGardenWorkOrderReqVO createRequestVo) { |
| 126 | 125 | |
| 127 | 126 | List<String> imgList = createRequestVo.getImgs(); |
| 128 | - //List<String> streetImgList = createRequestVo.getStreetImgList(); | |
| 129 | - //List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | |
| 130 | - // 插入 工单 | |
| 127 | + | |
| 131 | 128 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 132 | 129 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| 133 | 130 | |
| ... | ... | @@ -136,7 +133,10 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 136 | 133 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 137 | 134 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| 138 | 135 | workOrder.setOrderType(BpmCommonConstant.ORDER_TYPE_Q); |
| 139 | - DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, createRequestVo.getPressingType().toString()); | |
| 136 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | |
| 137 | + if(null == dictData){ | |
| 138 | + throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | |
| 139 | + } | |
| 140 | 140 | workOrder.setCuringLevelId(Integer.valueOf(dictData.getValue())); |
| 141 | 141 | workOrder.setCuringLevelName(dictData.getLabel()); |
| 142 | 142 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| ... | ... | @@ -150,8 +150,9 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 150 | 150 | workOrder.setOrderNo(workOrderNum); |
| 151 | 151 | workOrderMapper.insert(workOrder); |
| 152 | 152 | |
| 153 | - //附件插入 | |
| 154 | - attachmentApend(imgList,null,null,workOrder); | |
| 153 | + if(ObjectUtils.isNotAllEmpty(imgList) && imgList.size()>0){ | |
| 154 | + attachmentInsertOrUpdate(imgList,BpmCommonConstant.PROBLEM_IMG_GROUP,workOrder); | |
| 155 | + } | |
| 155 | 156 | // 发起 BPM 流程 |
| 156 | 157 | Map<String, Object> processInstanceVariables = new HashMap<>(); |
| 157 | 158 | processInstanceVariables.put(COMMON_QUICK_PROCESS_INITIATOR, SecurityFrameworkUtils.getLoginUserId()); |
| ... | ... | @@ -244,6 +245,9 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 244 | 245 | MainInfoDO workerOrder = workOrderMapper.selectById(id); |
| 245 | 246 | workerOrder.setHandleResult(reqVO.getHandleResult()); |
| 246 | 247 | workerOrder.setCoHandlers(reqVO.getCoHandlers()); |
| 248 | + workerOrder.setWorkerId(SecurityFrameworkUtils.getLoginUserId()); | |
| 249 | + workerOrder.setWorkerName(SecurityFrameworkUtils.getLoginUserNickname()); | |
| 250 | + workerOrder.setWorkerCompanyId(SecurityFrameworkUtils.getCompanyId()); | |
| 247 | 251 | workOrderMapper.updateById(workerOrder); |
| 248 | 252 | |
| 249 | 253 | if(ObjectUtils.isNotAllEmpty(id) && ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ |
| ... | ... | @@ -286,23 +290,6 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 286 | 290 | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| 287 | 291 | taskService.returnTask(userId, targetVO); |
| 288 | 292 | |
| 289 | - /*if(TaskNodeEnum.YL_TEAM_LEADER.getNodeName().equals(currentTaskey)){ | |
| 290 | - Task task = taskService.getTask(reqVO.getId()); | |
| 291 | - String processInstanceId = task.getProcessInstanceId(); | |
| 292 | - | |
| 293 | - Map<String, Object> variables = new HashMap<>(); | |
| 294 | - variables.put("isReturnedToFirstApproval", true); | |
| 295 | - variables.put("isFirstEnterFirstApproval", false); | |
| 296 | - // 更新流程实例级别变量 | |
| 297 | - runtimeService.setVariables(processInstanceId, variables); | |
| 298 | - }*/ | |
| 299 | - Long id = reqVO.getWorkerDataId(); | |
| 300 | - List<String> returnImgs = reqVO.getReturnImgs(); | |
| 301 | - if(ObjectUtils.isNotAllEmpty(id) && ObjectUtils.isNotAllEmpty(returnImgs) && returnImgs.size()>0){ | |
| 302 | - MainInfoDO workerOrder = workOrderMapper.selectById(id); | |
| 303 | - attachmentInsertOrUpdate(returnImgs,BpmCommonConstant.GARDEN_TEAMLEADER_RETURN_IMG,workerOrder); | |
| 304 | - } | |
| 305 | - | |
| 306 | 293 | } |
| 307 | 294 | |
| 308 | 295 | @Override |
| ... | ... | @@ -529,7 +516,6 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 529 | 516 | return newRespVO; |
| 530 | 517 | } |
| 531 | 518 | |
| 532 | - | |
| 533 | 519 | /** |
| 534 | 520 | * app端创建工单 |
| 535 | 521 | * @param createRequestVo |
| ... | ... | @@ -539,8 +525,6 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 539 | 525 | @Transactional(rollbackFor = Exception.class) |
| 540 | 526 | public Long createWorkOrder(AppGardenWorkOrderReqVO createRequestVo) { |
| 541 | 527 | List<String> imgList = createRequestVo.getImgs(); |
| 542 | - //List<String> streetImgList = createRequestVo.getStreetImgList(); | |
| 543 | - //List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | |
| 544 | 528 | |
| 545 | 529 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 546 | 530 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| ... | ... | @@ -550,7 +534,10 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 550 | 534 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 551 | 535 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| 552 | 536 | workOrder.setOrderType(BpmCommonConstant.ORDER_TYPE_Q); |
| 553 | - DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, createRequestVo.getPressingType().toString()); | |
| 537 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | |
| 538 | + if(null == dictData){ | |
| 539 | + throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | |
| 540 | + } | |
| 554 | 541 | workOrder.setCuringLevelId(Integer.valueOf(dictData.getValue())); |
| 555 | 542 | workOrder.setCuringLevelName(dictData.getLabel()); |
| 556 | 543 | workOrder.setCommitDate(LocalDateTime.now()); |
| ... | ... | @@ -558,12 +545,13 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 558 | 545 | workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); |
| 559 | 546 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); |
| 560 | 547 | workOrder.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); |
| 561 | - workOrder.setCommitDate(LocalDateTime.now()); | |
| 548 | + //workOrder.setFinishDate(LocalDateTime.now()); | |
| 562 | 549 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_GARDEN); |
| 563 | 550 | workOrder.setOrderNo(workOrderNum); |
| 564 | 551 | workOrderMapper.insert(workOrder); |
| 565 | - //附件插入 | |
| 566 | - attachmentApend(imgList,null,null,workOrder); | |
| 552 | + if(ObjectUtils.isNotAllEmpty(imgList) && imgList.size()>0){ | |
| 553 | + attachmentInsertOrUpdate(imgList,BpmCommonConstant.PROBLEM_IMG_GROUP,workOrder); | |
| 554 | + } | |
| 567 | 555 | // 发起 BPM 流程 |
| 568 | 556 | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| 569 | 557 | Map<String, Object> processInstanceVariables = new HashMap<>(); |
| ... | ... | @@ -598,7 +586,8 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 598 | 586 | * @param type |
| 599 | 587 | * @param workOrder |
| 600 | 588 | */ |
| 601 | - private void attachmentInsertOrUpdate(List<String> imgList,String type,MainInfoDO workOrder){ | |
| 589 | + @Override | |
| 590 | + public void attachmentInsertOrUpdate(List<String> imgList,String type,MainInfoDO workOrder){ | |
| 602 | 591 | if(ObjectUtils.isNotAllEmpty(imgList)){ |
| 603 | 592 | AttachmentDO saveDO = new AttachmentDO(); |
| 604 | 593 | saveDO.setBusiLine(workOrder.getBusiLine()); |
| ... | ... | @@ -615,67 +604,12 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 615 | 604 | } |
| 616 | 605 | } |
| 617 | 606 | |
| 618 | - /** | |
| 619 | - * 附件插入 | |
| 620 | - * @param imgList 问题照片 P1 | |
| 621 | - * @param streetImgList 街道照片 P2 | |
| 622 | - * @param longRangeImgList 远景照片 P3 | |
| 623 | - * @param workOrder | |
| 624 | - */ | |
| 625 | - private void attachmentApend(List<String> imgList, List<String> streetImgList, List<String> longRangeImgList, MainInfoDO workOrder) { | |
| 626 | - //问题图片 | |
| 627 | - if(ObjectUtils.isNotAllEmpty(imgList)){ | |
| 628 | - AttachmentDO saveDO = new AttachmentDO(); | |
| 629 | - saveDO.setBusiLine(workOrder.getBusiLine()); | |
| 630 | - saveDO.setBusiType(BpmCommonConstant.PROBLEM_IMG_GROUP); | |
| 631 | - saveDO.setOrderNo(workOrder.getOrderNo()); | |
| 632 | - String filePaths = String.join(",",imgList); | |
| 633 | - saveDO.setFileNames(filePaths); | |
| 634 | - LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() | |
| 635 | - .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine()) | |
| 636 | - .eq(AttachmentDO::getBusiType, BpmCommonConstant.PROBLEM_IMG_GROUP) | |
| 637 | - .eq(AttachmentDO::getOrderNo, workOrder.getOrderNo()); | |
| 638 | - attachmentMapper.delete(deleteWrapper); | |
| 639 | - attachmentMapper.insert(saveDO); | |
| 640 | - } | |
| 641 | - //街道图片 | |
| 642 | - if(ObjectUtils.isNotAllEmpty(streetImgList)){ | |
| 643 | - AttachmentDO saveDO = new AttachmentDO(); | |
| 644 | - saveDO.setBusiLine(workOrder.getBusiLine()); | |
| 645 | - saveDO.setBusiType(BpmCommonConstant.START_IMG_GROUP); | |
| 646 | - saveDO.setOrderNo(workOrder.getOrderNo()); | |
| 647 | - String filePaths = String.join(",",streetImgList); | |
| 648 | - saveDO.setFileNames(filePaths); | |
| 649 | - LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() | |
| 650 | - .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine()) | |
| 651 | - .eq(AttachmentDO::getBusiType, BpmCommonConstant.START_IMG_GROUP) | |
| 652 | - .eq(AttachmentDO::getOrderNo, workOrder.getOrderNo()); | |
| 653 | - attachmentMapper.delete(deleteWrapper); | |
| 654 | - attachmentMapper.insert(saveDO); | |
| 655 | - } | |
| 656 | - | |
| 657 | - if(ObjectUtils.isNotAllEmpty(longRangeImgList)){ | |
| 658 | - AttachmentDO saveDO = new AttachmentDO(); | |
| 659 | - saveDO.setBusiLine(workOrder.getBusiLine()); | |
| 660 | - saveDO.setBusiType(BpmCommonConstant.PROCESS_IMG_GROUP); | |
| 661 | - saveDO.setOrderNo(workOrder.getOrderNo()); | |
| 662 | - String filePaths = String.join(",",longRangeImgList); | |
| 663 | - saveDO.setFileNames(filePaths); | |
| 664 | - LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() | |
| 665 | - .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine()) | |
| 666 | - .eq(AttachmentDO::getBusiType, BpmCommonConstant.PROCESS_IMG_GROUP) | |
| 667 | - .eq(AttachmentDO::getOrderNo, workOrder.getOrderNo()); | |
| 668 | - attachmentMapper.delete(deleteWrapper); | |
| 669 | - attachmentMapper.insert(saveDO); | |
| 670 | - } | |
| 671 | - | |
| 672 | - | |
| 673 | - } | |
| 674 | 607 | |
| 675 | 608 | @Override |
| 676 | 609 | public void updateWorkOrderStatus(Long id, Integer status) { |
| 677 | 610 | validateExists(id); |
| 678 | - workOrderMapper.updateById(new MainInfoDO().setId(id).setStatus(status)); | |
| 611 | + MainInfoDO mainInfoDO = new MainInfoDO().setId(id).setStatus(status).setFinishDate(LocalDateTime.now()); | |
| 612 | + workOrderMapper.updateById(mainInfoDO); | |
| 679 | 613 | } |
| 680 | 614 | private void validateExists(Long id) { |
| 681 | 615 | if (workOrderMapper.selectById(id) == null) { |
| ... | ... | @@ -723,6 +657,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 723 | 657 | mainInfoPageReqVo.setOrderName(content); |
| 724 | 658 | } |
| 725 | 659 | } |
| 660 | + mainInfoPageReqVo.setOrderType(ORDER_TYPE_Q);//快速工单只能查询 Q的数据 | |
| 726 | 661 | PageResult<MainInfoDO> pageList = workOrderMapper.selectPage(loginUserId, mainInfoPageReqVo); |
| 727 | 662 | return BpmGardenWorkOrderConverter.INSTANCE.convertPage(pageList, attachmentMapper); |
| 728 | 663 | } | ... | ... |