Commit 140244cec7cf5b91662a1ce7da1ce0c0bfbe3494
1 parent
d9a34189
工单表扩展字段
Showing
9 changed files
with
151 additions
and
28 deletions
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderReqVO.java
| @@ -59,8 +59,8 @@ public class AppGardenWorkOrderReqVO { | @@ -59,8 +59,8 @@ public class AppGardenWorkOrderReqVO { | ||
| 59 | @NotEmpty(message = "经纬度地址不能为空") | 59 | @NotEmpty(message = "经纬度地址不能为空") |
| 60 | private String lonLatAddress; | 60 | private String lonLatAddress; |
| 61 | 61 | ||
| 62 | - @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | ||
| 63 | - @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般不能为空") | 62 | + @Schema(description = " 养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") |
| 63 | + @NotNull(message = "养护级别: 10:特级;11:一级:12:二级;13:三级") | ||
| 64 | private Integer pressingType; | 64 | private Integer pressingType; |
| 65 | 65 | ||
| 66 | @Schema(description = "工单名称", example = "绿地卫生") | 66 | @Schema(description = "工单名称", example = "绿地卫生") |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
| @@ -11,15 +11,35 @@ public class BpmCommonConstant { | @@ -11,15 +11,35 @@ public class BpmCommonConstant { | ||
| 11 | * 通用快速流程 | 11 | * 通用快速流程 |
| 12 | */ | 12 | */ |
| 13 | public static final String COMMON_QUICK_PROCESS = "common_quick_process"; | 13 | public static final String COMMON_QUICK_PROCESS = "common_quick_process"; |
| 14 | + | ||
| 15 | + public static final String COMMON_QUICK_PROCESS_INITIATOR = "initiator"; | ||
| 16 | + | ||
| 14 | /** | 17 | /** |
| 15 | * 园林巡检工单 流程业务key | 18 | * 园林巡检工单 流程业务key |
| 16 | */ | 19 | */ |
| 20 | + @Deprecated | ||
| 17 | public static final String BPM_GARDEN_INSPECT_WO = "garden_inspect_wo"; | 21 | public static final String BPM_GARDEN_INSPECT_WO = "garden_inspect_wo"; |
| 18 | 22 | ||
| 19 | /** | 23 | /** |
| 20 | * 园林巡检工单 通用版本 | 24 | * 园林巡检工单 通用版本 |
| 21 | */ | 25 | */ |
| 22 | public static final String BPM_WORKORDER_COMMON_PROD = "workorder_common_prod"; | 26 | public static final String BPM_WORKORDER_COMMON_PROD = "workorder_common_prod"; |
| 27 | + //----------------------------------------工单初始化流程变量key---------------------- | ||
| 28 | + public static final String BPM_COMMON_PROD_ROADID = "roadId"; | ||
| 29 | + public static final String BPM_COMMON_PROD_APPLYUSERID = "applyUserId"; | ||
| 30 | + | ||
| 31 | + public static final String BPM_COMMON_PROD_LEADERID = "ylTeamLeaderId"; | ||
| 32 | + | ||
| 33 | + public static final String BPM_COMMON_PROD_WORKERID = "ylWorkerId"; | ||
| 34 | + | ||
| 35 | + public static final String BPM_COMMON_PROD_ISNEED = "isNeed"; | ||
| 36 | + | ||
| 37 | + public static final String BPM_COMMON_PROD_ISREVOKE = "isRevoke"; | ||
| 38 | + | ||
| 39 | + public static final String BPM_COMMON_PROD_ISVERIFY = "isVerify"; | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + //----------------------------------------工单初始化流程变量key---------------------- | ||
| 23 | /** | 43 | /** |
| 24 | * 物业巡检工单 流程业务key | 44 | * 物业巡检工单 流程业务key |
| 25 | */ | 45 | */ |
| @@ -28,6 +48,7 @@ public class BpmCommonConstant { | @@ -28,6 +48,7 @@ public class BpmCommonConstant { | ||
| 28 | * 市政巡检工单 流程业务key | 48 | * 市政巡检工单 流程业务key |
| 29 | */ | 49 | */ |
| 30 | public static final String BPM_MUNICIPAL_INSPECT_WO = "municipal_inspect_wo"; | 50 | public static final String BPM_MUNICIPAL_INSPECT_WO = "municipal_inspect_wo"; |
| 51 | + //----------------------------------------------------------------------------------- | ||
| 31 | /** 01 问题图片,02 开始图片,03 进行中图片,04 已完成图片,05 人员图片:06 材料图片 | 52 | /** 01 问题图片,02 开始图片,03 进行中图片,04 已完成图片,05 人员图片:06 材料图片 |
| 32 | * problemsImgs,startImgs,processingImgs,endImgs,personImgs,materialImgs | 53 | * problemsImgs,startImgs,processingImgs,endImgs,personImgs,materialImgs |
| 33 | * 园林问题单处理前图片描述 | 54 | * 园林问题单处理前图片描述 |
| @@ -58,6 +79,7 @@ public class BpmCommonConstant { | @@ -58,6 +79,7 @@ public class BpmCommonConstant { | ||
| 58 | * 园林工作流 组长退回的附件照片 | 79 | * 园林工作流 组长退回的附件照片 |
| 59 | */ | 80 | */ |
| 60 | public static final String GARDEN_TEAMLEADER_RETURN_IMG = "09"; | 81 | public static final String GARDEN_TEAMLEADER_RETURN_IMG = "09"; |
| 82 | + //--------------------------------------------------------------- | ||
| 61 | /** | 83 | /** |
| 62 | * 园林工单编号前缀 | 84 | * 园林工单编号前缀 |
| 63 | */ | 85 | */ |
| @@ -66,6 +88,12 @@ public class BpmCommonConstant { | @@ -66,6 +88,12 @@ public class BpmCommonConstant { | ||
| 66 | * 快速工单编号前缀 | 88 | * 快速工单编号前缀 |
| 67 | */ | 89 | */ |
| 68 | public static final String WORK_ORDER_PREFFIX_QUICK = "QWO"; | 90 | public static final String WORK_ORDER_PREFFIX_QUICK = "QWO"; |
| 91 | + public static final String ORDER_STATUS_INIT = "000"; | ||
| 92 | + | ||
| 93 | + public static final String ORDER_TYPE_Q = "Q"; | ||
| 94 | + public static final String ORDER_TYPE_C = "C"; | ||
| 95 | + public static final String ORDER_TYPE_O = "O"; | ||
| 96 | + //--------------------------------------------------------------- | ||
| 69 | /** | 97 | /** |
| 70 | * 园林养护员 角色编码 | 98 | * 园林养护员 角色编码 |
| 71 | */ | 99 | */ |
| @@ -80,4 +108,7 @@ public class BpmCommonConstant { | @@ -80,4 +108,7 @@ public class BpmCommonConstant { | ||
| 80 | */ | 108 | */ |
| 81 | public static final String YL_INSPECTOR = "yl_inspector"; | 109 | public static final String YL_INSPECTOR = "yl_inspector"; |
| 82 | 110 | ||
| 111 | + /*养护级别-字典key*/ | ||
| 112 | + public static final String CONSERVE_LEVEL = "conserve_level"; | ||
| 113 | + | ||
| 83 | } | 114 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoPageReqVO.java
| @@ -106,4 +106,19 @@ public class MainInfoPageReqVO extends PageParam { | @@ -106,4 +106,19 @@ public class MainInfoPageReqVO extends PageParam { | ||
| 106 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 106 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 107 | private LocalDateTime[] createTime; | 107 | private LocalDateTime[] createTime; |
| 108 | 108 | ||
| 109 | + @Schema(description = "工单类型 Q:快速工单,C:普通工单,O:其他工单", example = "C") | ||
| 110 | + private String orderType; | ||
| 111 | + | ||
| 112 | + @Schema(description = "工单溯源号:0 无溯源号", example = "0") | ||
| 113 | + private String rootCauseBy; | ||
| 114 | + | ||
| 115 | + @Schema(description = "实施人员ID", example = "12") | ||
| 116 | + private Long workerId; | ||
| 117 | + | ||
| 118 | + @Schema(description = "实施人员名称", example = "苞米豆") | ||
| 119 | + private String workerName; | ||
| 120 | + | ||
| 121 | + @Schema(description = "实施人员部门id", example = "12") | ||
| 122 | + private Long workerCompanyId; | ||
| 123 | + | ||
| 109 | } | 124 | } |
| 110 | \ No newline at end of file | 125 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderController.java
| @@ -318,6 +318,7 @@ public class AppGardenWorkOrderController { | @@ -318,6 +318,7 @@ public class AppGardenWorkOrderController { | ||
| 318 | throw exception(APP_AGREE_CHOOSE); | 318 | throw exception(APP_AGREE_CHOOSE); |
| 319 | } | 319 | } |
| 320 | assignReqVO.setAgree(status); | 320 | assignReqVO.setAgree(status); |
| 321 | + // TODO 需修改更新工单数据 | ||
| 321 | this.ylTeamLeaderAssignWOrder(assignReqVO); | 322 | this.ylTeamLeaderAssignWOrder(assignReqVO); |
| 322 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"<--结束"); | 323 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"<--结束"); |
| 323 | return success(true); | 324 | return success(true); |
| @@ -335,7 +336,7 @@ public class AppGardenWorkOrderController { | @@ -335,7 +336,7 @@ public class AppGardenWorkOrderController { | ||
| 335 | this.approveTask(returnApproveReqVO); | 336 | this.approveTask(returnApproveReqVO); |
| 336 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"<--结束"); | 337 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"<--结束"); |
| 337 | return success(true); | 338 | return success(true); |
| 338 | - case YL_INSPECTOR_START_FINISH , YL_INSPECTOR_START_RELAUNCH : //巡查员结束工单,巡查员重新发起 | 339 | + case YL_INSPECTOR_START_FINISH : //巡查员结束工单 |
| 339 | log.info("当前操作:养护组长结束工单(不同意)或巡查员重新发起(同意)开始,是否同意:"+reqVO.getAgree()+"-->"); | 340 | log.info("当前操作:养护组长结束工单(不同意)或巡查员重新发起(同意)开始,是否同意:"+reqVO.getAgree()+"-->"); |
| 340 | AppGardenTaskApproveReqVO inspectStartReqVO = new AppGardenTaskApproveReqVO(); | 341 | AppGardenTaskApproveReqVO inspectStartReqVO = new AppGardenTaskApproveReqVO(); |
| 341 | Integer revokeStatus = reqVO.getAgree(); | 342 | Integer revokeStatus = reqVO.getAgree(); |
| @@ -348,6 +349,25 @@ public class AppGardenWorkOrderController { | @@ -348,6 +349,25 @@ public class AppGardenWorkOrderController { | ||
| 348 | this.approveTask(inspectStartReqVO); | 349 | this.approveTask(inspectStartReqVO); |
| 349 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); | 350 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); |
| 350 | return success(true); | 351 | return success(true); |
| 352 | + case YL_INSPECTOR_START_RELAUNCH : //巡查员重新发起 | ||
| 353 | + log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"开始,操作类型:"+OperateTypeEnum.YL_WORKER_RETURN.getCode()+"-->"); | ||
| 354 | + // TODO 需修改更新工单数据 | ||
| 355 | + AppGardenTaskApproveReqVO reStartReqVO = new AppGardenTaskApproveReqVO(); | ||
| 356 | + Integer reStatus = reqVO.getAgree(); | ||
| 357 | + if (reStatus == null || (reStatus != 0 && reStatus != 1)) { | ||
| 358 | + throw exception(APP_AGREE_CHOOSE); | ||
| 359 | + } | ||
| 360 | + Long id = reqVO.getWorkerDataId(); | ||
| 361 | + if (id == null) { | ||
| 362 | + throw exception(APP_WORKER_ID_NOT_EMPTY); | ||
| 363 | + } | ||
| 364 | + reStartReqVO.setWorkerDataId(id); | ||
| 365 | + reStartReqVO.setAgree(reStatus); | ||
| 366 | + reStartReqVO.setReason(reqVO.getReason()); | ||
| 367 | + reStartReqVO.setId(reqVO.getTaskId()); | ||
| 368 | + this.approveTask(reStartReqVO); | ||
| 369 | + log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getDesc()+"<--结束"); | ||
| 370 | + return success(true); | ||
| 351 | case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://巡查员验收通过,巡查员验收不通过 | 371 | case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://巡查员验收通过,巡查员验收不通过 |
| 352 | log.info("当前操作:巡查员验收通过 或巡查员验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); | 372 | log.info("当前操作:巡查员验收通过 或巡查员验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); |
| 353 | AppGardenTaskApproveReqVO inspectReqVO = new AppGardenTaskApproveReqVO(); | 373 | AppGardenTaskApproveReqVO inspectReqVO = new AppGardenTaskApproveReqVO(); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/task/AppGardenTaskApproveReqVO.java
| @@ -33,4 +33,8 @@ public class AppGardenTaskApproveReqVO { | @@ -33,4 +33,8 @@ public class AppGardenTaskApproveReqVO { | ||
| 33 | //@NotNull(message = "同意选择类型不能为空") | 33 | //@NotNull(message = "同意选择类型不能为空") |
| 34 | private Integer agree; | 34 | private Integer agree; |
| 35 | 35 | ||
| 36 | + @Schema(description = "工单的数据id", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 37 | + //@NotEmpty(message = "工单的数据id不能为空") | ||
| 38 | + private Long workerDataId; | ||
| 39 | + | ||
| 36 | } | 40 | } |
| 37 | \ No newline at end of file | 41 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoDO.java
| @@ -46,6 +46,14 @@ public class MainInfoDO extends BaseDO { | @@ -46,6 +46,14 @@ public class MainInfoDO extends BaseDO { | ||
| 46 | */ | 46 | */ |
| 47 | private String orderName; | 47 | private String orderName; |
| 48 | /** | 48 | /** |
| 49 | + * 工单类型 Q:快速工单,C:普通工单,O:其他工单 | ||
| 50 | + */ | ||
| 51 | + private String orderType; | ||
| 52 | + /** | ||
| 53 | + * 工单溯源号:0 无溯源号 | ||
| 54 | + */ | ||
| 55 | + private String rootCauseBy; | ||
| 56 | + /** | ||
| 49 | * 来源ID | 57 | * 来源ID |
| 50 | */ | 58 | */ |
| 51 | private Integer sourceId; | 59 | private Integer sourceId; |
| @@ -146,9 +154,24 @@ public class MainInfoDO extends BaseDO { | @@ -146,9 +154,24 @@ public class MainInfoDO extends BaseDO { | ||
| 146 | * 工单完成结果描述 | 154 | * 工单完成结果描述 |
| 147 | */ | 155 | */ |
| 148 | private String handleResult; | 156 | private String handleResult; |
| 149 | - | 157 | + /** |
| 158 | + * 共同处理人 | ||
| 159 | + */ | ||
| 150 | @TableField(typeHandler = JacksonTypeHandler.class) | 160 | @TableField(typeHandler = JacksonTypeHandler.class) |
| 151 | private Set<Long> coHandlers; | 161 | private Set<Long> coHandlers; |
| 162 | + /** | ||
| 163 | + * 实施人员ID | ||
| 164 | + */ | ||
| 165 | + private Long workerId; | ||
| 166 | + /** | ||
| 167 | + * 实施人员名称 | ||
| 168 | + */ | ||
| 169 | + private String workerName; | ||
| 170 | + /** | ||
| 171 | + * 实施人员部门id | ||
| 172 | + */ | ||
| 173 | + private Long workerCompanyId; | ||
| 174 | + | ||
| 152 | 175 | ||
| 153 | 176 | ||
| 154 | } | 177 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java
| @@ -41,6 +41,13 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { | @@ -41,6 +41,13 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { | ||
| 41 | }); | 41 | }); |
| 42 | queryWrapper.eqIfPresent(MainInfoDO::getOrderNo, reqVO.getOrderNo()) | 42 | queryWrapper.eqIfPresent(MainInfoDO::getOrderNo, reqVO.getOrderNo()) |
| 43 | .likeIfPresent(MainInfoDO::getOrderName, reqVO.getOrderName()) | 43 | .likeIfPresent(MainInfoDO::getOrderName, reqVO.getOrderName()) |
| 44 | + | ||
| 45 | + .eqIfPresent(MainInfoDO::getRootCauseBy, reqVO.getRootCauseBy()) | ||
| 46 | + .eqIfPresent(MainInfoDO::getOrderType, reqVO.getOrderType()) | ||
| 47 | + .eqIfPresent(MainInfoDO::getWorkerCompanyId, reqVO.getWorkerName()) | ||
| 48 | + .eqIfPresent(MainInfoDO::getWorkerId, reqVO.getOrderType()) | ||
| 49 | + .likeIfPresent(MainInfoDO::getWorkerName, reqVO.getWorkerName()) | ||
| 50 | + | ||
| 44 | .eqIfPresent(MainInfoDO::getSourceId, reqVO.getSourceId()) | 51 | .eqIfPresent(MainInfoDO::getSourceId, reqVO.getSourceId()) |
| 45 | .likeIfPresent(MainInfoDO::getSourceName, reqVO.getSourceName()) | 52 | .likeIfPresent(MainInfoDO::getSourceName, reqVO.getSourceName()) |
| 46 | .eqIfPresent(MainInfoDO::getRoadId, reqVO.getRoadId()) | 53 | .eqIfPresent(MainInfoDO::getRoadId, reqVO.getRoadId()) |
| @@ -76,6 +83,13 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { | @@ -76,6 +83,13 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { | ||
| 76 | .eqIfPresent(MainInfoDO::getBusiLine, reqVO.getBusiLine()) | 83 | .eqIfPresent(MainInfoDO::getBusiLine, reqVO.getBusiLine()) |
| 77 | .likeIfPresent(MainInfoDO::getOrderNo, reqVO.getOrderNo()) | 84 | .likeIfPresent(MainInfoDO::getOrderNo, reqVO.getOrderNo()) |
| 78 | .likeIfPresent(MainInfoDO::getOrderName, reqVO.getOrderName()) | 85 | .likeIfPresent(MainInfoDO::getOrderName, reqVO.getOrderName()) |
| 86 | + | ||
| 87 | + .eqIfPresent(MainInfoDO::getRootCauseBy, reqVO.getRootCauseBy()) | ||
| 88 | + .eqIfPresent(MainInfoDO::getOrderType, reqVO.getOrderType()) | ||
| 89 | + .eqIfPresent(MainInfoDO::getWorkerCompanyId, reqVO.getWorkerName()) | ||
| 90 | + .eqIfPresent(MainInfoDO::getWorkerId, reqVO.getOrderType()) | ||
| 91 | + .likeIfPresent(MainInfoDO::getWorkerName, reqVO.getWorkerName()) | ||
| 92 | + | ||
| 79 | .eqIfPresent(MainInfoDO::getSourceId, reqVO.getSourceId()) | 93 | .eqIfPresent(MainInfoDO::getSourceId, reqVO.getSourceId()) |
| 80 | .likeIfPresent(MainInfoDO::getSourceName, reqVO.getSourceName()) | 94 | .likeIfPresent(MainInfoDO::getSourceName, reqVO.getSourceName()) |
| 81 | .eqIfPresent(MainInfoDO::getRoadId, reqVO.getRoadId()) | 95 | .eqIfPresent(MainInfoDO::getRoadId, reqVO.getRoadId()) |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
| @@ -21,7 +21,9 @@ public interface ErrorCodeConstants { | @@ -21,7 +21,9 @@ public interface ErrorCodeConstants { | ||
| 21 | 21 | ||
| 22 | ErrorCode APP_AGREE_CHOOSE = new ErrorCode(1-900-001-004, "agree状态只能为0或1"); | 22 | ErrorCode APP_AGREE_CHOOSE = new ErrorCode(1-900-001-004, "agree状态只能为0或1"); |
| 23 | 23 | ||
| 24 | - ErrorCode APP_OPERATOR_NOT_EXISTS = new ErrorCode(1-900-001-004, "无此操作类型!"); | 24 | + ErrorCode APP_OPERATOR_NOT_EXISTS = new ErrorCode(1-900-001-005, "无此操作类型!"); |
| 25 | 25 | ||
| 26 | - ErrorCode APP_WORKER_NOT_EXISTS = new ErrorCode(1-900-001-004, "养护员必须指派,不能为空!"); | 26 | + ErrorCode APP_WORKER_NOT_EXISTS = new ErrorCode(1-900-001-006, "养护员必须指派,不能为空!"); |
| 27 | + | ||
| 28 | + ErrorCode APP_WORKER_ID_NOT_EMPTY = new ErrorCode(1-900-001-007, "WorkerDataId不能为空!"); | ||
| 27 | } | 29 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
| @@ -2,6 +2,8 @@ package com.zteits.urbanops.module.workorder.service.garden; | @@ -2,6 +2,8 @@ package com.zteits.urbanops.module.workorder.service.garden; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 5 | +import com.zteits.urbanops.framework.common.biz.system.dict.DictDataCommonApi; | ||
| 6 | +import com.zteits.urbanops.framework.common.biz.system.dict.dto.DictDataRespDTO; | ||
| 5 | import com.zteits.urbanops.framework.common.pojo.PageParam; | 7 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 6 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 8 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 7 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; | 9 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| @@ -67,6 +69,7 @@ import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCo | @@ -67,6 +69,7 @@ import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCo | ||
| 67 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | 69 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 68 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; | 70 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; |
| 69 | import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertSet; | 71 | import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertSet; |
| 72 | +import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.*; | ||
| 70 | import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.MAIN_INFO_NOT_EXISTS; | 73 | import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.MAIN_INFO_NOT_EXISTS; |
| 71 | import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.TEAM_LEADER_YL_NOT_EXISTS; | 74 | import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.TEAM_LEADER_YL_NOT_EXISTS; |
| 72 | 75 | ||
| @@ -109,6 +112,9 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -109,6 +112,9 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 109 | @Resource | 112 | @Resource |
| 110 | private RuntimeService runtimeService; | 113 | private RuntimeService runtimeService; |
| 111 | 114 | ||
| 115 | + @Resource | ||
| 116 | + private DictDataCommonApi dictDataCommonApi; | ||
| 117 | + | ||
| 112 | /** | 118 | /** |
| 113 | * app 端快速工单入口 | 119 | * app 端快速工单入口 |
| 114 | * @param createRequestVo | 120 | * @param createRequestVo |
| @@ -120,7 +126,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -120,7 +126,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 120 | 126 | ||
| 121 | List<String> imgList = createRequestVo.getImgs(); | 127 | List<String> imgList = createRequestVo.getImgs(); |
| 122 | //List<String> streetImgList = createRequestVo.getStreetImgList(); | 128 | //List<String> streetImgList = createRequestVo.getStreetImgList(); |
| 123 | - List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | 129 | + //List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); |
| 124 | // 插入 工单 | 130 | // 插入 工单 |
| 125 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) | 131 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 126 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); | 132 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| @@ -128,8 +134,11 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -128,8 +134,11 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 128 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); | 134 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); |
| 129 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); | 135 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 130 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); | 136 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 131 | - | ||
| 132 | - //workOrder.setBuzStatus("t1");//需给出映射关系 | 137 | + workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| 138 | + workOrder.setOrderType(BpmCommonConstant.ORDER_TYPE_Q); | ||
| 139 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, createRequestVo.getPressingType().toString()); | ||
| 140 | + workOrder.setCuringLevelId(Integer.valueOf(dictData.getValue())); | ||
| 141 | + workOrder.setCuringLevelName(dictData.getLabel()); | ||
| 133 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | 142 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 134 | workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); | 143 | workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); |
| 135 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); | 144 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); |
| @@ -139,14 +148,13 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -139,14 +148,13 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 139 | workOrder.setFinishDate(now); | 148 | workOrder.setFinishDate(now); |
| 140 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_QUICK); | 149 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_QUICK); |
| 141 | workOrder.setOrderNo(workOrderNum); | 150 | workOrder.setOrderNo(workOrderNum); |
| 142 | - //workOrder.setOrderName("园林工单"); | ||
| 143 | workOrderMapper.insert(workOrder); | 151 | workOrderMapper.insert(workOrder); |
| 144 | 152 | ||
| 145 | //附件插入 | 153 | //附件插入 |
| 146 | - attachmentApend(imgList,null,longRangeImgList,workOrder); | 154 | + attachmentApend(imgList,null,null,workOrder); |
| 147 | // 发起 BPM 流程 | 155 | // 发起 BPM 流程 |
| 148 | Map<String, Object> processInstanceVariables = new HashMap<>(); | 156 | Map<String, Object> processInstanceVariables = new HashMap<>(); |
| 149 | - processInstanceVariables.put("initiator", SecurityFrameworkUtils.getLoginUserId()); | 157 | + processInstanceVariables.put(COMMON_QUICK_PROCESS_INITIATOR, SecurityFrameworkUtils.getLoginUserId()); |
| 150 | 158 | ||
| 151 | String processInstanceId = processInstanceApi.createProcessInstance(SecurityFrameworkUtils.getLoginUserId(), | 159 | String processInstanceId = processInstanceApi.createProcessInstance(SecurityFrameworkUtils.getLoginUserId(), |
| 152 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.COMMON_QUICK_PROCESS) | 160 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.COMMON_QUICK_PROCESS) |
| @@ -180,14 +188,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -180,14 +188,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 180 | variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS,BpmTaskStatusEnum.APPROVE.getStatus()); | 188 | variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS,BpmTaskStatusEnum.APPROVE.getStatus()); |
| 181 | Integer status = reqVO.getAgree(); | 189 | Integer status = reqVO.getAgree(); |
| 182 | if(status == null || status == 1){//status == null 此处是为了兼容老接口,防止前段少改造 | 190 | if(status == null || status == 1){//status == null 此处是为了兼容老接口,防止前段少改造 |
| 183 | - variables.put("isNeed",false); | ||
| 184 | - variables.put("isRevoke",false); | ||
| 185 | - variables.put("isVerify",false); | 191 | + variables.put(BPM_COMMON_PROD_ISNEED,false); |
| 192 | + variables.put(BPM_COMMON_PROD_ISREVOKE,false); | ||
| 193 | + variables.put(BPM_COMMON_PROD_ISVERIFY,false); | ||
| 186 | }else { | 194 | }else { |
| 187 | - variables.put("isNeed",true); | ||
| 188 | - variables.put("isRevoke",true); | ||
| 189 | - variables.put("isVerify",true); | 195 | + variables.put(BPM_COMMON_PROD_ISNEED,true); |
| 196 | + variables.put(BPM_COMMON_PROD_ISREVOKE,true); | ||
| 197 | + variables.put(BPM_COMMON_PROD_ISVERIFY,true); | ||
| 190 | } | 198 | } |
| 199 | + //TODO 重新发起需更新工单数据库 | ||
| 200 | + | ||
| 191 | targetVO.setVariables(variables); | 201 | targetVO.setVariables(variables); |
| 192 | //TODO 审批候选人需要赋值 | 202 | //TODO 审批候选人需要赋值 |
| 193 | Map<String, List<Long>> nextAssignees = new HashMap<>(); | 203 | Map<String, List<Long>> nextAssignees = new HashMap<>(); |
| @@ -201,12 +211,12 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -201,12 +211,12 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 201 | Map<String, Object> variables = new HashMap<>(); | 211 | Map<String, Object> variables = new HashMap<>(); |
| 202 | //审批通过 | 212 | //审批通过 |
| 203 | variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS,BpmTaskStatusEnum.APPROVE.getStatus()); | 213 | variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS,BpmTaskStatusEnum.APPROVE.getStatus()); |
| 204 | - variables.put("ylWorkerId",reqVO.getNextAssignee()); | 214 | + variables.put(BPM_COMMON_PROD_WORKERID,reqVO.getNextAssignee()); |
| 205 | Integer status = reqVO.getAgree(); | 215 | Integer status = reqVO.getAgree(); |
| 206 | if(status == null || status == 0){//status == null 此处是为了兼容老接口,防止前段少改造 | 216 | if(status == null || status == 0){//status == null 此处是为了兼容老接口,防止前段少改造 |
| 207 | - variables.put("isNeed",true); | 217 | + variables.put(BPM_COMMON_PROD_ISNEED,true); |
| 208 | }else { | 218 | }else { |
| 209 | - variables.put("isNeed",false); | 219 | + variables.put(BPM_COMMON_PROD_ISNEED,false); |
| 210 | } | 220 | } |
| 211 | targetVO.setVariables(variables); | 221 | targetVO.setVariables(variables); |
| 212 | Map<String, List<Long>> nextAssignees = new HashMap<>(); | 222 | Map<String, List<Long>> nextAssignees = new HashMap<>(); |
| @@ -530,14 +540,19 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -530,14 +540,19 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 530 | public Long createWorkOrder(AppGardenWorkOrderReqVO createRequestVo) { | 540 | public Long createWorkOrder(AppGardenWorkOrderReqVO createRequestVo) { |
| 531 | List<String> imgList = createRequestVo.getImgs(); | 541 | List<String> imgList = createRequestVo.getImgs(); |
| 532 | //List<String> streetImgList = createRequestVo.getStreetImgList(); | 542 | //List<String> streetImgList = createRequestVo.getStreetImgList(); |
| 533 | - List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | 543 | + //List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); |
| 534 | 544 | ||
| 535 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) | 545 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 536 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); | 546 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| 537 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); | 547 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); |
| 548 | + | ||
| 538 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); | 549 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 539 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); | 550 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 540 | - //workOrder.setBuzStatus("t1");//需给出映射关系 | 551 | + workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| 552 | + workOrder.setOrderType(BpmCommonConstant.ORDER_TYPE_Q); | ||
| 553 | + DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, createRequestVo.getPressingType().toString()); | ||
| 554 | + workOrder.setCuringLevelId(Integer.valueOf(dictData.getValue())); | ||
| 555 | + workOrder.setCuringLevelName(dictData.getLabel()); | ||
| 541 | workOrder.setCommitDate(LocalDateTime.now()); | 556 | workOrder.setCommitDate(LocalDateTime.now()); |
| 542 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | 557 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 543 | workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); | 558 | workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); |
| @@ -546,15 +561,14 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -546,15 +561,14 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 546 | workOrder.setCommitDate(LocalDateTime.now()); | 561 | workOrder.setCommitDate(LocalDateTime.now()); |
| 547 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_GARDEN); | 562 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_GARDEN); |
| 548 | workOrder.setOrderNo(workOrderNum); | 563 | workOrder.setOrderNo(workOrderNum); |
| 549 | - //workOrder.setOrderName("园林工单"); | ||
| 550 | workOrderMapper.insert(workOrder); | 564 | workOrderMapper.insert(workOrder); |
| 551 | //附件插入 | 565 | //附件插入 |
| 552 | - attachmentApend(imgList,null,longRangeImgList,workOrder); | 566 | + attachmentApend(imgList,null,null,workOrder); |
| 553 | // 发起 BPM 流程 | 567 | // 发起 BPM 流程 |
| 554 | Long userId = SecurityFrameworkUtils.getLoginUserId(); | 568 | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| 555 | Map<String, Object> processInstanceVariables = new HashMap<>(); | 569 | Map<String, Object> processInstanceVariables = new HashMap<>(); |
| 556 | - processInstanceVariables.put("roadId", workOrder.getRoadId()); | ||
| 557 | - processInstanceVariables.put("applyUserId", userId); | 570 | + processInstanceVariables.put(BPM_COMMON_PROD_ROADID, workOrder.getRoadId()); |
| 571 | + processInstanceVariables.put(BPM_COMMON_PROD_APPLYUSERID, userId); | ||
| 558 | Map<String, List<Long>> startUserSelectAssignees = new HashMap<>(); | 572 | Map<String, List<Long>> startUserSelectAssignees = new HashMap<>(); |
| 559 | List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(workOrder.getRoadId(),BpmCommonConstant.TEAM_LEADER_YL,createRequestVo.getBusiLine()); | 573 | List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(workOrder.getRoadId(),BpmCommonConstant.TEAM_LEADER_YL,createRequestVo.getBusiLine()); |
| 560 | if(org.springframework.util.ObjectUtils.isEmpty(userList)){ | 574 | if(org.springframework.util.ObjectUtils.isEmpty(userList)){ |
| @@ -566,7 +580,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -566,7 +580,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 566 | .map(AdminUserRespDTO::getId) | 580 | .map(AdminUserRespDTO::getId) |
| 567 | // 收集结果到List | 581 | // 收集结果到List |
| 568 | .collect(Collectors.toList()); | 582 | .collect(Collectors.toList()); |
| 569 | - processInstanceVariables.put("ylTeamLeaderId", idList.get(0)); | 583 | + processInstanceVariables.put(BPM_COMMON_PROD_LEADERID, idList.get(0)); |
| 570 | String processInstanceId = processInstanceApi.createProcessInstance(userId, | 584 | String processInstanceId = processInstanceApi.createProcessInstance(userId, |
| 571 | // new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO) | 585 | // new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO) |
| 572 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_WORKORDER_COMMON_PROD) | 586 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_WORKORDER_COMMON_PROD) |