Bladeren bron

实现工单配置的接口及数据库改造,还有redis的改造

lijie 4 jaren geleden
bovenliggende
commit
cd0dab615c
57 gewijzigde bestanden met toevoegingen van 3361 en 1774 verwijderingen
  1. 0 5
      fm-sop/pom.xml
  2. 0 120
      fm-sop/src/main/java/com/persagy/fm/sop/constant/SopCommonConst.java
  3. 0 8
      fm-sop/src/main/java/com/persagy/fm/sop/controller/BatchHandleSopController.java
  4. 2 2
      fm-sop/src/main/java/com/persagy/fm/sop/controller/GroupSopController.java
  5. 0 57
      fm-sop/src/main/java/com/persagy/fm/sop/enums/IdPrefixEnum.java
  6. 1 1
      fm-sop/src/main/java/com/persagy/fm/sop/model/dto/ConfirmResultBean.java
  7. 0 5
      fm-sop/src/main/java/com/persagy/fm/sop/model/dto/ConvertClassBean.java
  8. 1 1
      fm-sop/src/main/java/com/persagy/fm/sop/model/dto/CustomInfoPointsBean.java
  9. 1 3
      fm-sop/src/main/java/com/persagy/fm/sop/model/dto/FitObjsBean.java
  10. 1 1
      fm-sop/src/main/java/com/persagy/fm/sop/model/dto/InfoPointsBean.java
  11. 1 4
      fm-sop/src/main/java/com/persagy/fm/sop/model/dto/SopStepsBean.java
  12. 1 2
      fm-sop/src/main/java/com/persagy/fm/sop/model/dto/StepContentBean.java
  13. 1 2
      fm-sop/src/main/java/com/persagy/fm/sop/model/vo/QueryVerifySopNameBaseVo.java
  14. 2 0
      fm-sop/src/main/java/com/persagy/fm/sop/model/vo/SaveSopVo.java
  15. 0 3
      fm-sop/src/main/java/com/persagy/fm/sop/model/vo/VerifySopNameVo.java
  16. 44 40
      fm-sop/src/main/java/com/persagy/fm/sop/service/BaseService.java
  17. 10 9
      fm-sop/src/main/java/com/persagy/fm/sop/service/impl/DictionaryServiceImpl.java
  18. 5 4
      fm-sop/src/main/java/com/persagy/fm/sop/service/impl/InstanceServiceImpl.java
  19. 136 134
      fm-sop/src/main/java/com/persagy/fm/sop/service/impl/ObjectServiceImpl.java
  20. 38 35
      fm-sop/src/main/java/com/persagy/fm/sop/service/impl/ProjectSopServiceImpl.java
  21. 0 5
      fm-sop/src/main/java/com/persagy/fm/sop/service/impl/SopDestroyMsgServiceImpl.java
  22. 0 6
      fm-sop/src/main/java/com/persagy/fm/sop/service/impl/SopReviseMsgServiceImpl.java
  23. 3 1
      fm-sop/src/main/java/com/persagy/fm/sop/service/impl/WoFlowPlanServiceImpl.java
  24. 0 12
      fm-sop/src/main/java/com/persagy/fm/sop/validator/Delete.java
  25. 0 12
      fm-sop/src/main/java/com/persagy/fm/sop/validator/Insert.java
  26. 0 12
      fm-sop/src/main/java/com/persagy/fm/sop/validator/Query.java
  27. 0 12
      fm-sop/src/main/java/com/persagy/fm/sop/validator/Update.java
  28. 1 1
      fm-sop/src/main/java/com/persagy/old/cache/GraphCache.java
  29. 3 2
      fm-sop/src/main/java/com/persagy/old/cache/ProjectCache.java
  30. 0 50
      fm-sop/src/main/java/com/persagy/old/common/CommonMessage.java
  31. 0 88
      fm-sop/src/main/java/com/persagy/old/common/DataRequestPathUtil.java
  32. 0 670
      fm-sop/src/main/java/com/persagy/old/common/DataRequestProcessUtil.java
  33. 2 1
      fm-sop/src/main/java/com/persagy/old/common/DateUtil.java
  34. 3 2
      fm-sop/src/main/java/com/persagy/old/common/JSONUtil.java
  35. 18 9
      fm-workorder/pom.xml
  36. 70 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/cache/OrderTypeCache.java
  37. 10 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/client/SaasClient.java
  38. 1 7
      fm-workorder/src/main/java/com/persagy/fm/workorder/client/SaasFallBackFactory.java
  39. 31 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/config/MybatisConfigure.java
  40. 2 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/constant/FlowPlanConstant.java
  41. 308 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/constant/RedisConstant.java
  42. 30 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/constant/enums/WoFlowPlanStatusEnum.java
  43. 150 176
      fm-workorder/src/main/java/com/persagy/fm/workorder/controller/WoFlowPlanController.java
  44. 2 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/domain/dto/NextRouteBean.java
  45. 1 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/domain/dto/TimeLimitBean.java
  46. 172 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/domain/dto/WoFlowPlanBean.java
  47. 8 6
      fm-workorder/src/main/java/com/persagy/fm/workorder/domain/entity/WoFlowPlan.java
  48. 30 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/domain/vo/BaseQueryFlowPlanVo.java
  49. 1 9
      fm-workorder/src/main/java/com/persagy/fm/workorder/domain/vo/QueryVerifyFlowPlanVo.java
  50. 124 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/domain/vo/WoFlowPlanVo.java
  51. 754 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/service/BaseService.java
  52. 238 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/service/IDictionaryService.java
  53. 83 1
      fm-workorder/src/main/java/com/persagy/fm/workorder/service/IWoFlowPlanService.java
  54. 566 0
      fm-workorder/src/main/java/com/persagy/fm/workorder/service/impl/DictionaryServiceImpl.java
  55. 478 21
      fm-workorder/src/main/java/com/persagy/fm/workorder/service/impl/WoFlowPlanServiceImpl.java
  56. 8 1
      fm-workorder/src/main/resources/bootstrap.yml
  57. 20 234
      fm-workorder/src/main/resources/db/schema.sql

+ 0 - 5
fm-sop/pom.xml

@@ -90,11 +90,6 @@
             </exclusions>
         </dependency>
         <dependency>
-            <groupId>com.persagy</groupId>
-            <artifactId>fm-common</artifactId>
-            <version>3.0.1</version>
-        </dependency>
-        <dependency>
             <groupId>org.apache.velocity</groupId>
             <artifactId>velocity-engine-core</artifactId>
             <version>2.3</version>

+ 0 - 120
fm-sop/src/main/java/com/persagy/fm/sop/constant/SopCommonConst.java

@@ -36,126 +36,6 @@ public class SopCommonConst {
     /**SOP版本描述*/
     public final static String VERSION_EXPLAIN_CREATE = "发布标准操作";
 
-    //通用sop的项目ID(默认)
-    public final static String group_sop_id = "group_sop_id";
-    //时间格式-显示
-    public final static String date_format_show = "yyyy-MM-dd HH:mm:ss";
-    //时间格式-存储
-    public final static String date_format_save = "yyyyMMddHHmmss";
-
-    //数据字典类型-专业、系统大类、设备大类
-    public final static String dict_type_object_domain = "domain_require";
-    //数据字典类型-信息点
-    public final static String dict_type_info_point = "info_point";
-
-    //字段名称-数据平台
-    public final static String info_name_datas = "infos";
-    //字段名称-本地名称-项目
-    public final static String info_name_local_name_project = "ProjLocalName";
-    //字段名称-本地名称-项目
-    public final static String info_name_local_id_project = "ProjLocalID";
-    //字段名称-本地名称-建筑
-    public final static String info_name_local_name_build = "BuildLocalName";
-    //字段名称-本地编码-建筑
-    public final static String info_name_local_id_build = "BuildLocalID";
-    //字段名称-本地名称-楼层
-    public final static String info_name_local_name_floor = "FloorLocalName";
-    //字段名称-本地编码-楼层
-    public final static String info_name_local_id_floor = "FloorLocalID";
-    //字段名称-本地编码-竖井
-    public final static String info_name_local_id_shaft = "ShaftLocalID";
-    //字段名称-本地编码-竖井
-    public final static String info_name_local_name_shaft = "ShaftLocalName";
-    //字段名称-本地名称-空间
-    public final static String info_name_local_name_space = "RoomLocalName";
-    //字段名称-本地编码-空间
-    public final static String info_name_local_id_space = "RoomLocalID";
-    //字段名称-本地名称-系统
-    public final static String info_name_local_name_system = "SysLocalName";
-    //字段名称-本地编码-系统
-    public final static String info_name_local_id_system = "SysLocalID";
-    //字段名称-本地名称-设备
-    public final static String info_name_local_name_equip = "EquipLocalName";
-    //字段名称-本地编码-设备
-    public final static String info_name_local_id_equip = "EquipLocalID";
-    //字段名称-信息点-code
-    public final static String info_name_info_point_code = "infoPointCode";
-    //字段名称-信息点-name
-    public final static String info_name_info_point_name = "infoPointName";
-    //字段名称-信息点-输入方式(原始组件)
-    public final static String info_name_info_point_baseCmpt = "inputMode";
-
-    //关系-关联code
-    public final static String relation_from_id = "from_id";
-    //关系-被关联code
-    public final static String relation_to_id = "to_id";
-
-    //图类型-设备所在空间
-    public final static String graph_type_equip_in_space = "EquipinSpace";
-    //图类型-设备服务空间
-    public final static String graph_type_equip_service_space = "EquipforSpace";
-    //图类型-系统包含设备
-    public final static String graph_type_system_contain_equip = "SystemEquip";
-    //竖井关联的建筑
-    public final static String graph_type_shaft_and_building = "ShaftandBuilding";
-
-    //关系类型-设备所在空间
-    public final static String relation_type_equip_in_space = "1";
-    //关系类型-设备服务空间
-    public final static String relation_type_equip_service_space = "1";
-    //关系类型-系统包含设备
-    public final static String relation_type_system_contain_equip = "1";
-
-    //数据类型-建筑
-    public final static String data_type_build = "build";
-    //数据类型-楼层
-    public final static String data_type_floor = "floor";
-    //数据类型-空间
-    public final static String data_type_space = "space";
-    //数据类型-系统
-    public final static String data_type_system = "system";
-    //数据类型-设备
-    public final static String data_type_equip = "equip";
-    //数据类型-系统大类
-    public final static String data_type_system_class = "system_class";
-    //数据类型-设备大类
-    public final static String data_type_equip_class = "equip_class";
-    //数据类型-空间大类
-    public final static String data_type_space_class = "space_class";
-    //数据类型-建筑功能类型
-    public final static String data_type_build_func_type = "build_func_type";
-    //数据类型-楼层类型
-    public final static String data_type_floor_type = "floor_type";
-    //数据类型-竖井功能类型
-    public final static String data_type_shaft_type = "shaft_type";
-    //数据类型-竖井
-    public final static String data_type_shaft = "shaft";
-    //标识-项目
-    public final static String tag_project = "Pj";
-    //标识-建筑
-    public final static String tag_build = "Bd";
-    //标识-楼层
-    public final static String tag_floor = "Fl";
-    //标识-空间
-    public final static String tag_space = "Sp";
-    //标识-设备
-    public final static String tag_equip = "Eq";
-    //标识-系统
-    public final static String tag_system = "Sy";
-    //标识-设备对象
-    public final static String tag_equip_object = "EqObj";
-    //标识-系统对象
-    public final static String tag_system_object = "SyObj";
-    //标识-设备字典-专业
-    public final static String tag_dict_class = "Clazz";
-    //标识-设备字典-系统
-    public final static String tag_dict_sytstem = "System";
-    //标识-设备字典-设备
-    public final static String tag_dict_equip = "Equip";
-    //系统主键
-    public final static String SYSTEM_ID = "systemId";
-
-
     public final static int desc = -1;
     public final static int asc = 1;
 

+ 0 - 8
fm-sop/src/main/java/com/persagy/fm/sop/controller/BatchHandleSopController.java

@@ -1,31 +1,23 @@
 package com.persagy.fm.sop.controller;
 
-import com.persagy.common.exception.BusinessException;
 import com.persagy.fm.common.constant.CommonConstant;
 import com.persagy.fm.common.model.vo.BaseVo;
 import com.persagy.fm.common.utils.FileUtil;
 import com.persagy.fm.sop.aop.BusinessAssert;
-import com.persagy.fm.sop.constant.SopCommonConst;
 import com.persagy.fm.sop.constant.SopQueryConst;
-import com.persagy.fm.sop.model.vo.SaveSopVo;
 import com.persagy.fm.sop.service.IBatchHandleSopService;
-import com.persagy.fm.sop.utils.OldResponseResult;
-import com.persagy.fm.sop.utils.OldResponseResultUtil;
-import com.persagy.fm.sop.validator.Insert;
 import com.persagy.log.core.annotation.IgnoreLog;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 

+ 2 - 2
fm-sop/src/main/java/com/persagy/fm/sop/controller/GroupSopController.java

@@ -5,14 +5,14 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.persagy.common.exception.BusinessException;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.common.old.utils.ToolsUtil;
+import com.persagy.fm.common.validator.Insert;
+import com.persagy.fm.common.validator.Update;
 import com.persagy.fm.sop.model.dto.RefedSopBean;
 import com.persagy.fm.sop.model.dto.SopBean;
 import com.persagy.fm.sop.model.vo.*;
 import com.persagy.fm.sop.service.IGroupSopService;
 import com.persagy.fm.sop.utils.OldResponseResult;
 import com.persagy.fm.sop.utils.OldResponseResultUtil;
-import com.persagy.fm.sop.validator.Insert;
-import com.persagy.fm.sop.validator.Update;
 import com.persagy.fm.sop.service.IObjectService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 0 - 57
fm-sop/src/main/java/com/persagy/fm/sop/enums/IdPrefixEnum.java

@@ -1,57 +0,0 @@
-package com.persagy.fm.sop.enums;
-/***
- * Description: 表ID的前缀枚举类
- * @author : lijie
- * @date :2021/4/1 22:17
- * Update By lijie 2021/4/1 22:17
- */
-public enum IdPrefixEnum {
-    /**sop表ID的前缀*/
-    SOP("SOP","sop表ID的前缀"),
-    /**sop_cell表ID的前缀*/
-    SOP_CELL("SOPSC","sop_cell表ID的前缀"),
-    /**sop_domain_rel表ID的前缀*/
-    SOP_DOMAIN_REL("SDRI","sop_domain_rel表ID的前缀"),
-    /**sop_tool_rel表ID的前缀*/
-    SOP_TOOL_REL("STRI","sop_tool_rel表ID的前缀"),
-    /**sop_media_rel表ID的前缀*/
-    SOP_MEDIA_REL("SMRI","sop_media_rel表ID的前缀"),
-    /**sop_obj_rel表ID的前缀*/
-    SOP_OBJ_REL("SOR","sop_obj_rel表ID的前缀"),
-    /**sop_equip_model_rel表id的前缀*/
-    SOP_EQUIP_MODEL_REL("SEMR","sop_equip_model_rel表ID的前缀"),
-    /**sop_order_type_rel表id的前缀*/
-    SOP_ORDER_TYPE_REL("SOTR","sop_order_type_rel表ID的前缀"),
-    /**sop_label_rel表id的前缀*/
-    SOP_LABEL_REL("SLR","sop_label_rel表ID的前缀"),
-    /**sop_edit表id的前缀*/
-    SOP_EDIT("SE","sop_edit表ID的前缀"),
-    /**sop_his表id的前缀*/
-    SOP_HIS("SH","sop_his表ID的前缀"),
-    /**sop_destroy_msg表id的前缀*/
-    SOP_DESTROY_MSG("SDM","sop_destroy_msg表ID的前缀");
-
-    IdPrefixEnum(String prefix, String describe) {
-        this.prefix = prefix;
-        this.describe = describe;
-    }
-
-    private String prefix;
-    private String describe;
-
-    public String getPrefix() {
-        return prefix;
-    }
-
-    public void setPrefix(String prefix) {
-        this.prefix = prefix;
-    }
-
-    public String getDescribe() {
-        return describe;
-    }
-
-    public void setDescribe(String describe) {
-        this.describe = describe;
-    }
-}

+ 1 - 1
fm-sop/src/main/java/com/persagy/fm/sop/model/dto/ConfirmResultBean.java

@@ -2,7 +2,7 @@ package com.persagy.fm.sop.model.dto;
 
 import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.persagy.fm.sop.validator.Insert;
+import com.persagy.fm.common.validator.Insert;
 import com.persagy.fm.sop.validator.ProjectInsert;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;

+ 0 - 5
fm-sop/src/main/java/com/persagy/fm/sop/model/dto/ConvertClassBean.java

@@ -2,16 +2,11 @@ package com.persagy.fm.sop.model.dto;
 
 import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.persagy.fm.sop.validator.Insert;
-import com.persagy.fm.sop.validator.ProjectInsert;
 import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import javax.validation.constraints.NotBlank;
 import java.util.List;
 
 @Data

+ 1 - 1
fm-sop/src/main/java/com/persagy/fm/sop/model/dto/CustomInfoPointsBean.java

@@ -1,7 +1,7 @@
 package com.persagy.fm.sop.model.dto;
 
 import com.fasterxml.jackson.annotation.JsonAlias;
-import com.persagy.fm.sop.validator.Insert;
+import com.persagy.fm.common.validator.Insert;
 import com.persagy.fm.sop.validator.ProjectInsert;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;

+ 1 - 3
fm-sop/src/main/java/com/persagy/fm/sop/model/dto/FitObjsBean.java

@@ -2,7 +2,7 @@ package com.persagy.fm.sop.model.dto;
 
 import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.persagy.fm.sop.validator.Insert;
+import com.persagy.fm.common.validator.Insert;
 import com.persagy.fm.sop.validator.ProjectInsert;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -11,8 +11,6 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
 import java.util.List;
 
 @Data

+ 1 - 1
fm-sop/src/main/java/com/persagy/fm/sop/model/dto/InfoPointsBean.java

@@ -1,6 +1,6 @@
 package com.persagy.fm.sop.model.dto;
 
-import com.persagy.fm.sop.validator.Insert;
+import com.persagy.fm.common.validator.Insert;
 import com.persagy.fm.sop.validator.ProjectInsert;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;

+ 1 - 4
fm-sop/src/main/java/com/persagy/fm/sop/model/dto/SopStepsBean.java

@@ -2,9 +2,8 @@ package com.persagy.fm.sop.model.dto;
 
 import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.persagy.fm.sop.validator.Insert;
+import com.persagy.fm.common.validator.Insert;
 import com.persagy.fm.sop.validator.ProjectInsert;
-import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -12,8 +11,6 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 

+ 1 - 2
fm-sop/src/main/java/com/persagy/fm/sop/model/dto/StepContentBean.java

@@ -2,7 +2,7 @@ package com.persagy.fm.sop.model.dto;
 
 import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.persagy.fm.sop.validator.Insert;
+import com.persagy.fm.common.validator.Insert;
 import com.persagy.fm.sop.validator.ProjectInsert;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -11,7 +11,6 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 

+ 1 - 2
fm-sop/src/main/java/com/persagy/fm/sop/model/vo/QueryVerifySopNameBaseVo.java

@@ -2,11 +2,10 @@ package com.persagy.fm.sop.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 import com.persagy.fm.common.model.vo.BaseVo;
+import com.persagy.fm.common.validator.Update;
 import com.persagy.fm.sop.validator.ProjectInsert;
 import com.persagy.fm.sop.validator.ProjectUpdate;
-import com.persagy.fm.sop.validator.Update;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 

+ 2 - 0
fm-sop/src/main/java/com/persagy/fm/sop/model/vo/SaveSopVo.java

@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import com.persagy.fm.common.model.vo.BaseVo;
+import com.persagy.fm.common.validator.Insert;
+import com.persagy.fm.common.validator.Update;
 import com.persagy.fm.sop.deserializers.SpecialParamDeserializer;
 import com.persagy.fm.sop.model.dto.*;
 import com.persagy.fm.sop.validator.*;

+ 0 - 3
fm-sop/src/main/java/com/persagy/fm/sop/model/vo/VerifySopNameVo.java

@@ -2,12 +2,9 @@ package com.persagy.fm.sop.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.persagy.fm.sop.validator.Update;
 import lombok.Builder;
 import lombok.Data;
 
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotEmpty;
 /***
  * Description: 校验SOP名称结果
  * @author : lijie

+ 44 - 40
fm-sop/src/main/java/com/persagy/fm/sop/service/BaseService.java

@@ -12,6 +12,10 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.persagy.fm.common.constant.CommonConstant;
+import com.persagy.fm.common.constant.CommonMessage;
+import com.persagy.fm.common.constant.DataRequestPathUtil;
+import com.persagy.fm.common.constant.DataRequestProcessUtil;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.common.old.utils.ToolsUtil;
 import com.persagy.fm.sop.constant.SopCommonConst;
@@ -386,14 +390,14 @@ public class BaseService {
 		objTypeMap = objTypeMap == null ? Maps.newHashMap() : objTypeMap;
 		String ctmObjType = objTypeMap.get(objId);
 		if(!StringUtil.isNull(ctmObjType)){
-		}else if(objType.equals(SopCommonConst.data_type_build)){
+		}else if(objType.equals(CommonConstant.data_type_build)){
 			ctmObjType = "building";
-		}else if(objType.equals(SopCommonConst.data_type_floor)){
+		}else if(objType.equals(CommonConstant.data_type_floor)){
 			ctmObjType = "floor";
-		}else if(objType.equals(SopCommonConst.data_type_space)){
+		}else if(objType.equals(CommonConstant.data_type_space)){
 			ctmObjType = "space";
-		}else if(objType.equals(SopCommonConst.data_type_equip)){
-			String project_id = transferId(objId, SopCommonConst.tag_project, dataPlatBasePath);
+		}else if(objType.equals(CommonConstant.data_type_equip)){
+			String project_id = transferId(objId, CommonConstant.tag_project, dataPlatBasePath);
 			String params = "{\"projectId\":\""+ project_id +"\", \"criterias\":[{\"id\":\""+objId+"\"}]}";
 			String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query);
 //			String resultStr = httpPostRequest(requestUrl, params);
@@ -406,10 +410,10 @@ public class BaseService {
 				relation = relation == null ? new JSONObject() : relation;
 				ctmObjType = relation.getString("equipment_category");
 			}
-		}else if(objType.equals(SopCommonConst.data_type_equip_class)){
+		}else if(objType.equals(CommonConstant.data_type_equip_class)){
 			ctmObjType = objId;
-		}else if(objType.equals(SopCommonConst.data_type_system)){
-			String project_id = transferId(objId, SopCommonConst.tag_project, dataPlatBasePath);
+		}else if(objType.equals(CommonConstant.data_type_system)){
+			String project_id = transferId(objId, CommonConstant.tag_project, dataPlatBasePath);
 			String params = "{\"projectId\":\""+ project_id +"\", \"criterias\":[{\"id\":\""+objId+"\"}]}";
 			String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query);
 //			String resultStr = httpPostRequest(requestUrl, params);
@@ -422,7 +426,7 @@ public class BaseService {
 				relation = relation == null ? new JSONObject() : relation;
 				ctmObjType = relation.getString("equipment_category");
 			}
-		}else if(objType.equals(SopCommonConst.data_type_system_class)){
+		}else if(objType.equals(CommonConstant.data_type_system_class)){
 			ctmObjType = objId;
 		}
 		objTypeMap.put(objId, ctmObjType);
@@ -442,24 +446,24 @@ public class BaseService {
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
-		Map<String, String> map = new HashMap<String, String>();
-		if(id.startsWith(SopCommonConst.tag_project)){
-
-		}else if(id.startsWith(SopCommonConst.tag_build)){
-			map.put(SopCommonConst.tag_project, SopCommonConst.tag_project+ id.substring(2, 12));
-		}else if(id.startsWith(SopCommonConst.tag_floor)){
-			map.put(SopCommonConst.tag_project, SopCommonConst.tag_project+ id.substring(2, 12));
-			map.put(SopCommonConst.tag_build, parentIdMap.get("building"));
-		}else if(id.startsWith(SopCommonConst.tag_space)){
-			map.put(SopCommonConst.tag_project, SopCommonConst.tag_project+ id.substring(2, 12));
-			map.put(SopCommonConst.tag_build, parentIdMap.get("building"));
-			map.put(SopCommonConst.tag_floor, parentIdMap.get("floor"));
-		}else if(id.startsWith(SopCommonConst.tag_equip)){
-			map.put(SopCommonConst.tag_project, SopCommonConst.tag_project+ id.substring(2, 12));
-			map.put(SopCommonConst.tag_build, parentIdMap.get("building"));
-		}else if(id.startsWith(SopCommonConst.tag_system)){
-			map.put(SopCommonConst.tag_project, SopCommonConst.tag_project+ id.substring(2, 12));
-			map.put(SopCommonConst.tag_build, parentIdMap.get("building"));
+		Map<String, String> map = new HashMap<>();
+		if(id.startsWith(CommonConstant.tag_project)){
+
+		}else if(id.startsWith(CommonConstant.tag_build)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+		}else if(id.startsWith(CommonConstant.tag_floor)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+			map.put(CommonConstant.tag_build, parentIdMap.get("building"));
+		}else if(id.startsWith(CommonConstant.tag_space)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+			map.put(CommonConstant.tag_build, parentIdMap.get("building"));
+			map.put(CommonConstant.tag_floor, parentIdMap.get("floor"));
+		}else if(id.startsWith(CommonConstant.tag_equip)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+			map.put(CommonConstant.tag_build, parentIdMap.get("building"));
+		}else if(id.startsWith(CommonConstant.tag_system)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+			map.put(CommonConstant.tag_build, parentIdMap.get("building"));
 		}
 		return map.get(taget);
 	}
@@ -550,12 +554,12 @@ public class BaseService {
 			e.printStackTrace();
 		}
 		String category = parentCategoryMap.get("category");
-		if (id.startsWith(SopCommonConst.tag_equip)) {
-			map.put(SopCommonConst.tag_dict_class, category == null || category.length()<6 ? null : category.substring(0, 2));
-			map.put(SopCommonConst.tag_dict_equip, category == null || category.length()<6  ? null : category.substring(2, 6));
-		} else if (id.startsWith(SopCommonConst.tag_system)) {
-			map.put(SopCommonConst.tag_dict_class, category == null || category.length()<4 ? null : category.substring(0, 2));
-			map.put(SopCommonConst.tag_dict_sytstem, category == null || category.length()<4  ? null : category.substring(2, 4));
+		if (id.startsWith(CommonConstant.tag_equip)) {
+			map.put(CommonConstant.tag_dict_class, category == null || category.length()<6 ? null : category.substring(0, 2));
+			map.put(CommonConstant.tag_dict_equip, category == null || category.length()<6  ? null : category.substring(2, 6));
+		} else if (id.startsWith(CommonConstant.tag_system)) {
+			map.put(CommonConstant.tag_dict_class, category == null || category.length()<4 ? null : category.substring(0, 2));
+			map.put(CommonConstant.tag_dict_sytstem, category == null || category.length()<4  ? null : category.substring(2, 4));
 		}
 		return map.get(taget);
 	}
@@ -624,19 +628,19 @@ public class BaseService {
 	 */
 	public String getObjTypeForInfoId(String objType) throws Exception {
 		String ctmObjType = null;
-		if(objType.equals(SopCommonConst.data_type_build)){
+		if(objType.equals(CommonConstant.data_type_build)){
 			ctmObjType = "build";
-		}else if(objType.equals(SopCommonConst.data_type_floor)){
+		}else if(objType.equals(CommonConstant.data_type_floor)){
 			ctmObjType = "floor";
-		}else if(objType.equals(SopCommonConst.data_type_space)){
+		}else if(objType.equals(CommonConstant.data_type_space)){
 			ctmObjType = "space";
-		}else if(objType.equals(SopCommonConst.data_type_equip)){
+		}else if(objType.equals(CommonConstant.data_type_equip)){
 			ctmObjType = "equip";
-		}else if(objType.equals(SopCommonConst.data_type_equip_class)){
+		}else if(objType.equals(CommonConstant.data_type_equip_class)){
 			ctmObjType = "equip";
-		}else if(objType.equals(SopCommonConst.data_type_system)){
+		}else if(objType.equals(CommonConstant.data_type_system)){
 			ctmObjType = "system";
-		}else if(objType.equals(SopCommonConst.data_type_system_class)){
+		}else if(objType.equals(CommonConstant.data_type_system_class)){
 			ctmObjType = "system";
 		}
 		return ctmObjType;

+ 10 - 9
fm-sop/src/main/java/com/persagy/fm/sop/service/impl/DictionaryServiceImpl.java

@@ -2,10 +2,11 @@ package com.persagy.fm.sop.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.persagy.fm.common.constant.CommonConstant;
+import com.persagy.fm.common.constant.DataRequestPathUtil;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.sop.constant.SopCommonConst;
 import com.persagy.old.cache.DictionaryCache;
-import com.persagy.old.common.DataRequestPathUtil;
 import com.persagy.old.common.JSONUtil;
 import com.persagy.old.dao.DBCommonMethods;
 import com.persagy.old.dao.DBConst;
@@ -103,7 +104,7 @@ public class DictionaryServiceImpl extends BaseService implements IDictionarySer
 	 */
 	@Override
 	public Map<String, String> queryAllClimateAreaCode() throws Exception {
-		Map<String, String> climateMap = new HashMap<String, String>();
+		Map<String, String> climateMap = new HashMap<>();
 		String requestURL = this.getDataPlatDictPath(DataRequestPathUtil.dataPlat_dict_query ,"climate");
 //		String resultStr = this.httpGetRequest(requestURL);
 		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
@@ -133,7 +134,7 @@ public class DictionaryServiceImpl extends BaseService implements IDictionarySer
 	 */
 	@Override
 	public Map<String, String> queryAllDevelopmentLevelCode() throws Exception {
-		Map<String, String> developMap = new HashMap<String, String>();
+		Map<String, String> developMap = new HashMap<>();
 		String requestURL = this.getDataPlatDictPath(DataRequestPathUtil.dataPlat_dict_query ,"develop");
 //		String resultStr = this.httpGetRequest(requestURL);
 		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
@@ -177,7 +178,7 @@ public class DictionaryServiceImpl extends BaseService implements IDictionarySer
 	 */
 	@Override
 	public Map<String, String> queryAllWeatherStatusCode() throws Exception {
-		Map<String, String> weatherMap = new HashMap<String, String>();
+		Map<String, String> weatherMap = new HashMap<>();
 		String requestURL = this.getDataPlatDictPath(DataRequestPathUtil.dataPlat_dict_query ,"weather");
 //		String resultStr = this.httpGetRequest(requestURL);
 		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
@@ -200,7 +201,7 @@ public class DictionaryServiceImpl extends BaseService implements IDictionarySer
 	 */
 	@Override
 	public Map<String, String> queryAllWindLevelCode() throws Exception {
-		Map<String, String> windMap = new HashMap<String, String>();
+		Map<String, String> windMap = new HashMap<>();
 		String requestURL = this.getDataPlatDictPath(DataRequestPathUtil.dataPlat_dict_query ,"wind");
 //		String resultStr = this.httpGetRequest(requestURL);
 		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
@@ -223,7 +224,7 @@ public class DictionaryServiceImpl extends BaseService implements IDictionarySer
 	 */
 	@Override
 	public Map<String, String> queryAllDirectionCode() throws Exception {
-		Map<String, String> directionMap = new HashMap<String, String>();
+		Map<String, String> directionMap = new HashMap<>();
 		String requestURL = this.getDataPlatDictPath(DataRequestPathUtil.dataPlat_dict_query ,"direction");
 //		String resultStr = this.httpGetRequest(requestURL);
 		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
@@ -260,7 +261,7 @@ public class DictionaryServiceImpl extends BaseService implements IDictionarySer
 	 */
 	@Override
 	public Map<String, String> queryAllBuildingCode() throws Exception {
-		Map<String, String> buildingMap = new HashMap<String, String>();
+		Map<String, String> buildingMap = new HashMap<>();
 		String requestURL = this.getDataPlatDictPath(DataRequestPathUtil.dataPlat_dict_query ,"building");
 //		String resultStr = this.httpGetRequest(requestURL);
 		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
@@ -296,7 +297,7 @@ public class DictionaryServiceImpl extends BaseService implements IDictionarySer
 	 */
 	@Override
 	public Map<String, String> queryAllSpaceCode() throws Exception {
-		Map<String, String> spaceMap = new HashMap<String, String>();
+		Map<String, String> spaceMap = new HashMap<>();
 		String requestURL = this.getDataPlatDictPath(DataRequestPathUtil.dataPlat_dict_query ,"space");
 //		String resultStr = this.httpGetRequest(requestURL);
 		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
@@ -438,7 +439,7 @@ public class DictionaryServiceImpl extends BaseService implements IDictionarySer
 			JSONObject resultProfession = new JSONObject();
 			resultProfession.put("code", professionCode);
 			if(!StringUtil.isNull(projectId)){
-				resultProfession.put("name", dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, professionCode));
+				resultProfession.put("name", dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, professionCode));
 			}else{
 				resultProfession.put("name", professionName);
 			}

+ 5 - 4
fm-sop/src/main/java/com/persagy/fm/sop/service/impl/InstanceServiceImpl.java

@@ -2,6 +2,7 @@ package com.persagy.fm.sop.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.persagy.fm.common.constant.CommonConstant;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.sop.constant.SopCommonConst;
 import com.persagy.fm.sop.service.IInstanceService;
@@ -50,7 +51,7 @@ public class InstanceServiceImpl extends BaseService implements IInstanceService
 			objId = clazz.getString("obj_id");
 			objType = clazz.getString("obj_type");
 			containScopeFlag = false;
-			if (SopCommonConst.data_type_equip_class.equals(objType) && !StringUtil.isEmptyList(clazz, "space_scope")) {
+			if (CommonConstant.data_type_equip_class.equals(objType) && !StringUtil.isEmptyList(clazz, "space_scope")) {
 				JSONObject spaceClazz = clazz.getJSONArray("space_scope").getJSONObject(0);
 				containScopeFlag = true;
 				objId = spaceClazz.getString("obj_id");
@@ -118,7 +119,7 @@ public class InstanceServiceImpl extends BaseService implements IInstanceService
 			id2equip.put(equip.getString("obj_id"), equip);
 		}
 		//======获取空间内的所有设备===
-		String graphId = graphCache.getGraphIdByProjectIdAndGraph(projectId, SopCommonConst.graph_type_equip_in_space);
+		String graphId = graphCache.getGraphIdByProjectIdAndGraph(projectId, CommonConstant.graph_type_equip_in_space);
 		for (Object object : spaceObjs) {
 			space = (JSONObject) object;
 			spaceId = space.getString("obj_id");
@@ -142,9 +143,9 @@ public class InstanceServiceImpl extends BaseService implements IInstanceService
 	}
 
 	private JSONArray querySpaceOrEquipByType(String projectId, String id , String type) throws Exception {
-		if (SopCommonConst.data_type_equip_class.equals(type)) {
+		if (CommonConstant.data_type_equip_class.equals(type)) {
 			return objectService.queryEquipByType(projectId, id);
-		}else if (SopCommonConst.data_type_space_class.equals(type)) {
+		}else if (CommonConstant.data_type_space_class.equals(type)) {
 			return objectService.querySpaceByType(projectId, id);
 		}
 		return new JSONArray();

+ 136 - 134
fm-sop/src/main/java/com/persagy/fm/sop/service/impl/ObjectServiceImpl.java

@@ -8,6 +8,10 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.google.common.collect.Maps;
 import com.persagy.common.exception.BusinessException;
+import com.persagy.fm.common.constant.CommonConstant;
+import com.persagy.fm.common.constant.CommonMessage;
+import com.persagy.fm.common.constant.DataRequestPathUtil;
+import com.persagy.fm.common.constant.DataRequestProcessUtil;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.common.old.utils.ToolsUtil;
 import com.persagy.fm.sop.constant.SopCommonConst;
@@ -102,7 +106,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                  * 若获取项目下字典名称为空,name使用数据平台的数据
                  * update by yuecaipu on 2018-5-9 18:15
                  */
-                objName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, object.getString("obj_id"));
+                objName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, object.getString("obj_id"));
                 objName = objName == null ? result.getString("eqName"):objName;
                 object.put("obj_name", objName);
                 object.put("obj_code", result.getString("eq"));
@@ -198,7 +202,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 			JSONObject spaceClassJson = JSONObject.parseObject(spaceClass);
 			if (DBConst.Result.SUCCESS.equals(spaceClassJson.getString(DBConst.Result.RESULT))) {
 				JSONArray content = spaceClassJson.getJSONArray(DBConst.Result.CONTENT);
-				filterObjByKeyWords(keyWords, objects, content, SopCommonConst.data_type_space_class);
+				filterObjByKeyWords(keyWords, objects, content, CommonConstant.data_type_space_class);
 			}
 		}
 		// 3.搜索 build_func_type-建筑功能类型
@@ -245,8 +249,6 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 			}
 		}
 		if (!criterias.isEmpty()) {
-//			String projectId = StringUtil.transferId(criterias.getJSONObject(0).getString("id"), SopCommonConst.tag_project);		
-//			String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query_post, projectId, null);
 			String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query_post);
 			JSONObject params = new JSONObject();
 			params.put("projectId", projectId);
@@ -312,7 +314,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 	@Override
     public String searchObjectClass(String jsonStr) throws Exception {
     	JSONObject jsonObject = JSONObject.parseObject(jsonStr);
-    	String projectId = SopCommonConst.group_sop_id;
+    	String projectId = SopCommonConst.GROUP_SOP_ID;
     	String keyWord = jsonObject.getString("keyword");
     	keyWord = keyWord == null ? "" : keyWord;
     	String[] keyWords = keyWord.split(" +");
@@ -740,8 +742,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         String buildStr = httpPostRequestDataPlatform(url, "{\"projectId\":\"" + projectId + "\",\"criteria\":{\"type\":[\"Bd\"]}}");
         JSONObject buildJson = JSONObject.parseObject(buildStr);
         if("success".equals(buildJson.getString("Result"))){
-        	Map<String, String> idLocalNameMap = getObjectIdNameMap(buildJson, SopCommonConst.info_name_local_name_build);
-        	Map<String, String> idLocalIdMap = getObjectIdNameMap(buildJson, SopCommonConst.info_name_local_id_build);
+        	Map<String, String> idLocalNameMap = getObjectIdNameMap(buildJson, CommonConstant.info_name_local_name_build);
+        	Map<String, String> idLocalIdMap = getObjectIdNameMap(buildJson, CommonConstant.info_name_local_id_build);
         	JSONArray builds = new JSONArray();
         	JSONObject build;
         	//for(String id : idLocalNameMap.keySet()){
@@ -760,7 +762,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 //                buildItem = buildArray.getJSONObject(i);
 //                build = new JSONObject();
 //                build.put("obj_id", buildItem.getString("id"));
-//                build.put("obj_name", buildItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_build));
+//                build.put("obj_name", buildItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_build));
 //                builds.add(build);
 //            }
             buildStr = ToolsUtil.successJsonMsg(builds);
@@ -818,16 +820,16 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     floor = new JSONObject();
                     floorId = floorItem.getString("id");
                     floor.put("obj_id", floorId);
-                    floor.put("obj_name", floorItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_floor));
-                    floor.put("obj_code", floorItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_id_floor));
-					//buildId = StringUtil.transferId(floorId, SopCommonConst.tag_build);
+                    floor.put("obj_name", floorItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_floor));
+                    floor.put("obj_code", floorItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_id_floor));
+					//buildId = StringUtil.transferId(floorId, CommonConstant.tag_build);
                     buildId = floorId_location.get(floorId) == null ? null : floorId_location.get(floorId).getString("building");
 					floorList = floorMap.getOrDefault(buildId, new JSONArray());
                     floorList.add(floor);
                     floorMap.put(buildId, floorList);
                 }
                 //遍历建筑 {"buildingId":"buildingName"}
-                Map<String, String> map = getObjectIdNameMap(buildJson, SopCommonConst.info_name_local_name_build);
+                Map<String, String> map = getObjectIdNameMap(buildJson, CommonConstant.info_name_local_name_build);
             	builds = new JSONArray();
             	//for(String id : map.keySet()){
                 String id;
@@ -874,10 +876,10 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         String buildUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query);
         String floorParamStr, buildParamStr, spaceStr, floorStr, buildStr;
         String floorUrl, spaceParmaStr = "{\"projectId\":\"" + projectId + "\",\"criteria\":{\"id\":\""+objId+"\",\"type\":[\"Sp\"]}}";
-        if(SopCommonConst.data_type_floor.equals(objType)){
+        if(CommonConstant.data_type_floor.equals(objType)){
 //            floorUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query, projectId, projectCache.getProjectSecretById(projectId));
             floorUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query);
-            String buildId = transferId(objId, SopCommonConst.tag_build, dataPlatBasePath);
+            String buildId = transferId(objId, CommonConstant.tag_build, dataPlatBasePath);
             buildParamStr = "{\"projectId\":\"" + projectId + "\",\"criterias\":[{\"id\":\""+buildId+"\"}]}";
             floorParamStr = "{\"projectId\":\"" + projectId + "\",\"criterias\":[{\"id\":\""+objId+"\"}]}";
         }else{
@@ -904,7 +906,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         if("success".equals(spaceJson.getString("Result")) && "success".equals(floorJson.getString("Result")) && "success".equals(buildJson.getString("Result"))){
             //定义缓存Map
             //key:buildId value:build
-            Map<String, String> buildMap = new HashMap<String, String>();
+            Map<String, String> buildMap = new HashMap<>();
             //key:floorId value:floor
             Map<String, String> floorMap = new HashMap<String, String>();
             //定义变量
@@ -915,13 +917,13 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
             buildArray = buildJson.getJSONArray("Content");
             for(int i=0; i<buildArray.size(); i++){
                 buildItem = buildArray.getJSONObject(i);
-                buildMap.put(buildItem.getString("id"), buildItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_build));
+                buildMap.put(buildItem.getString("id"), buildItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_build));
             }
             //处理楼层数据
             floorArray = floorJson.getJSONArray("Content");
             for(int i=0; i<floorArray.size(); i++){
                 floorItem = floorArray.getJSONObject(i);
-                floorMap.put(floorItem.getString("id"), floorItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_floor));
+                floorMap.put(floorItem.getString("id"), floorItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_floor));
             }
             //处理空间数据
             spaceArray = spaceJson.getJSONArray("Content");
