Commit 4e3f41efd18a5a7da57aaa454e52ca89540c4d59

Authored by 颜惠青
1 parent b9b56e70

三海道路字典配置

urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
... ... @@ -181,6 +181,8 @@ public class BpmCommonConstant {
181 181 public static final String AI_DISPATCHER = "AI_dispatcher";
182 182 /*养护级别-字典key*/
183 183 public static final String CONSERVE_LEVEL = "conserve_level";
  184 +
  185 + public static final String SANHAI_COMPANY = "sanhai_compamys";
184 186 //---------------------------------------------------------------------------------
185 187  
186 188 /**
... ...
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
... ... @@ -57,5 +57,7 @@ public interface ErrorCodeConstants {
57 57 ErrorCode APP_AI_USER_ROLE_ERROR = new ErrorCode(1-900-004-004, "该登录人不是 AI工单派发人员,无法发起流程!");
58 58  
59 59 ErrorCode APP_WORK_AI_ROLE_ILLEGLE = new ErrorCode(1-900-004-005, "该登录人即是 大区经理 角色,又是 AI工单派发人员,无法发起流程!");
  60 +
  61 + ErrorCode SANHAI_COMPANY_NOT_EXISTS = new ErrorCode(1-900-004-006, "三海道路归属部门的id,字典项不存在!");
60 62 }
61 63  
... ...
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmAIServiceImpl.java
... ... @@ -305,8 +305,19 @@ public class BpmAIServiceImpl implements BpmAIService{
305 305  
306 306 @Override
307 307 public boolean isSanhai(Long companyId) {
  308 + List<DictDataRespDTO> dictData = dictDataCommonApi.getDictDataList(SANHAI_COMPANY);
  309 + if(null == dictData || dictData.size()==0){
  310 + throw exception(SANHAI_COMPANY_NOT_EXISTS);
  311 + }
308 312 List<Long> sanHaiRoadId = new ArrayList<>();
309   - sanHaiRoadId.add(115L); // TODO 目前写死
  313 + for(DictDataRespDTO dto:dictData){
  314 + try {
  315 + sanHaiRoadId.add(Long.parseLong(dto.getValue()));
  316 + }catch (Exception e){
  317 + throw exception(SANHAI_COMPANY_NOT_EXISTS);
  318 + }
  319 + }
  320 + //sanHaiRoadId.add(115L); // 目前写死 ,上面改为从字典值获取258
310 321 //是否三海路段
311 322 boolean isSanhai = sanHaiRoadId.contains(companyId);
312 323 return isSanhai;
... ...