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 | 59 | @NotEmpty(message = "经纬度地址不能为空") |
| 60 | 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 | 64 | private Integer pressingType; |
| 65 | 65 | |
| 66 | 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 | 11 | * 通用快速流程 |
| 12 | 12 | */ |
| 13 | 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 | 18 | * 园林巡检工单 流程业务key |
| 16 | 19 | */ |
| 20 | + @Deprecated | |
| 17 | 21 | public static final String BPM_GARDEN_INSPECT_WO = "garden_inspect_wo"; |
| 18 | 22 | |
| 19 | 23 | /** |
| 20 | 24 | * 园林巡检工单 通用版本 |
| 21 | 25 | */ |
| 22 | 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 | 44 | * 物业巡检工单 流程业务key |
| 25 | 45 | */ |
| ... | ... | @@ -28,6 +48,7 @@ public class BpmCommonConstant { |
| 28 | 48 | * 市政巡检工单 流程业务key |
| 29 | 49 | */ |
| 30 | 50 | public static final String BPM_MUNICIPAL_INSPECT_WO = "municipal_inspect_wo"; |
| 51 | + //----------------------------------------------------------------------------------- | |
| 31 | 52 | /** 01 问题图片,02 开始图片,03 进行中图片,04 已完成图片,05 人员图片:06 材料图片 |
| 32 | 53 | * problemsImgs,startImgs,processingImgs,endImgs,personImgs,materialImgs |
| 33 | 54 | * 园林问题单处理前图片描述 |
| ... | ... | @@ -58,6 +79,7 @@ public class BpmCommonConstant { |
| 58 | 79 | * 园林工作流 组长退回的附件照片 |
| 59 | 80 | */ |
| 60 | 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 | 88 | * 快速工单编号前缀 |
| 67 | 89 | */ |
| 68 | 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 | 108 | */ |
| 81 | 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 | 106 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 107 | 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 | 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 | 318 | throw exception(APP_AGREE_CHOOSE); |
| 319 | 319 | } |
| 320 | 320 | assignReqVO.setAgree(status); |
| 321 | + // TODO 需修改更新工单数据 | |
| 321 | 322 | this.ylTeamLeaderAssignWOrder(assignReqVO); |
| 322 | 323 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_ASSIGN.getDesc()+"<--结束"); |
| 323 | 324 | return success(true); |
| ... | ... | @@ -335,7 +336,7 @@ public class AppGardenWorkOrderController { |
| 335 | 336 | this.approveTask(returnApproveReqVO); |
| 336 | 337 | log.info("当前操作:"+OperateTypeEnum.YL_TEAM_LEADER_RETURN.getDesc()+"<--结束"); |
| 337 | 338 | return success(true); |
| 338 | - case YL_INSPECTOR_START_FINISH , YL_INSPECTOR_START_RELAUNCH : //巡查员结束工单,巡查员重新发起 | |
| 339 | + case YL_INSPECTOR_START_FINISH : //巡查员结束工单 | |
| 339 | 340 | log.info("当前操作:养护组长结束工单(不同意)或巡查员重新发起(同意)开始,是否同意:"+reqVO.getAgree()+"-->"); |
| 340 | 341 | AppGardenTaskApproveReqVO inspectStartReqVO = new AppGardenTaskApproveReqVO(); |
| 341 | 342 | Integer revokeStatus = reqVO.getAgree(); |
| ... | ... | @@ -348,6 +349,25 @@ public class AppGardenWorkOrderController { |
| 348 | 349 | this.approveTask(inspectStartReqVO); |
| 349 | 350 | log.info("当前操作:"+OperateTypeEnum.YL_INSPECTOR_START_FINISH.getDesc()+"<--结束"); |
| 350 | 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 | 371 | case YL_INSPECTOR_CHECK_PASS , YL_INSPECTOR_CHECK_REJECT ://巡查员验收通过,巡查员验收不通过 |
| 352 | 372 | log.info("当前操作:巡查员验收通过 或巡查员验收不通过开始,是否同意:"+reqVO.getAgree()+"-->"); |
| 353 | 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 | 33 | //@NotNull(message = "同意选择类型不能为空") |
| 34 | 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 | 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 | 46 | */ |
| 47 | 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 | 57 | * 来源ID |
| 50 | 58 | */ |
| 51 | 59 | private Integer sourceId; |
| ... | ... | @@ -146,9 +154,24 @@ public class MainInfoDO extends BaseDO { |
| 146 | 154 | * 工单完成结果描述 |
| 147 | 155 | */ |
| 148 | 156 | private String handleResult; |
| 149 | - | |
| 157 | + /** | |
| 158 | + * 共同处理人 | |
| 159 | + */ | |
| 150 | 160 | @TableField(typeHandler = JacksonTypeHandler.class) |
| 151 | 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 | 41 | }); |
| 42 | 42 | queryWrapper.eqIfPresent(MainInfoDO::getOrderNo, reqVO.getOrderNo()) |
| 43 | 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 | 51 | .eqIfPresent(MainInfoDO::getSourceId, reqVO.getSourceId()) |
| 45 | 52 | .likeIfPresent(MainInfoDO::getSourceName, reqVO.getSourceName()) |
| 46 | 53 | .eqIfPresent(MainInfoDO::getRoadId, reqVO.getRoadId()) |
| ... | ... | @@ -76,6 +83,13 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { |
| 76 | 83 | .eqIfPresent(MainInfoDO::getBusiLine, reqVO.getBusiLine()) |
| 77 | 84 | .likeIfPresent(MainInfoDO::getOrderNo, reqVO.getOrderNo()) |
| 78 | 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 | 93 | .eqIfPresent(MainInfoDO::getSourceId, reqVO.getSourceId()) |
| 80 | 94 | .likeIfPresent(MainInfoDO::getSourceName, reqVO.getSourceName()) |
| 81 | 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 | 21 | |
| 22 | 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 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 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 | 7 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 6 | 8 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 7 | 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 | 69 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 68 | 70 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; |
| 69 | 71 | import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertSet; |
| 72 | +import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.*; | |
| 70 | 73 | import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.MAIN_INFO_NOT_EXISTS; |
| 71 | 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 | 112 | @Resource |
| 110 | 113 | private RuntimeService runtimeService; |
| 111 | 114 | |
| 115 | + @Resource | |
| 116 | + private DictDataCommonApi dictDataCommonApi; | |
| 117 | + | |
| 112 | 118 | /** |
| 113 | 119 | * app 端快速工单入口 |
| 114 | 120 | * @param createRequestVo |
| ... | ... | @@ -120,7 +126,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 120 | 126 | |
| 121 | 127 | List<String> imgList = createRequestVo.getImgs(); |
| 122 | 128 | //List<String> streetImgList = createRequestVo.getStreetImgList(); |
| 123 | - List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | |
| 129 | + //List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | |
| 124 | 130 | // 插入 工单 |
| 125 | 131 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 126 | 132 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| ... | ... | @@ -128,8 +134,11 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 128 | 134 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); |
| 129 | 135 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 130 | 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 | 142 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 134 | 143 | workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); |
| 135 | 144 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); |
| ... | ... | @@ -139,14 +148,13 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 139 | 148 | workOrder.setFinishDate(now); |
| 140 | 149 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_QUICK); |
| 141 | 150 | workOrder.setOrderNo(workOrderNum); |
| 142 | - //workOrder.setOrderName("园林工单"); | |
| 143 | 151 | workOrderMapper.insert(workOrder); |
| 144 | 152 | |
| 145 | 153 | //附件插入 |
| 146 | - attachmentApend(imgList,null,longRangeImgList,workOrder); | |
| 154 | + attachmentApend(imgList,null,null,workOrder); | |
| 147 | 155 | // 发起 BPM 流程 |
| 148 | 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 | 159 | String processInstanceId = processInstanceApi.createProcessInstance(SecurityFrameworkUtils.getLoginUserId(), |
| 152 | 160 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.COMMON_QUICK_PROCESS) |
| ... | ... | @@ -180,14 +188,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 180 | 188 | variables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_STATUS,BpmTaskStatusEnum.APPROVE.getStatus()); |
| 181 | 189 | Integer status = reqVO.getAgree(); |
| 182 | 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 | 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 | 201 | targetVO.setVariables(variables); |
| 192 | 202 | //TODO 审批候选人需要赋值 |
| 193 | 203 | Map<String, List<Long>> nextAssignees = new HashMap<>(); |
| ... | ... | @@ -201,12 +211,12 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 201 | 211 | Map<String, Object> variables = new HashMap<>(); |
| 202 | 212 | //审批通过 |
| 203 | 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 | 215 | Integer status = reqVO.getAgree(); |
| 206 | 216 | if(status == null || status == 0){//status == null 此处是为了兼容老接口,防止前段少改造 |
| 207 | - variables.put("isNeed",true); | |
| 217 | + variables.put(BPM_COMMON_PROD_ISNEED,true); | |
| 208 | 218 | }else { |
| 209 | - variables.put("isNeed",false); | |
| 219 | + variables.put(BPM_COMMON_PROD_ISNEED,false); | |
| 210 | 220 | } |
| 211 | 221 | targetVO.setVariables(variables); |
| 212 | 222 | Map<String, List<Long>> nextAssignees = new HashMap<>(); |
| ... | ... | @@ -530,14 +540,19 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 530 | 540 | public Long createWorkOrder(AppGardenWorkOrderReqVO createRequestVo) { |
| 531 | 541 | List<String> imgList = createRequestVo.getImgs(); |
| 532 | 542 | //List<String> streetImgList = createRequestVo.getStreetImgList(); |
| 533 | - List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | |
| 543 | + //List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | |
| 534 | 544 | |
| 535 | 545 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 536 | 546 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| 537 | 547 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); |
| 548 | + | |
| 538 | 549 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 539 | 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 | 556 | workOrder.setCommitDate(LocalDateTime.now()); |
| 542 | 557 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 543 | 558 | workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); |
| ... | ... | @@ -546,15 +561,14 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 546 | 561 | workOrder.setCommitDate(LocalDateTime.now()); |
| 547 | 562 | String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_GARDEN); |
| 548 | 563 | workOrder.setOrderNo(workOrderNum); |
| 549 | - //workOrder.setOrderName("园林工单"); | |
| 550 | 564 | workOrderMapper.insert(workOrder); |
| 551 | 565 | //附件插入 |
| 552 | - attachmentApend(imgList,null,longRangeImgList,workOrder); | |
| 566 | + attachmentApend(imgList,null,null,workOrder); | |
| 553 | 567 | // 发起 BPM 流程 |
| 554 | 568 | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| 555 | 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 | 572 | Map<String, List<Long>> startUserSelectAssignees = new HashMap<>(); |
| 559 | 573 | List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(workOrder.getRoadId(),BpmCommonConstant.TEAM_LEADER_YL,createRequestVo.getBusiLine()); |
| 560 | 574 | if(org.springframework.util.ObjectUtils.isEmpty(userList)){ |
| ... | ... | @@ -566,7 +580,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 566 | 580 | .map(AdminUserRespDTO::getId) |
| 567 | 581 | // 收集结果到List |
| 568 | 582 | .collect(Collectors.toList()); |
| 569 | - processInstanceVariables.put("ylTeamLeaderId", idList.get(0)); | |
| 583 | + processInstanceVariables.put(BPM_COMMON_PROD_LEADERID, idList.get(0)); | |
| 570 | 584 | String processInstanceId = processInstanceApi.createProcessInstance(userId, |
| 571 | 585 | // new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO) |
| 572 | 586 | new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_WORKORDER_COMMON_PROD) | ... | ... |