Commit 29cef0ec965dcc2805c6371547e5815e93a676fe
1 parent
3fe9c3e6
AI工单 审批流程
Showing
4 changed files
with
33 additions
and
10 deletions
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderAIReqVO.java
| @@ -81,6 +81,12 @@ public class AppGardenWorkOrderAIReqVO { | @@ -81,6 +81,12 @@ public class AppGardenWorkOrderAIReqVO { | ||
| 81 | @Schema(description = "工单业务线", example = "yl") | 81 | @Schema(description = "工单业务线", example = "yl") |
| 82 | private String busiLine; | 82 | private String busiLine; |
| 83 | 83 | ||
| 84 | + @Schema(description = "工单来源编码", example = "axcbng") | ||
| 85 | + private String woSourceId; | ||
| 86 | + | ||
| 87 | + @Schema(description = "工单来源名称", example = "摄像头") | ||
| 88 | + private String woSourceName; | ||
| 89 | + | ||
| 84 | 90 | ||
| 85 | 91 | ||
| 86 | } | 92 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
| @@ -171,9 +171,14 @@ public class BpmCommonConstant { | @@ -171,9 +171,14 @@ public class BpmCommonConstant { | ||
| 171 | * 大区经理 角色编码 | 171 | * 大区经理 角色编码 |
| 172 | */ | 172 | */ |
| 173 | public static final String REGIONAL_MANAGER = "regional_manager"; | 173 | public static final String REGIONAL_MANAGER = "regional_manager"; |
| 174 | - | 174 | + /** |
| 175 | + * 督察员 角色编码 | ||
| 176 | + */ | ||
| 175 | public static final String INSPECTOR_GLOBAL = "Inspector_global"; | 177 | public static final String INSPECTOR_GLOBAL = "Inspector_global"; |
| 176 | - | 178 | + /** |
| 179 | + * ai 工单派发人 | ||
| 180 | + */ | ||
| 181 | + public static final String AI_DISPATCHER = "AI_dispatcher"; | ||
| 177 | /*养护级别-字典key*/ | 182 | /*养护级别-字典key*/ |
| 178 | public static final String CONSERVE_LEVEL = "conserve_level"; | 183 | public static final String CONSERVE_LEVEL = "conserve_level"; |
| 179 | //--------------------------------------------------------------------------------- | 184 | //--------------------------------------------------------------------------------- |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
| @@ -49,8 +49,12 @@ public interface ErrorCodeConstants { | @@ -49,8 +49,12 @@ public interface ErrorCodeConstants { | ||
| 49 | 49 | ||
| 50 | ErrorCode APP_INSPECTOR_USER_ROLE_ERROR = new ErrorCode(1-900-004-001, "该登录人不是 全域督查员,无法发起流程!"); | 50 | ErrorCode APP_INSPECTOR_USER_ROLE_ERROR = new ErrorCode(1-900-004-001, "该登录人不是 全域督查员,无法发起流程!"); |
| 51 | 51 | ||
| 52 | - ErrorCode APP_WORK_INSPECTOR_ROLE_ILLEGLE = new ErrorCode(1-900-004-00, "该登录人即是 大区经理 角色,又是 全域督察员,无法发起流程!"); | 52 | + ErrorCode APP_WORK_INSPECTOR_ROLE_ILLEGLE = new ErrorCode(1-900-004-003, "该登录人即是 大区经理 角色,又是 全域督察员,无法发起流程!"); |
| 53 | 53 | ||
| 54 | - ErrorCode APP_WORK_ROAD_NOT_EXISTS = new ErrorCode(1-900-004-001, "道路信息不存在"); | 54 | + ErrorCode APP_WORK_ROAD_NOT_EXISTS = new ErrorCode(1-900-004-002, "道路信息不存在"); |
| 55 | + | ||
| 56 | + ErrorCode APP_AI_USER_ROLE_ERROR = new ErrorCode(1-900-004-004, "该登录人不是 AI工单派发人员,无法发起流程!"); | ||
| 57 | + | ||
| 58 | + ErrorCode APP_WORK_AI_ROLE_ILLEGLE = new ErrorCode(1-900-004-005, "该登录人即是 大区经理 角色,又是 AI工单派发人员,无法发起流程!"); | ||
| 55 | } | 59 | } |
| 56 | 60 |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmAIServiceImpl.java
| @@ -110,12 +110,12 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -110,12 +110,12 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 110 | throw exception(APP_USER_ROLE_NOT_EXISTS); | 110 | throw exception(APP_USER_ROLE_NOT_EXISTS); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | - if(!RoleListUtils.containsCode(roleList,INSPECTOR_GLOBAL)){ | ||
| 114 | - throw exception(APP_INSPECTOR_USER_ROLE_ERROR); | 113 | + if(!RoleListUtils.containsCode(roleList,AI_DISPATCHER)){ |
| 114 | + throw exception(APP_AI_USER_ROLE_ERROR); | ||
| 115 | } | 115 | } |
| 116 | //校验人员不能有 双重角色 | 116 | //校验人员不能有 双重角色 |
| 117 | - if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, INSPECTOR_GLOBAL)){ | ||
| 118 | - throw exception(APP_WORK_INSPECTOR_ROLE_ILLEGLE); | 117 | + if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, AI_DISPATCHER)){ |
| 118 | + throw exception(APP_WORK_AI_ROLE_ILLEGLE); | ||
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | List<String> problemsImgsList = createRequestVo.getProblemsImgs(); | 121 | List<String> problemsImgsList = createRequestVo.getProblemsImgs(); |
| @@ -148,8 +148,16 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -148,8 +148,16 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 148 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); | 148 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 149 | workOrder.setSourceId(EventSourceEnum.AI.getCode()); | 149 | workOrder.setSourceId(EventSourceEnum.AI.getCode()); |
| 150 | workOrder.setSourceName(EventSourceEnum.AI.getDesc()); | 150 | workOrder.setSourceName(EventSourceEnum.AI.getDesc()); |
| 151 | - workOrder.setWoSourceId(roleList.get(0).getCode()); | ||
| 152 | - workOrder.setWoSourceName(roleList.get(0).getName()); | 151 | + String wsourceId = createRequestVo.getWoSourceId(); |
| 152 | + String wsourceName = createRequestVo.getWoSourceName(); | ||
| 153 | + if(StringUtil.isEmpty(wsourceId)){ | ||
| 154 | + wsourceId = roleList.get(0).getCode(); | ||
| 155 | + } | ||
| 156 | + if(StringUtil.isEmpty(wsourceName)){ | ||
| 157 | + wsourceName = roleList.get(0).getCode(); | ||
| 158 | + } | ||
| 159 | + workOrder.setWoSourceId(wsourceId); | ||
| 160 | + workOrder.setWoSourceName(wsourceName); | ||
| 153 | String busiLine = createRequestVo.getBusiLine(); | 161 | String busiLine = createRequestVo.getBusiLine(); |
| 154 | if(StringUtil.isEmpty(busiLine)){ | 162 | if(StringUtil.isEmpty(busiLine)){ |
| 155 | busiLine = SecurityFrameworkUtils.getBusiLine(); | 163 | busiLine = SecurityFrameworkUtils.getBusiLine(); |