@@ -939,8 +941,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 space = new JSONObject();
                 spaceId = spaceItem.getString("id");
                 if(needBack){
-                    //floorId = StringUtil.transferId(spaceId, SopCommonConst.tag_floor);
-                    //buildId = StringUtil.transferId(spaceId, SopCommonConst.tag_build);
+                    //floorId = StringUtil.transferId(spaceId, CommonConstant.tag_floor);
+                    //buildId = StringUtil.transferId(spaceId, CommonConstant.tag_build);
                 	floorId = spaceId_location.get(spaceId) == null ? null : spaceId_location.get(spaceId).getString("floor");
                 	buildId = spaceId_location.get(spaceId) == null ? null : spaceId_location.get(spaceId).getString("building");		
                     if(floorMap.containsKey(floorId)){
@@ -951,8 +953,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     space.put("parents", JSONArray.parseArray(parentStr));
                 }
                 space.put("obj_id", spaceId);
-                space.put("obj_name", spaceItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_space));
-                space.put("obj_code", spaceItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_id_space));
+                space.put("obj_name", spaceItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_space));
+                space.put("obj_code", spaceItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_id_space));
                 spaces.add(space);
             }
             resultStr = ToolsUtil.successJsonMsg(spaces);
@@ -1018,12 +1020,12 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 systemItem = systemArray.getJSONObject(i);
                 system = new JSONObject();
                 systemId = systemItem.getString("id");
-                systemName = systemItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_system);
+                systemName = systemItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_system);
                 String category = systemItem.getString("category");
                 systemClass = category == null || category.length() < 2 ? null : category.substring(0, 2);
                 system.put("obj_id", systemId);
                 system.put("obj_name", systemName);
-                system.put("obj_code", systemItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_id_system));
+                system.put("obj_code", systemItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_id_system));
                 //位置信息(所属建筑)
                 system.put("location", systemItem.getJSONObject("location"));
                 systemList = systemMap.getOrDefault(systemClass, new ArrayList<String>());
@@ -1034,7 +1036,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
             buildArray = buildJson.getJSONArray("Content");
             for(int i=0; i<buildArray.size(); i++){
                 buildItem = buildArray.getJSONObject(i);
-                buildMap.put(buildItem.getString("id"), buildItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_build));
+                buildMap.put(buildItem.getString("id"), buildItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_build));
             }
             //处理数据字典
             dictArray = dictJson.getJSONArray("Content");
@@ -1061,7 +1063,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 for(String systemObj : systemList){
                     system = JSONObject.parseObject(systemObj);
                     systemId = system.getString("obj_id");
-                    //buildId = StringUtil.transferId(systemId, SopCommonConst.tag_build);
+                    //buildId = StringUtil.transferId(systemId, CommonConstant.tag_build);
                     buildId = systemId_location.get(systemId) == null ? null : systemId_location.get(systemId).getString("building");
                     buildName = buildMap.get(buildId);
                     if(needBack){
@@ -1108,7 +1110,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 systemItem = systemArray.getJSONObject(i);
                 system = new JSONObject();
                 system.put("system_id", systemItem.getString("id"));
-                system.put("system_name", systemItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_system));
+                system.put("system_name", systemItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_system));
                 systems.add(system);
             }
             resultStr = ToolsUtil.successJsonMsg(systems);
@@ -1152,9 +1154,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 			for(int i = 0; i < objectArray.size(); i++) {
 				JSONObject queryContent= objectArray.getJSONObject(i);
 				String obj_id = queryContent.getString("id");
-				if(obj_id.startsWith(SopCommonConst.tag_floor)) {
+				if(obj_id.startsWith(CommonConstant.tag_floor)) {
 					floorIdInContents.add(obj_id);
-				}else if(obj_id.startsWith(SopCommonConst.tag_space)) {
+				}else if(obj_id.startsWith(CommonConstant.tag_space)) {
 					spaceIdInContents.add(obj_id);
 				}
 			}
@@ -1168,26 +1170,26 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
             for(int i=0; i<objectArray.size(); i++){
                 objectItem = objectArray.getJSONObject(i);
                 objectId = objectItem.getString("id");
-                floor_sequence_id = objectItem.getJSONObject(SopCommonConst.info_name_datas).getString("FloorSequenceID");
-                if(objectId.startsWith(SopCommonConst.tag_build)){
+                floor_sequence_id = objectItem.getJSONObject(CommonConstant.info_name_datas).getString("FloorSequenceID");
+                if(objectId.startsWith(CommonConstant.tag_build)){
                     //建筑
-                    buildMap.put(objectId, objectItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_build));
-                }else if(objectId.startsWith(SopCommonConst.tag_floor)){
+                    buildMap.put(objectId, objectItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_build));
+                }else if(objectId.startsWith(CommonConstant.tag_floor)){
                     //楼层
-                    //buildId = StringUtil.transferId(objectId, SopCommonConst.tag_build);
+                    //buildId = StringUtil.transferId(objectId, CommonConstant.tag_build);
                 	buildId = floorId_location.get(objectId) == null ? null : floorId_location.get(objectId).get("building");
                     mapValues = relBuildStepObjectMap.get(buildId);
                     mapValues = mapValues == null ? new JSONArray() : mapValues;
                     mapValues.add(objectId);
                     relBuildStepObjectMap.put(buildId, mapValues);
-                    floorMap.put(objectId, objectItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_floor));
+                    floorMap.put(objectId, objectItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_floor));
                     floorSequenceMap.put(objectId, floor_sequence_id);
-                }else if(objectId.startsWith(SopCommonConst.tag_space)){
+                }else if(objectId.startsWith(CommonConstant.tag_space)){
                     //空间
-                    //floorId = StringUtil.transferId(objectId, SopCommonConst.tag_floor);
+                    //floorId = StringUtil.transferId(objectId, CommonConstant.tag_floor);
                 	floorId = spaceId_location.get(objectId) == null ? null : spaceId_location.get(objectId).get("floor");
                     if(null != floorId && floorId.endsWith("000")){
-                        //buildId = StringUtil.transferId(objectId, SopCommonConst.tag_build);
+                        //buildId = StringUtil.transferId(objectId, CommonConstant.tag_build);
                     	buildId = spaceId_location.get(objectId) == null ? null : spaceId_location.get(objectId).get("building");
                         mapValues = relBuildStepObjectMap.get(buildId);
                         mapValues = mapValues == null ? new JSONArray() : mapValues;
@@ -1199,7 +1201,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                         mapValues.add(objectId);
                         relFloorSpaceMap.put(floorId, mapValues);
                     }
-                    spaceMap.put(objectId, objectItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_space));
+                    spaceMap.put(objectId, objectItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_space));
                 }
             }
             String stepObjectId, spaceId;
@@ -1215,7 +1217,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 for(int i=0; i<relStepObjects.size(); i++){
                     stepObjectId = relStepObjects.getString(i);
                     buildStepObject = new JSONObject();
-                    if(stepObjectId.startsWith(SopCommonConst.tag_floor)){
+                    if(stepObjectId.startsWith(CommonConstant.tag_floor)){
                         //楼层
                         spaces = new JSONArray();
                         relSpaces = relFloorSpaceMap.getOrDefault(stepObjectId, new JSONArray());
@@ -1382,13 +1384,13 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         // 查询关系请求参数对象
         params.clear();
         // 项目下的 设备-空间  图实例id
-        String graphIdOfEquipAndSPace = graphCache.getGraphIdByProjectIdAndGraph(projectId, SopCommonConst.graph_type_equip_in_space);
+        String graphIdOfEquipAndSPace = graphCache.getGraphIdByProjectIdAndGraph(projectId, CommonConstant.graph_type_equip_in_space);
         
         if(!StringUtil.isNull(graphIdOfEquipAndSPace)) {
         	if(needBackParents) {
         		criteria.clear();
         		criteria.put("graph_id", graphIdOfEquipAndSPace);
-        		criteria.put("rel_type", SopCommonConst.relation_type_equip_in_space);
+        		criteria.put("rel_type", CommonConstant.relation_type_equip_in_space);
         		if(!StringUtil.isNull(spaceId)){
         			criteria.put("to_id", spaceId);
         		}
@@ -1399,12 +1401,12 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         		
         		if(resultStr.contains("success")){
         			// resultStr 设备与空间关系查询的结果集
-        			eqid_spid_map = getRelationMap(resultStr, SopCommonConst.relation_from_id, SopCommonConst.relation_to_id);
+        			eqid_spid_map = getRelationMap(resultStr, CommonConstant.relation_from_id, CommonConstant.relation_to_id);
         		}
         	}else if(!StringUtil.isNull(spaceId)) {
         		criteria.clear();
         		criteria.put("graph_id", graphIdOfEquipAndSPace);
-        		criteria.put("rel_type", SopCommonConst.relation_type_equip_in_space);
+        		criteria.put("rel_type", CommonConstant.relation_type_equip_in_space);
         		criteria.put("to_id", spaceId);
         		params.put("criteria", criteria);
         		params.put("projectId", projectId);
@@ -1413,7 +1415,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         		
         		if(resultStr.contains("success")){
         			// resultStr 设备与空间关系查询的结果集
-        			eqid_spid_map = getRelationMap(resultStr, SopCommonConst.relation_from_id, SopCommonConst.relation_to_id);
+        			eqid_spid_map = getRelationMap(resultStr, CommonConstant.relation_from_id, CommonConstant.relation_to_id);
         		}
         	}
         }
@@ -1424,12 +1426,12 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         Map<String, String> eqid_syid_map = new HashMap<>();
         // ------------------- 查询设备和系统关系 start---------------------- //
         //项目下的设备-系统图实例id
-        String graphIdOfEquipAndSystem = graphCache.getGraphIdByProjectIdAndGraph(projectId, SopCommonConst.graph_type_system_contain_equip);
+        String graphIdOfEquipAndSystem = graphCache.getGraphIdByProjectIdAndGraph(projectId, CommonConstant.graph_type_system_contain_equip);
         if(!StringUtil.isNull(graphIdOfEquipAndSystem)){
         	if(needBackParents) {
         		criteria.clear();
         		criteria.put("graph_id", graphIdOfEquipAndSystem);
-        		criteria.put("rel_type", SopCommonConst.relation_type_system_contain_equip);
+        		criteria.put("rel_type", CommonConstant.relation_type_system_contain_equip);
         		if(!StringUtil.isNull(systemId)){
         			criteria.put("from_id", systemId);
         		}
@@ -1441,12 +1443,12 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         		
         		if(resultStr.contains("success")){
         			// resultStr 设备与系统关系查询的结果集
-        			eqid_syid_map = getRelationMap(resultStr, SopCommonConst.relation_to_id, SopCommonConst.relation_from_id);
+        			eqid_syid_map = getRelationMap(resultStr, CommonConstant.relation_to_id, CommonConstant.relation_from_id);
         		}
         	}else if(!StringUtil.isNull(systemId)) {
         		criteria.clear();
         		criteria.put("graph_id", graphIdOfEquipAndSystem);
-        		criteria.put("rel_type", SopCommonConst.relation_type_system_contain_equip);
+        		criteria.put("rel_type", CommonConstant.relation_type_system_contain_equip);
     			criteria.put("from_id", systemId);
         		params.clear();
         		params.put("criteria", criteria);
@@ -1456,7 +1458,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         		
         		if(resultStr.contains("success")){
         			// resultStr 设备与系统关系查询的结果集
-        			eqid_syid_map = getRelationMap(resultStr, SopCommonConst.relation_to_id, SopCommonConst.relation_from_id);
+        			eqid_syid_map = getRelationMap(resultStr, CommonConstant.relation_to_id, CommonConstant.relation_from_id);
         		}
         	}
         }
@@ -1581,7 +1583,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 relSystemName = objectIdNameMap.get(relSystemId);
                 // 专业编码
                 domainId = syid_domaincode_map.get(relSystemId);
-                domainName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, domainId);
+                domainName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, domainId);
 				if (domainId != null) {
 					parentIds.add(domainId);
 				}
@@ -1606,8 +1608,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 equip.put("parents", parents);
             }
             equip.put("obj_id", equipId);
-            equip.put("obj_name", equipItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_equip));
-            equip.put("obj_code", equipItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_id_equip));
+            equip.put("obj_name", equipItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_equip));
+            equip.put("obj_code", equipItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_id_equip));
             equips.add(equip);
         }
         resultStr = ToolsUtil.successJsonMsg(equips);
@@ -1737,7 +1739,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 info = new JSONObject();
                 parents = new JSONArray();
                 infoType = infoItem.getString("type");
-                if(SopCommonConst.tag_equip.equals(infoType)){
+                if(CommonConstant.tag_equip.equals(infoType)){
                     //设备大类信息点
                     parents = new JSONArray();
                     infoPoint = new JSONObject();
@@ -1746,7 +1748,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     parentIds = new JSONArray();
                     parentNames = new JSONArray();
                     parentId = infoItem.getString("major");
-                    parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
+                    parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
                     if(!StringUtil.isNull(parentId, parentName)) {
                         parentIds.add(parentId);
                         parentNames.add(parentName);
@@ -1770,7 +1772,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     info.put("obj_type", "equip_class");
                     info.put("parents", parents);
                     info.put("info_point", infoPoint);
-                }else if(SopCommonConst.tag_system.equals(infoType)){
+                }else if(CommonConstant.tag_system.equals(infoType)){
                     //系统大类信息点
                     parents = new JSONArray();
                     infoPoint = new JSONObject();
@@ -1779,7 +1781,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     parentIds = new JSONArray();
                     parentNames = new JSONArray();
                     parentId = infoItem.getString("major");
-                    parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
+                    parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
                     if(!StringUtil.isNull(parentId, parentName)) {
                         parentIds.add(parentId);
                         parentNames.add(parentName);
@@ -1797,7 +1799,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     info.put("obj_type", "system_class");
                     info.put("parents", parents);
                     info.put("info_point", infoPoint);
-                }else if(SopCommonConst.tag_equip_object.equals(infoType)){
+                }else if(CommonConstant.tag_equip_object.equals(infoType)){
                     //设备对象信息点
                     parents = new JSONArray();
                     infoPoint = new JSONObject();
@@ -1808,7 +1810,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                         parentIds = new JSONArray();
                         parentNames = new JSONArray();
                         parentId = infoItem.getString("major");
-                        parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
+                        parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
                         if (!StringUtil.isNull(parentId, parentName)) {
                             parentIds.add(parentId);
                             parentNames.add(parentName);
@@ -1850,7 +1852,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     parents.add(parent);
 
                     //处理信息点
-                    infoPoint.put("id", "equip_" + getEquipOrSystemCodeFromId(infoItem.getString("eqObj"), SopCommonConst.tag_dict_equip, dataPlatBasePath) + "_" + infoItem.getString("info"));
+                    infoPoint.put("id", "equip_" + getEquipOrSystemCodeFromId(infoItem.getString("eqObj"), CommonConstant.tag_dict_equip, dataPlatBasePath) + "_" + infoItem.getString("info"));
                     infoPoint.put("code", infoItem.getString("info"));
                     infoPoint.put("name", infoItem.getString("infoName"));
 
@@ -1859,7 +1861,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     info.put("obj_type", "equip");
                     info.put("parents", parents);
                     info.put("info_point", infoPoint);
-                }else if(SopCommonConst.tag_system_object.equals(infoType)){
+                }else if(CommonConstant.tag_system_object.equals(infoType)){
                     //系统对象信息点
                     parents = new JSONArray();
                     infoPoint = new JSONObject();
@@ -1868,7 +1870,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     parentIds = new JSONArray();
                     parentNames = new JSONArray();
                     parentId = infoItem.getString("major");
-                    parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
+                    parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
                     if(!StringUtil.isNull(parentId, parentName)) {
                         parentIds.add(parentId);
                         parentNames.add(parentName);
@@ -1890,7 +1892,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     parent.put("parent_names", parentNames);
                     parents.add(parent);
                     //处理信息点
-                    infoPoint.put("id", "system_" + getEquipOrSystemCodeFromId(infoItem.getString("sysObj"), SopCommonConst.tag_dict_sytstem, dataPlatBasePath) + "_" + infoItem.getString("info"));
+                    infoPoint.put("id", "system_" + getEquipOrSystemCodeFromId(infoItem.getString("sysObj"), CommonConstant.tag_dict_sytstem, dataPlatBasePath) + "_" + infoItem.getString("info"));
                     infoPoint.put("code", infoItem.getString("info"));
                     infoPoint.put("name", infoItem.getString("infoName"));
 
@@ -1901,7 +1903,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                     info.put("info_point", infoPoint);
                 }
                 if(info.containsKey("info_point") 
-                		&& infoPointCache.isShowInApp(info.getJSONObject("info_point").getString("id"), infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+                		&& infoPointCache.isShowInApp(info.getJSONObject("info_point").getString("id"), infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
                 	infos.add(info);
                 }
             }
@@ -1945,7 +1947,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         if(!StringUtil.isNull(keyword)){
         	 keywords = keyword.split(" ");
         }
-        String systemType = getEquipOrSystemCodeFromId(systemId, SopCommonConst.tag_dict_sytstem, dataPlatBasePath);
+        String systemType = getEquipOrSystemCodeFromId(systemId, CommonConstant.tag_dict_sytstem, dataPlatBasePath);
         String url = getDataPlatDictPath(DataRequestPathUtil.dataPlat_infoPoint_special, systemType);
 //        String infoStr = httpGetRequest(url);
         String infoStr = httpPostRequestDataPlatform(url,"{}");
@@ -1959,9 +1961,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
             infos = new JSONArray();
             for(int i=0; i<infoArray.size(); i++){
                 infoItem = infoArray.getJSONObject(i);
-                code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-                name = infoItem.getString(SopCommonConst.info_name_info_point_name);
-                baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
+                code = infoItem.getString(CommonConstant.info_name_info_point_code);
+                name = infoItem.getString(CommonConstant.info_name_info_point_name);
+                baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
                 boolean flag = true;
                 if(keywords != null){
                 	for(String key : keywords){
@@ -1974,11 +1976,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 	continue;
                 }
                 id = "system"+"_" +systemType+"_"+code;
-                if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+                if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
                     info = new JSONObject();
                     info.put("id", id);
                     info.put("code", code);
-                    info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+                    info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
                     info.put("unit", infoItem.getString("unit"));
                     info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
                     info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
@@ -2000,7 +2002,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         if(!StringUtil.isNull(keyword)){
         	 keywords = keyword.split(" ");
         }
-        String equipType = getEquipOrSystemCodeFromId(equipId, SopCommonConst.tag_dict_equip, dataPlatBasePath);
+        String equipType = getEquipOrSystemCodeFromId(equipId, CommonConstant.tag_dict_equip, dataPlatBasePath);
         String url = getDataPlatDictPath(DataRequestPathUtil.dataPlat_infoPoint_special, equipType);
 //        String infoStr = httpGetRequest(url);
         String infoStr = httpPostRequestDataPlatform(url,"{}");
@@ -2014,9 +2016,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
             infos = new JSONArray();
             for(int i=0; i<infoArray.size(); i++){
                 infoItem = infoArray.getJSONObject(i);
-                code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-                name = infoItem.getString(SopCommonConst.info_name_info_point_name);
-                baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
+                code = infoItem.getString(CommonConstant.info_name_info_point_code);
+                name = infoItem.getString(CommonConstant.info_name_info_point_name);
+                baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
                 boolean flag = true;
                 if(keywords != null){
                 	for(String key : keywords){
@@ -2029,11 +2031,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 	continue;
                 }
                 id = "equip"+"_" +equipType+"_"+code;
-                if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+                if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
                     info = new JSONObject();
                     info.put("id", id);
                     info.put("code", code);
-                    info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+                    info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
                     info.put("unit", infoItem.getString("unit"));
                     info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
                     info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
@@ -2067,9 +2069,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
             infos = new JSONArray();
             for(int i=0; i<infoArray.size(); i++){
                 infoItem = infoArray.getJSONObject(i);
-                code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-                name = infoItem.getString(SopCommonConst.info_name_info_point_name);
-                baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
+                code = infoItem.getString(CommonConstant.info_name_info_point_code);
+                name = infoItem.getString(CommonConstant.info_name_info_point_name);
+                baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
                 boolean flag = true;
                 if(keywords != null){
                 	for(String key : keywords){
@@ -2082,11 +2084,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 	continue;
                 }
                 id = "system"+"_" +systemType+"_"+code;
-                if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+                if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
                     info = new JSONObject();
                     info.put("id", id);
                     info.put("code", code);
-                    info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+                    info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
                     info.put("unit", infoItem.getString("unit"));
                     info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
                     info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
@@ -2121,9 +2123,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
             infos = new JSONArray();
             for(int i=0; i<infoArray.size(); i++){
                 infoItem = infoArray.getJSONObject(i);
-                code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-                name = infoItem.getString(SopCommonConst.info_name_info_point_name);
-                baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
+                code = infoItem.getString(CommonConstant.info_name_info_point_code);
+                name = infoItem.getString(CommonConstant.info_name_info_point_name);
+                baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
                 boolean flag = true;
                 if(keywords != null){
                 	for(String key : keywords){
@@ -2136,11 +2138,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 	continue;
                 }
                 id = "shaft"+"_" +type+"_"+code;
-                if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+                if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
                     info = new JSONObject();
                     info.put("id", id);
                     info.put("code", code);
-                    info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+                    info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
                     info.put("unit", infoItem.getString("unit"));
                     info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
                     info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
@@ -2175,9 +2177,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
     		infos = new JSONArray();
     		for(int i=0; i<infoArray.size(); i++){
     			infoItem = infoArray.getJSONObject(i);
-    			code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-    			name = infoItem.getString(SopCommonConst.info_name_info_point_name);
-    			baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
+    			code = infoItem.getString(CommonConstant.info_name_info_point_code);
+    			name = infoItem.getString(CommonConstant.info_name_info_point_name);
+    			baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
     			boolean flag = true;
     			if(keywords != null){
     				for(String key : keywords){
@@ -2190,11 +2192,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
     				continue;
     			}
     			id = "build_0_"+code;
-    			if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+    			if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
     				info = new JSONObject();
     				info.put("id", id);
     				info.put("code", code);
-    				info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+    				info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
                     info.put("unit", infoItem.getString("unit"));
                     info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
                     info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
@@ -2228,9 +2230,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
     		infos = new JSONArray();
     		for(int i=0; i<infoArray.size(); i++){
     			infoItem = infoArray.getJSONObject(i);
-    			code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-    			name = infoItem.getString(SopCommonConst.info_name_info_point_name);
-    			baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
+    			code = infoItem.getString(CommonConstant.info_name_info_point_code);
+    			name = infoItem.getString(CommonConstant.info_name_info_point_name);
+    			baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
     			boolean flag = true;
     			if(keywords != null){
     				for(String key : keywords){
@@ -2243,11 +2245,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
     				continue;
     			}
     			id = "floor"+"_0_"+code;
-    			if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+    			if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
     				info = new JSONObject();
     				info.put("id", id);
     				info.put("code", code);
-    				info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+    				info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
 					info.put("unit", infoItem.getString("unit"));
 	                info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
                     if ("FloorIdentity".equals(code)) {
@@ -2282,8 +2284,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
     		infos = new JSONArray();
     		for(int i=0; i<infoArray.size(); i++){
     			infoItem = infoArray.getJSONObject(i);
-    			code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-    			name = infoItem.getString(SopCommonConst.info_name_info_point_name);
+    			code = infoItem.getString(CommonConstant.info_name_info_point_code);
+    			name = infoItem.getString(CommonConstant.info_name_info_point_name);
     			boolean flag = true;
     			if(keywords != null){
     				for(String key : keywords){
@@ -2296,11 +2298,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
     				continue;
     			}
     			id = "space_0_"+code;
-    			if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+    			if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
     				info = new JSONObject();
     				info.put("id", id);
     				info.put("code", code);
-    				info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+    				info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
     				infos.add(info);
     			}
     		}
@@ -2330,9 +2332,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
     		infos = new JSONArray();
     		for(int i=0; i<infoArray.size(); i++){
     			infoItem = infoArray.getJSONObject(i);
-    			code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-    			name = infoItem.getString(SopCommonConst.info_name_info_point_name);
-    			baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
+    			code = infoItem.getString(CommonConstant.info_name_info_point_code);
+    			name = infoItem.getString(CommonConstant.info_name_info_point_name);
+    			baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
     			boolean flag = true;
     			if(keywords != null){
     				for(String key : keywords){
@@ -2345,11 +2347,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
     				continue;
     			}
     			id = "space_0_"+code;
-    			if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+    			if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
     				info = new JSONObject();
     				info.put("id", id);
     				info.put("code", code);
-    				info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+    				info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
                     info.put("unit", infoItem.getString("unit"));
                     info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
                     if ("RoomFuncType".equals(code) || "ProjRoomFuncType".equals(code)) {
@@ -2388,9 +2390,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
             infos = new JSONArray();
             for(int i=0; i<infoArray.size(); i++){
                 infoItem = infoArray.getJSONObject(i);
-                code = infoItem.getString(SopCommonConst.info_name_info_point_code);
-                name = infoItem.getString(SopCommonConst.info_name_info_point_name);
-                baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
+                code = infoItem.getString(CommonConstant.info_name_info_point_code);
+                name = infoItem.getString(CommonConstant.info_name_info_point_name);
+                baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
                 boolean flag = true;
                 if(keywords != null){
                 	for(String key : keywords){
@@ -2403,11 +2405,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
                 	continue;
                 }
                 id = "equip"+"_" +equipType+"_"+code;
-                if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+                if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
                     info = new JSONObject();
                     info.put("id", id);
                     info.put("code", code);
-                    info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
+                    info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
                     info.put("unit", infoItem.getString("unit"));
                     info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
                     info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
@@ -2517,21 +2519,21 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
         results = resultJson.getJSONArray("Content");
         for(int i=0; i<results.size(); i++){
             result = results.getJSONObject(i);
-            infoDatas = result.getJSONObject(SopCommonConst.info_name_datas);
-            if(infoDatas.containsKey(SopCommonConst.info_name_local_name_project)){
-                localName = infoDatas.getString(SopCommonConst.info_name_local_name_project);
-            }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_build)){
-                localName = infoDatas.getString(SopCommonConst.info_name_local_name_build);
-            }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_floor)){
-                localName = infoDatas.getString(SopCommonConst.info_name_local_name_floor);
-            }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_space)){
-                localName = infoDatas.getString(SopCommonConst.info_name_local_name_space);
-            }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_equip)){
-                localName = infoDatas.getString(SopCommonConst.info_name_local_name_equip);
-            }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_system)){
-                localName = infoDatas.getString(SopCommonConst.info_name_local_name_system);
-            }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_shaft)){
-                localName = infoDatas.getString(SopCommonConst.info_name_local_name_shaft);
+            infoDatas = result.getJSONObject(CommonConstant.info_name_datas);
+            if(infoDatas.containsKey(CommonConstant.info_name_local_name_project)){
+                localName = infoDatas.getString(CommonConstant.info_name_local_name_project);
+            }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_build)){
+                localName = infoDatas.getString(CommonConstant.info_name_local_name_build);
+            }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_floor)){
+                localName = infoDatas.getString(CommonConstant.info_name_local_name_floor);
+            }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_space)){
+                localName = infoDatas.getString(CommonConstant.info_name_local_name_space);
+            }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_equip)){
+                localName = infoDatas.getString(CommonConstant.info_name_local_name_equip);
+            }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_system)){
+                localName = infoDatas.getString(CommonConstant.info_name_local_name_system);
+            }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_shaft)){
+                localName = infoDatas.getString(CommonConstant.info_name_local_name_shaft);
             }
             idNameMap.put(result.getString("id"), localName);
         }
@@ -2585,7 +2587,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 		array = array == null ? new JSONArray() : array;
 		for(int i=0; i<array.size(); i++){
 			JSONObject item = array.getJSONObject(i);
-			map.put(item.getString("id"), item.getJSONObject(SopCommonConst.info_name_datas).getString(localName));
+			map.put(item.getString("id"), item.getJSONObject(CommonConstant.info_name_datas).getString(localName));
 		}
 		return map;
 	}
@@ -3394,7 +3396,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 			String objId = clazz.getString("obj_id");
 			String objType = clazz.getString("obj_type");
 			boolean containScopeFlag = false;
-			if (SopCommonConst.data_type_equip_class.equals(objType) && !StringUtil.isEmptyList(clazz, "space_scope")) {
+			if (CommonConstant.data_type_equip_class.equals(objType) && !StringUtil.isEmptyList(clazz, "space_scope")) {
 				JSONObject spaceClazz = clazz.getJSONArray("space_scope").getJSONObject(0);
 				containScopeFlag = true;
 				objId = spaceClazz.getString("obj_id");
@@ -3444,7 +3446,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 			JSONObject equip = (JSONObject) object;
 			id2equip.put(equip.getString("obj_id"), equip);
 		}
-		String graphId = graphCache.getGraphIdByProjectIdAndGraph(projectId, SopCommonConst.graph_type_equip_in_space);
+		String graphId = graphCache.getGraphIdByProjectIdAndGraph(projectId, CommonConstant.graph_type_equip_in_space);
 		for (Object object : spaceObjs) {
 			JSONObject space = (JSONObject) object;
 			String spaceId = space.getString("obj_id");
@@ -3468,9 +3470,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 	}
 
 	private JSONArray querySpaceOrEquipByType(String projectId, String id , String type) throws Exception {
-		if (SopCommonConst.data_type_equip_class.equals(type)) {
+		if (CommonConstant.data_type_equip_class.equals(type)) {
 			return queryEquipByType(projectId, id);
-		}else if (SopCommonConst.data_type_space_class.equals(type)) {
+		}else if (CommonConstant.data_type_space_class.equals(type)) {
 			return querySpaceByType(projectId, id);
 		}
 		return new JSONArray();
@@ -4054,7 +4056,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 				infoItem = infoArray.getJSONObject(i);
 				info = new JSONObject();
 				infoType = infoItem.getString("type");
-				if(SopCommonConst.tag_equip.equals(infoType)){
+				if(CommonConstant.tag_equip.equals(infoType)){
 					//设备大类信息点
 					parents = new JSONArray();
 					infoPoint = new JSONObject();
@@ -4063,7 +4065,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 					parentIds = new JSONArray();
 					parentNames = new JSONArray();
 					parentId = infoItem.getString("major");
-					parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
+					parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
 					if(!StringUtil.isNull(parentId, parentName)) {
 						parentIds.add(parentId);
 						parentNames.add(parentName);
@@ -4089,7 +4091,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 					info.put("obj_type", "equip_class");
 					info.put("parents", parents);
 					info.put("info_point", infoPoint);
-				}else if(SopCommonConst.tag_system.equals(infoType)){
+				}else if(CommonConstant.tag_system.equals(infoType)){
 					//系统大类信息点
 					parents = new JSONArray();
 					infoPoint = new JSONObject();
@@ -4098,7 +4100,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 					parentIds = new JSONArray();
 					parentNames = new JSONArray();
 					parentId = infoItem.getString("major");
-					parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
+					parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
 					if(!StringUtil.isNull(parentId, parentName)) {
 						parentIds.add(parentId);
 						parentNames.add(parentName);
@@ -4121,7 +4123,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
 					info.put("info_point", infoPoint);
 				}
 				if(info.containsKey("info_point")
-						&& infoPointCache.isShowInApp(info.getJSONObject("info_point").getString("id"), infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
+						&& infoPointCache.isShowInApp(info.getJSONObject("info_point").getString("id"), infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
 					infoPoint = info.getJSONObject("info_point");
 					infoPoint.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(infoItem.getString("inputMode")));
 				}

+ 38 - 35
fm-sop/src/main/java/com/persagy/fm/sop/service/impl/ProjectSopServiceImpl.java

@@ -13,7 +13,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.persagy.common.exception.BusinessException;
+import com.persagy.fm.common.constant.CommonConstant;
+import com.persagy.fm.common.constant.DataRequestPathUtil;
 import com.persagy.fm.common.constant.enums.BoolEnum;
+import com.persagy.fm.common.constant.enums.IdPrefixEnum;
 import com.persagy.fm.common.constant.enums.ResultEnum;
 import com.persagy.fm.common.constant.enums.ValidEnum;
 import com.persagy.fm.common.model.vo.GeneralDictVo;
@@ -704,9 +707,9 @@ public class ProjectSopServiceImpl implements IProjectSopService {
         // 项目id
         Set<String> projectIds = new HashSet<>();
         projectIds.add(queryPublishedListVo.getProjectId());
-        if (!SopCommonConst.group_sop_id.equals(queryPublishedListVo.getProjectId())
+        if (!SopCommonConst.GROUP_SOP_ID.equals(queryPublishedListVo.getProjectId())
              && (CollUtil.isEmpty(queryPublishedListVo.getSignCodes()) || queryPublishedListVo.getSignCodes().contains("public"))){
-            projectIds.add(SopCommonConst.group_sop_id);
+            projectIds.add(SopCommonConst.GROUP_SOP_ID);
         }
         queryWrapper.in(Sop::getProjectId,projectIds);
         queryWrapper.eq(Sop::getValid,true);
@@ -715,22 +718,22 @@ public class ProjectSopServiceImpl implements IProjectSopService {
         String updateTimeFrom = queryPublishedListVo.getUpdateTimeFrom();
         String updateTimeTo = queryPublishedListVo.getUpdateTimeTo();
         if (StrUtil.isNotBlank(updateTimeFrom)) {
-            queryWrapper.ge(Sop::getUpdateTime,DateUtil.transferDateFormat(updateTimeFrom, SopCommonConst.date_format_show, SopCommonConst.date_format_save));
+            queryWrapper.ge(Sop::getUpdateTime,DateUtil.transferDateFormat(updateTimeFrom, CommonConstant.date_format_show, CommonConstant.date_format_save));
         }
         if (StrUtil.isNotBlank(updateTimeTo)) {
-            queryWrapper.le(Sop::getUpdateTime,DateUtil.transferDateFormat(updateTimeTo, SopCommonConst.date_format_show, SopCommonConst.date_format_save));
+            queryWrapper.le(Sop::getUpdateTime,DateUtil.transferDateFormat(updateTimeTo, CommonConstant.date_format_show, CommonConstant.date_format_save));
         }
         // SOP名称
         if (StrUtil.isNotBlank(queryPublishedListVo.getSopName())) {
             queryWrapper.like(Sop::getSopName, queryPublishedListVo.getSopName());
         }
         // ========2.移除待修订状态sop=======
-        if (!SopCommonConst.group_sop_id.equals(queryPublishedListVo.getProjectId())) {
+        if (!SopCommonConst.GROUP_SOP_ID.equals(queryPublishedListVo.getProjectId())) {
             queryWrapper.and(wrapper->{
-                wrapper.or(subWrapper->subWrapper.ne(Sop::getProjectId,SopCommonConst.group_sop_id));
+                wrapper.or(subWrapper->subWrapper.ne(Sop::getProjectId,SopCommonConst.GROUP_SOP_ID));
                 wrapper.or(subWrapper->{
                     subWrapper.ne(Sop::getPublishStatus,SopPublishStatusEnum.REVISE.getType());
-                    subWrapper.eq(Sop::getProjectId, SopCommonConst.group_sop_id);
+                    subWrapper.eq(Sop::getProjectId, SopCommonConst.GROUP_SOP_ID);
                 });
             });
             String rootProjFuncType = objectService.queryRootProjFuncTypeById(queryPublishedListVo.getProjectId());
@@ -1189,10 +1192,10 @@ public class ProjectSopServiceImpl implements IProjectSopService {
         String updateTimeFrom = queryPublishedSelVo.getUpdateTimeFrom();
         String updateTimeTo = queryPublishedSelVo.getUpdateTimeTo();
         if (!StringUtil.isNull(updateTimeFrom)) {
-            queryWrapper.ge(Sop.UPDATE_TIME, DateUtil.transferDateFormat(updateTimeFrom, SopCommonConst.date_format_show, SopCommonConst.date_format_save));
+            queryWrapper.ge(Sop.UPDATE_TIME, DateUtil.transferDateFormat(updateTimeFrom, CommonConstant.date_format_show, CommonConstant.date_format_save));
         }
         if (!StringUtil.isNull(updateTimeTo)) {
-            queryWrapper.le(Sop.UPDATE_TIME, DateUtil.transferDateFormat(updateTimeTo, SopCommonConst.date_format_show, SopCommonConst.date_format_save));
+            queryWrapper.le(Sop.UPDATE_TIME, DateUtil.transferDateFormat(updateTimeTo, CommonConstant.date_format_show, CommonConstant.date_format_save));
         }
         if (StrUtil.isNotBlank(queryPublishedSelVo.getSopName())) {
             queryWrapper.like(Sop.SOP_NAME, queryPublishedSelVo.getSopName());
@@ -1200,7 +1203,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
         List<Sop> sops = sopService.list(queryWrapper);
         //========2.移除待修订状态sop=======
         removeReviseSop(sops);
-        if (!SopCommonConst.group_sop_id.equals(queryPublishedSelVo.getProjectId())) {
+        if (!SopCommonConst.GROUP_SOP_ID.equals(queryPublishedSelVo.getProjectId())) {
             String rootProjFuncType = objectService.queryRootProjFuncTypeById(queryPublishedSelVo.getProjectId());
             removeWithoutProJFuncType(sops, rootProjFuncType);
         }
@@ -1269,7 +1272,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                         .version(refSop.getVersion())
                         .sopType(refSop.getSopType())
                         .statusExplain(getSopStatus(refSop.getSopStatus(), refSop.getPublishStatus()))
-                        .updateTime(DateUtil.transferDateFormat(refSop.getUpdateTime(), SopCommonConst.date_format_save, SopCommonConst.date_format_show))
+                        .updateTime(DateUtil.transferDateFormat(refSop.getUpdateTime(), CommonConstant.date_format_save, CommonConstant.date_format_show))
                         .build();
                 if (!SopCommonConst.GROUP_SOP_ID.equals(refSop.getProjectId())){
                     sopListVo.setProjectId(refSop.getProjectId());
@@ -1434,7 +1437,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                     .msgId(sopReviseMsg.getSopId())
                     .content(sopReviseMsg.getContent())
                     .reviseObjId(sopReviseMsg.getObjId())
-                    .createTime(DateUtil.transferDateFormat(sopReviseMsg.getCreateTime(), SopCommonConst.date_format_save, SopCommonConst.date_format_show))
+                    .createTime(DateUtil.transferDateFormat(sopReviseMsg.getCreateTime(), CommonConstant.date_format_save, CommonConstant.date_format_show))
                     .build());
         }
         return result;
@@ -1481,7 +1484,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                 .version(destSop.getVersion())
                 .versionExplain(destSop.getVersionExplain())
                 .currentVersion(true)
-                .updateTime(DateUtil.transferDateFormat(destSop.getUpdateTime(), SopCommonConst.date_format_save, SopCommonConst.date_format_show))
+                .updateTime(DateUtil.transferDateFormat(destSop.getUpdateTime(), CommonConstant.date_format_save, CommonConstant.date_format_show))
                 .build();
         if (StrUtil.isNotBlank(destSop.getOperatorId())
                 && StrUtil.isNotBlank(destSop.getOperatorName())){
@@ -1498,7 +1501,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
         for (SopHis sopHis : sopHisList) {
             result.add(SopHisListVo.builder()
                     .sopId(sopHis.getSopId())
-                    .updateTime(DateUtil.transferDateFormat(sopHis.getUpdateTime(), SopCommonConst.date_format_save, SopCommonConst.date_format_show))
+                    .updateTime(DateUtil.transferDateFormat(sopHis.getUpdateTime(), CommonConstant.date_format_save, CommonConstant.date_format_show))
                     .currentVersion(false)
                     .versionExplain(sopHis.getVersionExplain())
                     .version(sopHis.getVersion())
@@ -1873,7 +1876,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
             return ToolsUtil.successJsonMsg(publishedListVo.getContent());
         }
         String project_id = jsonObject.getString("project_id");
-        project_id = project_id == null ? SopCommonConst.group_sop_id : project_id;
+        project_id = project_id == null ? SopCommonConst.GROUP_SOP_ID : project_id;
 //    	String secret = projectCache.getProjectSecretById(project_id);
         List<String> lastSopIds = null;
         if (!CollectionUtils.isEmpty(fitObjIds)) {
@@ -1891,7 +1894,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                 relObjs.add(createObj(obj_id, obj_type));
                 JSONArray equip_model_ids = new JSONArray();
                 //获取该建筑下的所有楼层,空间,设备
-                if(SopCommonConst.data_type_build.equals(obj_type)) {
+                if(CommonConstant.data_type_build.equals(obj_type)) {
                     //				obj_ids.add(obj_id);
                     String obj = objectService.queryObjById(obj_id, project_id);
                     JSONObject objJson = JSONObject.parseObject(obj);
@@ -1946,7 +1949,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                             }
                         }
                     }
-                } else if(SopCommonConst.data_type_floor.equals(obj_type)) {
+                } else if(CommonConstant.data_type_floor.equals(obj_type)) {
 
                     //				obj_ids.add(obj_id);
                     String obj = objectService.queryObjById(obj_id, project_id);
@@ -2012,7 +2015,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                             }
                         }
                     }
-                }  else if(SopCommonConst.data_type_shaft.equals(obj_type)) {
+                }  else if(CommonConstant.data_type_shaft.equals(obj_type)) {
                     //				obj_ids.add(obj_id);
                     String obj = objectService.queryObjById(obj_id, project_id);
                     JSONObject objJson = JSONObject.parseObject(obj);
@@ -2062,7 +2065,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                             }
                         }
                     }
-                }else if(SopCommonConst.data_type_space.equals(obj_type)) {
+                }else if(CommonConstant.data_type_space.equals(obj_type)) {
                     JSONArray criterias = new JSONArray();
                     JSONObject criteria = new JSONObject();
                     criteria.put("to_id", obj_id);
@@ -2108,10 +2111,10 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                             }
                         }
                     }
-                } else if(SopCommonConst.data_type_system.equals(obj_type)) {
+                } else if(CommonConstant.data_type_system.equals(obj_type)) {
                     //系统id
                     //系统类型id
-                    String systemClass = baseService.getEquipOrSystemCodeFromId(obj_id, SopCommonConst.tag_dict_sytstem, dataPlatBasePath);
+                    String systemClass = baseService.getEquipOrSystemCodeFromId(obj_id, CommonConstant.tag_dict_sytstem, dataPlatBasePath);
                     relObjs.add(createObj(systemClass, "system_class"));
                     //系统
                     JSONObject params = new JSONObject();
@@ -2134,7 +2137,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                             for (int j = 0; j < queryConstents.size(); j++) {
                                 JSONObject queryConstent = queryConstents.getJSONObject(j);
                                 String id = queryConstent.getString("id");
-                                String equipClass = baseService.getEquipOrSystemCodeFromId(id, SopCommonConst.tag_dict_equip, dataPlatBasePath);
+                                String equipClass = baseService.getEquipOrSystemCodeFromId(id, CommonConstant.tag_dict_equip, dataPlatBasePath);
                                 //设备类型id
                                 if(!obj_ids.contains(equipClass)) {
                                     obj_ids.add(equipClass);
@@ -2146,9 +2149,9 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                             }
                         }
                     }
-                } else if(SopCommonConst.data_type_equip.equals(obj_type)) {
+                } else if(CommonConstant.data_type_equip.equals(obj_type)) {
                     //设备id
-                    String equipClass = baseService.getEquipOrSystemCodeFromId(obj_id, SopCommonConst.tag_dict_equip, dataPlatBasePath);
+                    String equipClass = baseService.getEquipOrSystemCodeFromId(obj_id, CommonConstant.tag_dict_equip, dataPlatBasePath);
                     //设备类型id
                     if(!obj_ids.contains(equipClass)) {
                         obj_ids.add(equipClass);
@@ -2209,10 +2212,10 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                wrapper.in(Sop::getSopId,querySopIds);
                wrapper.eq(Sop::getProjectId,queryProjectId);
             });
-            if (!SopCommonConst.group_sop_id.equals(project_id)){
+            if (!SopCommonConst.GROUP_SOP_ID.equals(project_id)){
                 sopLambdaQueryWrapper.or(wrapper->{
                     wrapper.in(Sop::getSopId,querySopIds);
-                    wrapper.eq(Sop::getProjectId,SopCommonConst.group_sop_id);
+                    wrapper.eq(Sop::getProjectId,SopCommonConst.GROUP_SOP_ID);
                 });
             }
             sopLambdaQueryWrapper.in(Sop::getSopId,JSONArray.parseArray(JSON.toJSONString(lastSopIds)).toJavaList(String.class));
@@ -2221,7 +2224,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
             List<SopBean> sopBeans = fillSopDetail(sopList);
             List<SopBean> sopBeanList = CollUtil.sort(sopBeans, Comparator.comparing(SopBean::getCreateTime));
             String rootProjFuncType = null;
-            if (!SopCommonConst.group_sop_id.equals(project_id)) {
+            if (!SopCommonConst.GROUP_SOP_ID.equals(project_id)) {
                 rootProjFuncType = objectService.queryRootProjFuncTypeById(project_id);
             }
             for (SopBean sopBean : sopBeanList) {
@@ -3151,7 +3154,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
 		}
     	//=====竖井查询====
     	if (!shaftIds.isEmpty()) {
-    		String graphId = graphCache.getGraphIdByProjectIdAndGraph(projectId, SopCommonConst.graph_type_shaft_and_building);
+    		String graphId = graphCache.getGraphIdByProjectIdAndGraph(projectId, CommonConstant.graph_type_shaft_and_building);
     		JSONObject relation ;
     		for (Object object : shaftIds) {
     			relation = objectService.queryRelation(projectId, null, (String) object, null, graphId, "1");
@@ -3517,7 +3520,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                 String refSopId = refSop.getSopId();
                 log.error("移除作废的引用sop后步骤为空,作废该sop:"+refSopId);
                 QueryDestroySopVo destroySopVo = QueryDestroySopVo.builder()
-                        .operator(OperatorBean.builder().id(SopCommonConst.SYSTEM_ID).name("系统").build())
+                        .operator(OperatorBean.builder().id(CommonConstant.SYSTEM_ID).name("系统").build())
                         .build();
                 destroySopVo.setSopId(refSopId);
                 destroySopVo.setUserId(userId);
@@ -3746,7 +3749,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                     .sopName(sop.getSopName())
                     .version(sop.getVersion())
                     .scopes(scopes)
-                    .updateTime(DateUtil.transferDateFormat(sop.getUpdateTime(), SopCommonConst.date_format_save, SopCommonConst.date_format_show))
+                    .updateTime(DateUtil.transferDateFormat(sop.getUpdateTime(), CommonConstant.date_format_save, CommonConstant.date_format_show))
                     .build();
             if (!destoryFlag) {
                 sopBean.setSopStatus(sop.getSopStatus());
@@ -3823,7 +3826,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                     .sopName(sopName)
                     .version(sopEdit.getVersion())
                     .scopes(scopes)
-                    .updateTime(DateUtil.transferDateFormat(sopEdit.getUpdateTime(), SopCommonConst.date_format_save, SopCommonConst.date_format_show))
+                    .updateTime(DateUtil.transferDateFormat(sopEdit.getUpdateTime(), CommonConstant.date_format_save, CommonConstant.date_format_show))
                     .build();
             if (!destoryFlag) {
                 sopBean.setSopStatus(sopEdit.getSopStatus());
@@ -4024,7 +4027,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
                     .collect(Collectors.toList());
             for (int i = 0, length = sopBeans.size(); i < length; i++) {
                 sop = sopBeans.get(i);
-                sop.setUpdateTime(DateUtil.transferDateFormat(sop.getUpdateTime(), SopCommonConst.date_format_save, SopCommonConst.date_format_show));
+                sop.setUpdateTime(DateUtil.transferDateFormat(sop.getUpdateTime(), CommonConstant.date_format_save, CommonConstant.date_format_show));
                 if ("2".equals(queryType)) {
                     sop.setSopType(sop.getSopType());
                     sop.setStepCount(sop.getSteps().size());
@@ -4073,7 +4076,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
      */
     private SopSignBean getSopSign(SopBean sopBean, String projectId) {
         SopSignBean sign = null;
-        if (SopCommonConst.group_sop_id.equals(projectId)) {
+        if (SopCommonConst.GROUP_SOP_ID.equals(projectId)) {
             String publishStatus = sopBean.getPublishStatus();
             if (SopConst.PUBLISH_STATUS_REVISE.equals(publishStatus)) {
                 sign = SopSignBean.builder().code("revise").name("待修订").build();
@@ -4234,7 +4237,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
         for (int i = 0; i < sops.size(); i++) {
             Sop sop = sops.get(i);
             if (SopConst.PUBLISH_STATUS_REVISE.equals(sop.getPublishStatus())
-                    && SopCommonConst.group_sop_id.equals(sop.getProjectId())) {
+                    && SopCommonConst.GROUP_SOP_ID.equals(sop.getProjectId())) {
                 sops.remove(i);
                 i--;
             }
@@ -5242,7 +5245,7 @@ public class ProjectSopServiceImpl implements IProjectSopService {
         for (SopBean sopBean : sopBeans) {
             sopBean.setStepCount(sopBean.getSteps().size());
             sopBean.setStautsExplain(getSopStatus(sopBean.getSopStatus(),sopBean.getPublishStatus()));
-            sopBean.setUpdateTime(DateUtil.transferDateFormat(sopBean.getUpdateTime(), SopCommonConst.date_format_save, SopCommonConst.date_format_show));
+            sopBean.setUpdateTime(DateUtil.transferDateFormat(sopBean.getUpdateTime(), CommonConstant.date_format_save, CommonConstant.date_format_show));
             map.put(sopBean.getSopId(), sopBean);
         }
         return map;

+ 0 - 5
fm-sop/src/main/java/com/persagy/fm/sop/service/impl/SopDestroyMsgServiceImpl.java

@@ -1,7 +1,6 @@
 package com.persagy.fm.sop.service.impl;
 
 import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.persagy.fm.sop.entity.SopDestroyMsg;
@@ -9,10 +8,6 @@ import com.persagy.fm.sop.dao.SopDestroyMsgMapper;
 import com.persagy.fm.sop.enums.MsgStatusEnum;
 import com.persagy.fm.sop.service.ISopDestroyMsgService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.persagy.old.common.CommonMessage;
-import com.persagy.old.common.JSONUtil;
-import com.persagy.old.dao.DBCommonMethods;
-import com.persagy.old.dao.DBConst;
 import org.springframework.stereotype.Service;
 
 import java.util.List;

+ 0 - 6
fm-sop/src/main/java/com/persagy/fm/sop/service/impl/SopReviseMsgServiceImpl.java

@@ -2,19 +2,13 @@ package com.persagy.fm.sop.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.persagy.fm.sop.entity.SopReviseMsg;
 import com.persagy.fm.sop.dao.SopReviseMsgMapper;
 import com.persagy.fm.sop.enums.MsgStatusEnum;
-import com.persagy.fm.sop.model.vo.SaveSopVo;
 import com.persagy.fm.sop.service.ISopReviseMsgService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.persagy.old.common.CommonMessage;
-import com.persagy.old.common.JSONUtil;
-import com.persagy.old.dao.DBCommonMethods;
-import com.persagy.old.dao.DBConst;
 import org.springframework.stereotype.Service;
 
 import java.util.List;

+ 3 - 1
fm-sop/src/main/java/com/persagy/fm/sop/service/impl/WoFlowPlanServiceImpl.java

@@ -3,6 +3,8 @@ package com.persagy.fm.sop.service.impl;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.persagy.fm.common.constant.CommonConstant;
+import com.persagy.fm.common.constant.DataRequestPathUtil;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.common.old.utils.ToolsUtil;
 import com.persagy.fm.sop.constant.SopCommonConst;
@@ -226,7 +228,7 @@ public class WoFlowPlanServiceImpl extends BaseService implements IWoFlowPlanSer
 			skips = JSONObject.parseObject(content.getJSONObject(0).getString("skips"));
 			skips = skips == null ? new JSONObject() : skips;
 			if (!StringUtil.isNull(skips, "resetTime") && new Date()
-					.after(DateUtil.parseDate(SopCommonConst.date_format_save, skips.getString("resetTime")))) {
+					.after(DateUtil.parseDate(CommonConstant.date_format_save, skips.getString("resetTime")))) {
 				skips.clear();
 			}
 		}

+ 0 - 12
fm-sop/src/main/java/com/persagy/fm/sop/validator/Delete.java

@@ -1,12 +0,0 @@
-package com.persagy.fm.sop.validator;
-
-import javax.validation.groups.Default;
-
-/***
- * Description: 集团SOP删除的验证接口
- * @author : lijie
- * @date :2021/4/10 17:58
- * Update By lijie 2021/4/10 17:58
- */
-public interface Delete extends Default {
-}

+ 0 - 12
fm-sop/src/main/java/com/persagy/fm/sop/validator/Insert.java

@@ -1,12 +0,0 @@
-package com.persagy.fm.sop.validator;
-
-import javax.validation.groups.Default;
-
-/***
- * Description: 集团SOP插入的校验器
- * @author : lijie
- * @date :2021/4/2 12:07
- * Update By lijie 2021/4/2 12:07
- */
-public interface Insert extends Default {
-}

+ 0 - 12
fm-sop/src/main/java/com/persagy/fm/sop/validator/Query.java

@@ -1,12 +0,0 @@
-package com.persagy.fm.sop.validator;
-
-import javax.validation.groups.Default;
-
-/***
- * Description: 集团SOP的校验器
- * @author : lijie
- * @date :2021/4/10 17:59
- * Update By lijie 2021/4/10 17:59
- */
-public interface Query extends Default {
-}

+ 0 - 12
fm-sop/src/main/java/com/persagy/fm/sop/validator/Update.java

@@ -1,12 +0,0 @@
-package com.persagy.fm.sop.validator;
-
-import javax.validation.groups.Default;
-
-/***
- * Description: 更新的校验器
- * @author : lijie
- * @date :2021/4/10 18:00
- * Update By lijie 2021/4/10 18:00
- */
-public interface Update extends Default {
-}

+ 1 - 1
fm-sop/src/main/java/com/persagy/old/cache/GraphCache.java

@@ -1,8 +1,8 @@
 package com.persagy.old.cache;
 
 import com.alibaba.fastjson.JSONObject;
+import com.persagy.fm.common.constant.DataRequestPathUtil;
 import com.persagy.fm.common.old.utils.StringUtil;
-import com.persagy.old.common.DataRequestPathUtil;
 import com.persagy.old.common.RedisConstant;
 import com.persagy.old.dao.DBConst;
 import com.persagy.fm.sop.service.BaseService;

+ 3 - 2
fm-sop/src/main/java/com/persagy/old/cache/ProjectCache.java

@@ -1,6 +1,7 @@
 package com.persagy.old.cache;
 
 import com.alibaba.fastjson.JSONObject;
+import com.persagy.fm.common.constant.CommonConstant;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.sop.constant.SopCommonConst;
 import com.persagy.old.common.RedisConstant;
@@ -30,12 +31,12 @@ public class ProjectCache  {
 
     public String getProjectNameById(String projectId){
 
-        return getProjectById(projectId).getString(SopCommonConst.info_name_local_name_project);
+        return getProjectById(projectId).getString(CommonConstant.info_name_local_name_project);
     }
 
     public String getProjLocalIDById(String projectId){
 
-        return getProjectById(projectId).getString(SopCommonConst.info_name_local_id_project);
+        return getProjectById(projectId).getString(CommonConstant.info_name_local_id_project);
     }
 
     /**

File diff suppressed because it is too large
+ 0 - 50
fm-sop/src/main/java/com/persagy/old/common/CommonMessage.java


+ 0 - 88
fm-sop/src/main/java/com/persagy/old/common/DataRequestPathUtil.java

@@ -1,88 +0,0 @@
-/**
- * @包名称 com.sagacloud.common
- * @文件名 DataRequestPathUtil.java
- * @创建者 wanghailong
- * @邮箱 wanghailong@persagy.com  
- * @修改描述 
- */
-
-package com.persagy.old.common;
-
-/** 
- * 功能描述: 数据请求路径工具类
- * @类型名称 DataRequestPathUtil
- * @创建者 wanghailong
- * @邮箱 wanghailong@persagy.com  
- * @修改描述 
- */
-public class DataRequestPathUtil {
-	
-	/**** 数据平台请求路径 ***/
-	//get:数据平台-数据字典查询
-	public final static String dataPlat_dict_query = "BASEPATH/dict/query/PARAM";
-
-	//post: 数据平台-对象模糊查询
-	public final static String dataPlat_object_like_query = "BASEPATH/object/search?projectId=PROJECTID&secret=SECRET";
-	//post:数据平台-对象-批量查询
-	public final static String dataPlat_object_batch_query = "BASEPATH/object/batch_query?projectId=PROJECTID&secret=SECRET";
-	//post:数据平台-对象-批量查询 (post)
-	public final static String dataPlat_object_batch_query_post = "BASEPATH/object/batch_query";
-
-	//post:根据信息点来查询各物理实体
-	public final static String dataPlat_object_query_by_info = "BASEPATH/object/query_by_info?projectId=PROJECTID&secret=SECRET";
-	//post:数据平台-对象-查询某个对象下的指定类型的objects
-	public final static String dataPlat_object_subset_query = "BASEPATH/object/subset_query?projectId=PROJECTID&secret=SECRET";
-	//post:数据平台-系统-查询某个专业下的所有系统
-	public final static String dataPlat_system_query_by_domain = "BASEPATH/equipment/system_query?projectId=PROJECTID&secret=SECRET";
-	//get:数据平台-项目-管理员查询
-	public final static String dataPlat_project_query = "BASEPATH/mng/project/query?secret=SECRET";
-	//post:数据平台-对象-设备综合查询
-	public final static String dataPlat_equipment_complex_query = "BASEPATH/equipment/complex_query?projectId=PROJECTID&secret=SECRET";
-		
-
-	//post:数据平台-关系-图实例-查询
-	public final static String dataPlat_relation_graph_instance_query = "BASEPATH/relation/graph_instance/query?projectId=PROJECTID&secret=SECRET";
-	//post:数据平台-关系-关系实例-查询
-	public final static String dataPlat_relation_relation_instance_query = "BASEPATH/relation/query?projectId=PROJECTID&secret=SECRET";
-	//post:数据平台-关系-指定图类型和关系类型的集合
-	public final static String dataPlat_relation_query_subset = "BASEPATH/relation/query_subset?projectId=PROJECTID&secret=SECRET";
-	//post:数据平台-关系-根据obj_type查询
-	public final static String dataPlat_relation_query_by_obj_type = "BASEPATH/relation/query_by_obj_type";
-
-
-	//get:数据平台-信息点-空间信息点
-	public final static String dataPlat_infoPoint_query_space = "BASEPATH/infocode/query/space";
-	//get:数据平台-信息点-楼层信息点
-	public final static String dataPlat_infoPoint_query_floor = "BASEPATH/infocode/query/floor";
-	//get:数据平台-信息点-建筑体信息点
-	public final static String dataPlat_infoPoint_query_building = "BASEPATH/infocode/query/building";
-	//get:数据平台-信息点-设备、系统独有信息点
-	public final static String dataPlat_infoPoint_special = "BASEPATH/infocode/query?ID=PARAM";
-	//post:数据平台-信息点-模糊查询
-	public final static String dataPlat_infoPoint_search = "BASEPATH/info_point/search?projectId=PROJECTID&secret=SECRET";
-	//post:数据平台-抗震设防烈度
-	public final static String dataPlat_seismic_precautionary_intensity_query = "BASEPATH/dict/query/seismic_precautionary_intensity";
-	//post:数据平台-查询信息点方案
-	public final static String dataPlat_custom_infoCode_scheme_query = "BASEPATH/custom_infocode/scheme/query";
-	//post:数据平台-查询信息点
-	public final static String dataPlat_custom_infoCode_scheme_info_query = "BASEPATH/custom_infocode/scheme/info/query";
-	//post:数据平台-增加自定义信息点
-	public final static String dataPlat_custom_infoCode_scheme_info_create = "BASEPATH/custom_infocode/scheme/info/create";
-
-	//post : 查询当前用户的密码MD5值
-//	public final static String persagy_manage_query_password_byuserid = "BASEPATH/Spring/MVC/entrance/unifier/queryPasswordByUserIdService";
-
-	//post:数据平台-查询种族相关信息点
-	public final static String dataPlat_infoCode_query_property = "BASEPATH/infocode/query_property";
-
-	//post:数据平台-图-图实例-添加
-	public final static String dataPlat_relation_graph_instance_create = "BASEPATH/relation/graph_instance/create?projectId=PROJECTID&secret=SECRET";
-	
-	//post:saas-竖井查询
-	public final static String dataPlat_query_shaft = "BASEPATH/restObjectService/queryShaft";
-
-	//post:数据平台-根据空间id或设备id查关系详情(层级结构)
-	public final static String dataPlat_query_space_or_equip = "BASEPATH/facility/querySpaceOrEquip";
-	//post:数据平台-根据空间id或设备id查关系详情(非层级结构)
-	public final static String dataPlat_query_space_or_equip_NoHierarchy = "BASEPATH/facility/querySpaceOrEquipNoHierarchy";
-}

+ 0 - 670
fm-sop/src/main/java/com/persagy/old/common/DataRequestProcessUtil.java

@@ -1,670 +0,0 @@
-package com.persagy.old.common;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.google.common.collect.Maps;
-import com.persagy.fm.common.old.utils.StringUtil;
-import com.persagy.fm.sop.constant.SopCommonConst;
-import com.persagy.old.dao.DBConst.Result;
-
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.Map;
-
-/**
- * 
- * 功能描述: 数据请求处理类,包括查询条件的组装、返回数据处理、排序等
- * @类型名称 DataRequestProcessUtil
- * @创建者 wanghailong
- * @邮箱 wanghailong@persagy.com  
- * @修改描述
- */
-public class DataRequestProcessUtil {
-    /**
-     * 转换更新参数
-     * @param jsonObject    用户接口参数,除了过滤项,其它项默认为新增项
-     * @return              数据平台接口参数
-     */
-    public static JSONObject getAddParamJson(JSONObject jsonObject){
-        JSONObject paramJson = new JSONObject();
-        paramJson.put("insertObject", jsonObject);
-        return paramJson;
-    }
-
-    /**
-     * 转换主键查询参数
-     * @param jsonObject    用户接口数据
-     * @param majors         主键
-     * @return                数据平台接口参数
-     */
-    public static JSONObject getKeyWithMajors(JSONObject jsonObject, String... majors){
-        JSONObject paramJson = new JSONObject();
-        JSONObject keyJson = new JSONObject();
-        Object value;
-        for(String major : majors){
-            value = jsonObject.get(major);
-            if(value != null && !"".equals(value.toString())){
-                keyJson.put(major, value);
-            }
-        }
-        paramJson.put("Key", keyJson);
-        return paramJson;
-    }
-
-    /**
-     * 转换更新参数
-     * @param jsonObject    用户接口参数,除了过滤项,其它项默认为修改项
-     * @param majors        过滤项
-     * @return              数据平台接口参数
-     */
-    public static JSONObject getUpdateParamJson(JSONObject jsonObject, String... majors){
-        JSONObject paramJson = new JSONObject();
-        JSONObject criteriaJson = new JSONObject();
-        Object value;
-        for(String major : majors){
-            value = jsonObject.get(major);
-            if(value != null && !"".equals(value.toString())){
-                criteriaJson.put(major, value);
-            }
-            jsonObject.remove(major);
-        }
-        paramJson.put("criteria", criteriaJson);
-        paramJson.put("set", jsonObject);
-
-        return paramJson;
-    }
-
-    /**
-     * 获得除去某些项的条件
-     * @param jsonObject    用户接口参数
-     * @param majors        过滤项
-     * @return              数据平台接口参数
-     */
-    public static JSONObject getCriteriaRemoveMajors(JSONObject jsonObject, String... majors){
-        JSONObject paramJson = new JSONObject();
-        for(String major : majors){
-            jsonObject.remove(major);
-        }
-        paramJson.put("criteria", jsonObject);
-        return paramJson;
-    }
-
-    /**
-     * 获得指定项的条件
-     * @param jsonObject    用户接口参数
-     * @param majors        过滤项
-     * @return              数据平台接口参数
-     */
-    public static JSONObject getCriteriaWithMajors(JSONObject jsonObject, String... majors){
-        JSONObject paramJson = new JSONObject();
-        JSONObject criteria = new JSONObject();
-        for(String major : majors){
-            criteria.put(major, jsonObject.get(major));
-        }
-        paramJson.put("criteria", criteria);
-        return paramJson;
-    }
-
-    /**
-     * 获得指定项的条件-用于批量查询
-     * @param jsonArray    用户接口参数
-     * @param key           参数的code码
-     * @param code          用户接口参数code码
-     * @return              数据平台接口参数
-     */
-    public static JSONObject getCriteriasWithMajors(JSONArray jsonArray, String key, String code){
-        JSONObject paramJson = new JSONObject();
-        JSONArray criterias = new JSONArray();
-        JSONObject criteria, json;
-        for(int i=0; i<jsonArray.size(); i++){
-            json = jsonArray.getJSONObject(i);
-            criteria = new JSONObject();
-            criteria.put(code, json.get(key));
-            criterias.add(criteria);
-        }
-        paramJson.put("criterias", criterias);
-        return paramJson;
-    }
-
-    /**
-     * 获得指定项的条件-用于批量查询
-     * @param jsonObject    用户接口参数
-     * @param key           参数的code码
-     * @param code          用户接口参数code码
-     * @return              数据平台接口参数
-     */
-    public static JSONObject getCriteriasWithMajors(JSONObject jsonObject, String key, String code){
-        JSONObject paramJson = new JSONObject();
-        JSONArray criterias = new JSONArray();
-        JSONObject criteria = new JSONObject();
-        criteria.put(code, jsonObject.get(key));
-        criterias.add(criteria);
-        paramJson.put("criterias", criterias);
-        return paramJson;
-    }
-    
-    /**
-     * 获得批量查询参数
-     * @param jsonObject 参数
-     * @param arrayInfo 批量数组名
-     * @param infoName  查询参数
-     * @param marjors   非批量参数
-     * @return
-     */
-    public static JSONObject getCriteriasWithMajors(JSONObject jsonObject, String arrayInfo, String infoName, String... marjors){
-        JSONObject paramJson = new JSONObject();
-        JSONArray criterias = new JSONArray();
-        JSONObject criteria;
-        JSONArray infos = jsonObject.getJSONArray(arrayInfo);
-        if(infos != null) {
-            for (int i=0; i<infos.size(); i++){
-                criteria = new JSONObject();
-                criteria.put(infoName, infos.get(i));
-                for(String marjor : marjors){
-                    if(!marjor.equals(infoName))
-                        criteria.put(marjor, jsonObject.get(marjor));
-                }
-                criterias.add(criteria);
-            }
-        }
-        paramJson.put("criterias", criterias);
-        return paramJson;
-    }
-
-    /**
-     * 获得数据平台查询条件
-     * @param codeName
-     * @param jsonObject
-     * @param majors
-     * @return
-     */
-    public static JSONObject getDataPlatCriteriaWithMajors(String codeName, JSONObject jsonObject, String... majors){
-        JSONObject paramJson = new JSONObject();
-        JSONObject criteria = new JSONObject();
-        if(codeName != null){
-            criteria.put("id", jsonObject.get(codeName));
-        }
-        for(String major : majors){
-            criteria.put(major, jsonObject.get(major));
-        }
-        paramJson.put("criteria", criteria);
-        return paramJson;
-    }
-
-    /**
-     * filter info
-     */
-    public static IJSONOperator filter = (jsonObject, filters) -> {
-        JSONObject returnJson = new JSONObject();
-        for(String filter : filters){
-            returnJson.put(filter, jsonObject.get(filter));
-        }
-        return returnJson;
-    };
-
-    /**
-     * remove info
-     */
-    public static IJSONOperator removeInfo = (jsonObject, infos) -> {
-        if(jsonObject != null){
-            for(String info : infos){
-                jsonObject.remove(info);
-            }
-        }
-        return jsonObject;
-    };
-
-    /**
-     * String to JSONObject/JSONArray
-     */
-    public static IJSONOperator processStringToJson = (jsonObject, marjors) ->{
-        if(jsonObject != null){
-            String content;
-            for(String marjor : marjors){
-                content = jsonObject.getString(marjor);
-                if(content != null){
-                    if(content.startsWith("{"))
-                        jsonObject.put(marjor, JSONObject.parseObject(content));
-                    else if(content.startsWith("["))
-                        jsonObject.put(marjor, JSONObject.parseArray(content));
-                }
-            }
-        }
-        return jsonObject;
-    };
-
-    /**
-     * tranfer infoValue of date type
-     */
-    public static IJSONOperator tranferTimeFormat = (jsonObject, marjors) ->{
-        SimpleDateFormat fsdf = new SimpleDateFormat(SopCommonConst.date_format_save);
-        SimpleDateFormat tsdf = new SimpleDateFormat(SopCommonConst.date_format_show);
-        for(String marjor : marjors){
-            if(jsonObject.containsKey(marjor))
-                jsonObject.put(marjor, tsdf.format(fsdf.parse(jsonObject.getString(marjor))));
-        }
-        return jsonObject;
-    };
-
-    /**
-     * process result : tranfer info of date type、 filter info、 process string to json
-     * @param queryResult query result
-     * @param tranferTimeFormat operation of tranfer info of date type
-     * @param processStringToJson operation of process string to json
-     * @param filter operation of filter info
-     * @param dataInfo parameter of tranfer info of date type
-     * @param jsonInfo parameter of process string to json
-     * @param filters parameter of filter info
-     * @return
-     * @throws Exception
-     */
-    public static JSONObject processQueryResult(String queryResult, IJSONOperator tranferTimeFormat, IJSONOperator processStringToJson, IJSONOperator filter, String dataInfo, String[] jsonInfo, String... filters) throws Exception {
-        JSONObject queryResultJson = JSONObject.parseObject(queryResult);
-        if("failure".equals(queryResultJson.getString("Result")) || queryResultJson.getIntValue("Count") < 1)
-            return queryResultJson;
-        JSONArray queryResultArray = queryResultJson.getJSONArray("Content");
-        JSONArray returnArray = new JSONArray();
-        JSONObject item;
-        for(int i=0; i<queryResultArray.size(); i++){
-            item = queryResultArray.getJSONObject(i);
-            if(tranferTimeFormat != null)
-                item = tranferTimeFormat.operation(item, dataInfo);
-            if(processStringToJson != null)
-                item = processStringToJson.operation(item, jsonInfo);
-            if(filter != null)
-                item = filter.operation(item, filters);
-            returnArray.add(item);
-        }
-        queryResultJson.put("Content", returnArray);
-        queryResultJson.put("Count", returnArray.size());
-        return queryResultJson;
-    }
-
-    /**
-     * get first record from query result
-     * @param queryResult query result
-     * @param tranferTimeFormat operation of tranfer info of date type
-     * @param processStringToJson operation of process string to json
-     * @param filter operation of filter info
-     * @param dataInfo parameter of tranfer info of date type
-     * @param jsonInfo parameter of process string to json
-     * @param filters parameter of filter info
-     * @return
-     * @throws Exception
-     */
-    public static JSONObject getFirstRecordfromResult(String queryResult, IJSONOperator tranferTimeFormat, IJSONOperator processStringToJson, IJSONOperator filter, String[] dataInfo, String[] jsonInfo, String... filters) throws Exception {
-        JSONObject queryResultJson = JSONObject.parseObject(queryResult);
-        if("failure".equals(queryResultJson.getString("Result")) || queryResultJson.getIntValue("Count") < 1)
-            return queryResultJson;
-        JSONArray queryResultArray = queryResultJson.getJSONArray("Content");
-        JSONObject item = queryResultArray.getJSONObject(0);
-        if(tranferTimeFormat != null)
-            item = tranferTimeFormat.operation(item, dataInfo);
-        if(processStringToJson != null)
-            item = processStringToJson.operation(item, jsonInfo);
-        if(filter != null)
-            item = filter.operation(item, filters);
-        queryResultJson.put("Item", item);
-        queryResultJson.remove("Content");
-        queryResultJson.remove("Count");
-        return queryResultJson;
-    }
-
-    /**
-     *
-     * 功能描述:处理查询返回结果,将结果中的内容项转化为JsonString
-     * @param queryResult
-     * @param majors
-     * @return
-     * @创建者 wanghailong
-     * @邮箱 wanghailong@persagy.com 
-     * @修改描述
-     */
-    public static String prossesResultToJsonString(String queryResult, String... majors){
-        if(queryResult.contains("Result") && queryResult.contains("Content")){
-            JSONObject resultJson = JSONObject.parseObject(queryResult);
-            JSONArray array = (JSONArray) resultJson.get("Content");
-            for(int i = 0 ; i < array.size() ; i++){
-                JSONObject dataJson = array.getJSONObject(i);
-                for(String major : majors){
-                    String dataString = dataJson.getString(major);
-                    if(!StringUtil.isNull(dataString)){
-                        if(dataString.startsWith("{")){
-                            dataJson.put(major, JSONObject.parseObject(dataJson.getString(major)));
-                        }else if(dataString.startsWith("[")){
-                            dataJson.put(major, JSONArray.parseArray(dataJson.getString(major)));
-                        }
-                    }
-                }
-                array.set(i, dataJson);
-            }
-            resultJson.put("Content", array);
-            queryResult = resultJson.toString();
-        }
-        return queryResult;
-    }
-
-    /**
-     *
-     * 功能描述:处理插入参数,将参数中的内容项转化为JsonString
-     * @param jsonObject
-     * @param majors
-     * @return
-     * @创建者 wanghailong
-     * @邮箱 wanghailong@persagy.com
-     * @修改描述
-     */
-    public static JSONObject prossesParamToJsonString(JSONObject jsonObject, String... majors){
-        for(String major : majors){
-            if(jsonObject.containsKey(major)){
-                jsonObject.put(major, JSON.toJSONString(jsonObject.get(major)));
-            }
-        }
-        return jsonObject;
-    }
-
-    /**
-     * 功能描述:处理查询返回结果,转换结果中Date类型的数据格式
-     * @param queryResult
-     * @param fromDateFormat
-     * @param toDateFormat
-     * @param majors
-     * @return
-     * @throws Exception
-     */
-    public static String prossesResultToDateString(String queryResult, String fromDateFormat, String toDateFormat , String... majors) throws Exception {
-        if(queryResult.contains("Result") && queryResult.contains("Content")){
-            JSONObject resultJson = JSONObject.parseObject(queryResult);
-            JSONArray array = (JSONArray) resultJson.get("Content");
-            SimpleDateFormat fsdf = new SimpleDateFormat(fromDateFormat);
-            SimpleDateFormat tsdf = new SimpleDateFormat(toDateFormat);
-            for(int i = 0 ; i < array.size() ; i++){
-                JSONObject dataJson = array.getJSONObject(i);
-                for(String major : majors){
-                    String dataString = dataJson.getString(major);
-                    if(!StringUtil.isNull(dataString)){
-                        dataJson.put(major, tsdf.format(fsdf.parse(dataString)));
-                    }
-                }
-                array.set(i, dataJson);
-            }
-            resultJson.put("Content", array);
-            queryResult = resultJson.toString();
-        }
-        return queryResult;
-    }
-
-    /**
-     *
-     * 功能描述:返回查询结果中的第一条记录
-     * @param queryResult
-     * @return
-     * @创建者 wanghailong
-     * @邮箱 wanghailong@persagy.com 
-     * @修改描述
-     */
-    public static String getFirstRecordfromResult(String queryResult){
-        if(queryResult.contains("Result") && queryResult.contains("Content")){
-            JSONObject resultJson = JSONObject.parseObject(queryResult);
-            JSONArray array = (JSONArray) resultJson.get("Content");
-            if(array.size() > 0 && null != array.get(0)) {
-                resultJson.put("Item", JSONObject.parseObject(array.get(0).toString()));
-                resultJson.remove("Content");
-                resultJson.remove("Count");
-            }
-
-            queryResult = resultJson.toString();
-        }
-        return queryResult;
-    }
-
-    /**
-     *
-     * 功能描述:返回查询结果中的第一条记录,Json格式
-     * @param queryResult
-     * @return
-     * @创建者 wanghailong
-     * @邮箱 wanghailong@persagy.com 
-     * @修改描述
-     */
-    public static JSONObject getFirstRecordfromResultWithJson(String queryResult){
-        JSONObject firstJson = null;
-        if(queryResult.contains("Result") && queryResult.contains("Content")){
-            JSONObject resultJson = JSONObject.parseObject(queryResult);
-            JSONArray array = (JSONArray) resultJson.get("Content");
-            if(array.size() > 0 && null != array.get(0)) {
-                firstJson = JSONObject.parseObject(array.get(0).toString());
-            }
-        }
-        return firstJson;
-    }
-
-    /**
-     * 转换返回结果数据格式 persagy --> saga
-     * @param queryResult
-     * @return
-     */
-    public static JSONObject translationResultFromPersagy(String queryResult){
-        JSONObject queryJson = JSONObject.parseObject(queryResult);
-        JSONObject result = new JSONObject();
-        result.put(Result.RESULT, queryJson.get(Result.PERSAGY_RESULT));
-        result.put(Result.CONTENT, queryJson.get(Result.PERSAGY_CONTENT));
-        result.put(Result.RESULTMSG, queryJson.get(Result.PERSAGY_REASON));
-        return result;
-    }
-
-
-    public static <K, V> Map<K, V> getMapFromResult(JSONObject resultJson, String keyCode, String valueCode){
-        Map<K, V> map = Maps.newHashMap();
-
-        JSONArray results = resultJson.getJSONArray(Result.CONTENT);
-        results = results == null ? new JSONArray() : results;
-        JSONObject result;
-
-        for(int i=0; i<results.size(); i++){
-            result = results.getJSONObject(i);
-            map.put((K)result.get(keyCode), (V)result.get(valueCode));
-        }
-
-        return map;
-    }
-
-    /**
-     * 排序
-     * @param queryResult
-     * @param field  排序的字段
-     * @param order      -1:倒序  1:正序
-     * @return
-     */
-    public static JSONObject sortByField(String queryResult, String field, int order){
-        JSONObject resultJson = JSONObject.parseObject(queryResult);
-        JSONArray contentArray = resultJson.getJSONArray("Content");
-        if(contentArray != null){
-            Collections.sort(contentArray, new Comparator<Object>(){
-                public int compare(Object str1, Object str2){
-                    JSONObject obj1 = JSONObject.parseObject(str1.toString());
-                    JSONObject obj2 = JSONObject.parseObject(str2.toString());
-                    if(obj1.getLongValue(field) > obj2.getLongValue(field)){
-                        return order;
-                    }
-                    if(obj1.getLongValue(field) == obj2.getLongValue(field)){
-                        return 0;
-                    }
-                    return -1 * order;
-                }
-            });
-        }
-        resultJson.put("Content", contentArray);
-        return resultJson;
-    }
-
-    /**
-     * 排序
-     * @param array
-     * @param field  排序的字段
-     * @param order      -1:倒序  1:正序
-     * @return
-     */
-    public static JSONArray sortByField(JSONArray array, String field, int order){
-        if(array != null){
-            Collections.sort(array, new Comparator<Object>(){
-                public int compare(Object str1, Object str2){
-                    JSONObject obj1 = JSONObject.parseObject(str1.toString());
-                    JSONObject obj2 = JSONObject.parseObject(str2.toString());
-                    if(obj1.getLongValue(field) > obj2.getLongValue(field)){
-                        return order;
-                    }
-                    if(obj1.getLongValue(field) == obj2.getLongValue(field)){
-                        return 0;
-                    }
-                    return -1 * order;
-                }
-            });
-        }
-        return array;
-    }
-    
-    /**
-     * 排序
-     * @param array
-     * @param field  排序的字段
-     * @param order      -1:倒序  1:正序
-     * @return
-     */
-    public static JSONArray sortByIntegerField(JSONArray array, String field, int order){
-    	if(array != null){
-    		Collections.sort(array, new Comparator<Object>(){
-    			public int compare(Object str1, Object str2){
-    				JSONObject obj1 = JSONObject.parseObject(str1.toString());
-    				JSONObject obj2 = JSONObject.parseObject(str2.toString());
-    				String order1_Str = obj1.getString(field);
-    				String order2_Str = obj2.getString(field);
-    				if(StringUtil.isNull(order1_Str)) {
-    					order1_Str = Integer.MIN_VALUE + "";
-    				}
-    				if(StringUtil.isNull(order2_Str)) {
-    					order2_Str = Integer.MIN_VALUE + "";
-    				}
-    				
-    				
-    				Integer order1 = Integer.valueOf(order1_Str);
-    				Integer order2 = Integer.valueOf(order2_Str);
-    				
-    				if(order1 > order2){
-    					return order;
-    				}
-    				if(order1 == order2){
-    					return 0;
-    				}
-    				return -1 * order;
-    			}
-    		});
-    	}
-    	return array;
-    }
-    /**
-     * 排序
-     * @param array
-     * @param field  排序的字段
-     * @param order      -1:倒序  1:正序
-     * @return
-     */
-    public static JSONArray sortByStringField(JSONArray array, String field, int order){
-    	if(array != null){
-    		Collections.sort(array, new Comparator<Object>(){
-    			public int compare(Object str1, Object str2){
-    				JSONObject obj1 = JSONObject.parseObject(str1.toString());
-    				JSONObject obj2 = JSONObject.parseObject(str2.toString());
-    				String order1 = obj1.getString(field);
-    				if(order1 == null) {
-    					order1 = "";
-    				}
-    				
-    				String order2 = obj2.getString(field);
-    				if(order2 == null) {
-    					order2 = "";
-    				}
-    				
-    				
-    				if(order1.compareTo(order2) > -1){
-    					return order;
-    				}
-    				return -1 * order;
-    			}
-    		});
-    	}
-    	return array;
-    }
-
-    /**
-     * 排序
-     * @param array
-     * @param field  排序的字段
-     * @param order      -1:倒序  1:正序
-     * @return
-     */
-    public static JSONArray sortByDateField(JSONArray array, String field, int order){
-    	if(array != null){
-    		Collections.sort(array, new Comparator<Object>(){
-    			public int compare(Object str1, Object str2){
-    				JSONObject obj1 = JSONObject.parseObject(str1.toString());
-    				JSONObject obj2 = JSONObject.parseObject(str2.toString());
-    				String order1_Str = obj1.getString(field);
-    				String order2_Str = obj2.getString(field);
-    				try {
-    					Date order1 = DateUtil.parseDate(SopCommonConst.date_format_save, order1_Str);
-    					Date order2 = DateUtil.parseDate(SopCommonConst.date_format_save, order2_Str);
-    					
-    					if(order1.getTime() > order2.getTime()){
-    						return order;
-    					}
-    					if(order1.getTime() == order2.getTime()){
-    						return 0;
-    					}
-					} catch (Exception e) {
-					}
-    				return -1 * order;
-    			}
-    		});
-    	}
-    	return array;
-    }
-    
-    public static void main(String[] args) {
-		JSONArray array = new JSONArray();
-		JSONObject object = new JSONObject();
-		object.put("create_time", "20171120000056");
-		array.add(object);
-		object = new JSONObject();
-		object.put("create_time", "20171120000001");
-		array.add(object);
-		object = new JSONObject();
-		object.put("create_time", "20171120000008");
-		array.add(object);
-		object = new JSONObject();
-		object.put("create_time", "20171120000004");
-		array.add(object);
-		object = new JSONObject();
-		object.put("create_time", "20171120000003");
-		array.add(object);
-		object = new JSONObject();
-		object.put("create_time", "20171120000015");
-		array.add(object);
-		object = new JSONObject();
-		object.put("create_time", "20171120000011");
-		array.add(object);
-		object = new JSONObject();
-		object.put("create_time", "20171120000003");
-		array.add(object);
-		object = new JSONObject();
-		object.put("create_time", "20171120000003");
-		array.add(object);
-		System.out.println(sortByDateField(array, "create_time", 1).toJSONString());
-		System.out.println(sortByDateField(array, "create_time", -1).toJSONString());
-	}
-    
-    
-}

+ 2 - 1
fm-sop/src/main/java/com/persagy/old/common/DateUtil.java

@@ -8,6 +8,7 @@
 
 package com.persagy.old.common;
 
+import com.persagy.fm.common.constant.CommonConstant;
 import com.persagy.fm.sop.constant.SopCommonConst;
 
 import java.text.ParseException;
@@ -25,7 +26,7 @@ public class DateUtil {
     public static String sdfHour = "yyyyMMddHH";
 
 	public static String getNowTimeStr() {
-    	SimpleDateFormat sdf = new SimpleDateFormat(SopCommonConst.date_format_save);
+    	SimpleDateFormat sdf = new SimpleDateFormat(CommonConstant.date_format_save);
         return sdf.format(new Date());
     }
     

+ 3 - 2
fm-sop/src/main/java/com/persagy/old/common/JSONUtil.java

@@ -3,6 +3,7 @@ package com.persagy.old.common;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.persagy.fm.common.constant.CommonConstant;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.common.old.utils.ToolsUtil;
 import com.persagy.fm.sop.constant.SopCommonConst;
@@ -354,8 +355,8 @@ public class JSONUtil {
      * tranfer infoValue of date type
      */
     public static IJSONOperator tranferTimeFormat = (jsonObject, marjors) ->{
-        SimpleDateFormat fsdf = new SimpleDateFormat(SopCommonConst.date_format_save);
-        SimpleDateFormat tsdf = new SimpleDateFormat(SopCommonConst.date_format_show);
+        SimpleDateFormat fsdf = new SimpleDateFormat(CommonConstant.date_format_save);
+        SimpleDateFormat tsdf = new SimpleDateFormat(CommonConstant.date_format_show);
         for(String marjor : marjors){
             if(jsonObject.containsKey(marjor))
                 jsonObject.put(marjor, tsdf.format(fsdf.parse(jsonObject.getString(marjor))));

+ 18 - 9
fm-workorder/pom.xml

@@ -16,20 +16,20 @@
     </properties>
     <repositories>
         <repository>
-            <id>SagaCloud</id>
-            <name>SagaCloud</name>
-            <url>http://47.93.33.207:8082/repository/SagaCloud/</url>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
+            <id>Persagy</id>
+            <name>Persagy</name>
+            <url>http://47.93.132.139:8081/nexus/content/groups/public/</url>
             <releases>
                 <enabled>true</enabled>
             </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
         </repository>
         <repository>
-            <id>Persagy</id>
-            <name>Persagy</name>
-            <url>http://47.93.132.139:8081/nexus/content/groups/public/</url>
+            <id>integrated</id>
+            <name>integrated</name>
+            <url>http://47.93.132.139:8081/nexus/content/repositories/integrated/</url>
             <releases>
                 <enabled>true</enabled>
             </releases>
@@ -76,6 +76,10 @@
             <artifactId>velocity-engine-core</artifactId>
             <version>2.3</version>
         </dependency>
+        <dependency>
+            <groupId>com.persagy</groupId>
+            <artifactId>fm-package</artifactId>
+        </dependency>
         <!-- swagger -->
         <dependency>
             <groupId>com.persagy</groupId>
@@ -158,5 +162,10 @@
             <artifactId>integrated-db-spring-boot-starter</artifactId>
             <version>1.0.0</version>
         </dependency>
+        <dependency>
+            <groupId>com.persagy</groupId>
+            <artifactId>integrated-redis-spring-boot-starter</artifactId>
+            <version>1.0.0</version>
+        </dependency>
     </dependencies>
 </project>

+ 70 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/cache/OrderTypeCache.java

@@ -0,0 +1,70 @@
+package com.persagy.fm.workorder.cache;
+
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.fm.workorder.constant.RedisConstant;
+import com.persagy.fm.workorder.domain.entity.WoFlowPlan;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.log4j.Logger;
+import org.springframework.data.redis.core.RedisOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+@Component
+@Slf4j
+@RequiredArgsConstructor
+public class OrderTypeCache {
+    private final RedisTemplate<String,String> redisTemplate;
+
+    public  String getNameByTypeCode(String code){
+        String orderTypeStr = (String) redisTemplate.opsForHash().get(RedisConstant.ALL_WO_FLOW_PLAN_PERSAGY_KEY, code);
+
+        if (orderTypeStr!=null){
+            JSONObject orderType = JSONObject.parseObject(orderTypeStr);
+            return orderType.getString("plan_name");
+        }
+        log.error("OrderTypeCache:getNameByTypeCode" + "未获取到缓存:" + code);
+        return "";
+    }
+
+    public  String getWorkTypeByCode(String code){
+        String orderTypeStr = (String) redisTemplate.opsForHash().get(RedisConstant.ALL_WO_FLOW_PLAN_PERSAGY_KEY, code);
+
+        if (orderTypeStr!=null){
+            JSONObject orderType = JSONObject.parseObject(orderTypeStr);
+            return orderType.getString("work_type");
+        }
+        log.error("OrderTypeCache:getWorkTypeByCode" + "未获取到缓存:" + code);
+        return "";
+    }
+    /***
+     * Description: 更新缓存
+     * @param woFlowPlan : 工单类型
+     * @return : boolean  
+     * @author : lijie
+     * @date :2021/5/8 14:58
+     * Update By lijie 2021/5/8 14:58
+     */
+    public boolean updateCache(WoFlowPlan woFlowPlan){
+        boolean resultFlag = true;
+        String orderTypeId = woFlowPlan.getPlanId();
+        String planName = woFlowPlan.getPlanName();
+        String workType = woFlowPlan.getWorkType();
+        String excuteType = woFlowPlan.getExecuteType();
+        String functionType = woFlowPlan.getFunctionType();
+        JSONObject orderTypeObj = new JSONObject();
+        orderTypeObj.put("plan_name", planName);
+        orderTypeObj.put("work_type", workType);
+        orderTypeObj.put("execute_type", excuteType);
+        orderTypeObj.put("function_type", functionType);
+        try {
+            redisTemplate.opsForHash().put(RedisConstant.ALL_WO_FLOW_PLAN_PERSAGY_KEY, orderTypeId, orderTypeObj.toJSONString());
+        }catch (Exception e){
+            resultFlag =  false;
+            log.error("更新工单类型缓存失败:"+e);
+        }
+        return resultFlag;
+    }
+}

+ 10 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/client/SaasClient.java

@@ -18,6 +18,16 @@ public interface SaasClient {
      */
     @PostMapping(value = "/restGeneralDictService/queryGeneralDictByDictType")
     String queryGeneralDictByDictType(@RequestBody JSONObject param);
+    /***
+     * Description: 查询部门岗位树
+     * @param param : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/4/9 21:51
+     * Update By lijie 2021/4/9 21:51
+     */
+    @PostMapping(value = "/restDeptService/queryDeptPositionTree")
+    String queryDeptPositionTree(@RequestBody JSONObject param);
 
 
 }

+ 1 - 7
fm-workorder/src/main/java/com/persagy/fm/workorder/client/SaasFallBackFactory.java

@@ -1,14 +1,9 @@
 package com.persagy.fm.workorder.client;
 
-import com.alibaba.fastjson.JSONObject;
-import com.persagy.fm.common.model.vo.GeneralDictVo;
-import com.persagy.fm.common.old.utils.OldResponseResultUtil;
 import feign.hystrix.FallbackFactory;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
-import java.util.Collections;
-
 /**
  * @author yuecaipu
  * @version 1.0
@@ -20,7 +15,6 @@ import java.util.Collections;
 public class SaasFallBackFactory implements FallbackFactory<SaasClient> {
 	@Override
 	public SaasClient create(Throwable throwable) {
-		return queryGeneralDictVo -> JSONObject.toJSONString(OldResponseResultUtil
-				.successResult(Collections.singletonList(GeneralDictVo.builder().build())));
+		return null;
 	}
 }

+ 31 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/config/MybatisConfigure.java

@@ -0,0 +1,31 @@
+package com.persagy.fm.workorder.config;
+
+import com.persagy.db.config.DateMetaObjectHandler;
+import com.persagy.db.properties.MybatisPlusAutoFillProperties;
+import lombok.RequiredArgsConstructor;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+@Configuration
+@EnableConfigurationProperties({MybatisPlusAutoFillProperties.class})
+@RequiredArgsConstructor
+public class MybatisConfigure {
+
+    private final MybatisPlusAutoFillProperties autoFillProperties;
+
+    @Bean
+    @ConditionalOnProperty(
+            prefix = "integrated.mybatis-plus.auto-fill",
+            name = {"enabled"},
+            havingValue = "true",
+            matchIfMissing = true
+    )
+    @Primary
+    public DateMetaObjectHandler dateMetaObjectHandler(){
+        return new DateMetaObjectHandler(this.autoFillProperties);
+    }
+
+}

+ 2 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/constant/FlowPlanConstant.java

@@ -12,4 +12,6 @@ public class FlowPlanConstant {
     public final static String PLAN_NAME = "plan_name";
     /**工作类型*/
     public final static String WORK_TYPE = "work_type";
+    /**系统岗位id*/
+    public final static String SYSTEM_POSITION = "systemPosition";
 }

+ 308 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/constant/RedisConstant.java

@@ -0,0 +1,308 @@
+package com.persagy.fm.workorder.constant;
+
+public class RedisConstant {
+    /**
+     * 存储管理分区集合的key,String类型
+     * MANAGE_PARATION_LIST_KEY:[{管理分区},{管理分区}]
+     */
+    public static final String MANAGE_PARTITION_LIST_KEY="MANAGE_PARTITION_LIST";
+
+    /**
+     * 索引为5的redis库中存放不加入报表统计的表的键名
+     * 格式为String格式
+     */
+    public static final String NO_JOIN_COUNT="NO_JOIN_COUNT_PROJECT_IDS";
+    /**
+     * redis库中存所有项目名称的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_PROJECT_NAMES_KEY="ALL_PROJECT_NAMES";
+    /**
+     * redis库中存所有启用状态的项目id
+     * 格式为Set格式
+     */
+    public static final String ALL_ENABLED_PROJECTIDS_KEY="ALL_ENABLED_PROJECTIDS";
+    /**
+     * redis库中存所有停用状态的项目信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_PROJECTS_KEY = "ALL_PROJECTS";
+
+    /**
+     * redis库中存所有的项目信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_DATA_PLATFORM_PROJECTS_KEY = "ALL_DATA_PLATFORM_PROJECTS_KEY";
+
+    /**
+     * redis库中存所有权限包信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_AUTHO_PACKAGES_KEY = "ALL_AUTHO_PACKAGES";
+
+    /**
+     * redis库中存所有部门信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_DEPT_KEY = "ALL_DEPTS";
+
+    /**
+     * redis库中存工单类型信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_WO_FLOW_PLAN_PERSAGY_KEY = "ALL_WO_FLOW_PLAN_PERSAGY";
+
+    /**
+     * redis库中存所有岗位信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_POSITIONS_KEY = "ALL_POSITIONS";
+    /**
+     * redis库中存所有岗位信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_POSITIONS_DEPT_KEY = "ALL_POSITIONS_DEPT";
+    /**
+     * redis库中存所有人员基本信息的key,使用人员id作为key
+     * 格式为Hash格式
+     */
+    public static final String PERSON_CACHE_ID="PERSON_CACHE_ID";
+    /**
+     * redis库中存所有人员基本信息的key,PERSON_CACHE_USER_ID_人员id_用户id
+     * 格式为String格式
+     */
+    public static final String PERSON_CACHE_USER_ID="PERSON_CACHE_USER_ID";
+    /**
+     * redis库中存所有项目人员信息的key,使用PERSON_PROJECT_POSITION_人员id_项目id_岗位id
+     * 格式为String格式
+     */
+    public static final String PERSON_PROJECT_POSITION_PREFIX = "PERSON_PROJECT_POSITION";
+    /**
+     * redis库中存所有专业类型信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_SPECIALTY_KEY = "ALL_SPECIALTY";
+
+    /**
+     * redis库中存组件关系表信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_COMPONENT_RELATION_KEY = "ALL_COMPONENT_RELATION";
+
+
+    /**
+     * redis库中存信息点组件表信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_INFO_COMPONENT_KEY = "ALL_INFO_COMPONENT";
+
+
+    /**
+     * redis库中存数据字典表信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_GENERAL_DICTIONARY_KEY = "ALL_GENERAL_DICTIONARY";
+
+
+    /**
+     * redis库中存对象工单提醒配置表信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_OBJ_WO_REMIND_CONFIG_KEY = "ALL_OBJ_WO_REMIND_CONFIG";
+
+    /**
+     * redis库中存事件订阅管理表信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_EVENT_AUTHORITY_KEY = "ALL_EVENT_AUTHORITY";
+
+    /**
+     * redis库中存储所有任务类型的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_TASK_TYPE_KEY = "ALL_TASK_TYPE";
+    /**
+     * redis库中存储所有任务类型名称的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_TASK_TYPE_NAME_KEY = "ALL_TASK_TYPE_NAME";
+
+    /**
+     * redis库中存储所有节点类型的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_NODE_TYPE_KEY = "ALL_NODE_TYPE";
+    /**
+     * redis库中存储所有节点类型名称的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_NODE_TYPE_NAME_KEY = "ALL_NODE_TYPE_NAME";
+
+    /**
+     * redis库中存储所有重要级别的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_URGENCY_KEY = "ALL_URGENCY";
+    /**
+     * redis库中存储所有重要级别名称的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_URGENCY_NAME_KEY = "ALL_URGENCY_NAME";
+
+    /**
+     * redis库中存储所有审核流程的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_AUDIT_STREAM_KEY = "ALL_AUDIT_STREAM";
+    /**
+     * redis库中存储所有审核流程名称的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_AUDIT_STREAM_NAME_KEY = "ALL_AUDIT_STREAM_NAME";
+    /**
+     * redis库中存储项目计划引用集团计划个数的键
+     * 格式为Hash格式
+     */
+    public static final String ALL_QUOTE_GOUP_PLAN_NUM_KEY = "ALL_QUOTE_GOUP_PLAN_NUM";
+
+    /**
+     * redis库中存所有合同类型提醒设置表
+     * 格式为Hash格式
+     */
+    public static final String ALL_CONTRACT_TYPE_KEY = "ALL_CONTRACT_TYPE";
+    /**
+     * redis库中存所有供应商类型信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_SUPPLIER_TYPE_KEY = "ALL_SUPPLIER_TYPE";
+
+    /**
+     * redis库中存所有供应商类型扩展信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_SUPPLIER_TYPE_EXTEND_KEY = "ALL_SUPPLIER_TYPE_EXTEND";
+
+    /**
+     * redis库中存所有供应商信息
+     * 格式为Hash格式
+     */
+    public static final String ALL_SUPPLIER_KEY = "ALL_SUPPLIER";
+
+    /**
+     * redis库中存 信息点方案id:系统启动时会创建自定义信息点方案,创建成功会返回方案id,赋值给UNIQUE_SCHEME,创建操作只执行一次
+     * 格式为Hash格式
+     */
+    public static final String UNIQUE_SCHEME_KEY = "UNIQUE_SCHEME";
+
+    /**
+     * redis库中存所有项目、建筑功能类型缓存的Key
+     * 格式为Hash格式
+     */
+    public static final String ALL_FUNCTION_TYPES_KEY = "ALL_FUNCTION_TYPES_KEY";
+
+    /**
+     * redis库中存所有地理位置-省市区缓存类型的Key
+     * 格式为Hash格式
+     */
+    public static final String ALL_GEOGRAPHY_KEY = "ALL_GEOGRAPHY_KEY";
+
+    /**
+     * redis库中存所有用户信息,user_id为hkey
+     * 格式为Hash格式
+     */
+    public static final String ALL_USERS_KEY = "ALL_USERS";
+
+    /**
+     * redis库中存所有用户信息,hkey为用户名
+     * 格式为Hash格式
+     */
+    public static final String All_USERS_NAME_KEY = "ALL_USERS_NAME";
+    /**
+     * redis库中存所有用户密码的MD5值,user_id为hkey
+     * 格式为Hash格式
+     */
+    public static final String ALL_USERS_PASS_MD5_KEY = "ALL_USERS_PASS_MD5_KEY";
+
+    /**
+     * redis库中存权限包id最大个数的Key
+     * 格式为Hash格式
+     */
+    public static final String AUTHORIZATION_INCR_ID = "authorizationIncrId";
+
+    /**
+     * redis库中存储的所有功能点
+     */
+    public static final String ALL_FUNCTIONS_KEY = "ALL_FUNCTIONS";
+    /**
+     * redis库中存储的所有资源点
+     */
+    public static final String ALL_RESOURCES_KEY = "ALL_RESOURCES";
+    /**
+     * redis库中存储的所有功能标签KEY
+     */
+    public static final String ALL_FUNCTIONTAGS_KEY = "ALL_FUNCTIONTAGS";
+
+    /**
+     * redis库中存所有事件类型数据
+     * 格式为String格式
+     */
+    public static final String ALL_EVENT_TYPES = "ALL_EVENT_TYPES";
+
+    /**
+     * redis库中存所有事件来源数据
+     * 格式为String格式
+     */
+    public static final String ALL_EVENT_SOURCES = "ALL_EVENT_SOURCES";
+
+    /**
+     * redis库中存所有紧急程度数据
+     * 格式为String格式
+     */
+    public static final String ALL_EVENT_URGENCYS = "ALL_EVENT_URGENCYS";
+    /**
+     * redis库中存所有关闭类型数据
+     * 格式为String格式
+     */
+    public static final String ALL_EVENT_CLOSE_TYPES = "ALL_EVENT_CLOSE_TYPES";
+
+    /**
+     * redis库中存所有问题原因数据
+     * 格式为String格式
+     */
+    public static final String ALL_EVENT_ROOT_REASONS = "ALL_EVENT_ROOT_REASONS";
+
+    /**
+     * redis库中存所有问题类型数据
+     * 格式为String格式
+     */
+    public static final String ALL_EVENT_PROBLEM_TYPES = "ALL_PROBLEM_TYPES";
+
+    /**
+     * redis库中存所有问题类型树数据
+     * 格式为String格式
+     */
+    public static final String PROBLEM_TYPES_TREE = "PROBLEM_TYPES_TREE";
+    /**
+     * redis库中存数据平台中的专业-名称数据
+     * 格式为String格式
+     */
+    public static final String ALL_DOMAIN_SPECIALITY_KEY = "ALL_DOMAIN_SPECIALITY";
+    /**
+     * redis库中存数据平台中的系统类-名称数据
+     * 格式为String格式
+     */
+    public static final String ALL_SYSTEM_CLASS_KEY = "ALL_SYSTEM_CLASS";
+    /**
+     * redis库中存数据平台中的设备类-名称数据
+     * 格式为String格式
+     */
+    public static final String ALL_EQUIPMENT_CLASS_KEY = "ALL_EQUIPMENT_CLASS";
+
+
+    /**
+     * redis库中存数据平台中的图实例ID 项目id:图类型 -- 图实例ID  数据
+     * 格式为String格式
+     */
+    public static final String ALL_GRAPH_INSTANCE_KEY = "ALL_GRAPH_INSTANCE";
+
+}

+ 30 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/constant/enums/WoFlowPlanStatusEnum.java

@@ -0,0 +1,30 @@
+package com.persagy.fm.workorder.constant.enums;
+
+public enum WoFlowPlanStatusEnum {
+    REVISE("0","需维护"),
+    NORMAL("1","正常");
+
+    WoFlowPlanStatusEnum(String type, String describe) {
+        this.type = type;
+        this.describe = describe;
+    }
+
+    private String type;
+    private String describe;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getDescribe() {
+        return describe;
+    }
+
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+}

+ 150 - 176
fm-workorder/src/main/java/com/persagy/fm/workorder/controller/WoFlowPlanController.java

@@ -9,13 +9,20 @@
 package com.persagy.fm.workorder.controller;
 
 
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
+import com.persagy.common.exception.BusinessException;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.common.old.utils.ToolsUtil;
+import com.persagy.fm.common.validator.Insert;
+import com.persagy.fm.common.validator.Update;
+import com.persagy.fm.workorder.domain.vo.WoFlowPlanVo;
+import com.persagy.fm.workorder.domain.vo.BaseQueryFlowPlanVo;
 import com.persagy.fm.workorder.domain.vo.QueryFlowPlanListVo;
 import com.persagy.fm.workorder.domain.vo.QueryVerifyFlowPlanVo;
 import com.persagy.fm.workorder.service.IWoFlowPlanService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -58,182 +65,149 @@ public class WoFlowPlanController{
 	public String verifyFlowPlan(@RequestBody @Validated QueryVerifyFlowPlanVo queryVerifyFlowPlanVo) throws Exception {
 		return flowPlanService.verifyFlowPlan(queryVerifyFlowPlanVo);
 	}
-//
-//	/**
-//	 *
-//	 * Description: 查询部门岗位树
-//	 * @return 中心部门和项目通用部门的岗位
-//	 * @throws Exception String
-//	 * @author ChenQuanWei
-//	 * @since 2018年5月11日: 下午2:40:57
-//	 * Update By ChenQuanWei 2018年5月11日: 下午2:40:57
-//	 */
-//	@PostMapping("/queryDeptPositionTree")
-//	public String queryDeptPositionTree(@RequestBody JSONObject jsonObject) throws Exception{
-//		if( ! StringUtil.isNull(jsonObject, "user_id")){
-//			return flowPlanService.queryDeptPositionTree(jsonObject.toJSONString());
-//		}
-//		return ToolsUtil.return_error_json;
-//
-//	}
-//
-//	/**
-//	 *
-//	 * 功能描述:根据Id删除工单类型
-//	 * @return
-//	 * @throws Exception
-//	 * @创建者 wanghailong
-//	 * @邮箱 wanghailong@persagy.com
-//	 * @修改描述
-//	 */
-//	@PostMapping("/deleteFlowPlanById")
-//	public String deleteFlowPlanById(@RequestBody JSONObject jsonObject) throws Exception {
-//		if(!StringUtil.isNull(jsonObject, "user_id", "plan_id")){
-//			return flowPlanService.deleteFlowPlanById(jsonObject.toJSONString());
-//		}else{
-//			return ToolsUtil.return_error_json;
-//		}
-//	}
-//
-//	/**
-//	 *
-//	 * 功能描述:查询项目下所有流转方案
-//	 * @return
-//	 * @throws Exception
-//	 * @创建者 wanghailong
-//	 * @邮箱 wanghailong@persagy.com
-//	 * @修改描述
-//	 */
-//	@PostMapping("/queryProjectFlowPlan")
-//	public String queryProjectFlowPlan(@RequestBody JSONObject jsonObject) throws Exception {
-//		if(!StringUtil.isNull(jsonObject, "user_id", "project_id")){
-//			return flowPlanService.queryProjectFlowPlan(jsonObject.toJSONString());
-//		}else{
-//			return ToolsUtil.return_error_json;
-//		}
-//	}
-//
-//
-//	/**
-//	 * 功能描述:验证工单方案岗位职责
-//	 * @param jsonStr
-//	 * @return
-//	 * @throws Exception
-//	 */
-////	@Path("verifyPostAndDuty")
-////	@POST
-////	@PostMapping("/planBatchUpdate")
-////	public String verifyPostAndDuty(@RequestBody JSONObject jsonObject) throws Exception{
-////		JSONObject jsonObject = JSONObject.parseObject(jsonObject.toJSONString());
-////		if(!StringUtil.isNull(jsonObject, "user_id", "project_id") && !StringUtil.isEmptyList(jsonObject, "post_and_duty")){
-////			return flowPlanService.verifyPostAndDuty(jsonObject.toJSONString());
-////		}
-////		return ToolsUtil.return_error_json;
-////	}
-//
-//	/**
-//	 *
-//	 * 功能描述:添加工单流转方案信息
-//	 * @return
-//	 * @throws Exception
-//	 * @创建者 wanghailong
-//	 * @邮箱 wanghailong@persagy.com
-//	 * @修改描述
-//	 */
-//	@PostMapping("/addFlowPlan")
-//	public String addFlowPlan(@RequestBody JSONObject jsonObject) throws Exception {
-//		if(!StringUtil.isNull(jsonObject, "user_id", "work_type", "execute_type","plan_name") && !StringUtil.isEmptyList(jsonObject, "post_and_duty")){
-//			return flowPlanService.addFlowPlan(jsonObject.toJSONString());
-//		}else{
-//			return ToolsUtil.return_error_json;
-//		}
-//	}
-//
-//	/**
-//	 *
-//	 * 功能描述:根据Id查询工单详细信息
-//	 * @return
-//	 * @throws Exception
-//	 * @创建者 wanghailong
-//	 * @邮箱 wanghailong@persagy.com
-//	 * @修改描述
-//	 */
-//	@PostMapping("/queryFlowPlanById")
-//	public String queryFlowPlanById(@RequestBody JSONObject jsonObject) throws Exception {
-//		if(!StringUtil.isNull(jsonObject, "user_id", "plan_id")){
-//			return flowPlanService.queryFlowPlanById(jsonObject.toJSONString());
-//		}else{
-//			return ToolsUtil.return_error_json;
-//		}
-//	}
-//
-//	/**
-//	 *
-//	 * 功能描述:根据Id编辑流转方案信息
-//	 * @return
-//	 * @throws Exception
-//	 * @创建者 wanghailong
-//	 * @邮箱 wanghailong@persagy.com
-//	 * @修改描述
-//	 */
-//	@PostMapping("/updateFlowPlanById")
-//	public String updateFlowPlanById(@RequestBody JSONObject jsonObject) throws Exception {
-//		if(!StringUtil.isNull(jsonObject, "user_id", "plan_id", "work_type", "execute_type")){
-//			return flowPlanService.updateFlowPlanById(jsonObject.toJSONString());
-//		}else{
-//			return ToolsUtil.return_error_json;
-//		}
-//	}
-//
-//	/**
-//	 * Description: 根据工作类型查询所有有效工单流转方案信息
-//	 * @return String
-//	 * @author ChenQuanWei
-//	 * @throws Exception
-//	 * @since 2018年7月5日: 上午8:53:26
-//	 * Update By ChenQuanWei 2018年7月5日: 上午8:53:26
-//	 */
-//	@PostMapping("/queryFlowPlanByWorkType")
-//	public String queryFlowPlanByWorkType(@RequestBody JSONObject jsonObject) throws Exception{
-//		if( ! StringUtil.isNull(jsonObject, "user_id", "work_type")){
-//			return flowPlanService.queryFlowPlanByWorkType(jsonObject.toJSONString());
-//		} else {
-//			return ToolsUtil.return_error_json;
-//		}
-//	}
-//	/**
-//	 * Description: 根据时间类型查询所有有效流转方案信息
-//	 * @return
-//	 * @throws Exception String
-//	 * @author ChenQuanWei
-//	 * @since 2018年7月5日: 上午10:34:23
-//	 * Update By ChenQuanWei 2018年7月5日: 上午10:34:23
-//	 */
-//	@PostMapping("/queryFlowPlanByExecuteType")
-//	public String queryFlowPlanByExecuteType(@RequestBody JSONObject jsonObject) throws Exception{
-//		if( ! StringUtil.isNull(jsonObject, "user_id", "execute_type")){
-//			return flowPlanService.queryFlowPlanByExecuteType(jsonObject.toJSONString());
-//		} else {
-//			return ToolsUtil.return_error_json;
-//		}
-//
-//	}
-//	/**
-//	 * Description: 通过工单类型名称查询所有有效工单
-//	 * @return
-//	 * @throws Exception String
-//	 * @author ChenQuanWei
-//	 * @since 2018年7月5日: 上午10:38:37
-//	 * Update By ChenQuanWei 2018年7月5日: 上午10:38:37
-//	 */
-//	@PostMapping("/queryFlowPlanByPlanName")
-//	public String queryFlowPlanByPlanName(@RequestBody JSONObject jsonObject) throws Exception{
-//		if( ! StringUtil.isNull(jsonObject, "user_id", "plan_name")){
-//			return flowPlanService.queryFlowPlanByPlanName(jsonObject.toJSONString());
-//		} else {
-//			return ToolsUtil.return_error_json;
-//		}
-//	}
+
+	/***
+	 * Description: 查询部门岗位树
+	 * @param jsonObject : 请求参数
+	 * @return : java.lang.String
+	 * @author : lijie
+	 * @date :2021/5/8 10:23
+	 * Update By lijie 2021/5/8 10:23
+	 */
+	@PostMapping("/queryDeptPositionTree")
+	public String queryDeptPositionTree(@RequestBody JSONObject jsonObject) throws Exception{
+		if( ! StringUtil.isNull(jsonObject, "user_id")){
+			return flowPlanService.queryDeptPositionTree(jsonObject.toJSONString());
+		}
+		return ToolsUtil.return_error_json;
+	}
+
+	/***
+	 * Description: 根据Id删除工单类型
+	 * @param jsonObject : 请求参数
+	 * @return : java.lang.String  
+	 * @author : lijie
+	 * @date :2021/5/8 10:23
+	 * Update By lijie 2021/5/8 10:23
+	 */
+	@PostMapping("/deleteFlowPlanById")
+	public String deleteFlowPlanById(@RequestBody JSONObject jsonObject) throws Exception {
+		if(!StringUtil.isNull(jsonObject, "user_id", "plan_id")){
+			return flowPlanService.deleteFlowPlanById(jsonObject.toJSONString());
+		}else{
+			return ToolsUtil.return_error_json;
+		}
+	}
+
+	/***
+	 * Description: 查询项目下所有流转方案
+	 * @param queryFlowPlanListVo : 请求参数
+	 * @return : java.lang.String
+	 * @author : lijie
+	 * @date :2021/5/8 10:31
+	 * Update By lijie 2021/5/8 10:31
+	 */
+	@PostMapping("/queryProjectFlowPlan")
+	public String queryProjectFlowPlan(@RequestBody @Validated QueryFlowPlanListVo queryFlowPlanListVo) throws Exception {
+		if (StrUtil.isBlank(queryFlowPlanListVo.getProjectId())){
+			return ToolsUtil.return_error_json;
+		}
+		return flowPlanService.queryProjectFlowPlan(queryFlowPlanListVo);
+	}
+
+	/***
+	 * Description: 添加工单流转方案信息
+	 * @param woFlowPlanVo : 请求参数
+	 * @return : java.lang.String
+	 * @author : lijie
+	 * @date :2021/5/8 11:21
+	 * Update By lijie 2021/5/8 11:21
+	 */
+	@PostMapping("/addFlowPlan")
+	@Transactional(rollbackFor = BusinessException.class)
+	public String addFlowPlan(@RequestBody @Validated(Insert.class) WoFlowPlanVo woFlowPlanVo) throws Exception {
+		return flowPlanService.addFlowPlan(woFlowPlanVo);
+	}
+
+	/***
+	 * Description: 根据Id查询工单详细信息
+	 * @param baseQueryFlowPlanVo : 请求参数
+	 * @return : java.lang.String  
+	 * @author : lijie
+	 * @date :2021/5/8 15:01
+	 * Update By lijie 2021/5/8 15:01
+	 */
+	@PostMapping("/queryFlowPlanById")
+	public String queryFlowPlanById(@RequestBody @Validated BaseQueryFlowPlanVo baseQueryFlowPlanVo) throws Exception {
+		if (StrUtil.isBlank(baseQueryFlowPlanVo.getPlanId())){
+			return ToolsUtil.return_error_json;
+		}
+		return flowPlanService.queryFlowPlanById(baseQueryFlowPlanVo);
+	}
+
+	/***
+	 * Description: 根据Id编辑流转方案信息
+	 * @param woFlowPlanVo : 请求参数
+	 * @return : java.lang.String  
+	 * @author : lijie
+	 * @date :2021/5/8 16:19
+	 * Update By lijie 2021/5/8 16:19
+	 */
+	@PostMapping("/updateFlowPlanById")
+	public String updateFlowPlanById(@RequestBody @Validated(Update.class) WoFlowPlanVo woFlowPlanVo) throws Exception {
+		return flowPlanService.updateFlowPlanById(woFlowPlanVo);
+	}
+
+	/***
+	 * Description: 根据工作类型查询所有有效工单流转方案信息
+	 * @param jsonObject : 请求参数
+	 * @return : java.lang.String  
+	 * @author : lijie
+	 * @date :2021/5/8 17:04
+	 * Update By lijie 2021/5/8 17:04
+	 */
+	@PostMapping("/queryFlowPlanByWorkType")
+	public String queryFlowPlanByWorkType(@RequestBody JSONObject jsonObject) throws Exception{
+		if(!StringUtil.isNull(jsonObject, "user_id", "work_type")){
+			return flowPlanService.queryFlowPlanByWorkType(jsonObject.getString("work_type"));
+		} else {
+			return ToolsUtil.return_error_json;
+		}
+	}
+	/***
+	 * Description: 根据时间类型查询所有有效流转方案信息
+	 * @param jsonObject : 请求参数
+	 * @return : java.lang.String  
+	 * @author : lijie
+	 * @date :2021/5/8 17:08
+	 * Update By lijie 2021/5/8 17:08
+	 */
+	@PostMapping("/queryFlowPlanByExecuteType")
+	public String queryFlowPlanByExecuteType(@RequestBody JSONObject jsonObject) throws Exception{
+		if( ! StringUtil.isNull(jsonObject, "user_id", "execute_type")){
+			return flowPlanService.queryFlowPlanByExecuteType(jsonObject.getString("execute_type"));
+		} else {
+			return ToolsUtil.return_error_json;
+		}
+
+	}
+	/***
+	 * Description: 通过工单类型名称查询所有有效工单
+	 * @param jsonObject : 请求参数
+	 * @return : java.lang.String  
+	 * @author : lijie
+	 * @date :2021/5/8 17:12
+	 * Update By lijie 2021/5/8 17:12
+	 */
+	@PostMapping("/queryFlowPlanByPlanName")
+	public String queryFlowPlanByPlanName(@RequestBody JSONObject jsonObject) throws Exception{
+		if( ! StringUtil.isNull(jsonObject, "user_id", "plan_name")){
+			return flowPlanService.queryFlowPlanByPlanName(jsonObject.getString("plan_name"));
+		} else {
+			return ToolsUtil.return_error_json;
+		}
+	}
+	// TODO 维修项的需要等工单重构后才能做这两个接口
 //
 //
 //

+ 2 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/domain/dto/NextRouteBean.java

@@ -4,12 +4,14 @@ import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
+@Builder
 public class NextRouteBean {
     @ApiModelProperty("类型,2-岗位")
     private String type;

+ 1 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/domain/dto/TimeLimitBean.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 

+ 172 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/domain/dto/WoFlowPlanBean.java

@@ -0,0 +1,172 @@
+package com.persagy.fm.workorder.domain.dto;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.persagy.fm.workorder.handler.JsonTypeHandlerFactory;
+import lombok.*;
+import lombok.experimental.Accessors;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author lijie
+ * @since 2021-04-26
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class WoFlowPlanBean{
+
+    /**
+     * 工单类型id
+     */
+    @JsonAlias({"planId","plan_id"})
+    @JsonProperty("plan_id")
+    @JSONField(name = "plan_id")
+    private String planId;
+
+    /**
+     * 工单类型名称
+     */
+    @JsonAlias({"planName","plan_name"})
+    @JsonProperty("plan_name")
+    @JSONField(name = "plan_name")
+    private String planName;
+
+    /**
+     * 项目id
+     */
+    @JsonAlias({"projectId","project_id"})
+    @JsonProperty("project_id")
+    @JSONField(name = "project_id")
+    private String projectId;
+
+    /**
+     * 报修是否可以转此类工单,0-不可以,1-可以
+     */
+    @JsonAlias({"repairFlag","repair_flag"})
+    @JsonProperty("repair_flag")
+    @JSONField(name = "repair_flag")
+    private String repairFlag;
+
+    /**
+     * 工作类型id,1-维保,2-维修,3-巡检,4-运行,5-安全
+     */
+    @JsonAlias({"workType","work_type"})
+    @JsonProperty("work_type")
+    @JSONField(name = "work_type")
+    private String workType;
+    /**
+     * 工作类型名称,1-维保,2-维修,3-巡检,4-运行,5-安全
+     */
+    @JsonAlias({"workTypeName","work_type_name"})
+    @JsonProperty("work_type_name")
+    @JSONField(name = "work_type_name")
+    private String workTypeName;
+
+    /**
+     * 建筑功能类型
+     */
+    @JsonAlias({"functionType","function_type"})
+    @JsonProperty("function_type")
+    @JSONField(name = "function_type")
+    private String functionType;
+
+    /**
+     * 设置的此类工单相关要求
+     */
+    @JsonAlias({"timeLimit","time_limit"})
+    @JsonProperty("time_limit")
+    @JSONField(name = "time_limit")
+    private TimeLimitBean timeLimit;
+
+    /**
+     * 时间类型,temp-临时,plan-计划
+     */
+    @JsonAlias({"executeType","execute_type"})
+    @JsonProperty("execute_type")
+    @JSONField(name = "execute_type")
+    private String executeType;
+    /**
+     * 时间类型名称,temp-临时,plan-计划
+     */
+    @JsonAlias({"executeTypeName","execute_type_name"})
+    @JsonProperty("execute_type_name")
+    @JSONField(name = "execute_type_name")
+    private String executeTypeName;
+
+    /**
+     * 岗位职责数据
+     */
+    @JsonAlias({"postAndDuty","post_and_duty"})
+    @JsonProperty("post_and_duty")
+    @JSONField(name = "post_and_duty")
+    private List<PostAndDuty> postAndDuty;
+
+    /**
+     * 原生岗位职责数据
+     */
+    @JsonAlias({"postAndDutyNative","post_and_duty_native"})
+    @JsonProperty("post_and_duty_native")
+    @JSONField(name = "post_and_duty_native")
+    private PostAndDutyNative postAndDutyNative;
+
+    /**
+     * 部门id
+     */
+    @JsonAlias({"departmentId","department_id"})
+    @JsonProperty("department_id")
+    @JSONField(name = "department_id")
+    private String departmentId;
+
+    /**
+     * 工单类型状态,0-需修订,1-正常
+     */
+    @JsonAlias({"planStatus","plan_status"})
+    @JsonProperty("plan_status")
+    @JSONField(name = "plan_status")
+    private String planStatus;
+
+    /**
+     * 版本号
+     */
+    private Integer version;
+
+    /**
+     * 创建者id
+     */
+    @JsonAlias({"creatorId","creator_id"})
+    @JsonProperty("creator_id")
+    @JSONField(name = "creator_id")
+    private String creatorId;
+
+    /**
+     * 创建时间
+     */
+    @JsonAlias({"createTime","create_time"})
+    @JsonProperty("create_time")
+    @JSONField(name = "create_time")
+    private String createTime;
+
+    /**
+     * 更新时间
+     */
+    @JsonAlias({"updateTime","update_time"})
+    @JsonProperty("update_time")
+    @JSONField(name = "update_time")
+    private String updateTime;
+
+    /**
+     * 是否有效
+     */
+    private Boolean valid;
+
+}

+ 8 - 6
fm-workorder/src/main/java/com/persagy/fm/workorder/domain/entity/WoFlowPlan.java

@@ -11,8 +11,7 @@ import com.persagy.fm.workorder.domain.dto.PostAndDuty;
 import com.persagy.fm.workorder.domain.dto.PostAndDutyNative;
 import com.persagy.fm.workorder.domain.dto.TimeLimitBean;
 import com.persagy.fm.workorder.handler.JsonTypeHandlerFactory;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
+import lombok.*;
 import lombok.experimental.Accessors;
 
 /**
@@ -22,7 +21,10 @@ import lombok.experimental.Accessors;
 @Data
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@TableName("wo_flow_plan")
+@TableName(value = "wo_flow_plan",autoResultMap = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
 public class WoFlowPlan extends Model<WoFlowPlan> {
 
     private static final long serialVersionUID = 1L;
@@ -78,8 +80,8 @@ public class WoFlowPlan extends Model<WoFlowPlan> {
     /**
      * 时间类型,temp-临时,plan-计划
      */
-    @TableField("excute_type")
-    private String excuteType;
+    @TableField("execute_type")
+    private String executeType;
 
     /**
      * 岗位职责数据
@@ -114,7 +116,7 @@ public class WoFlowPlan extends Model<WoFlowPlan> {
     /**
      * 创建时间
      */
-    @TableField(value = "create_time",fill = FieldFill.INSERT)
+    @TableField(value = "create_time", fill = FieldFill.INSERT)
     private String createTime;
 
     /**

+ 30 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/domain/vo/BaseQueryFlowPlanVo.java

@@ -0,0 +1,30 @@
+package com.persagy.fm.workorder.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.persagy.fm.common.model.vo.BaseVo;
+import com.persagy.fm.workorder.domain.dto.PostAndDuty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+/***
+ * Description: 验证工单类型岗位职责信息Vo类
+ * @author : lijie
+ * @date :2021/4/27 17:57
+ * Update By lijie 2021/4/27 17:57
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BaseQueryFlowPlanVo extends BaseVo {
+    @ApiModelProperty("工单类型id,编辑是需要传,验证工单类型名称是否重复")
+    @JsonAlias({"plan_id","planId"})
+    @JsonProperty("plan_id")
+    private String planId;
+}

+ 1 - 9
fm-workorder/src/main/java/com/persagy/fm/workorder/domain/vo/QueryVerifyFlowPlanVo.java

@@ -23,11 +23,7 @@ import java.util.List;
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
-public class QueryVerifyFlowPlanVo extends BaseVo {
-    @ApiModelProperty("工单类型id,编辑是需要传,验证工单类型名称是否重复")
-    @JsonAlias({"plan_id","planId"})
-    @JsonProperty("plan_id")
-    private String planId;
+public class QueryVerifyFlowPlanVo extends BaseQueryFlowPlanVo {
     @ApiModelProperty("工单类型名称")
     @JsonAlias({"plan_name","planName"})
     @JsonProperty("plan_name")
@@ -42,8 +38,4 @@ public class QueryVerifyFlowPlanVo extends BaseVo {
     @JsonProperty("post_and_duty")
     @NotEmpty(message = "缺少必填项:post_and_duty")
     private List<PostAndDuty> postAndDuty;
-
-
-
-
 }

+ 124 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/domain/vo/WoFlowPlanVo.java

@@ -0,0 +1,124 @@
+package com.persagy.fm.workorder.domain.vo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.persagy.fm.common.model.vo.BaseVo;
+import com.persagy.fm.common.validator.Insert;
+import com.persagy.fm.common.validator.Update;
+import com.persagy.fm.workorder.domain.dto.PostAndDuty;
+import com.persagy.fm.workorder.domain.dto.PostAndDutyNative;
+import com.persagy.fm.workorder.domain.dto.TimeLimitBean;
+import com.persagy.fm.workorder.handler.JsonTypeHandlerFactory;
+import lombok.*;
+import lombok.experimental.Accessors;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author lijie
+ * @since 2021-04-26
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class WoFlowPlanVo extends BaseVo {
+
+
+    /**
+     * 工单类型id
+     */
+    @JsonAlias({"planId","plan_id"})
+    @JsonProperty("plan_id")
+    @NotBlank(message = "缺少必填项:plan_id",groups = {Update.class})
+    private String planId;
+
+    /**
+     * 人员id
+     */
+    @JsonAlias({"personId","person_id"})
+    @JsonProperty("person_id")
+    private String personId;
+
+    /**
+     * 工单类型名称
+     */
+    @JsonAlias({"planName","plan_name"})
+    @JsonProperty("plan_name")
+    @NotBlank(message = "缺少必填项:plan_name",groups = {Insert.class})
+    private String planName;
+
+    /**
+     * 项目id
+     */
+    @JsonAlias({"projectId","project_id"})
+    @JsonProperty("project_id")
+    private String projectId;
+
+    /**
+     * 报修是否可以转此类工单,0-不可以,1-可以
+     */
+    @JsonAlias({"repairFlag","repair_flag"})
+    @JsonProperty("repair_flag")
+    private String repairFlag;
+
+    /**
+     * 工作类型id,1-维保,2-维修,3-巡检,4-运行,5-安全
+     */
+    @JsonAlias({"workType","work_type"})
+    @JsonProperty("work_type")
+    @NotBlank(message = "缺少必填项:work_type")
+    private String workType;
+
+    /**
+     * 建筑功能类型
+     */
+    @JsonAlias({"functionType","function_type"})
+    @JsonProperty("function_type")
+    private String functionType;
+
+    /**
+     * 设置的此类工单相关要求
+     */
+    @JsonAlias({"timeLimit","time_limit"})
+    @JsonProperty("time_limit")
+    private TimeLimitBean timeLimit;
+
+    /**
+     * 时间类型,temp-临时,plan-计划
+     */
+    @JsonAlias({"executeType","execute_type"})
+    @JsonProperty("execute_type")
+    @NotBlank(message = "缺少必填项:excute_type")
+    private String executeType;
+
+    /**
+     * 岗位职责数据
+     */
+    @JsonAlias({"postAndDuty","post_and_duty"})
+    @JsonProperty("post_and_duty")
+    @NotEmpty(message = "缺少必填项:post_and_duty")
+    private List<PostAndDuty> postAndDuty;
+
+    /**
+     * 原生岗位职责数据
+     */
+    @JsonAlias({"postAndDutyNative","post_and_duty_native"})
+    @JsonProperty("post_and_duty_native")
+    private PostAndDutyNative postAndDutyNative;
+
+    /**
+     * 工单类型状态,0-需修订,1-正常
+     */
+    @JsonAlias({"planStatus","plan_status"})
+    @JsonProperty("plan_status")
+    private String planStatus;
+
+}

+ 754 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/service/BaseService.java

@@ -0,0 +1,754 @@
+/**
+ * @包名称 com.sagacloud.service
+ * @文件名 BaseService.java
+ * @创建者 wanghailong
+ * @邮箱 wanghailong@persagy.com  
+ * @修改描述 
+ */
+
+package com.persagy.fm.workorder.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.persagy.fm.common.constant.CommonConstant;
+import com.persagy.fm.common.constant.CommonMessage;
+import com.persagy.fm.common.constant.DataRequestPathUtil;
+import com.persagy.fm.common.constant.DataRequestProcessUtil;
+import com.persagy.fm.common.constant.enums.ResultEnum;
+import com.persagy.fm.common.old.utils.StringUtil;
+import com.persagy.fm.common.old.utils.ToolsUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * 功能描述:
+ * 
+ * @类型名称 BaseService
+ * @创建者 wanghailong
+ * @邮箱 wanghailong@persagy.com
+ * @修改描述
+ * 
+ * update by yuecaipu 2018/5/2
+ */
+//被@RefreshScope修饰的Bean都是延迟加载的,只有在第一次访问时才会被初始化,刷新Bean也是同理,下次访问时会创建一个信息的对象
+//@RefreshScope //这里不能省略  不然不能手动触发
+@Service("baseService")
+public class BaseService {
+	@Value("${data.platform.basePath}")
+	public String dataPlatBasePath;
+
+
+	/**
+	 * 数据平台使用设备标签筛选
+    */
+    @Value("${obj.filter.by.tag}")
+    public boolean tagFlag;
+    /**
+     * 数据平台设备标签(后缀)
+     */
+    @Value("${equip.tag}")
+    public String equipTag;
+
+	private static final Logger log = Logger.getLogger(BaseService.class);
+
+	/**
+	 * 功能描述:http请求,Json类型参数
+	 * 
+	 * @param url
+	 * @param jsonStr
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 修改描述
+	 */
+	public String httpPostRequest(String url, String jsonStr) throws Exception {
+		log.info("请求数据平台post:"+url);
+		
+		if(StringUtil.isNull(jsonStr)) {
+			jsonStr = new JSONObject().toJSONString();
+		}
+		/**
+		 * 统一处理:调用非运维系统时,user_id统一使用systemId
+		 */
+//		JSONObject jsonParam = JSONObject.parseObject(jsonStr);
+//		jsonParam.put("user_id", SopCommonConst.SYSTEM_ID);
+//		jsonStr = jsonParam.toJSONString();
+		
+		/***********统一处理:调用非运维系统时,user_id统一使用systemId  结束**************************/
+		
+		
+		log.info(jsonStr);
+
+		/*---- 数据平台不接收get方式传参 需要将get请求的参数projectId转为post updateTime:20180504 10:53 ----*/
+//		dataPlatBasePath = dataPlatBasePath == null ? initDataPlatBasePath() : dataPlatBasePath;
+//		if (url.contains("projectId") && url.contains(dataPlatBasePath)) {
+//			JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+//			int index = url.indexOf("projectId");
+//			String projectId = url.substring(index + "projectId=".length(), index + "projectId".length() + 13);
+//			jsonObject.put("projectId", projectId);
+//			jsonStr = jsonObject.toString();
+//		}
+		/*----------- end -------------*/
+
+		String respContent = null;
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		HttpPost httpPost = new HttpPost(url);
+		httpPost.addHeader("Content-Type", "application/json;charset=utf-8");
+		httpPost.setEntity(new StringEntity(jsonStr, "utf-8"));
+		// 执行请求
+		respContent = executeHttpRequest(httpclient, httpPost);
+//		log.info(respContent);
+		return respContent;
+	}
+
+	
+	/**
+	 * Description: post方式访问数据平台接口,项目id放到post参数体内,不需要项目密码
+	 * @param url 请求数据平台url
+	 * @param jsonStr 请求参数jsonString
+	 * @return
+	 * @throws Exception String
+	 * @author cuixubin
+	 * @since 2018年5月3日: 下午8:11:04
+	 * Update By cuixubin 2018年5月3日: 下午8:11:04
+	 */
+	public String httpPostRequestDataPlatform(String url, String jsonStr) throws Exception {
+
+        /**
+         * 数据平台设备标签筛选 特殊处理
+         **/
+		if (tagFlag) {
+			if (url.contains("equipment/complex_query")) {
+				JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+				jsonObject.put("businessTag", Arrays.asList(equipTag));
+				jsonStr = jsonObject.toJSONString();
+			} else if (url.contains("object/search")) {
+				JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+				jsonObject.put("businessTag", Arrays.asList("EqObj_" + equipTag));
+				jsonStr = jsonObject.toJSONString();
+			} else if (url.contains("object/subset_query") || url.contains("object/query_by_info")) {
+				JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+				jsonObject.put("businessTag", Arrays.asList("Eq_" + equipTag));
+				jsonStr = jsonObject.toJSONString();
+			}
+		}
+
+        log.info("请求数据平台post:"+url);
+        log.info(jsonStr);
+
+        // 项目id放到post体
+//		if(url.contains("projectId")){
+//			JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+//			int index = url.indexOf("projectId");
+//			String projectId = url.substring(index+"projectId=".length(),index+"projectId".length()+13);
+//			jsonObject.put("projectId",projectId);
+//			jsonStr = jsonObject.toString();
+//		}
+
+		String respContent = null;
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		HttpPost httpPost = new HttpPost(url);
+		httpPost.addHeader("Content-Type", "application/json;charset=utf-8");
+		httpPost.setEntity(new StringEntity(jsonStr, "utf-8"));
+		// 执行请求
+		respContent = executeHttpRequest(httpclient, httpPost);
+		if(null != respContent && respContent.contains("failure")) {
+			log.error(respContent);
+		}
+		return respContent;
+	}
+	
+	
+
+	
+	
+	
+	/**
+	 * 
+	 * 功能描述::http请求,非Json类型参数,参数直接是'&'间隔的
+	 * 
+	 * @param url
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 修改描述
+	 */
+	@Deprecated
+	public String httpPostWithListParams(String url, Map<String, String> params) throws Exception {
+		String respContent = null;
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		HttpPost httpPost = new HttpPost(url);
+		httpPost.addHeader("Content-Type", "application/json;charset=utf-8");
+		// 设置请求的的参数
+		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
+		// 参数 jsonArray形式
+		Set<String> keySet = params.keySet();
+		for (String key : keySet) {
+			nvps.add(new BasicNameValuePair(key, params.get(key)));
+		}
+		httpPost.setEntity(new UrlEncodedFormEntity(nvps, "utf-8"));
+		// 执行请求
+		respContent = executeHttpRequest(httpclient, httpPost);
+//		log.info(respContent);
+		return respContent;
+	}
+
+
+	
+	/**
+	 * 功能描述:http请求,Json类型参数
+	 *
+	 * @param url
+	 * @param jsonStr
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 修改描述
+	 */
+	public String httpPostRequestToPersagy(String url, String jsonStr) throws Exception {
+		log.info("请求数据平台post:"+url);
+		log.info(jsonStr);
+		String respContent = null;
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		HttpPost httpPost = new HttpPost(url);
+		httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded");
+		httpPost.setEntity(new StringEntity("jsonString=" + jsonStr, "utf-8"));
+		// 执行请求
+		respContent = executeHttpRequest(httpclient, httpPost);
+//		log.info(respContent);
+		return respContent;
+	}
+
+	
+	
+	
+	
+	private Map<String, String> URLRequest(String URL) {
+		Map<String, String> mapRequest = new HashMap<String, String>();
+		String[] arrSplit = null;
+		String strUrlParam = TruncateUrlPage(URL);
+		if (strUrlParam == null) {
+			return mapRequest;
+		}
+		//每个键值为一组 www.2cto.com
+		arrSplit = strUrlParam.split("[&]");
+		for (String strSplit : arrSplit) {
+			String[] arrSplitEqual = null;
+			arrSplitEqual = strSplit.split("[=]");
+
+			//解析出键值
+			if (arrSplitEqual.length > 1) {
+				//正确解析
+				mapRequest.put(arrSplitEqual[0], arrSplitEqual[1]);
+			} else {
+				if (arrSplitEqual[0] != "") {
+					//只有参数没有值,不加入
+					mapRequest.put(arrSplitEqual[0], "");
+				}
+			}
+		}
+		mapRequest.remove("secret");
+		return mapRequest;
+	}
+
+	private static String TruncateUrlPage(String strURL) {
+		if (StringUtils.isNotEmpty(strURL)) {
+			String[] arrSplit = strURL.trim().split("[?]");
+			if (arrSplit.length > 1) {
+				return arrSplit[1];
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * 执行http请求
+	 * @param httpClient
+	 * @param httpRequest
+	 * @return
+	 */
+	private static String executeHttpRequest(CloseableHttpClient httpClient, HttpUriRequest httpRequest){
+		CloseableHttpResponse response;
+		String respContent = null;
+		try {
+			response = httpClient.execute(httpRequest);
+			respContent = EntityUtils.toString(response.getEntity(), "utf-8");
+		} catch (Exception e) {
+		}finally {
+			try {
+				httpClient.close();
+			} catch (IOException e) {
+				log.error("HttpClient closed failed!");
+			}
+			
+			if(respContent == null || respContent.startsWith("<")){
+				respContent = ToolsUtil.errorJsonMsg("请求异常" + respContent);
+			}
+		}
+		return respContent;
+	}
+
+	  /**
+	    *
+	    * 功能描述::获取数据平台请求路径
+	    * @param requestPath 请求路径,DataRequestPathUtil中的属性值
+	    * @return
+	    * @创建者 wanghailong
+	    * @邮箱 wanghailong@persagy.com
+	    * 修改描述
+	    */
+		public String getDataPlatformPath(String requestPath) {
+			String requestUrl = null;
+			if (null == requestPath || "".equals(requestPath))
+				return requestUrl;
+			else
+				requestUrl = requestPath;
+			requestUrl = requestUrl.replace("BASEPATH", dataPlatBasePath);
+//			requestUrl = requestUrl.replace("SECRET", dataPlatDefaultSecret);
+			return requestUrl;
+		}
+		/**
+		 *
+		 * 功能描述:获取数据平台-数据字典请求路径
+		 * @param requestPath
+		 * @param param 数据字典编码
+		 * @return
+		 * @创建者 wanghailong
+		 * @邮箱 wanghailong@persagy.com
+		 * 修改描述
+		 */
+		public String getDataPlatDictPath(String requestPath , String param) {
+			String requestUrl = null;
+			if (null == requestPath || "".equals(requestPath))
+				return requestUrl;
+			else
+				requestUrl = requestPath;
+			requestUrl = requestUrl.replace("BASEPATH", dataPlatBasePath);
+			if(null != param && !"".equals(param)){
+				requestUrl = requestUrl.replace("PARAM", param);
+			}
+			return requestUrl;
+		}
+
+	/**
+	 *
+	 * 功能描述:获取数据平台请求路径
+	 * @param requestPath  请求路径,DataRequestPathUtil中的属性值
+	 * @param projectId 项目Id,项目相关请求,path中可以不带该参数
+	 * @param secret 秘钥,项目相关请求可以使用默认秘钥,其它请求需要projectId和secret匹配
+	 * @return
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 修改描述
+	 */
+//	public String getDataPlatformPath(String requestPath, String projectId, String secret) {
+//		String requestUrl = null;
+//		if (null == requestPath || "".equals(requestPath))
+//			return requestUrl;
+//		else
+//			requestUrl = requestPath;
+//		requestUrl = requestUrl.replace("BASEPATH", dataPlatBasePath);
+//		if (null != projectId && !"".equals(projectId)) {
+//			requestUrl = requestUrl.replace("PROJECTID", projectId);
+//		}
+////		if (null != secret && !"".equals(secret)) {
+////			requestUrl = requestUrl.replace("SECRET", secret);
+////		} else {
+////			requestUrl = requestUrl.replace("SECRET", dataPlatDefaultSecret);
+////		}
+//		return requestUrl;
+//	}
+
+	/**
+	 * 获取创建自定义信息点参数中的objType
+	 * @param objId
+	 * @param objType
+	 * @param objTypeMap 暂存
+	 * @return
+	 */
+	public String getObjTypeForCtm(String objId, String objType, Map<String, String> objTypeMap) throws Exception {
+		objTypeMap = objTypeMap == null ? Maps.newHashMap() : objTypeMap;
+		String ctmObjType = objTypeMap.get(objId);
+		if(!StringUtil.isNull(ctmObjType)){
+		}else if(objType.equals(CommonConstant.data_type_build)){
+			ctmObjType = "building";
+		}else if(objType.equals(CommonConstant.data_type_floor)){
+			ctmObjType = "floor";
+		}else if(objType.equals(CommonConstant.data_type_space)){
+			ctmObjType = "space";
+		}else if(objType.equals(CommonConstant.data_type_equip)){
+			String project_id = transferId(objId, CommonConstant.tag_project, dataPlatBasePath);
+			String params = "{\"projectId\":\""+ project_id +"\", \"criterias\":[{\"id\":\""+objId+"\"}]}";
+			String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query);
+//			String resultStr = httpPostRequest(requestUrl, params);
+			String resultStr = httpPostRequestDataPlatform(requestUrl, params);
+			JSONObject resultJson = JSONObject.parseObject(resultStr);
+			JSONArray content = resultJson.getJSONArray(ResultEnum.CONTENT.getType());
+			if(content != null && content.size() != 0){
+				JSONObject item = content.getJSONObject(0);
+				JSONObject relation = item.getJSONObject("relation");
+				relation = relation == null ? new JSONObject() : relation;
+				ctmObjType = relation.getString("equipment_category");
+			}
+		}else if(objType.equals(CommonConstant.data_type_equip_class)){
+			ctmObjType = objId;
+		}else if(objType.equals(CommonConstant.data_type_system)){
+			String project_id = transferId(objId, CommonConstant.tag_project, dataPlatBasePath);
+			String params = "{\"projectId\":\""+ project_id +"\", \"criterias\":[{\"id\":\""+objId+"\"}]}";
+			String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query);
+//			String resultStr = httpPostRequest(requestUrl, params);
+			String resultStr = httpPostRequestDataPlatform(requestUrl, params);
+			JSONObject resultJson = JSONObject.parseObject(resultStr);
+			JSONArray content = resultJson.getJSONArray(ResultEnum.CONTENT.getType());
+			if(content != null && content.size() != 0){
+				JSONObject item = content.getJSONObject(0);
+				JSONObject relation = item.getJSONObject("relation");
+				relation = relation == null ? new JSONObject() : relation;
+				ctmObjType = relation.getString("equipment_category");
+			}
+		}else if(objType.equals(CommonConstant.data_type_system_class)){
+			ctmObjType = objId;
+		}
+		objTypeMap.put(objId, ctmObjType);
+		return ctmObjType;
+	}
+
+	/**
+	 * 转换ID
+	 * @param id     ID
+	 * @param taget 转换目标ID标识
+	 * @return
+	 */
+	public static String transferId(String id, String taget, String dataPlatBasePath){
+		Map<String, String> parentIdMap = null;
+		try {
+			parentIdMap = getParentIdAndCategoryMap(id, dataPlatBasePath);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		Map<String, String> map = new HashMap<>();
+		if(id.startsWith(CommonConstant.tag_project)){
+
+		}else if(id.startsWith(CommonConstant.tag_build)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+		}else if(id.startsWith(CommonConstant.tag_floor)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+			map.put(CommonConstant.tag_build, parentIdMap.get("building"));
+		}else if(id.startsWith(CommonConstant.tag_space)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+			map.put(CommonConstant.tag_build, parentIdMap.get("building"));
+			map.put(CommonConstant.tag_floor, parentIdMap.get("floor"));
+		}else if(id.startsWith(CommonConstant.tag_equip)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+			map.put(CommonConstant.tag_build, parentIdMap.get("building"));
+		}else if(id.startsWith(CommonConstant.tag_system)){
+			map.put(CommonConstant.tag_project, CommonConstant.tag_project+ id.substring(2, 12));
+			map.put(CommonConstant.tag_build, parentIdMap.get("building"));
+		}
+		return map.get(taget);
+	}
+
+	/**
+	 *
+	 * Description:获取同一项目下同一类型对象的关联建筑id、楼层id、设备id信息
+	 * @param ids 设备(空间、部件)id的集合,集合内容应为同一类型的id
+	 * @return {"id值":{"building":"", "floor":"", "equipment":"", "category":""}}, 只有传入的id为设备和系统时,才会返回category,其值为类型码组合,如SETDLS(前两位是专业码,中间两位是系统码,后四位是设备类别码)
+	 * @throws Exception Map<String,String>
+	 * @author cuixubin
+	 * @since 2018年5月15日: 下午6:42:17
+	 * Update By cuixubin 2018年5月15日: 下午6:42:17
+	 */
+	public static Map<String, Map<String, String>> getParentIds(List<String> ids, String dataPlatBasePath) throws Exception {
+		Map<String, Map<String, String>> resultMap = new HashMap<>();
+		if(null == ids || ids.isEmpty()) {
+			return resultMap;
+		}
+		String id = ids.get(0);
+		String projectId = "Pj" + id.substring(2, 12);
+		String requestUrl = DataRequestPathUtil.dataPlat_object_batch_query;
+		requestUrl = requestUrl.replace("BASEPATH", dataPlatBasePath);
+		if (null != projectId && !"".equals(projectId)) {
+			requestUrl = requestUrl.replace("PROJECTID", projectId);
+		}
+
+		String buildParamStr = "{\"criterias\":[{\"id\":\"" + id + "\"}";
+		for(int i=1; i<ids.size(); i++) {
+			buildParamStr += ",{\"id\":\"" + ids.get(i) + "\"}";
+		}
+		buildParamStr += "],\"valid\":null,\"projectId\":\""+ projectId +"\"}";
+
+		String result = new BaseService().httpPostRequestDataPlatform(requestUrl, buildParamStr);
+		JSONObject resultJson = JSONObject.parseObject(result);
+		JSONArray content = (JSONArray) resultJson.get("Content");
+		if (content != null && content.size() != 0) {
+			Map<String, String> locationMap = new HashMap<>();
+			for(int i=0; i<content.size(); i++) {
+				JSONObject item = content.getJSONObject(i);
+				locationMap = (Map<String, String>) item.get("location");
+				locationMap.put("category",(String) ((JSONObject) content.get(i)).get("category"));
+//              resultMap.put("category",(String) ((JSONObject) content.get(0)).get("category"));
+				resultMap.put(item.getString("id"), locationMap);
+			}
+		}
+		return resultMap;
+	}
+
+	private static Map<String, String> getParentIdAndCategoryMap(String id, String dataPlatBasePath) throws Exception {
+		String projectId = "Pj" + id.substring(2, 12);
+		String requestUrl = DataRequestPathUtil.dataPlat_object_batch_query;
+		requestUrl = requestUrl.replace("BASEPATH", dataPlatBasePath);
+		if (null != projectId && !"".equals(projectId)) {
+			requestUrl = requestUrl.replace("PROJECTID", projectId);
+		}
+		String buildParamStr = "{\"criterias\":[{\"id\":\"" + id + "\"}]}";
+		JSONObject requstParams = JSONObject.parseObject(buildParamStr);
+		requstParams.put("projectId", projectId);
+//        String result = new BaseService().httpPostRequest(requestUrl, requstParams.toString());
+		String result = new BaseService().httpPostRequestDataPlatform(requestUrl, requstParams.toString());
+
+		JSONObject resultJson = JSONObject.parseObject(result);
+		JSONArray content = (JSONArray) resultJson.get("Content");
+		Map<String, String> resultMap = new HashMap<>();
+		if (content != null) {
+			Map<String, String> locationMap = (Map<String, String>) ((JSONObject) content.get(0)).get("location");
+			resultMap.putAll(locationMap);
+			resultMap.put("category",(String) ((JSONObject) content.get(0)).get("category"));
+		}
+		return resultMap;
+	}
+
+
+
+	/**
+	 * 获取设备或系统的类型
+	 * @param id 设备、系统ID
+	 * @Param taget 类型标识
+	 * @return
+	 */
+	public static String getEquipOrSystemCodeFromId(String id, String taget, String dataPlatBasePath){
+		Map<String, String> map = new HashMap<String, String>();
+		Map<String, String> parentCategoryMap = null;
+		try {
+			parentCategoryMap = getParentIdAndCategoryMap(id, dataPlatBasePath);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		String category = parentCategoryMap.get("category");
+		if (id.startsWith(CommonConstant.tag_equip)) {
+			map.put(CommonConstant.tag_dict_class, category == null || category.length()<6 ? null : category.substring(0, 2));
+			map.put(CommonConstant.tag_dict_equip, category == null || category.length()<6  ? null : category.substring(2, 6));
+		} else if (id.startsWith(CommonConstant.tag_system)) {
+			map.put(CommonConstant.tag_dict_class, category == null || category.length()<4 ? null : category.substring(0, 2));
+			map.put(CommonConstant.tag_dict_sytstem, category == null || category.length()<4  ? null : category.substring(2, 4));
+		}
+		return map.get(taget);
+	}
+
+	/**
+	 * 获取设备的类型
+	 * @param projectId 项目id
+	 * @Param ids 设备ids
+	 * @return
+	 */
+	public static JSONArray getEquipCodeFromEquipIds(String projectId, JSONArray ids, String dataPlatBasePath) {
+		JSONArray content = null;
+		try {
+//			Properties properties = new Properties();
+//			properties.load(StringUtil.class.getResourceAsStream("/config.properties"));
+//			String dataPlatBasePath = properties.getProperty("data.platform.basePath");
+			String requestUrl = DataRequestPathUtil.dataPlat_object_batch_query;
+			requestUrl = requestUrl.replace("BASEPATH", dataPlatBasePath);
+			if (null != projectId && !"".equals(projectId)) {
+				requestUrl = requestUrl.replace("PROJECTID", projectId);
+			}
+			JSONObject requstParams = new JSONObject();
+			requstParams.put("criterias", ids);
+			requstParams.put("projectId", projectId);
+//			String result = new BaseService().httpPostRequest(requestUrl, requstParams.toJSONString());
+			String result = new BaseService().httpPostRequestDataPlatform(requestUrl, requstParams.toJSONString());
+
+			JSONObject resultJson = JSONObject.parseObject(result);
+			content = (JSONArray) resultJson.get("Content");
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		JSONArray equipCodes = new JSONArray();
+		if (content != null && content.size() != 0) {
+			for (int i = 0, length = content.size(); i < length; i++) {
+				JSONObject jsonObject = content.getJSONObject(i);
+				String category = jsonObject.getString("category");
+				String equipCode = category == null || category.length() < 6 ? null : category.substring(2, 6);
+				if (!equipCodes.contains(equipCode)) {
+					equipCodes.add(equipCode);
+				}
+			}
+		}
+		return equipCodes;
+	}
+
+
+	/**
+	 * 右侧补齐String长度
+	 * @param str
+	 * @param length
+	 * @param sign
+	 * @return
+	 */
+	public static String completLengthFromRight(String str, int length, String sign){
+		while(str.length() < length){
+			str = str + sign;
+		}
+		return str;
+	}
+
+	/**
+	 * 获取信息点的id中的对象类型
+	 * @param objType	confirm_result中的对象类型
+	 * @return
+	 */
+	public String getObjTypeForInfoId(String objType) throws Exception {
+		String ctmObjType = null;
+		if(objType.equals(CommonConstant.data_type_build)){
+			ctmObjType = "build";
+		}else if(objType.equals(CommonConstant.data_type_floor)){
+			ctmObjType = "floor";
+		}else if(objType.equals(CommonConstant.data_type_space)){
+			ctmObjType = "space";
+		}else if(objType.equals(CommonConstant.data_type_equip)){
+			ctmObjType = "equip";
+		}else if(objType.equals(CommonConstant.data_type_equip_class)){
+			ctmObjType = "equip";
+		}else if(objType.equals(CommonConstant.data_type_system)){
+			ctmObjType = "system";
+		}else if(objType.equals(CommonConstant.data_type_system_class)){
+			ctmObjType = "system";
+		}
+		return ctmObjType;
+	}
+	
+	/**
+	 * 创建自定义信息点,自定义信息点的异常信息点一定要在自定义信息点后面,返回结果的map中不存在infoPointCode的信息点表示创建失败,调用之后用返回结果中的新code替换原来的code
+	 * @param objType					对象类型,如果有多种类型的对象,分开多次调用即可
+	 * @param firstTag				自定义信息点默认的一级标签
+	 * @param unit						单位
+	 * @param dataType				数据类型,默认Str
+	 * @param customInfos				自定义信息点
+	 * @return			<调用方法传入的信息点的code, 实际在数据平台存储的code>
+	 */
+	public Map<String, String> createCustomInfos(String objType, String firstTag, String unit, String dataType, List<JSONObject> customInfos) throws Exception {
+		Map<String, String> resultMap = Maps.newHashMap();
+		//设置默认值
+		if(StringUtil.isNull(firstTag)){
+			firstTag = "反馈参数";
+		}
+		if(StringUtil.isNull(dataType)){
+			dataType = "Str";
+		}
+		//1.查询objType对象类型的自定义信息点有哪些
+		//1.1 查询方案ID
+		String schemeId = null;
+		JSONObject params = new JSONObject();
+		String paramStr = DataRequestProcessUtil.getCriteriaWithMajors(params).toJSONString();
+		String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_custom_infoCode_scheme_query);
+//		String resultStr = httpPostRequest(requestUrl, paramStr);
+		String resultStr = httpPostRequestDataPlatform(requestUrl, paramStr);
+		JSONObject resultJson = JSONObject.parseObject(resultStr);
+		if(ResultEnum.FAILURE.getType().equals(resultJson.getString(ResultEnum.RESULT.getType()))){
+			return resultMap;
+		}
+		JSONArray schemes = resultJson.getJSONArray(ResultEnum.CONTENT.getType());
+		if(schemes == null || schemes.size() == 0){
+			return resultMap;
+		}
+		JSONObject scheme = schemes.getJSONObject(0);
+		schemeId = scheme.getString("scheme_id");
+		//1.2 已存在的信息点
+		params.put("scheme_id", schemeId);
+		params.put("obj_type", objType);
+		params.put("firstTag", firstTag);
+		paramStr = DataRequestProcessUtil.getCriteriaWithMajors(params, "scheme_id", "obj_type", "firstTag").toJSONString();
+		requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_custom_infoCode_scheme_info_query);
+//		resultStr = httpPostRequest(requestUrl, paramStr);
+		resultStr = httpPostRequestDataPlatform(requestUrl, paramStr);
+		resultJson = JSONObject.parseObject(resultStr);
+		if(ResultEnum.FAILURE.getType().equals(resultJson.getString(ResultEnum.RESULT.getType()))){
+			return resultMap;
+		}
+		//信息点名称和code对照信息
+		Map<String, String> infoNameOriginalCode = DataRequestProcessUtil.getMapFromResult(resultJson, "infoPointName", "infoPointCode");
+
+		//2.补充自定义信息点,并记录信息点在数据平台的code
+		customInfos = customInfos == null ? Lists.newArrayList() : customInfos;
+		JSONObject customInfo;
+		String infoPointCode, infoPointName, mainInfoPointCode, originalInfoPointCode, inputMode;
+		for(int i=0; i<customInfos.size(); i++){
+			customInfo = customInfos.get(i);
+			infoPointCode = customInfo.getString("infoPointCode");
+			infoPointName = customInfo.getString("infoPointName");
+			mainInfoPointCode = customInfo.getString("mainInfoPointCode");
+			originalInfoPointCode = infoNameOriginalCode.getOrDefault(infoPointName, infoPointCode);
+
+			if(!StringUtil.isNull(mainInfoPointCode)){
+				if(!mainInfoPointCode.equals(resultMap.get(mainInfoPointCode))){
+					//替换自定义信息点的异常信息点的code
+					originalInfoPointCode = infoPointCode.replace(mainInfoPointCode, resultMap.get(mainInfoPointCode));
+				}
+			}
+			//记录infoPointCode的变化
+			resultMap.put(infoPointCode, originalInfoPointCode);
+
+			customInfo.put("firstTag", firstTag);
+			customInfo.put("infoPointCode", originalInfoPointCode);
+			customInfo.put("dataType", dataType);
+			customInfo.put("inputMode", getInfoPointOriginalModeFromAppMode(customInfo.getString("inputMode")));
+		}
+		//3.创建自定义信息点
+		params.clear();
+		params.put("scheme_id", schemeId);
+		params.put("obj_type", objType);
+		params.put("criterias", customInfos);
+		requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_custom_infoCode_scheme_info_create);
+//		resultStr = httpPostRequest(requestUrl, params.toJSONString());
+		resultStr = httpPostRequestDataPlatform(requestUrl, params.toJSONString());
+		resultJson = JSONObject.parseObject(resultStr);
+		if(ResultEnum.FAILURE.getType().equals(resultJson.getString(ResultEnum.RESULT.getType()))){
+			resultMap.clear();
+		}
+		return resultMap;
+	}
+
+	/**
+	 * 根据自定义信息点类型转换信息点原始组件
+	 * @param appMode
+	 * @return
+	 */
+	public String getInfoPointOriginalModeFromAppMode(String appMode){
+		if(StringUtil.isNull(appMode)){
+			appMode = "default";
+		}
+		String infoPointMode = CommonMessage.customTypeInfoPointModeRels.getString(appMode);
+		if(StringUtil.isNull(infoPointMode)){
+			infoPointMode = CommonMessage.customTypeInfoPointModeRels.getString("default");
+		}
+		return infoPointMode;
+	}
+	
+}

+ 238 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/service/IDictionaryService.java

@@ -0,0 +1,238 @@
+/**
+ * @包名称 com.sagacloud.service
+ * @文件名 DictionaryServiceI.java
+ * @创建者 wanghailong
+ * @邮箱 wanghailong@persagy.com  
+ * @修改描述 
+ */
+
+package com.persagy.fm.workorder.service;
+
+import com.alibaba.fastjson.JSONArray;
+
+import java.util.Map;
+
+/**
+ * 功能描述: 数据字典相关操作接口
+ * 
+ * @类型名称 DictionaryServiceI
+ * @创建者 wanghailong
+ * @邮箱 wanghailong@persagy.com
+ * @修改描述
+ */
+public interface IDictionaryService {
+	
+	/**
+	 * 
+	 * 功能描述:查询所有设备类型
+	 * @return
+	 * @throws Exception 
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 
+	 * 修改描述
+	 */
+	public String queryAllEquipmentCategory() throws Exception;
+	
+
+	/**
+	 * 
+	 * 功能描述:查询所有行政区编码
+	 * @return
+	 * @throws Exception 
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllRegionCode() throws Exception;
+	
+	
+
+	/**
+	 * 
+	 * 功能描述:查询所有气候区代码
+	 * @return
+	 * @throws Exception 
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllClimateAreaCode() throws Exception;
+	
+	/**
+	 *
+	 * 功能描述:查询所有天气状态
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllWeatherStatusCode() throws Exception;
+	
+	/**
+	 *
+	 * 功能描述:查询所有风力等级
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllWindLevelCode() throws Exception;
+	
+	
+	/**
+	 *
+	 * 功能描述:查询所有方向代码
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllDirectionCode() throws Exception;
+	
+	/**
+	 *
+	 * 功能描述:查询建筑功能类型
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllBuildingCode() throws Exception;
+	
+
+	/**
+	 *
+	 * 功能描述:查询空间功能类型
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllSpaceCode() throws Exception;
+	
+	/**
+	 *
+	 * 功能描述:查询租赁业态类型
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllRentalCode() throws Exception;
+
+	/**
+	 *
+	 * 功能描述:查询抗震设防烈度
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllSeismicPrecautionaryIntensityCode() throws Exception;
+	
+
+	/**
+	 *
+	 * 功能描述:查询防尘等级
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllDustproofCode() throws Exception;
+
+	/**
+	 *
+	 * 功能描述:查询防水等级
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllWaterproofCode() throws Exception;
+	/**
+	 *
+	 * 功能描述:查询防爆类型
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllExplosionproofEquipmentCode() throws Exception;
+	/**
+	 *
+	 * 功能描述:查询防爆设备类型
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllDangerCode() throws Exception;
+	/**
+	 *
+	 * 功能描述:查询危险区域等级
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllExplosionproofGasTemperatureCode() throws Exception;
+	/**
+	 *
+	 * 功能描述:查询气体类型和温度类型
+	 * @return
+	 * @throws Exception
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com
+	 * 修改描述
+	 */
+	public Map<String, String> queryAllExplosionproofTypeCode() throws Exception;
+	
+	/**
+	 * 功能描述:查询污染等级
+	 * @return
+	 * @throws Exception
+	 */
+	public Map<String, String> queryAllPollutionLevelCode() throws Exception;
+	
+	/**
+	 * 功能描述:查询污秽等级
+	 * @return
+	 * @throws Exception
+	 */
+	public Map<String, String> queryAllContaminationLevelCode() throws Exception;
+
+	/**
+	 * 
+	 * 功能描述:查询数据字典数据
+	 * @param name
+	 * @return 
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 
+	 * 修改描述
+	 */
+	public Map<String, String> queryDictionaryDataByName(String name);
+
+	/**
+	 * 
+	 * 功能描述:查询数据字典数据
+	 * @param name
+	 * @return 
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 
+	 * 修改描述
+	 */
+	public JSONArray queryDictionaryDataForJSONArrayByName(String name) throws Exception;
+}

+ 83 - 1
fm-workorder/src/main/java/com/persagy/fm/workorder/service/IWoFlowPlanService.java

@@ -1,8 +1,9 @@
 package com.persagy.fm.workorder.service;
 
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.persagy.fm.workorder.domain.entity.WoFlowPlan;
+import com.persagy.fm.workorder.domain.vo.WoFlowPlanVo;
+import com.persagy.fm.workorder.domain.vo.BaseQueryFlowPlanVo;
 import com.persagy.fm.workorder.domain.vo.QueryFlowPlanListVo;
 import com.persagy.fm.workorder.domain.vo.QueryVerifyFlowPlanVo;
 
@@ -33,4 +34,85 @@ public interface IWoFlowPlanService extends IService<WoFlowPlan> {
      * Update By lijie 2021/4/27 17:54
      */
     String verifyFlowPlan(QueryVerifyFlowPlanVo queryVerifyFlowPlanVo);
+    /***
+     * Description: 查询部门岗位树
+     * @param jsonStr : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 10:18
+     * Update By lijie 2021/5/8 10:18
+     */
+    String queryDeptPositionTree(String jsonStr);
+    /***
+     * Description: 根据Id删除工单类型
+     * @param jsonStr : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 10:23
+     * Update By lijie 2021/5/8 10:23
+     */
+    String deleteFlowPlanById(String jsonStr);
+    /***
+     * Description: 查询项目下所有流转方案
+     * @param queryFlowPlanListVo : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 10:31
+     * Update By lijie 2021/5/8 10:31
+     */
+    String queryProjectFlowPlan(QueryFlowPlanListVo queryFlowPlanListVo);
+    /***
+     * Description: 添加工单流转方案信息
+     * @param woFlowPlanVo : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 11:21
+     * Update By lijie 2021/5/8 11:21
+     */
+    String addFlowPlan(WoFlowPlanVo woFlowPlanVo);
+    /***
+     * Description: 根据Id查询工单详细信息
+     * @param baseQueryFlowPlanVo : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 15:01
+     * Update By lijie 2021/5/8 15:01
+     */
+    String queryFlowPlanById(BaseQueryFlowPlanVo baseQueryFlowPlanVo) throws Exception;
+    /***
+     * Description: 根据Id编辑流转方案信息
+     * @param woFlowPlanVo : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 16:19
+     * Update By lijie 2021/5/8 16:19
+     */
+    String updateFlowPlanById(WoFlowPlanVo woFlowPlanVo);
+    /***
+     * Description: 根据工作类型查询所有有效工单流转方案信息
+     * @param workType : 工作类型
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 17:04
+     * Update By lijie 2021/5/8 17:04
+     */
+    String queryFlowPlanByWorkType(String workType);
+    /***
+     * Description: 根据时间类型查询所有有效流转方案信息
+     * @param executeType : 时间类型
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 17:08
+     * Update By lijie 2021/5/8 17:08
+     */
+    String queryFlowPlanByExecuteType(String executeType);
+    /***
+     * Description: 通过工单类型名称查询所有有效工单
+     * @param planName : 工单类型名称
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 17:12
+     * Update By lijie 2021/5/8 17:12
+     */
+    String queryFlowPlanByPlanName(String planName);
 }

+ 566 - 0
fm-workorder/src/main/java/com/persagy/fm/workorder/service/impl/DictionaryServiceImpl.java

@@ -0,0 +1,566 @@
+package com.persagy.fm.workorder.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.fm.common.constant.enums.ResultEnum;
+import com.persagy.fm.workorder.service.BaseService;
+import com.persagy.fm.workorder.service.IDictionaryService;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class DictionaryServiceImpl extends BaseService implements IDictionaryService {
+	
+	private final static  Logger log = Logger.getLogger(DictionaryServiceImpl.class);
+	//get:数据平台-数据字典查询
+	private final static String DATAPLAT_DICT_QUERY = "BASEPATH/dict/query/PARAM";
+	//post:数据平台-抗震设防烈度
+	public final static String DATAPLAT_SEISMIC_PRECAUTIONARY_INTENSITY_QUERY = "BASEPATH/dict/query/seismic_precautionary_intensity";
+	
+	/**
+	 * 查询所有设备类型的数据字典
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public String queryAllEquipmentCategory() throws Exception {
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"equipment_all");
+		String resQuery = this.httpPostRequestDataPlatform(requestURL,"{}");
+		return resQuery.replace("class", "name").replace("system", "name").replace("facility", "name");
+	}
+	
+	/**
+	 * 查询地理信息--省市信息
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public Map<String, String> queryAllRegionCode() throws Exception {
+		Map<String, String> regionMap = new HashMap<>();
+        String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"geography");
+        String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		JSONObject resultJson = JSONObject.parseObject(resultStr);
+		if("success".equals(resultJson.getString("Result"))){
+			JSONObject contentJson = resultJson.getJSONObject("Content");
+			JSONObject provinceItem, cityItem, cityInfo, districtItem;
+			JSONArray proviceArray, cityArray, cityInfoArray, districtArray;
+			//处理普通省市地区
+			proviceArray = contentJson.getJSONArray("normal");
+			if(proviceArray != null){
+				for(int i=0; i<proviceArray.size(); i++){
+					provinceItem = proviceArray.getJSONObject(i);
+					//处理市级数据
+					cityArray = provinceItem.getJSONArray("cities");
+					for(int j=0; j<cityArray.size(); j++){
+						cityItem = cityArray.getJSONObject(j);
+						cityInfoArray = cityItem.getJSONArray("cityInfo");
+						//处理市区数据
+						districtArray = cityItem.getJSONArray("district");
+						for(int k=0; k<districtArray.size(); k++){
+							districtItem = districtArray.getJSONObject(k);
+							regionMap.put(districtItem.getString("code"), districtItem.getString("districtName"));
+						}
+						//获取市级信息
+						for(int k=0; k<cityInfoArray.size(); k++){
+							cityInfo = cityInfoArray.getJSONObject(k);
+							if(!cityInfo.getString("name").contains("市本级")) {
+								regionMap.put(cityInfo.getString("code"), cityInfo.getString("name"));
+								break;
+							}
+						}
+					}
+					//处理省级数据
+					regionMap.put(completLengthFromRight(provinceItem.getString("provinceCode"), 6, "0"), provinceItem.getString("provinceName"));
+				}
+			}
+			//处理直辖市
+			proviceArray = contentJson.getJSONArray("specialCities");
+			if(proviceArray != null){
+				for(int i=0; i<proviceArray.size(); i++){
+					provinceItem = proviceArray.getJSONObject(i);
+					//处理市区信息
+					districtArray = provinceItem.getJSONArray("district");
+					for(int j=0; j<districtArray.size(); j++){
+						districtItem = districtArray.getJSONObject(j);
+						regionMap.put(districtItem.getString("code"), districtItem.getString("districtName"));
+					}
+					//处理市级信息
+					cityInfoArray = provinceItem.getJSONArray("cityInfo");
+					for(int j=0; j<cityInfoArray.size(); j++){
+						cityInfo = cityInfoArray.getJSONObject(j);
+						if(!cityInfo.getString("name").contains("市本级")){
+							regionMap.put(cityInfo.getString("code"), cityInfo.getString("name"));
+							break;
+						}
+					}
+				}
+			}
+		}
+		return regionMap;
+	}
+
+	/**
+	 * 查询气候区
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public Map<String, String> queryAllClimateAreaCode() throws Exception {
+		Map<String, String> climateMap = new HashMap<String, String>();
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"climate");
+		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains(ResultEnum.SUCCESS.getType())){
+			JSONObject climateJson = JSONObject.parseObject(resultStr);
+			JSONArray climates = climateJson.getJSONArray("Content");
+			getDictionaryCode(climateMap, climates);
+		}
+		return climateMap;
+	}
+	/**
+	 * 查询天气状态
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public Map<String, String> queryAllWeatherStatusCode() throws Exception{
+		Map<String, String> weatherMap = new HashMap<>();
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"weather");
+		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject weather;
+			JSONObject weatherJson = JSONObject.parseObject(resultStr);
+			JSONArray weathers = weatherJson.getJSONArray("Content");
+			for(int i=0; i<weathers.size(); i++){
+				weather = weathers.getJSONObject(i);
+				weatherMap.put(weather.getString("code"), weather.getString("name"));
+			}
+		}
+		return weatherMap;
+	}
+	
+
+	/**
+	 * 查询空气风力等级
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public Map<String, String> queryAllWindLevelCode() throws Exception{
+		Map<String, String> windMap = new HashMap<String, String>();
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"wind");
+		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject wind;
+			JSONObject windJson = JSONObject.parseObject(resultStr);
+			JSONArray winds = windJson.getJSONArray("Content");
+			for(int i=0; i<winds.size(); i++){
+				wind = winds.getJSONObject(i);
+				windMap.put(wind.getString("code"), wind.getString("name"));
+			}
+		}
+		return windMap;
+	}
+	
+
+	/**
+	 * 查询方位信息
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public Map<String, String> queryAllDirectionCode() throws Exception{
+		Map<String, String> directionMap = new HashMap<String, String>();
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"direction");
+		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject direction;
+			JSONObject directionJson = JSONObject.parseObject(resultStr);
+			JSONArray directions = directionJson.getJSONArray("Content");
+			for(int i=0; i<directions.size(); i++){
+				direction = directions.getJSONObject(i);
+				directionMap.put(direction.getString("code"), direction.getString("name"));
+			}
+		}
+		return directionMap;
+	}
+	
+	
+	/**
+	 * 查询建筑功能类型
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public Map<String, String> queryAllBuildingCode() throws Exception{
+		Map<String, String> buildingMap = new HashMap<String, String>();
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"building");
+		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject directionJson = JSONObject.parseObject(resultStr);
+			JSONArray directions = directionJson.getJSONArray("Content");
+			getDictionaryCode(buildingMap, directions);
+		}
+		return buildingMap;
+	}
+	public void getDictionaryCode(Map<String, String> dictionaryMap, JSONArray dictionarys){
+		if(dictionarys == null || dictionarys.size() == 0){
+			return;
+		}
+		JSONObject dictionary;
+		for(int i=0; i<dictionarys.size(); i++){
+			dictionary = dictionarys.getJSONObject(i);
+			dictionaryMap.put(dictionary.getString("code"), dictionary.getString("name"));
+			getDictionaryCode(dictionaryMap, dictionary.getJSONArray("content"));
+		}
+	}
+	/**
+	 * 查询空间功能类型
+	 * @return
+	 * @throws Exception
+	 */
+	public Map<String, String> queryAllSpaceCode() throws Exception{
+		Map<String, String> spaceMap = new HashMap<String, String>();
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"space");
+		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject spaceJson = JSONObject.parseObject(resultStr);
+			JSONArray spaces = spaceJson.getJSONArray("Content");
+			getDictionaryCode(spaceMap, spaces);
+		}
+		return spaceMap;
+	}
+	
+	/**
+	 * 查询租赁业态
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public Map<String, String> queryAllRentalCode() throws Exception{
+		Map<String, String> rentalMap = new HashMap<>();
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"rental");
+		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject rentalJson = JSONObject.parseObject(resultStr);
+			JSONArray rentals = rentalJson.getJSONArray("Content");
+			getDictionaryCode(rentalMap, rentals);
+		}
+		return rentalMap;
+	}
+	
+	/**
+	 * 查询抗震设防烈度
+	 * @return
+	 * @throws Exception
+	 */
+	@Override
+	public Map<String, String> queryAllSeismicPrecautionaryIntensityCode() throws Exception{
+		Map<String, String> rentalMap = new HashMap<>();
+		String requestURL = this.getDataPlatDictPath(DATAPLAT_SEISMIC_PRECAUTIONARY_INTENSITY_QUERY ,null);
+		String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject direction;
+			JSONObject directionJson = JSONObject.parseObject(resultStr);
+			JSONArray directions = directionJson.getJSONArray("Content");
+			for(int i=0; i<directions.size(); i++){
+				direction = directions.getJSONObject(i);
+				rentalMap.put(direction.getString("code"), direction.getString("name"));
+			}
+		}
+		return rentalMap;
+	}
+	
+	  /**
+     * 查询防尘等级
+     * @return
+     * @throws Exception
+     */
+	@Override
+    public Map<String, String> queryAllDustproofCode() throws Exception {
+		Map<String, String> dustproofMap = new HashMap<>();
+        String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"dustproof");
+        String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject direction;
+			JSONObject directionJson = JSONObject.parseObject(resultStr);
+			JSONArray directions = directionJson.getJSONArray("Content");
+			for(int i=0; i<directions.size(); i++){
+				direction = directions.getJSONObject(i);
+				dustproofMap.put(direction.getString("code"), direction.getString("name"));
+			}
+		}
+		return dustproofMap;
+    }
+	
+	 /**
+     * 查询防水等级
+     * @return
+     * @throws Exception
+     */
+    public Map<String, String> queryAllWaterproofCode() throws Exception {
+    	Map<String, String> waterproofMap = new HashMap<>();
+        String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"waterproof");
+        String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject direction;
+			JSONObject directionJson = JSONObject.parseObject(resultStr);
+			JSONArray directions = directionJson.getJSONArray("Content");
+			for(int i=0; i<directions.size(); i++){
+				direction = directions.getJSONObject(i);
+				waterproofMap.put(direction.getString("code"), direction.getString("name"));
+			}
+		}
+		return waterproofMap;
+    }
+	
+    /**
+     * 查询防爆型式
+     * @return
+     * @throws Exception
+     */
+    public Map<String, String> queryAllExplosionproofEquipmentCode() throws Exception {
+    	Map<String, String> proofEquipmentMap = new HashMap<>();
+        String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"explosionproof/equipment");
+        String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject rentalJson = JSONObject.parseObject(resultStr);
+			JSONArray rentals = rentalJson.getJSONArray("Content");
+			getDictionaryCode(proofEquipmentMap, rentals);
+		}
+		return proofEquipmentMap;
+    }
+    
+    /**
+     * 查询防爆设备类型
+     * @return
+     * @throws Exception
+     */
+    public Map<String, String> queryAllDangerCode() throws Exception {
+    	Map<String, String> dangerTypeMap = new HashMap<>();
+        String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"danger");
+        String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject direction;
+			JSONObject directionJson = JSONObject.parseObject(resultStr);
+			JSONArray directions = directionJson.getJSONArray("Content");
+			for(int i=0; i<directions.size(); i++){
+				direction = directions.getJSONObject(i);
+				dangerTypeMap.put(direction.getString("code"), direction.getString("name"));
+			}
+		}
+		return dangerTypeMap;
+    }
+    /**
+     * 查询危险区域等级
+     * @return
+     * @throws Exception
+     */
+    public Map<String, String> queryAllExplosionproofGasTemperatureCode() throws Exception {
+    	Map<String, String> gasTemperatureMap = new HashMap<>();
+        String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"explosionproof/gas_temperature");
+        String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject direction;
+			JSONObject directionJson = JSONObject.parseObject(resultStr);
+			JSONArray directions = directionJson.getJSONArray("Content");
+			for(int i=0; i<directions.size(); i++){
+				direction = directions.getJSONObject(i);
+				gasTemperatureMap.put(direction.getString("code"), direction.getString("name"));
+			}
+		}
+		return gasTemperatureMap;
+    }
+    
+    /**
+     * 查询气体类型或温度类型
+     * @return
+     * @throws Exception
+     */
+    public Map<String, String> queryAllExplosionproofTypeCode() throws Exception {
+    	Map<String, String> proofTypeMap = new HashMap<>();
+        String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"explosionproof/type");
+        String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject rentalJson = JSONObject.parseObject(resultStr);
+			JSONArray rentals = rentalJson.getJSONArray("Content");
+			getDictionaryCode(proofTypeMap, rentals);
+		}
+		return proofTypeMap;
+    }
+    
+    
+    /**
+     * 查询污染等级
+     * @return
+     * @throws Exception
+     */
+    public Map<String, String> queryAllPollutionLevelCode() throws Exception {
+    	Map<String, String> pollutionLevelMap = new HashMap<>();
+        String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"pollution_level");
+        String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+		if(resultStr.contains("success")){
+			JSONObject direction;
+			JSONObject directionJson = JSONObject.parseObject(resultStr);
+			JSONArray directions = directionJson.getJSONArray("Content");
+			for(int i=0; i<directions.size(); i++){
+				direction = directions.getJSONObject(i);
+				pollutionLevelMap.put(direction.getString("code"), direction.getString("name"));
+			}
+		}
+		return pollutionLevelMap;
+    }
+    
+    /**
+     * 查询污秽等级
+     * @return
+     * @throws Exception
+     */
+    public Map<String, String> queryAllContaminationLevelCode() throws Exception {
+    	Map<String, String> contaminationLevelMap = new HashMap<>();
+    	String requestURL = this.getDataPlatDictPath(DATAPLAT_DICT_QUERY,"contamination_level");
+    	String resultStr = this.httpPostRequestDataPlatform(requestURL,"{}");
+    	if(resultStr.contains("success")){
+    		JSONObject direction;
+    		JSONObject directionJson = JSONObject.parseObject(resultStr);
+    		JSONArray directions = directionJson.getJSONArray("Content");
+    		for(int i=0; i<directions.size(); i++){
+    			direction = directions.getJSONObject(i);
+    			contaminationLevelMap.put(direction.getString("code"), direction.getString("name"));
+    		}
+    	}
+    	return contaminationLevelMap;
+    }
+    
+	/**
+	 * 
+	 * 功能描述:查询数据字典数据
+	 * @param name
+	 * @return 
+	 * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 
+	 * 修改描述
+	 */
+    @Override
+	public Map<String, String> queryDictionaryDataByName(String name){
+		Map<String, String> map = null;
+		if(null == name || "".equals(name)) return map;
+		try {
+			if(name.contains("省市区代码")){
+				map = queryAllRegionCode();
+			}else if(name.contains("气候区代码")){
+				map = queryAllClimateAreaCode();
+			}else if(name.contains("天气状态")){
+				map = queryAllWeatherStatusCode();
+			}else if(name.contains("空气风力等级")){
+				map = queryAllWindLevelCode();
+			}else if(name.contains("方向代码")){
+				map = queryAllDirectionCode();
+			}else if(name.contains("建筑功能")){
+				map = queryAllBuildingCode();
+			}else if(name.contains("空间功能")){
+				map = queryAllSpaceCode();
+			}else if(name.contains("租赁业态")){
+				map = queryAllRentalCode();
+			}else if(name.contains("抗震设防烈度")){
+				map = queryAllSeismicPrecautionaryIntensityCode();
+			}else if(name.contains("防尘等级")){
+				map = queryAllDustproofCode();
+			}else if(name.contains("防水等级")){
+				map = queryAllWaterproofCode();
+			}else if(name.contains("防爆设备类型")){
+				map = queryAllDangerCode();
+			}else if(name.contains("防爆型式")){
+				map = queryAllExplosionproofEquipmentCode();
+			}else if(name.contains("危险区域等级")){
+				map = queryAllExplosionproofGasTemperatureCode();
+			}else if(name.contains("气体类型") || name.contains("温度类型") ){
+				map = queryAllExplosionproofTypeCode();
+			}else if(name.contains("防爆等级")){
+//				map = queryAllPollutionLevelCode();
+			}else if(name.contains("污秽等级")){
+				map = queryAllContaminationLevelCode();
+			}else if(name.contains("污染等级")){
+				map = queryAllPollutionLevelCode();
+			}else {
+				log.warn("未查到数据字典["+name+"]的信息!");
+			}
+		} catch (Exception e) {
+			log.warn("未查到数据字典["+name+"]的信息!");
+		}
+	
+		return map;
+	}
+    
+    /**
+	 * 
+	 * 功能描述:查询数据字典数据
+	 * @param name
+	 * @return 
+     * @throws Exception 
+     * @创建者 wanghailong
+	 * @邮箱 wanghailong@persagy.com 
+	 * 修改描述
+	 */
+    @Override
+	public JSONArray queryDictionaryDataForJSONArrayByName(String name) throws Exception{
+		JSONArray array = null;
+    	Map<String, String> map = null;
+		if(null == name || "".equals(name)) return array;
+		if(name.contains("省市区代码")){
+			map = queryAllRegionCode();
+		}else if(name.contains("气候区代码")){
+			map = queryAllClimateAreaCode();
+		}else if(name.contains("天气状态")){
+			map = queryAllWeatherStatusCode();
+		}else if(name.contains("空气风力等级")){
+			map = queryAllWindLevelCode();
+		}else if(name.contains("方向代码")){
+			map = queryAllDirectionCode();
+		}else if(name.contains("建筑功能类型")){
+			map = queryAllBuildingCode();
+		}else if(name.contains("空间功能类型")){
+			map = queryAllSpaceCode();
+		}else if(name.contains("租赁业态类型")){
+			map = queryAllRentalCode();
+		}else if(name.contains("防尘等级")){
+			map = queryAllDustproofCode();
+		}else if(name.contains("防水等级")){
+			map = queryAllWaterproofCode();
+		}else if(name.contains("防爆设备类型")){
+			map = queryAllDangerCode();
+		}else if(name.contains("防爆型式")){
+			map = queryAllExplosionproofEquipmentCode();
+		}else if(name.contains("危险区域等级")){
+			map = queryAllExplosionproofGasTemperatureCode();
+		}else if(name.contains("气体类型") || name.contains("温度类型") ){
+			map = queryAllExplosionproofTypeCode();
+		}else if(name.contains("防爆等级")){
+//				map = queryAllPollutionLevelCode();
+		}else if(name.contains("污秽等级")){
+			map = queryAllContaminationLevelCode();
+		}else if(name.contains("污染等级")){
+			map = queryAllPollutionLevelCode();
+		}else {
+			log.warn("未查到数据字典["+name+"]的信息!");
+		}
+		if(map != null){
+			array = new JSONArray();
+			JSONObject item;
+			for(String key : map.keySet()){
+				item = new JSONObject();
+				item.put("code", key);
+				item.put("name", map.get(key));
+				array.add(item);
+			}
+		}
+		return array;
+	}
+	
+	
+	
+	
+
+}

+ 478 - 21
fm-workorder/src/main/java/com/persagy/fm/workorder/service/impl/WoFlowPlanServiceImpl.java

@@ -1,39 +1,43 @@
 package com.persagy.fm.workorder.service.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.persagy.fm.common.constant.enums.BoolEnum;
-import com.persagy.fm.common.constant.enums.DictTypeEnum;
+import com.persagy.common.exception.BusinessException;
+import com.persagy.fm.common.constant.CommonConstant;
+import com.persagy.fm.common.constant.enums.*;
 import com.persagy.fm.common.model.vo.GeneralDictVo;
 import com.persagy.fm.common.old.utils.StringUtil;
 import com.persagy.fm.common.old.utils.ToolsUtil;
+import com.persagy.fm.workorder.cache.OrderTypeCache;
+import com.persagy.fm.workorder.client.SaasClient;
 import com.persagy.fm.workorder.constant.FlowPlanConstant;
 import com.persagy.fm.workorder.constant.enums.WoApplyItemEnum;
 import com.persagy.fm.workorder.constant.enums.WoControlModelEnum;
+import com.persagy.fm.workorder.constant.enums.WoFlowPlanStatusEnum;
 import com.persagy.fm.workorder.dao.WoFlowPlanMapper;
-import com.persagy.fm.workorder.domain.dto.ApplyItemBean;
-import com.persagy.fm.workorder.domain.dto.DutyBean;
-import com.persagy.fm.workorder.domain.dto.PostAndDuty;
+import com.persagy.fm.workorder.domain.dto.*;
 import com.persagy.fm.workorder.domain.entity.WoFlowPlan;
+import com.persagy.fm.workorder.domain.vo.WoFlowPlanVo;
+import com.persagy.fm.workorder.domain.vo.BaseQueryFlowPlanVo;
 import com.persagy.fm.workorder.domain.vo.QueryFlowPlanListVo;
 import com.persagy.fm.workorder.domain.vo.QueryVerifyFlowPlanVo;
+import com.persagy.fm.workorder.service.IDictionaryService;
 import com.persagy.fm.workorder.service.IGeneralDictService;
 import com.persagy.fm.workorder.service.IWoFlowPlanService;
 import lombok.RequiredArgsConstructor;
-import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.yarn.webapp.hamlet.Hamlet;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
-import javax.validation.constraints.NotEmpty;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import javax.xml.transform.Result;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -49,6 +53,10 @@ import java.util.stream.Collectors;
 public class WoFlowPlanServiceImpl extends ServiceImpl<WoFlowPlanMapper, WoFlowPlan> implements IWoFlowPlanService {
 
     private final IGeneralDictService generalDictService;
+    private final SaasClient saasClient;
+    private final OrderTypeCache orderTypeCache;
+    private final IDictionaryService dictionaryService;
+
 
     private static final String promptMessageOne = "一套分配方案至少有一个岗位的职责要包含“新建工单”";
     private static final String promptMessageTwo = "一套分配方案至少有一个岗位的职责要包含“执行”";
@@ -80,7 +88,7 @@ public class WoFlowPlanServiceImpl extends ServiceImpl<WoFlowPlanMapper, WoFlowP
             queryWrapper.eq(WoFlowPlan::getRepairFlag,queryFlowPlanListVo.getRepairFlag());
         }
         if (StrUtil.isNotBlank(queryFlowPlanListVo.getExecuteType())){
-            queryWrapper.eq(WoFlowPlan::getExcuteType,queryFlowPlanListVo.getExecuteType());
+            queryWrapper.eq(WoFlowPlan::getExecuteType,queryFlowPlanListVo.getExecuteType());
         }
         if (StrUtil.isBlank(queryFlowPlanListVo.getProjectId())){
             queryWrapper.eq(WoFlowPlan::getProjectId, FlowPlanConstant.GROUP_ID);
@@ -103,7 +111,6 @@ public class WoFlowPlanServiceImpl extends ServiceImpl<WoFlowPlanMapper, WoFlowP
     public String verifyFlowPlan(QueryVerifyFlowPlanVo queryVerifyFlowPlanVo) {
         List<PostAndDuty> postAndDutys = queryVerifyFlowPlanVo.getPostAndDuty();
         JSONArray promptMessages = new JSONArray();
-
         Map<String, JSONArray> map = new HashMap<String, JSONArray>();
         map.put("promptMessageOne", JSONArray.parseArray("[\""+promptMessageOne+"\"]"));
         map.put("promptMessageTwo", JSONArray.parseArray("[\""+promptMessageTwo+"\"]"));
@@ -180,6 +187,458 @@ public class WoFlowPlanServiceImpl extends ServiceImpl<WoFlowPlanMapper, WoFlowP
         verifyFlowPlanName(queryVerifyFlowPlanVo.getPlanId(),queryVerifyFlowPlanVo.getPlanName(),null, null, promptMessages);
         return ToolsUtil.successJsonMsg(promptMessages);
     }
+    /***
+     * Description: 查询部门岗位树
+     * @param jsonStr : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 10:18
+     * Update By lijie 2021/5/8 10:18
+     */
+    @Override
+    public String queryDeptPositionTree(String jsonStr){
+        JSONObject jsonObj = JSONObject.parseObject(jsonStr);
+        jsonObj.put("user_id", CommonConstant.SYSTEM_ID);
+        jsonObj.put("user_type", "0");
+        jsonObj.put("treeType", "dept_position_model");
+        String respContent = saasClient.queryDeptPositionTree(jsonObj);
+        //去掉“其他”部门
+        JSONObject jsonObject = JSONObject.parseObject(respContent);
+        JSONArray deptArr = jsonObject.getJSONArray(ResultEnum.CONTENT.getType());
+        if(deptArr != null && deptArr.size() > 0){
+            for (int i = 0; i < deptArr.size(); i++) {
+                JSONObject obj = deptArr.getJSONObject(i);
+                if("其他".equals(obj.getString("obj_name"))){
+                    deptArr.remove(i);
+                    i--;
+                }
+            }
+        } else {
+            deptArr = new JSONArray();
+        }
+        return ToolsUtil.successJsonMsg(deptArr);
+    }
+    /***
+     * Description: 根据Id删除工单类型
+     * @param jsonStr : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 10:23
+     * Update By lijie 2021/5/8 10:23
+     */
+    @Override
+    @Transactional(rollbackFor = BusinessException.class)
+    public String deleteFlowPlanById(String jsonStr){
+        JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+        WoFlowPlan woFlowPlan = WoFlowPlan.builder()
+                .planId(jsonObject.getString("plan_id"))
+                .valid(false)
+                .build();
+        this.updateById(woFlowPlan);
+        return ToolsUtil.successJsonMsg(new ArrayList<>());
+    }
+    /***
+     * Description: 查询项目下所有流转方案
+     * @param queryFlowPlanListVo : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 10:31
+     * Update By lijie 2021/5/8 10:31
+     */
+    @Override
+    public String queryProjectFlowPlan(QueryFlowPlanListVo queryFlowPlanListVo) {
+        LambdaQueryWrapper<WoFlowPlan> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(WoFlowPlan::getValid,true);
+        if (StrUtil.isNotBlank(queryFlowPlanListVo.getProjectId())){
+            queryWrapper.eq(WoFlowPlan::getProjectId,queryFlowPlanListVo.getProjectId());
+        }
+        if (StrUtil.isNotBlank(queryFlowPlanListVo.getExecuteType())){
+            queryWrapper.eq(WoFlowPlan::getExecuteType,queryFlowPlanListVo.getExecuteType());
+        }
+        if (StrUtil.isNotBlank(queryFlowPlanListVo.getWorkType())){
+            queryWrapper.eq(WoFlowPlan::getWorkType,queryFlowPlanListVo.getWorkType());
+        }
+        List<WoFlowPlan> woFlowPlans = this.list(queryWrapper);
+        if (CollUtil.isEmpty(woFlowPlans)){
+            return ToolsUtil.successJsonMsg(new ArrayList<>());
+        }
+        return ToolsUtil.successJsonMsg(fixQueryResult(woFlowPlans));
+    }
+    /***
+     * Description: 添加工单流转方案信息
+     * @param woFlowPlanVo : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 11:21
+     * Update By lijie 2021/5/8 11:21
+     */
+    @Override
+    public String addFlowPlan(WoFlowPlanVo woFlowPlanVo) {
+        //添加工单类型信息
+        // 1.过滤掉下级路由中重复的岗位
+        List<WoFlowPlan> woFlowPlans = queryWoFlanByPlanName(woFlowPlanVo.getPlanName());
+        if (CollUtil.isNotEmpty(woFlowPlans)){
+            return ToolsUtil.errorJsonMsg("工单类型名称重复!");
+        }
+        woFlowPlanVo.setPostAndDuty(distinctNextRoute(CollUtil.defaultIfEmpty(woFlowPlanVo.getPostAndDuty(), new ArrayList<>())));
+        woFlowPlanVo.setPostAndDuty(saveCreateAndAssignNextRoute(CollUtil.defaultIfEmpty(woFlowPlanVo.getPostAndDuty(), new ArrayList<>())));
+        WoFlowPlan woFlowPlan = new WoFlowPlan();
+        woFlowPlan.setPlanId(IdPrefixEnum.WO_FLOW_PLAN.getPrefix()+IdWorker.getIdStr());
+        woFlowPlan.setPlanName(woFlowPlanVo.getPlanName());
+        woFlowPlan.setProjectId(StrUtil.blankToDefault(woFlowPlanVo.getProjectId(),FlowPlanConstant.GROUP_ID));
+        //工作类型编码
+        woFlowPlan.setWorkType(woFlowPlanVo.getWorkType());
+        //时间类型编码
+        woFlowPlan.setExecuteType(woFlowPlanVo.getExecuteType());
+        //项目功能类型
+        woFlowPlan.setFunctionType(woFlowPlanVo.getFunctionType());
+        //方案状态 0-需维护,1-正常
+        woFlowPlan.setPlanStatus(WoFlowPlanStatusEnum.NORMAL.getType());
+        //创建人
+        woFlowPlan.setCreatorId(woFlowPlanVo.getPersonId());
+        //报修是否可以转此工单,  0-否,1-是
+        woFlowPlan.setRepairFlag(StrUtil.blankToDefault(woFlowPlanVo.getRepairFlag(), BoolEnum.FALSE.getType()));
+        //岗位职责
+        woFlowPlan.setPostAndDuty(woFlowPlanVo.getPostAndDuty());
+        if (ObjectUtil.isNotNull(woFlowPlanVo.getPostAndDutyNative())){
+            woFlowPlan.setPostAndDutyNative(woFlowPlanVo.getPostAndDutyNative());
+        }
+        //添加时间要求
+        woFlowPlan.setTimeLimit(ObjectUtil.defaultIfNull(woFlowPlanVo.getTimeLimit(), new TimeLimitBean()));
+        // 版本号
+        woFlowPlan.setVersion(1);
+        this.save(woFlowPlan);
+        //====刷新缓存===
+        orderTypeCache.updateCache(woFlowPlan);
+        return ToolsUtil.successJsonMsg(new ArrayList<>());
+    }
+    /***
+     * Description: 根据Id查询工单详细信息
+     * @param baseQueryFlowPlanVo : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 15:01
+     * Update By lijie 2021/5/8 15:01
+     */
+    @Override
+    public String queryFlowPlanById(BaseQueryFlowPlanVo baseQueryFlowPlanVo) throws Exception {
+        WoFlowPlan woFlowPlan = this.getById(baseQueryFlowPlanVo.getPlanId());
+        if (null==woFlowPlan){
+            return ToolsUtil.successJsonMsg(new JSONObject());
+        }
+        Map<String, String> buildingMap = dictionaryService.queryAllBuildingCode();
+        Map<String, String> typeNameMap = queryWorkTypeAndExecuteTypeNameMap();
+        WoFlowPlanBean woFlowPlanBean = BeanUtil.copyProperties(woFlowPlan, WoFlowPlanBean.class);
+        //获取工单类型和时间类型
+        woFlowPlanBean.setWorkTypeName(typeNameMap.getOrDefault(woFlowPlanBean.getWorkType(),""));
+        woFlowPlanBean.setExecuteTypeName(typeNameMap.getOrDefault(woFlowPlanBean.getExecuteType(),""));
+        JSONObject flowPlan = JSONObject.parseObject(JSONObject.toJSONString(woFlowPlanBean));
+        //在这里无法将字符串解析为对象  :是因为传入的参数的原因
+        String post_and_duty = flowPlan.getString("post_and_duty");
+        //-----旧数据兼容 中止->终止
+        post_and_duty = post_and_duty.replace("中止","终止");
+        flowPlan.put("post_and_duty", JSONArray.parseArray(post_and_duty));
+        if (!StringUtil.isNull(flowPlan,"post_and_duty_native")){
+            String post_and_duty_native = flowPlan.getString("post_and_duty_native");
+            post_and_duty_native = post_and_duty_native.replace("中止","终止");
+            flowPlan.put("post_and_duty_native", JSONObject.parseObject(post_and_duty_native));
+        }
+
+        String function_type =  flowPlan.getString("function_type");
+        String function_type_name = "";
+        if(!StringUtil.isNull(function_type)) {
+            function_type_name = buildingMap.get(function_type);
+        }
+        flowPlan.put("function_type_name", function_type_name == null ? "" : function_type_name);
+        //添加时间限制
+        flowPlan.put("time_limit", JSONObject.parseObject(flowPlan.getString("time_limit")));
+        return ToolsUtil.successJsonMsg(flowPlan);
+    }
+    /***
+     * Description: 根据Id编辑流转方案信息
+     * @param woFlowPlanVo : 请求参数
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 16:19
+     * Update By lijie 2021/5/8 16:19
+     */
+    @Override
+    public String updateFlowPlanById(WoFlowPlanVo woFlowPlanVo) {
+        // 1.根据plan_id查询工单类型
+        WoFlowPlan woFlowPlan = this.getById(woFlowPlanVo.getPlanId());
+        if (null==woFlowPlan){
+            return ToolsUtil.errorJsonMsg("未找到流转方案");
+        }
+        // 找到工单类型版本自动加一,自动更新不加版本
+        if (StrUtil.isBlank(woFlowPlanVo.getPlanStatus())){
+            woFlowPlan.setVersion(woFlowPlan.getVersion()+1);
+        }
+        woFlowPlanVo.setPostAndDuty(distinctNextRoute(CollUtil.defaultIfEmpty(woFlowPlanVo.getPostAndDuty(),new ArrayList<>())));
+        // 正常更新不传状态
+        if(StrUtil.isBlank(woFlowPlanVo.getPlanStatus())){
+            // 添加新建和指派的下级路由
+            woFlowPlanVo.setPostAndDuty(saveCreateAndAssignNextRoute(CollUtil.defaultIfEmpty(woFlowPlanVo.getPostAndDuty(),new ArrayList<>())));
+            woFlowPlan.setPlanStatus(WoFlowPlanStatusEnum.NORMAL.getType());
+        }
+        // 工单类型名称
+        if (StrUtil.isNotBlank(woFlowPlanVo.getPlanName())){
+            woFlowPlan.setPlanName(woFlowPlanVo.getPlanName());
+        }
+        // 工作类型编码
+        woFlowPlan.setWorkType(woFlowPlanVo.getWorkType());
+        // 时间类型编码
+        woFlowPlan.setExecuteType(woFlowPlanVo.getExecuteType());
+        //项目功能类型
+        if (StrUtil.isNotBlank(woFlowPlanVo.getFunctionType())){
+            woFlowPlan.setFunctionType(woFlowPlanVo.getFunctionType());
+        }
+        //报修是否可以转此工单,  0-否,1-是
+        woFlowPlan.setRepairFlag(StrUtil.blankToDefault(woFlowPlanVo.getRepairFlag(),BoolEnum.FALSE.getType()));
+        // 岗位职责
+        woFlowPlan.setPostAndDuty(CollUtil.defaultIfEmpty(woFlowPlanVo.getPostAndDuty(),new ArrayList<>()));
+        if (null!=woFlowPlanVo.getPostAndDutyNative()){
+            woFlowPlan.setPostAndDutyNative(woFlowPlanVo.getPostAndDutyNative());
+        }
+        woFlowPlan.setTimeLimit(ObjectUtil.defaultIfNull(woFlowPlanVo.getTimeLimit(),new TimeLimitBean()));
+        woFlowPlan.setUpdateTime(null);
+        this.updateById(woFlowPlan);
+        orderTypeCache.updateCache(woFlowPlan);
+        return ToolsUtil.successJsonMsg(new ArrayList<>());
+    }
+    /***
+     * Description: 根据工作类型查询所有有效工单流转方案信息
+     * @param workType : 工作类型
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 17:04
+     * Update By lijie 2021/5/8 17:04
+     */
+    @Override
+    @Deprecated
+    public String queryFlowPlanByWorkType(String workType) {
+        LambdaQueryWrapper<WoFlowPlan> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(WoFlowPlan::getValid,true);
+        queryWrapper.eq(WoFlowPlan::getWorkType,workType);
+        return queryWoFlowPlansByCondition(queryWrapper);
+    }
+    /***
+     * Description: 根据时间类型查询所有有效流转方案信息
+     * @param executeType : 时间类型
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 17:08
+     * Update By lijie 2021/5/8 17:08
+     */
+    @Override
+    public String queryFlowPlanByExecuteType(String executeType) {
+        LambdaQueryWrapper<WoFlowPlan> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(WoFlowPlan::getValid,true);
+        queryWrapper.eq(WoFlowPlan::getExecuteType,executeType);
+        return queryWoFlowPlansByCondition(queryWrapper);
+    }
+    /***
+     * Description: 通过工单类型名称查询所有有效工单
+     * @param planName : 工单类型名称
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 17:12
+     * Update By lijie 2021/5/8 17:12
+     */
+    @Override
+    public String queryFlowPlanByPlanName(String planName) {
+        LambdaQueryWrapper<WoFlowPlan> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(WoFlowPlan::getValid,true);
+        queryWrapper.eq(WoFlowPlan::getPlanName, planName);
+        return queryWoFlowPlansByCondition(queryWrapper);
+    }
+
+    /***
+     * Description: 根据条件查询工单类型列表
+     * @param queryWrapper : 查询Wrapper
+     * @return : java.lang.String
+     * @author : lijie
+     * @date :2021/5/8 17:11
+     * Update By lijie 2021/5/8 17:11
+     */
+    private String queryWoFlowPlansByCondition(LambdaQueryWrapper<WoFlowPlan> queryWrapper) {
+        List<WoFlowPlan> woFlowPlans = this.list(queryWrapper);
+        if (CollUtil.isEmpty(woFlowPlans)){
+            return ToolsUtil.successJsonMsg(new ArrayList<>());
+        }
+        return ToolsUtil.successJsonMsg(fixQueryResult(woFlowPlans));
+    }
+
+    /***
+     * Description: 查询工作类型和执行类型的名称映射
+     * @return : java.util.Map<java.lang.String,java.lang.String>
+     * @author : lijie
+     * @date :2021/5/8 16:05
+     * Update By lijie 2021/5/8 16:05
+     */
+    private Map<String,String> queryWorkTypeAndExecuteTypeNameMap() {
+        List<GeneralDictVo> workTypes = generalDictService.queryGeneralDictByKey(DictTypeEnum.WORK_TYPE.getType(), null);
+        List<GeneralDictVo> woExecuteTypes = generalDictService.queryGeneralDictByKey(DictTypeEnum.WO_EXECUTE_TYPE.getType(), null);
+        Map<String,String> dictTypeNameMap = new HashMap<>();
+        dictTypeNameMap.putAll(workTypes.stream().collect(Collectors.toMap(GeneralDictVo::getCode,GeneralDictVo::getName,(k1,k2)->k1)));
+        dictTypeNameMap.putAll(woExecuteTypes.stream().collect(Collectors.toMap(GeneralDictVo::getCode,GeneralDictVo::getName,(k1,k2)->k1)));
+        return dictTypeNameMap;
+    }
+
+    /***
+     * Description: 根据工单类型名称查询工单类型
+     * @param planName : 工单类型名称
+     * @return : void
+     * @author : lijie
+     * @date :2021/5/8 14:24
+     * Update By lijie 2021/5/8 14:24
+     */
+    private List<WoFlowPlan> queryWoFlanByPlanName(String planName) {
+        if (StrUtil.isBlank(planName)){
+            return new ArrayList<>();
+        }
+        LambdaQueryWrapper<WoFlowPlan> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(WoFlowPlan::getValid,true);
+        queryWrapper.eq(WoFlowPlan::getPlanName,planName);
+        return this.list(queryWrapper);
+    }
+
+    /**
+     * Description: 给新建指派控制模块添加下级路由
+     * @param postAndDuties:岗位职责
+     * @author ChenQuanWei
+     * @since 2018年5月31日: 上午8:55:23
+     * Update By ChenQuanWei 2018年5月31日: 上午8:55:23
+     */
+    private List<PostAndDuty> saveCreateAndAssignNextRoute(List<PostAndDuty> postAndDuties) {
+        Map<String,List<NextRouteBean>> dutyForPostMap = new HashMap<>();
+        // 1.遍历岗位职责,整理新建,指派和执行的岗位职责
+        for (PostAndDuty postAndDuty : postAndDuties) {
+            List<DutyBean> dutyBeans = CollUtil.defaultIfEmpty(postAndDuty.getDuty(), new ArrayList<>());
+            for (DutyBean dutyBean : dutyBeans) {
+                // 只整理新建、指派和执行
+                if (WoControlModelEnum.CREATE.getType().equals(dutyBean.getCode())
+                        || WoControlModelEnum.ASSIGN.getType().equals(dutyBean.getCode())
+                        || WoControlModelEnum.EXECUTE.getType().equals(dutyBean.getCode())) {
+                    List<NextRouteBean> nextRouteBeans = dutyForPostMap.getOrDefault(dutyBean.getCode(), new ArrayList<>());
+                    nextRouteBeans.add(NextRouteBean.builder()
+                            .type(postAndDuty.getType())
+                            .name(postAndDuty.getName())
+                            .positionId(postAndDuty.getPositionId())
+                            .build());
+                    dutyForPostMap.put(dutyBean.getCode(), nextRouteBeans);
+                }
+            }
+        }
+        List<NextRouteBean> excuteNextRouteBeans = dutyForPostMap.getOrDefault(WoControlModelEnum.EXECUTE.getType(), new ArrayList<>());
+        List<NextRouteBean> assignNextRouteBeans = dutyForPostMap.getOrDefault(WoControlModelEnum.ASSIGN.getType(), new ArrayList<>());
+        // 2.当指派路由大于1时去掉系统指派的路由
+        if (assignNextRouteBeans.size()>1){
+            for (int i = assignNextRouteBeans.size() - 1; i >= 0; i--) {
+                NextRouteBean nextRouteBean = assignNextRouteBeans.get(i);
+                if (FlowPlanConstant.SYSTEM_POSITION.equals(nextRouteBean.getPositionId())){
+                    assignNextRouteBeans.remove(i);
+                }
+            }
+        }
+        // 3.处理新建和指派时的下级路由
+        for (PostAndDuty postAndDuty : postAndDuties) {
+            List<DutyBean> dutyBeans = CollUtil.defaultIfEmpty(postAndDuty.getDuty(), new ArrayList<>());
+            for (DutyBean dutyBean : dutyBeans) {
+                List<NextRouteBean> nextRouteBeanArr = new ArrayList<>();
+                //只在新建中添加,设置默认
+                if (WoControlModelEnum.CREATE.getType().equals(dutyBean.getCode())){
+                    if (null==dutyBean.getArrivalTimeAllowExecute()){
+                        //到达工单要求开始时间时才允许执行
+                        dutyBean.setArrivalTimeAllowExecute(false);
+                    }
+                    if (null==dutyBean.getLimitDomain()){
+                        //请选择是否启用专业控制
+                        dutyBean.setLimitDomain(false);
+                    }
+                    // 保存的时候没有传来下级路由.  新建的下级路由可以是执行或指派
+                    if (WoControlModelEnum.ASSIGN.getType().equals(dutyBean.getExecutieMode())){
+                        for (NextRouteBean assignNextRouteBean : assignNextRouteBeans) {
+                            nextRouteBeanArr.add(NextRouteBean.builder()
+                                        .type("2")
+                                        .positionId(assignNextRouteBean.getPositionId())
+                                        .name(assignNextRouteBean.getName()).build());
+                        }
+                        dutyBean.setNextRoute(nextRouteBeanArr);
+                        continue;
+                    }
+                    if (CollUtil.isEmpty(excuteNextRouteBeans)){
+                        continue;
+                    }
+                    // 下级路由为执行和抢单
+                    for (NextRouteBean excuteNextRouteBean : excuteNextRouteBeans) {
+                        nextRouteBeanArr.add(NextRouteBean.builder()
+                                .type("2")
+                                .positionId(excuteNextRouteBean.getPositionId())
+                                .name(excuteNextRouteBean.getName()).build());
+                    }
+                    dutyBean.setNextRoute(nextRouteBeanArr);
+                    continue;
+                }
+                if (WoControlModelEnum.ASSIGN.getType().equals(dutyBean.getCode())){
+                    if (null==dutyBean.getExpecteOperation()){
+                        //期望该操作持续时间不超过
+                        dutyBean.setExpecteOperation(false);
+                    }
+                    if (null==dutyBean.getLimitDomain()){
+                        //请选择是否启用专业控制
+                        dutyBean.setLimitDomain(false);
+                    }
+                    if (null==dutyBean.getFilterScheduling()){
+                        //是否需要按照排班表过滤每次可转交的人员范围
+                        dutyBean.setFilterScheduling(false);
+                    }
+                    if (CollUtil.isEmpty(excuteNextRouteBeans)){
+                        continue;
+                    }
+                    // 下级路由为执行和抢单
+                    for (NextRouteBean excuteNextRouteBean : excuteNextRouteBeans) {
+                        nextRouteBeanArr.add(NextRouteBean.builder()
+                                .type("2")
+                                .positionId(excuteNextRouteBean.getPositionId())
+                                .name(excuteNextRouteBean.getName()).build());
+                    }
+                    dutyBean.setNextRoute(nextRouteBeanArr);
+                }
+            }
+            postAndDuty.setDuty(dutyBeans);
+        }
+        return postAndDuties;
+    }
+    /***
+     * Description: 去重下级路由
+     * @param postAndDuties : 工单类型
+     * @return : void
+     * @author : lijie
+     * @date :2021/5/8 11:25
+     * Update By lijie 2021/5/8 11:25
+     */
+    private List<PostAndDuty> distinctNextRoute(List<PostAndDuty> postAndDuties){
+        for (int i = postAndDuties.size() - 1; i >= 0; i--) {
+            PostAndDuty postAndDuty = postAndDuties.get(i);
+            List<DutyBean> dutyBeans = CollUtil.defaultIfEmpty(postAndDuty.getDuty(),new ArrayList<>());
+            for (int j = 0; j < dutyBeans.size(); j++) {
+                DutyBean dutyBean = dutyBeans.get(j);
+                List<NextRouteBean> nextRouteBeans = CollUtil.defaultIfEmpty(dutyBean.getNextRoute(), new ArrayList<>());
+                Set<String> nextRoutePositionIds = new HashSet<>();
+                for (int m = nextRouteBeans.size() - 1; m >= 0; m--) {
+                    NextRouteBean nextRouteBean = nextRouteBeans.get(m);
+                    if (nextRoutePositionIds.contains(nextRouteBean.getPositionId())){
+                        nextRouteBeans.remove(m);
+                        continue;
+                    }
+                    nextRoutePositionIds.add(nextRouteBean.getPositionId());
+                }
+                dutyBean.setNextRoute(nextRouteBeans);
+            }
+            postAndDuty.setDuty(dutyBeans);
+        }
+        return postAndDuties;
+    }
 
     /**
      * Description: 验证工单类型名是否重复
@@ -244,26 +703,24 @@ public class WoFlowPlanServiceImpl extends ServiceImpl<WoFlowPlanMapper, WoFlowP
     private JSONArray fixQueryResult(List<WoFlowPlan> woFlowPlans){
         String workType, executeType;
         JSONArray flowPlanArrays = new JSONArray();
-        List<GeneralDictVo> workTypes = generalDictService.queryGeneralDictByKey(DictTypeEnum.WORK_TYPE.getType(), null);
-        List<GeneralDictVo> woExecuteTypes = generalDictService.queryGeneralDictByKey(DictTypeEnum.WO_EXECUTE_TYPE.getType(), null);
-        Map<String,String> dictTypeNameMap = new HashMap<>();
-        dictTypeNameMap.putAll(workTypes.stream().collect(Collectors.toMap(GeneralDictVo::getCode,GeneralDictVo::getName,(k1,k2)->k1)));
-        dictTypeNameMap.putAll(woExecuteTypes.stream().collect(Collectors.toMap(GeneralDictVo::getCode,GeneralDictVo::getName,(k1,k2)->k1)));
+        Map<String,String> dictTypeNameMap = queryWorkTypeAndExecuteTypeNameMap();
         for (int i = 0; i < woFlowPlans.size(); i++) {
-            JSONObject flowPlans = new JSONObject(),postDuty;
+            JSONObject flowPlans = new JSONObject();
             //获取具体的一条信息,从中筛选前端所需信息
             WoFlowPlan flowPlan = woFlowPlans.get(i);
             workType = flowPlan.getWorkType();
-            executeType = flowPlan.getExcuteType();
+            executeType = flowPlan.getExecuteType();
             flowPlans.put("plan_id", flowPlan.getPlanId());
             flowPlans.put("plan_name", flowPlan.getPlanName());
             flowPlans.put("project_id", flowPlan.getProjectId());
             flowPlans.put("work_type", workType);
+            flowPlans.put("order_type", workType);
             flowPlans.put("execute_type", executeType);
             flowPlans.put("repair_flag", flowPlan.getRepairFlag());
             flowPlans.put("plan_status", flowPlan.getPlanStatus());
             flowPlans.put("create_time", flowPlan.getCreateTime());
             flowPlans.put("work_type_name", dictTypeNameMap.getOrDefault(workType,""));
+            flowPlans.put("order_type_name", dictTypeNameMap.getOrDefault(workType,""));
             flowPlans.put("execute_type_name", dictTypeNameMap.getOrDefault(executeType,""));
             //岗位名称
             List<PostAndDuty> postAndDutys = flowPlan.getPostAndDuty();

+ 8 - 1
fm-workorder/src/main/resources/bootstrap.yml

@@ -62,4 +62,11 @@ integrated:
 # integrated.mybatis-plus.auto-fill
   mybatis-plus:
     auto-fill:
-      enabled: true
+      enabled: true
+  redisson:
+    model: single
+    password: 123456
+    codec: string_codec
+    database: 0
+    single-server-config:
+      address: 192.168.100.107:9944

+ 20 - 234
fm-workorder/src/main/resources/db/schema.sql

@@ -1,274 +1,24 @@
 SET NAMES utf8mb4;
 SET FOREIGN_KEY_CHECKS = 0;
-CREATE TABLE IF NOT EXISTS `custom_info_point`  (
-  `custom_info_point_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `custom_info_point_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '信息点控件名',
-  `details` json NULL COMMENT '控件明细',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`custom_info_point_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `operate_log`  (
-  `log_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `operate_person_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '操作人id',
-  `table_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '操作表名',
-  `operate_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '操作类型',
-  `request_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '请求方法',
-  `request_content` json NULL COMMENT '请求内容',
-  `operate_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '操作时间,格式为yyyyMMddHHmmss',
-  `operate_result` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '操作结果',
-  `result_content` json NULL COMMENT '操作结果内容',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`log_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop`  (
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'SOP的主键id',
-  `project_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '项目id,集团SOP的值为group_sop_id',
-  `extend_field` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '建筑功能类型',
-  `operator_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '操作人id,为人员id或账号id',
-  `operator_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '操作人姓名,为人员名称或账号名称',
-  `sop_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的名称,目前长度定为100.交互支持50个字符',
-  `sop_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP类型,1-通用,2-项目专用',
-  `no_obj` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '是否有无对象的步骤,0-否 1-是.当为引用的SOP时,就算被引用的没有对象也为1',
-  `domains` json NULL COMMENT '专业编码,[code,code]',
-  `tools` json NULL COMMENT '工具数组,[{\"tool\":“……”,\"from_step\":true}]',
-  `related_data` json NULL COMMENT '相关资料,[{\"name\":\"***\",\"url\":\"***\"}]',
-  `sop_status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '1-已发布、2-已作废',
-  `publish_status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '1-正常、2-待修订、3-修订中',
-  `version` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '版本号',
-  `version_count` int(10) NULL DEFAULT NULL COMMENT '版本数量',
-  `version_explain` json NULL COMMENT '版本说明,[“描述”,“描述”]',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_cell`  (
-  `sop_cell_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'SOP_CELL的主键id',
-  `parent_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父级id,SOP的id或者sop_cell_id',
-  `from_sop` int(1) NULL DEFAULT NULL COMMENT 'true-引用的SOP.是否引用的SOP',
-  `rel_sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '引用的SOP',
-  `pre_execute` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '执行前验证  默认为空,1-设备运行继续执行,2-设备停用继续执行,3-设备停机继续执行',
-  `pre_conform` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '强制确认',
-  `notice` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '注意事项',
-  `obj_required_control` json NULL COMMENT '对象管控需求',
-  `obj_show_item` json NULL COMMENT '对象展示项 working_time-对象运行时间',
-  `time_limit` int(10) NULL DEFAULT NULL COMMENT '工作时长(分钟数)',
-  `info_points` json NULL COMMENT '标准信息点数组',
-  `description` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '内容描述',
-  `customs` json NULL COMMENT '自定义信息点数组',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_cell_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_destroy_msg`  (
-  `msg_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `project_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '项目id',
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的主键id',
-  `ref_sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '被引用的sop主键id',
-  `ref_sop_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '被引用的sop名称',
-  `ref_sop_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '被引用的sop状态描述',
-  `status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '状态,1-未处理、2-已处理',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`msg_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_domain_rel`  (
-  `sop_domain_rel_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `parent_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父级id,SOP的id或者sop_cell_id',
-  `domain` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '专业code',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_domain_rel_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_edit`  (
-  `sop_edit_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的主键id',
-  `project_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '项目id,集团SOP的值为group_sop_id',
-  `extend_field` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '建筑功能类型',
-  `operator` json NULL COMMENT '操作人信息',
-  `sop_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的名称,目前长度定为100.交互支持50个字符',
-  `sop_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP类型,1-通用,2-项目专用',
-  `no_obj` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '是否有无对象的步骤,0-否 1-是.当为引用的SOP时,就算被引用的没有对象也为1',
-  `domains` json NULL COMMENT '专业编码,[code,code]',
-  `tools` json NULL COMMENT '工具数组,[{\"tool\":“……”,\"from_step\":true}]',
-  `order_type` json NULL COMMENT '关联的工单类型,数组[code,code]',
-  `fit_objs` json NULL COMMENT '适用对象',
-  `equip_model_ids` json NULL COMMENT '设备型号',
-  `labels` json NULL COMMENT '自定义标签',
-  `steps` json NULL COMMENT '步骤',
-  `related_data` json NULL COMMENT '相关资料,[{\"name\":\"***\",“url”:“***”},{}]',
-  `sop_status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '1-已发布、2-已作废',
-  `publish_status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '1-正常、2-待修订、3-修订中',
-  `ref_sop_ids` json NULL COMMENT '引用的sop',
-  `version` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '版本号',
-  `version_count` int(10) NULL DEFAULT NULL COMMENT '版本数量',
-  `version_explain` json NULL COMMENT '版本说明,[“描述”,“描述”]',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_edit_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_equip_model_rel`  (
-  `sop_equip_model_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的主键id',
-  `equip_model_id` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '设备型号id',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_equip_model_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_his`  (
-  `sop_edit_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的主键id',
-  `project_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '项目id,集团SOP的值为group_sop_id',
-  `extend_field` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '建筑功能类型',
-  `operator` json NULL COMMENT '操作人信息',
-  `sop_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的名称,目前长度定为100.交互支持50个字符',
-  `sop_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP类型,1-通用,2-项目专用',
-  `no_obj` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '是否有无对象的步骤,0-否 1-是.当为引用的SOP时,就算被引用的没有对象也为1',
-  `domains` json NULL COMMENT '专业编码,[code,code]',
-  `tools` json NULL COMMENT '工具数组,[{\"tool\":“……”,\"from_step\":true}]',
-  `order_type` json NULL COMMENT '关联的工单类型,数组[code,code]',
-  `fit_objs` json NULL COMMENT '适用对象',
-  `equip_model_ids` json NULL COMMENT '设备型号',
-  `labels` json NULL COMMENT '自定义标签',
-  `steps` json NULL COMMENT '步骤',
-  `related_data` json NULL COMMENT '相关资料,[{\"name\":\"***\",“url”:“***”},{}]',
-  `sop_status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '1-已发布、2-已作废',
-  `publish_status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '1-正常、2-待修订、3-修订中',
-  `ref_sop_ids` json NULL COMMENT '引用的sop',
-  `version` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '版本号',
-  `version_count` int(10) NULL DEFAULT NULL COMMENT '版本数量',
-  `version_explain` json NULL COMMENT '版本说明,[“描述”,“描述”]',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_edit_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_label_rel`  (
-  `sop_label_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'sop的主键id',
-  `label` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '标签名称',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_label_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_media_rel`  (
-  `sop_media_rel_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `parent_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父级id,SOP的id或者sop_cell_id',
-  `key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '存储到图片服务器的key',
-  `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '附件名称,图片名称等',
-  `type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'pic-图片,att-附件',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_media_rel_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_obj_rel`  (
-  `sop_obj_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的id',
-  `sop_cell_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'sop的内容id',
-  `obj_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '对象id',
-  `obj_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '对象类型',
-  `is_revise` int(1) NULL DEFAULT NULL COMMENT 'true-需修订,false-不需修订',
-  `parents` json NULL COMMENT '父类对象',
-  `obj_source` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'content_obj-步骤中操作对象',
-  `obj_owner` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'content_obj-步骤中的操作对象,space_scope-空间范围,fit_obj-适用范围',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_obj_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_order_type_rel`  (
-  `sop_order_type_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的主键id',
-  `project_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '项目id',
-  `order_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '工单类型id',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_order_type_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_revise_msg`  (
-  `msg_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `sop_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'SOP的主键id',
-  `obj_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '作废对象id',
-  `obj_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '作废对象名称',
-  `obj_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '作废对象类型,1-对象模型、2-对象实例、3-信息点',
-  `content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '消息内容',
-  `status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '状态,1-未处理、2-已忽略、3-已自动处理',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`msg_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-
-CREATE TABLE IF NOT EXISTS `sop_tool_rel`  (
-  `sop_tool_rel_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '主键id',
-  `parent_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父级id,SOP的id或者sop_cell_id',
-  `tool` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '工具名称',
-  `from_step` int(1) NULL DEFAULT NULL COMMENT '1-是步骤中的工具,0或空-不是步骤中的工具',
-  `create_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建时间,格式为yyyyMMddHHmmss',
-  `update_time` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新时间,格式为yyyyMMddHHmmss',
-  `valid` int(1) NULL DEFAULT '1' COMMENT '是否有效',
-  PRIMARY KEY (`sop_tool_rel_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
+CREATE TABLE IF NOT EXISTS `wo_flow_plan` (
+  `plan_id` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT '工单类型id',
+  `plan_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '工单类型名称',
+  `project_id` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '项目id',
+  `repair_flag` varchar(2) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '报修是否可以转此类工单,0-不可以,1-可以',
+  `work_type` varchar(2) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '工作类型id,1-维保,2-维修,3-巡检,4-运行,5-安全',
+  `function_type` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '建筑功能类型',
+  `department_id` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '部门id',
+  `time_limit` json DEFAULT NULL COMMENT '设置的此类工单相关要求',
+  `execute_type` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '时间类型,temp-临时,plan-计划',
+  `post_and_duty` json DEFAULT NULL COMMENT '岗位职责数据',
+  `post_and_duty_native` json DEFAULT NULL COMMENT '原生岗位职责数据',
+  `plan_status` varchar(2) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '工单类型状态,0-需修订,1-正常',
+  `version` int(10) DEFAULT NULL COMMENT '版本号',
+  `creator_id` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建者id',
+  `create_time` varchar(14) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建时间',
+  `update_time` varchar(14) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新时间',
+  `valid` int(1) DEFAULT '1' COMMENT '是否有效',
+  PRIMARY KEY (`plan_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
 
 SET FOREIGN_KEY_CHECKS = 1;