Browse Source

Merge remote-tracking branch 'origin/master'

张维新 4 years ago
parent
commit
d6fd06e63b
34 changed files with 795 additions and 76 deletions
  1. 15 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/dao/mappers/SchemeMapper.kt
  2. 199 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/assistant/EquipmentProSy.kt
  3. 25 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/assistant/ModelKey.kt
  4. 5 3
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/objects/GeneralSystem.kt
  5. 5 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/REq2Sp.kt
  6. 17 0
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/requests/ModelKeyRequest.kt
  7. 1 1
      datacenter/src/main/kotlin/com/persagy/server/controllers/graphtype/GraphicTypeController.kt
  8. 33 0
      datacenter/src/main/kotlin/com/persagy/server/controllers/model/ModelController.kt
  9. 12 0
      datacenter/src/main/kotlin/com/persagy/server/controllers/objects/EquipController.kt
  10. 22 0
      datacenter/src/main/kotlin/com/persagy/server/mappers/IRelationCalcMapper.kt
  11. 4 1
      datacenter/src/main/kotlin/com/persagy/server/services/graphtype/RelationTypeProjectService.kt
  12. 74 0
      datacenter/src/main/kotlin/com/persagy/server/services/models/ModelService.kt
  13. 145 0
      datacenter/src/main/kotlin/com/persagy/server/services/objects/EquipmentProSyService.kt
  14. 1 1
      datacenter/src/main/kotlin/com/persagy/server/services/objects/GeneralSystemService.kt
  15. 18 16
      datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/CalcSpecialService.kt
  16. 12 8
      datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/MepSystemCalcService.kt
  17. 10 0
      datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/RelationCalcService.kt
  18. 2 2
      datacenter/src/main/resources/application-prod.yml
  19. BIN
      datacenter/src/main/resources/excel/relation-template.xlsx
  20. 38 6
      datasyn/src/main/kotlin/com/persagy/server/syn/controllers/obj/ObjectToFromController.kt
  21. 40 7
      datasyn/src/main/kotlin/com/persagy/server/syn/controllers/obj/RelFromToControllers.kt
  22. 20 19
      datasyn/src/main/kotlin/com/persagy/server/syn/controllers/obj/RelToFromController.kt
  23. 6 1
      datasyn/src/main/kotlin/com/persagy/server/syn/jms/DataCenterSync.kt
  24. 2 0
      datasyn/src/main/kotlin/com/persagy/server/syn/models/api/obj/BuildingApi.kt
  25. 1 1
      datasyn/src/main/kotlin/com/persagy/server/syn/models/api/obj/FloorApi.kt
  26. 1 0
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/EquipUtil.kt
  27. 2 1
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/FloorUtil.kt
  28. 1 1
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/SpaceUtil.kt
  29. 2 0
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/SystemUtil.kt
  30. 34 0
      datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/rel/AutomaticCalculationSync.kt
  31. 40 0
      datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/rel/EquipinSpaceSync.kt
  32. 5 5
      equip-component/src/main/kotlin/com/persagy/server/controllers/EquipController.kt
  33. 1 1
      equip-component/src/main/kotlin/com/persagy/server/service/EquipmentProSyService.kt
  34. 2 2
      equip-component/src/main/resources/application-prod.yml

File diff suppressed because it is too large
+ 15 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/dao/mappers/SchemeMapper.kt


+ 199 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/assistant/EquipmentProSy.kt

@@ -0,0 +1,199 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.datacenter.models.entities.assistant
+
+import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+
+/**
+ * 设备信息实体类、部件实体类
+ *
+ * @author  张维新
+ */
+@Schema(description = "设备信息实体类")
+@Table(name = "equipment")
+open class EquipmentProSy : BaseInfo() {
+
+    /** 设备id */
+    @Schema(description = "设备id",required = true)
+    @Id
+    @Column(name = "id")
+    var id: String? = null
+
+    /** 设备名称 */
+    @Schema(description = "设备名称",required = true)
+    @Column(name = "name")
+    var name: String? = null
+
+    /** 设备本地编码 */
+    @Schema(description = "设备本地编码")
+    @Column(name = "local_id")
+    var localId: String? = null
+
+    /** 设备本地名称 */
+    @Schema(description = "设备本地名称")
+    @Column(name = "local_name")
+    var localName: String? = null
+
+    /** 二维码图片 */
+    @Schema(description = "二维码图片")
+    @Column(name = "qr_code_pic")
+    var qRCodePic: String? = null
+
+    /** 二维码内容 */
+    @Schema(description = "二维码内容")
+    @Column(name = "default_qr_code")
+    var defaultQRCode: String? = null
+
+    /** RFID标识 */
+    @Schema(description = "RFID标识")
+    @Column(name = "rf_id")
+    var rfId: String? = null
+
+    /** BIM模型中编码 */
+    @Schema(description = "BIM模型中编码")
+    @Column(name = "bim_id")
+    var bimId: String? = null
+
+    /** BIM构建编码 */
+    @Schema(description = "BIM构建编码")
+    @Column(name = "bim_type_id")
+    var bimTypeId: String? = null
+
+    /** BIM模型中坐标 */
+    @Schema(description = "BIM模型中坐标")
+    @Column(name = "bim_location")
+    var bimLocation: String? = null
+
+    /** 项目id */
+    @Schema(description = "项目id",required = true)
+    @Column(name = "project_id")
+    var projectId: String? = null
+
+    /** 设备类型code */
+    @Schema(description = "设备类型code")
+    @Column(name = "class_code")
+    var classCode: String? = null
+
+    /** 设备所在建筑id */
+    @Schema(description = "设备所在建筑id")
+    @Column(name = "building_id")
+    var buildingId: String? = null
+
+    /** 设备所在楼层id */
+    @Schema(description = "设备所在楼层id")
+    @Column(name = "floor_id")
+    var floorId: String? = null
+
+    //    /** 设备关联的资产id */
+    @Schema(description = "设备关联的资产id")
+    @Column(name = "property_id",insertable = false,updatable = false )
+    var propertyId: Boolean? = false
+
+    /** 品牌型号id */
+    @Schema(description = "品牌型号id")
+    @Column(name = "dp_manufacturer_id")
+    var dpManufacturerID: String? = null
+
+    /** 供应商信息id */
+    @Schema(description = "供应商信息id")
+    @Column(name = "dp_supplier_id")
+    var dpSupplierID: String? = null
+
+    /** 维修商信息id */
+    @Schema(description = "维修商信息id")
+    @Column(name = "dp_maintainer_id")
+    var dpMaintainerID: String? = null
+
+    /** 保险公司信息id */
+    @Schema(description = "保险公司信息id")
+    @Column(name = "dp_insurer_id")
+    var dpInsurerID: String? = null
+
+    /** 设备型号id */
+    @Schema(description = "设备型号id")
+    @Column(name = "dp_specification_id")
+    var dpSpecificationID: String? = null
+
+    /** 品牌id */
+    @Schema(description = "品牌id")
+    @Column(name = "dp_brand_id")
+    var dpBrandID: String? = null
+
+    /** 信息点 */
+    @Schema(description = "信息点")
+    @Column(name = "infos")
+    var infos: HashMap<String,Any?>? = null
+
+    /** 部件关联设备id */
+    @Schema(description = "部件关联设备id")
+    @Column(name = "parent_id")
+    var parentId: String? = null
+
+    /** 对象类型 */
+    @Schema(description = "对象类型")
+    @Column(name = "object_type")
+    override var objectType: String? = "Equipment"
+
+    /** 系统id集合 */
+    @Schema(description = "系统id集合")
+    var systemList: List<String>? = null
+
+    /** 任务状态 待验证1、已验证0、未找到-1  */
+    @Schema(description = "任务状态-待验证1、已验证0、未找到-1")
+    @Column(name = "task_state")
+    var taskState: Int? = null
+
+    /** 模型文件id */
+    @Schema(description = "模型文件id")
+    @Column(name = "model_id")
+    var modelId: String? = null
+
+    /** Revit族 */
+    @Schema(description = "Revit族 ")
+    @Column(name = "family_name")
+    var familyName: String? = null
+
+    /** Revit族类型 */
+    @Schema(description = "Revit族类型 ")
+    @Column(name = "family_symbol")
+    var familySymbol: String? = null
+
+    /** 设备序号 */
+    @Schema(description = "设备序号 ")
+    @Column(name = "equip_serial")
+    var equipSerial: String? = null
+
+    /** 撕码贴码状态 */
+    @Schema(description = "撕码贴码状态")
+    @Column(name = "code_type")
+    var codeType: Int? = null
+
+}

+ 25 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/assistant/ModelKey.kt

@@ -0,0 +1,25 @@
+package com.persagy.server.datacenter.models.entities.assistant
+
+import java.io.Serializable
+
+/**
+ * 模型下载 key
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2020/10/16 15:28
+ */
+class ModelKey: Serializable {
+    /** key */
+    var key: String? = null
+   /** bimid 前缀 */
+    var bimIdPre: String? = null
+    /** 返回状态 */
+    var result: String? = null
+    /** 信息 */
+    var message: String? = null
+    /** 文件对应的楼层 */
+    var file_name: String? = null
+    /** 文件夹名 */
+    var folder_name: String? = null
+
+}

+ 5 - 3
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/objects/GeneralSystem.kt

@@ -26,6 +26,7 @@
 
 package com.persagy.server.datacenter.models.entities.objects
 
+import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.assistant.BuildingFloorInfo
 import com.persagy.server.datacenter.models.entities.assistant.GeneralSystemCategory
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
@@ -68,6 +69,7 @@ open class GeneralSystem : BaseInfo() {
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
+    @JSONField(name = "cADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
@@ -116,9 +118,9 @@ open class GeneralSystem : BaseInfo() {
     override var objectType: String? = "system"
 
     /** 专业名称 */
-    @Schema(description = "专业名称")
-    @Column(name = "major_name",insertable = false,updatable = false)
-    var majorName: String? = null
+//    @Schema(description = "专业名称")
+//    @Column(name = "major_name",insertable = false,updatable = false)
+//    var majorName: String? = null
 
     /** 设备数量 */
     @Schema(description = "设备数量")

+ 5 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/REq2Sp.kt

@@ -80,4 +80,9 @@ class REq2Sp : RBaseInfo(){
     @Column(name = "sign")
     var sign: Int? = null
 
+//    /** 计算标记 1 为手动 2为自动 */
+    @Schema(description = "计算标记 3 ")
+    @Column(name = "sign0")
+    var sign0: Int? = null
+
 }

+ 17 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/requests/ModelKeyRequest.kt

@@ -0,0 +1,17 @@
+package com.persagy.server.datacenter.models.requests
+
+import java.io.Serializable
+
+/**
+ * 模型下载 key
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2020/10/16 15:57
+ */
+class ModelKeyRequest: Serializable {
+    /** 项目 id */
+    var projectId: String? = null
+    /** 楼层 id */
+    var floorId: String? = null
+
+}

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/controllers/graphtype/GraphicTypeController.kt

@@ -93,7 +93,7 @@ open class GraphicTypeController {
      */
     @Operation(summary="导出关系*", description="")
     @GetMapping(value = ["/export"])
-    fun exportExcel(@RequestBody response: HttpServletResponse, @RequestParam projectId: String,@RequestParam relType: String,@RequestParam code: String = "对象ID", @RequestParam zoneType: String? = null) {
+    fun exportExcel( response: HttpServletResponse, @RequestParam projectId: String,@RequestParam relType: String,@RequestParam code: String = "对象ID", @RequestParam zoneType: String? = null) {
         RelationTypeProjectService.exportExcel(response, projectId,relType, code, zoneType)
     } // Fun exportExcel
 

+ 33 - 0
datacenter/src/main/kotlin/com/persagy/server/controllers/model/ModelController.kt

@@ -0,0 +1,33 @@
+package com.persagy.server.controllers.model
+
+import com.persagy.server.datacenter.models.entities.assistant.ModelKey
+import com.persagy.server.datacenter.models.requests.ModelKeyRequest
+import com.persagy.server.services.models.ModelService
+import io.swagger.v3.oas.annotations.Operation
+import io.swagger.v3.oas.annotations.tags.Tag
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestBody
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+/**
+ * 模型操作
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2020/10/16 12:10
+ */
+@Tag(name = "0001、模型")
+@RestController
+@RequestMapping("/model")
+class ModelController {
+
+    /**
+     * 模型文件下载地址 key
+     */
+    @Operation(summary = "模型文件下载地址 key", description = "projectId 项目id,floorId楼层id ")
+    @PostMapping(value = ["/key"])
+    fun modelKey(@RequestBody modelKeyRequest: ModelKeyRequest): ModelKey {
+        return  ModelService.modelKey(modelKeyRequest)
+    }
+
+}

+ 12 - 0
datacenter/src/main/kotlin/com/persagy/server/controllers/objects/EquipController.kt

@@ -27,7 +27,9 @@
 package com.persagy.server.controllers.objects
 
 import com.persagy.database.SFilter
+import com.persagy.server.datacenter.models.entities.assistant.EquipmentProSy
 import com.persagy.server.datacenter.models.entities.objects.Equipment
+import com.persagy.server.services.objects.EquipmentProSyService
 import com.persagy.server.services.objects.EquipmentService
 import com.persagy.service.SPageContext
 import com.persagy.service.models.requests.SCountRequest
@@ -157,5 +159,15 @@ open class EquipController {
         return EquipmentService.queryEquipCom()
     } // Function count()
 
+    /**
+     * 批量创建设备同时创建资产、创建设备和系统的关系
+     *
+     */
+    @Operation(summary = "批量创建设备同时创建资产、创建设备和系统的关系", description = "")
+    @PostMapping(value = ["/creat-equip-pro"])
+    fun createEquipPro(@RequestBody request: SCreateRequest<EquipmentProSy>): SCreateResponse<EquipmentProSy>{
+        return EquipmentProSyService.createList(request)
+    } // Function pageQuery()
+
 
 } // Class EquipController

+ 22 - 0
datacenter/src/main/kotlin/com/persagy/server/mappers/IRelationCalcMapper.kt

@@ -26,6 +26,8 @@
 
 package com.persagy.server.mappers
 
+import org.apache.ibatis.annotations.Delete
+import org.apache.ibatis.annotations.Insert
 import org.apache.ibatis.annotations.Mapper
 import org.apache.ibatis.annotations.Select
 import org.springframework.stereotype.Repository
@@ -78,6 +80,26 @@ interface IRelationCalcMapper {
     @Select("select public.f_rel_calc('rel_eq2sp', #{projectId}, 'zone_space_base','relationship.r_eq2sp', 2, 2)")
     fun calcEq2Sp( projectId: String): Int?
 
+//    /**
+//     * 删除关联业务空间
+//     *
+//     *@param projectId 项目id
+//     */
+//    @Select("delete from 'relationship.r_eq2sp' as r where r.sign0 = 3 and r.project_id = #{projectId}")
+//    fun deletesp( projectId: String): Int?
+
+    /**
+     * 插入关联业务空间
+     *
+     *@param projectId 项目id
+     */
+    @Insert("insert into relationship.r_eq2sp(eq_id, sp_id, project_id, sign, type, zone_type,sign0) " +
+            "select eq.id2 as eqid,ep.sp_id as spid,ep.project_id as project_id,ep.sign as sign,ep.type as type,ep.zone_type as zone_type,3  from relationship.r_eq2eq  as eq " +
+            "inner join relationship.r_eq2sp  as ep on eq.id1 = ep.eq_id  where ep.project_id = #{projectId} union\n" +
+            "select eq.id1 as eqid,ep.sp_id as spid,ep.project_id as project_id,ep.sign as sign,ep.type as type,ep.zone_type as zone_type,3  from relationship.r_eq2eq  as eq " +
+            "inner join relationship.r_eq2sp as ep  on eq.id2= ep.eq_id where ep.project_id = #{projectId}")
+    fun insertsp( projectId: String): Int?
+
     /**
      * 楼层贯通关系
      *

+ 4 - 1
datacenter/src/main/kotlin/com/persagy/server/services/graphtype/RelationTypeProjectService.kt

@@ -28,6 +28,7 @@ package com.persagy.server.services.graphtype
 
 import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.Opt
 import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
 import com.persagy.server.mappers.IRelationExcelExportMapper
 import com.persagy.server.mappers.IRelationExcelImportMapper
@@ -256,7 +257,7 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
             try {
 
                 val relationTypeProjectService = SObjectService(SMybatisDao(RelationTypeProject::class.java))
-                val relationType = relationTypeProjectService.select(SFilter.eq("projectId", projectId!!),SFilter.eq("RelationType", relType)).entity()
+                val relationType = relationTypeProjectService.select(SFilter.eq("projectId", projectId!!),SFilter.eq("relationType", relType)).entity()
                 if (relationType!=null){
                     relationType.computingTime = IdUtils.time()
                     relationTypeProjectService.update(relationType)
@@ -277,6 +278,8 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
 
             val outFile = File("/tmp/relation-$projectId-${relType}${zone}.xlsx")
             workbook.write(outFile.outputStream())
+            /** 发送消息 */
+            rabbitMqService.sendRel(Opt.projectId!!, relType,"20","123","456")
         } catch (e: Exception) {
             e.printStackTrace()
             return SBaseResponse(SResponseType.failure, e.message!!)

+ 74 - 0
datacenter/src/main/kotlin/com/persagy/server/services/models/ModelService.kt

@@ -0,0 +1,74 @@
+package com.persagy.server.services.models
+
+
+import com.persagy.base.extensions.toJson
+import com.persagy.server.datacenter.dao.mappers.SchemeMapper
+import com.persagy.server.datacenter.models.entities.assistant.ModelKey
+import com.persagy.server.datacenter.models.requests.ModelKeyRequest
+import com.persagy.service.SPageContext
+import com.persagy.service.utils.SSpringContextUtil
+import org.slf4j.LoggerFactory
+import org.springframework.stereotype.Service
+
+/**
+ * 模型服务
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2020/10/16 15:44
+ */
+@Service
+object ModelService {
+
+        // 日志
+        private val logger = LoggerFactory.getLogger(ModelService::class.java)
+
+
+    /** 自定义sql */
+    private val schemeMapper by lazy {
+        SSpringContextUtil.getBean(SchemeMapper::class.java) as SchemeMapper
+    }
+
+    /**
+     * @param modelKeyRequest   条件
+     * @return 返回结果
+     */
+    fun modelKey(modelKeyRequest: ModelKeyRequest): ModelKey {
+        val projectId = SPageContext.getHeader("projectId")
+        val modelKey = ModelKey()
+        try {
+            if (modelKeyRequest.floorId.isNullOrEmpty()) {
+                modelKey.result = "failure"
+                modelKey.message = "楼层 id 不能为空"
+                return modelKey
+            }
+
+            if (projectId.isNullOrEmpty() && modelKeyRequest.projectId.isNullOrEmpty()) {
+                modelKey.result = "failure"
+                modelKey.message = "项目 id 不能为空"
+                return modelKey
+            }
+            if (modelKeyRequest.projectId.isNullOrEmpty()){
+                modelKeyRequest.projectId = projectId
+            }
+            val model = schemeMapper.modelKey(modelKeyRequest.projectId!!, modelKeyRequest.floorId!!)
+            logger.debug("对象=${model?.toJson()}")
+            if (model!=null && !model.bimIdPre.isNullOrEmpty()){
+                val split = model.bimIdPre!!.split(":")
+                modelKey.bimIdPre = split[0]
+                modelKey.key = model.key
+                modelKey.result = "success"
+                return modelKey
+            }else {
+                modelKey.result = "failure"
+                modelKey.message = "楼层没有相关数据"
+                return modelKey
+            }
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+            modelKey.result = "failure"
+            modelKey.message = e.message!!
+            return modelKey
+        }
+    }
+}

+ 145 - 0
datacenter/src/main/kotlin/com/persagy/server/services/objects/EquipmentProSyService.kt

@@ -0,0 +1,145 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.services.objects
+
+import com.persagy.database.SFilter
+import com.persagy.database.extensions.keyValue
+import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.Opt
+import com.persagy.server.datacenter.models.entities.assistant.EquipmentProSy
+import com.persagy.server.datacenter.models.entities.objects.Property
+import com.persagy.server.datacenter.models.entities.rel.RSyEq
+import com.persagy.server.services.base.Service
+import com.persagy.server.services.dict.EquipFamilyService
+import com.persagy.server.services.rel.RSyEqService
+import com.persagy.server.synchronize.MessageHandler
+import com.persagy.server.utils.IdUtils
+import com.persagy.server.utils.ShaftNameUtil
+import com.persagy.service.SPageContext
+import com.persagy.service.models.requests.SCreateRequest
+import com.persagy.service.utils.SSpringContextUtil
+import org.slf4j.LoggerFactory
+
+/**
+ * 设备系统服务
+ *
+ * @author wx
+ */
+object EquipmentProSyService : Service<EquipmentProSy>(SMybatisDao(EquipmentProSy::class.java)) {
+
+    /** 日志 */
+    private val logger = LoggerFactory.getLogger(Service::class.java)
+
+    /** MQ消息对象 */
+    private val messageHandler by lazy {
+        SSpringContextUtil.getBean(MessageHandler::class.java) as MessageHandler
+    }
+
+
+    override fun onCreateBefore(equip: EquipmentProSy): Boolean {
+        try {
+            /** 查询准备类型 */
+            val projectId = SPageContext.getHeader("projectId")
+            if (!equip.id.isNullOrEmpty()) {
+                val isStartsWith = equip.id.toString().startsWith("Eq")
+                if (!isStartsWith) {
+                    /** 资产id */
+                    equip.id = IdUtils.equipmentIdCreate(projectId!!)
+                }
+            } else {
+                /** 资产id */
+                equip.id = IdUtils.equipmentIdCreate(projectId!!)
+            }
+            /** 项目id */
+            equip.projectId = projectId
+            /** 设备名字 */
+            if (equip.name.isNullOrEmpty()) {
+                equip.name = ShaftNameUtil.shaftName("设备-")
+            }
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return true
+    }
+
+    /**
+     * 创建成功回调函数
+     *
+     * @param   entityList          创建成功对象
+     */
+    override fun onCreateSuccess(entityList: ArrayList<EquipmentProSy>) {
+        try {
+            entityList.forEach {
+//                val jsonObject = JSONObject()
+//                jsonObject.put("type", "1")
+//                jsonObject.put("projectId",it.keyValue("projectId"))
+//                jsonObject.put("id", it.keyValue("id"))
+                /** 发送消息 */
+//                messageHandler!!.sendMessage(jsonObject.toString())
+                rabbitMqService.sendObjects(Opt.projectId!!, Opt.CREATE,it.keyValue("id").toString())
+            }
+            logger.debug("设备创建完成 =******************************************************************")
+            for (entity in entityList){
+                if (entity.propertyId!!){
+                    if (entity.classCode.isNullOrEmpty()){
+                        continue
+                    }
+                    val property = Property()
+                    property.projectId = entity.projectId
+                    property.buildingId = entity.buildingId
+                    property.floorId = entity.floorId
+                    val equipFamily = EquipFamilyService.select(SFilter.eq("equipCode", entity.classCode!!)).entity()
+                    property.family = equipFamily!!.family!!
+
+                    val sCreateRequest = SCreateRequest<Property>()
+                    var list = ArrayList<Property>()
+                    property.equipId = entity.id
+                    list.add(property)
+                    sCreateRequest.content = list
+                    PropertyService.createList(sCreateRequest)
+                }
+                if (!entity.systemList.isNullOrEmpty()){
+                    for (syId in entity.systemList!!){
+                        val rSyEq = RSyEq()
+                        rSyEq.equipId = entity.id
+                        rSyEq.sysId = syId
+                        RSyEqService.create(rSyEq)
+                    }
+                }
+            }
+            logger.debug("资产创建完成 =******************************************************************")
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return
+    } // Function onCreateSuccess()
+
+
+
+
+} // Object EquipmentProSyService

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/services/objects/GeneralSystemService.kt

@@ -181,7 +181,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
      * 查询之前的操作
      */
     override fun onQueryBefore(queryBuilder: SQueryBuilder<GeneralSystem>) {
-//        queryBuilder.tableName = "v_general_system"
+        queryBuilder.tableName = "v_general_system"
         return
     } // Function onQueryBefore()
 

+ 18 - 16
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/CalcSpecialService.kt

@@ -91,25 +91,27 @@ open class CalcSpecialService {
                         }
                     }
                     // 设置源
-                    val sourceType = mepSystemCalcService.setSourceType(projectId, calcName, null, systemName)
-                    if (!sourceType) {
-                        upDateBiaoji(projectId,relationType ,5)
-                        return SBaseResponse(SResponseType.success)
-                    }
+//                    val sourceType = mepSystemCalcService.setSourceType(projectId, calcName, null, systemName)
+//
+//                    if (!sourceType) {
+//                        upDateBiaoji(projectId,relationType ,5)
+//                        return SBaseResponse(SResponseType.success)
+//                    }
                     // 计算流向
-                    val exec = connectedBlockService.select(SFilter.eq("projectId", projectId), SFilter.inList("mepSystemType", systemName)).group("mepSystemType", "blockId").projection(arrayListOf("mepSystemType", "blockId")).exec()
-                    exec.forEach {
-                        val domain = toolsMap(it.mepSystemType!!)
-                        val result = mapper.sysDirection(projectId, buildingId, it.blockId!!, it.mepSystemType!!, domain, true)
-                        if (!result) {
-                            upDateBiaoji(projectId,relationType ,5)
-                            return SBaseResponse(SResponseType.success)
-                        }
-                    }
+//                    val exec = connectedBlockService.select(SFilter.eq("projectId", projectId), SFilter.inList("mepSystemType", systemName)).group("mepSystemType", "blockId").projection(arrayListOf("mepSystemType", "blockId")).exec()
+//                    exec.forEach {
+//                        val domain = toolsMap(it.mepSystemType!!)
+//                        val result = mapper.sysDirection(projectId, buildingId, it.blockId!!, it.mepSystemType!!, domain, true)
+//                        if (!result) {
+//                            upDateBiaoji(projectId,relationType ,5)
+//                            return SBaseResponse(SResponseType.success)
+//                        }
+//                    }
                     try {
                         // 生成数据中心使用的关系
-                        val generateRelation = mepSystemCalcService.generateRelation(projectId, relationType, null, systemName)
-                        generateRelation.addAll(mepSystemCalcService.generateNonDirectionalRelation(projectId, relationType, null, systemName))
+//                        val generateRelation = mepSystemCalcService.generateRelation(projectId, relationType, null, systemName)
+//                        generateRelation.addAll(mepSystemCalcService.generateNonDirectionalRelation(projectId, relationType, null, systemName))
+                        val generateRelation = mepSystemCalcService.generateNonDirectionalRelation(projectId, relationType, null, systemName)
                         if (generateRelation.size>0){
                             val delete = rEq2EqService.delete(SFilter.eq("projectId", projectId), SFilter.eq("type", relationType), SFilter.eq("sign", 2))
 

+ 12 - 8
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/MepSystemCalcService.kt

@@ -178,15 +178,19 @@ class MepSystemCalcService {
         }
         val mepSystemTransformer = MepSystemTransformer()
         originData.forEach {
-            if(it.direction == 1){
-                mepSystemTransformer.insertRelData(it.id1!!, it.type1!!, it.id2!!, it.type2!!)
-            }else if(it.direction == -1){
-                mepSystemTransformer.insertRelData(it.id2!!, it.type2!!, it.id1!!, it.type1!!)
-            }else if(it.direction == 0){
-                mepSystemTransformer.insertRelData(it.id1!!, it.type1!!, it.id2!!, it.type2!!)
-                mepSystemTransformer.insertRelData(it.id2!!, it.type2!!, it.id1!!, it.type1!!)
-            }
+            mepSystemTransformer.insertNonDirectionalRelData(it.id1!!, it.type1!!, it.id2!!, it.type2!!)
         }
+
+//        originData.forEach {
+//            if(it.direction == 1){
+//                mepSystemTransformer.insertRelData(it.id1!!, it.type1!!, it.id2!!, it.type2!!)
+//            }else if(it.direction == -1){
+//                mepSystemTransformer.insertRelData(it.id2!!, it.type2!!, it.id1!!, it.type1!!)
+//            }else if(it.direction == 0){
+//                mepSystemTransformer.insertRelData(it.id1!!, it.type1!!, it.id2!!, it.type2!!)
+//                mepSystemTransformer.insertRelData(it.id2!!, it.type2!!, it.id1!!, it.type1!!)
+//            }
+//        }
         mepSystemTransformer.trim()
         val eq2EqRelation = mepSystemTransformer.getEq2EqNonDirectionalRelation()
         val involvedEquip = mepSystemTransformer.getInvolvedEquip(eq2EqRelation, true)

+ 10 - 0
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/RelationCalcService.kt

@@ -1106,6 +1106,16 @@ open class RelationCalcService {
             /** 启动计算 */
             val result = mapper.calcEq2Sp(projectId)
             logger.debug("计算结果= ${result}")
+            try{
+//                val r1 = mapper.deletesp(projectId)
+                val r1 = REq2SpService.delete(SFilter.eq("projectId", projectId),SFilter.eq("sign0", 3))
+                val r2 = mapper.insertsp(projectId)
+                logger.debug("设备关联业务空间计算结果= ${r1}+${r2}")
+            }catch (e: Exception){
+                e.printStackTrace()
+            }
+
+
             if(result!=null && result == 0){
                 try {
                     /** 发送消息 */

+ 2 - 2
datacenter/src/main/resources/application-prod.yml

@@ -31,8 +31,8 @@ spring:
 #    url:                                jdbc:postgresql://data-center:5432/datacenter
 #    username:                           postgres
 #    password:                           123qwe!@#
-    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
-#    url:                                jdbc:postgresql://172.17.11.228:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
+    url:                                jdbc:postgresql://172.17.11.228:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
 #    password:                           persagy_2020qwe!@#

BIN
datacenter/src/main/resources/excel/relation-template.xlsx


+ 38 - 6
datasyn/src/main/kotlin/com/persagy/server/syn/controllers/obj/ObjectToFromController.kt

@@ -26,6 +26,8 @@
 
 package com.persagy.server.syn.controllers.obj
 
+import com.alibaba.fastjson.JSONArray
+import com.alibaba.fastjson.JSONObject
 import com.persagy.base.extensions.toJson
 import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
@@ -48,6 +50,7 @@ import io.swagger.v3.oas.annotations.tags.Tag
 import org.slf4j.LoggerFactory
 import org.springframework.web.bind.annotation.PostMapping
 import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RequestParam
 import org.springframework.web.bind.annotation.RestController
 
 /**
@@ -91,7 +94,7 @@ class ObjectToFromController {
      */
     @Operation(summary= "建筑-数据中心同步到数据中台", description = "")
     @PostMapping("/building")
-    fun buildingSynCreate(projectId: String): SBaseResponse {
+    fun buildingSynCreate(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val buildingList = buildingService.select(SFilter.eq("projectId", projectId)).exec()
@@ -119,7 +122,7 @@ class ObjectToFromController {
      */
     @Operation(summary= "楼层-数据中心同步到数据中台", description = "")
     @PostMapping("/floor")
-    fun floorSynCreate(projectId: String): SBaseResponse {
+    fun floorSynCreate(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val floorList = floorService.select(SFilter.eq("projectId", projectId)).exec()
@@ -135,6 +138,9 @@ class ObjectToFromController {
                         logger.debug("楼层更新失败:${floor.toJson()}")
                     }
                 }
+
+                val ObjArray = toJsonObjArray("ArchSubset", "Bd2Fl", floor.buildingId!!, floor.id!!)
+                val createRel = EquipApi.createRel(dictProject.groupCode!!, projectId, ObjArray)
             }
             return SBaseResponse(SResponseType.success)
         } catch (e: Exception) {
@@ -148,7 +154,7 @@ class ObjectToFromController {
      */
     @Operation(summary= "设备-数据中心同步到数据中台", description = "")
     @PostMapping("/equip")
-    fun equipSync(projectId: String): SBaseResponse {
+    fun equipSync(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val equipList = equipmentService.select(SFilter.eq("projectId", projectId)).exec()
@@ -184,7 +190,7 @@ class ObjectToFromController {
      */
     @Operation(summary= "系统-数据中心同步到数据中台", description = "")
     @PostMapping("/sys")
-    fun sysSync(projectId: String): SBaseResponse {
+    fun sysSync(@RequestParam projectId: String): SBaseResponse {
         try {
             val systemList = generalSystemService.select(SFilter.eq("projectId", projectId)).exec()
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
@@ -213,7 +219,7 @@ class ObjectToFromController {
      */
     @Operation(summary= "竖井-数据中心同步到数据中台", description = "")
     @PostMapping("/shaft")
-    fun shaftSync(projectId: String): SBaseResponse {
+    fun shaftSync(@RequestParam projectId: String): SBaseResponse {
         try {
             val shaftList = shaftService.select(SFilter.eq("projectId", projectId)).exec()
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
@@ -243,7 +249,7 @@ class ObjectToFromController {
      */
     @Operation(summary= "空间-数据中心同步到数据中台", description = "")
     @PostMapping("/space")
-    fun spaceSync(projectId: String): SBaseResponse {
+    fun spaceSync(@RequestParam projectId: String): SBaseResponse {
         try {
             val spaceList = spaceService.select(SFilter.eq("projectId", projectId)).exec()
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
@@ -271,5 +277,31 @@ class ObjectToFromController {
         }
     }
 
+    /**
+     * 创建关系列表
+     *
+     * @param graphCode     图类型编码
+     * @param relCode       边类型编码
+     * @param objFrom       主对象 id
+     * @param objTo         从对象 id
+     */
+    fun toJsonObjArray(graphCode: String, relCode: String, objFrom: String, objTo: String): JSONArray {
+        /** 列表 */
+        val jsonArray = JSONArray()
+        /** 对象 */
+        val jsonObject = JSONObject()
+        /** 图类型编码 */
+        jsonObject["graphCode"] = graphCode
+        /** 边类型编码 */
+        jsonObject["relCode"] = relCode
+        /** 主对象 id */
+        jsonObject["objFrom"] = objFrom
+        /** 从对象 id */
+        jsonObject["objTo"] = objTo
+        /** 添加到列表 */
+        jsonArray.plus(jsonObject)
+        return jsonArray
+    }
+
 
 }

+ 40 - 7
datasyn/src/main/kotlin/com/persagy/server/syn/controllers/obj/RelFromToControllers.kt

@@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.Operation
 import io.swagger.v3.oas.annotations.tags.Tag
 import org.springframework.web.bind.annotation.PostMapping
 import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RequestParam
 import org.springframework.web.bind.annotation.RestController
 
 /**
@@ -82,7 +83,7 @@ class RelFromToControllers {
      */
     @Operation(summary= "设备所在的业务空间-同步到数据中心", description = "")
     @PostMapping("/eq2spIn")
-    fun eq2SpIn(projectId: String): SBaseResponse {
+    fun eq2SpIn(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (dictProject!=null) {
@@ -128,7 +129,7 @@ class RelFromToControllers {
      */
     @Operation(summary= "系统下的设备设施-同步到数据中心", description = "")
     @PostMapping("/sy2EqIn")
-    fun sy2EqIn(projectId: String): SBaseResponse {
+    fun sy2EqIn(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (dictProject!=null) {
@@ -140,9 +141,10 @@ class RelFromToControllers {
                             val toId = rel["objTo"].toString()
                             val rSyEq = RSyEq()
                             rSyEq.sysId = fromId
-                            rSyEq.sysId = toId
+                            rSyEq.equipId = toId
                             rSyEq.projectId = projectId
                             rSyEq.graphCode = "MechSubset"
+                            rSyEq.type = "Sy2Eq"
                             rSyEqService.replace(rSyEq)
                         } catch (e: Exception) {
                             e.printStackTrace()
@@ -162,7 +164,7 @@ class RelFromToControllers {
      */
     @Operation(summary= "设备设施服务业务空间-同步到数据中心", description = "")
     @PostMapping("/eq2SpFor")
-    fun eq2SpFor(projectId: String): SBaseResponse {
+    fun eq2SpFor(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (dictProject!=null) {
@@ -208,7 +210,7 @@ class RelFromToControllers {
      */
     @Operation(summary= "建筑下的竖井-同步到数据中心", description = "")
     @PostMapping("/bd2ShIn")
-    fun bd2ShIn(projectId: String): SBaseResponse {
+    fun bd2ShIn(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (dictProject!=null) {
@@ -242,7 +244,7 @@ class RelFromToControllers {
      */
     @Operation(summary= "建筑下的业务空间-同步到数据中心", description = "")
     @PostMapping("/bd2SpIn")
-    fun bd2SpIn(projectId: String): SBaseResponse {
+    fun bd2SpIn(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (dictProject!=null) {
@@ -282,6 +284,37 @@ class RelFromToControllers {
         }
     }
 
-
+    /**
+     * 系统所在建筑
+     */
+    @Operation(summary= "系统所在建筑-同步到数据中心", description = "")
+    @PostMapping("/sy2BdIn")
+    fun sy2BdIn(@RequestParam projectId: String): SBaseResponse {
+        try {
+            val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
+            if (dictProject!=null) {
+                val relList = EquipApi.getRel(dictProject.groupCode!!, projectId, "MechInArch", "Sy2Bd")
+                if (!relList.isNullOrEmpty()){
+                    for ( rel in relList) {
+                        try {
+                            val fromId = rel["objFrom"].toString()
+                            val toId = rel["objTo"].toString()
+                            val rSyInBd = RSyInBd()
+                            rSyInBd.sysId = fromId
+                            rSyInBd.buildingId = toId
+                            rSyInBd.projectId = projectId
+                            rSyInBdService.replace(rSyInBd)
+                        } catch (e: Exception) {
+                            e.printStackTrace()
+                        }
+                    }
+                }
+            }
+            return SBaseResponse(SResponseType.success)
+        } catch (e: Exception) {
+            e.printStackTrace()
+            return SBaseResponse(SResponseType.failure)
+        }
+    }
 
 }

+ 20 - 19
datasyn/src/main/kotlin/com/persagy/server/syn/controllers/obj/RelToFromController.kt

@@ -45,6 +45,7 @@ import io.swagger.v3.oas.annotations.tags.Tag
 import org.slf4j.LoggerFactory
 import org.springframework.web.bind.annotation.PostMapping
 import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RequestParam
 import org.springframework.web.bind.annotation.RestController
 
 /**
@@ -123,7 +124,7 @@ class RelToFromController {
      */
     @Operation(summary= "设备和楼层关系-同步到中台", description = "设备所在的楼层(图类型 MechInArch 边类型 Eq2Fl ),设备服务的楼层(图类型 MechForArch 边类型 Eq2Fl), ")
     @PostMapping("/eq2fl")
-    fun eq2Fl(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun eq2Fl(@RequestParam projectId: String, @RequestParam graphCode: String, @RequestParam type: String, @RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (graphCode == "MechInArch") {
@@ -177,7 +178,7 @@ class RelToFromController {
      */
     @Operation(summary= "设备和建筑关系-同步到中台", description = "设备所在的建筑(图类型 MechInArch 边类型 Eq2Bd ),设备服务的建筑(图类型 MechForArch 边类型 Eq2Bd), ")
     @PostMapping("/eq2bd")
-    fun eq2Bd(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun eq2Bd(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (graphCode == "MechInArch") {
@@ -226,7 +227,7 @@ class RelToFromController {
      */
     @Operation(summary= "设备和系统关系-同步到中台", description = "系统下设备(图类型 MechSubset 边类型 Sy2Eq )")
     @PostMapping("/sy2eq")
-    fun sy2Eq(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun sy2Eq(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val rSyEqList = rSyEqService.select(
@@ -259,7 +260,7 @@ class RelToFromController {
      */
     @Operation(summary= "设备和竖井关系-同步到中台", description = "设备所在的竖井(图类型 MechInArch 边类型 Eq2Sh ),设备服务的竖井(图类型 MechForArch 边类型 Eq2Sh), ")
     @PostMapping("/eq2sh")
-    fun eq2Sh(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun eq2Sh(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (graphCode == "MechInArch") {
@@ -307,7 +308,7 @@ class RelToFromController {
      */
     @Operation(summary= "设备和空间关系-同步到中台", description = "设备所在的空间(图类型 MechInArch 边类型 Eq2Sp ),设备服务的空间(图类型 MechForArch 边类型 Eq2Sp), ")
     @PostMapping("/eq2sp")
-    fun eq2Sp(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun eq2Sp(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val rEq2SpList = rEq2SpService.select(
@@ -339,7 +340,7 @@ class RelToFromController {
      */
     @Operation(summary= "设备和部件关系-同步到中台", description = "设备下部件(图类型 MechSubset 边类型 Eq2Ec )")
     @PostMapping("/eq2ec")
-    fun eq2Ec(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun eq2Ec(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val equipmentList =
@@ -373,7 +374,7 @@ class RelToFromController {
      */
     @Operation(summary= "系统和竖井关系-同步到中台", description = "系统所在的竖井(图类型 MechInArch 边类型 Sy2Sh ),系统服务于竖井(图类型MechForArch  边类型 Sy2Sh )")
     @PostMapping("/sy2sh")
-    fun sy2Sh(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse{
+    fun sy2Sh(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse{
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (graphCode == "MechInArch") {
@@ -424,7 +425,7 @@ class RelToFromController {
      */
     @Operation(summary= "竖井下的业务空间关系-同步到中台", description = "竖井下的业务空间(图类型 ArchSubset 边类型 Sh2Sp )")
     @PostMapping("/sh2sp")
-    fun sh2Sp(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun sh2Sp(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val rSh2SpList = rSh2SpService.select(SFilter.eq("projectId", projectId)).exec()
@@ -454,7 +455,7 @@ class RelToFromController {
      */
     @Operation(summary= "建筑体下的竖井关系-同步到中台", description = "建筑体下的竖井(图类型 ArchSubset 边类型 Bd2Sh )")
     @PostMapping("/bd2sh")
-    fun bd2sh(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun bd2sh(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val rShInBdList = rShInBdService.select(SFilter.eq("projectId", projectId)).exec()
@@ -486,7 +487,7 @@ class RelToFromController {
      */
     @Operation(summary= "竖井贯通关系-同步到中台", description = "竖井贯通关系(图类型 ThroughRelationship 边类型 Sh2Sh )")
     @PostMapping("/sh2sh")
-    fun sh2sh(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun sh2sh(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val rShaftThroughShaftList = rShaftThroughShaftService.select(SFilter.eq("projectId", projectId)).exec()
@@ -516,7 +517,7 @@ class RelToFromController {
      */
     @Operation(summary= "系统和楼层关系-同步到中台", description = "系统所在的楼层(图类型 MechInArch 边类型 Sy2Fl ),系统服务于楼层(图类型MechForArch  边类型 Sy2Fl )")
     @PostMapping("/sy2fl")
-    fun sy2fl(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse{
+    fun sy2fl(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse{
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (graphCode == "MechInArch") {
@@ -566,7 +567,7 @@ class RelToFromController {
      */
     @Operation(summary= "系统和楼层关系-同步到中台", description = "系统所在的建筑体(图类型 MechInArch 边类型 Sy2Bd ),系统服务于建筑体(图类型MechForArch  边类型 Sy2Bd )")
     @PostMapping("/sy2bd")
-    fun sy2bd(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse{
+    fun sy2bd(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse{
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (graphCode == "MechInArch") {
@@ -617,7 +618,7 @@ class RelToFromController {
      */
     @Operation(summary= "建筑体下的楼层-同步到中台", description = "建筑体下的楼层(图类型 ArchSubset 边类型 Bd2Fl )")
     @PostMapping("/bd2fl")
-    fun bd2fl(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun bd2fl(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val floorList = floorService.select(SFilter.eq("projectId", projectId)).exec()
@@ -648,7 +649,7 @@ class RelToFromController {
      */
     @Operation(summary= "楼层下的业务空间-同步到中台", description = "楼层下的业务空间(图类型 ArchSubset 边类型 Fl2Sp )")
     @PostMapping("/fl2sp")
-    fun fl2sp(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun fl2sp(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val rSpinFlList = rSpinFlService.select(SFilter.eq("projectId", projectId)).exec()
@@ -678,7 +679,7 @@ class RelToFromController {
      */
     @Operation(summary= "建筑体下的业务空间-同步到中台", description = "建筑体下的业务空间(图类型 ArchSubset 边类型 Bd2Sp )")
     @PostMapping("/bd2sp")
-    fun bd2sp(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun bd2sp(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val rSpinBdList = rSpinBdService.select(SFilter.eq("projectId", projectId)).exec()
@@ -708,7 +709,7 @@ class RelToFromController {
      */
     @Operation(summary= "楼层贯通关系-同步到中台", description = "楼层贯通关系(图类型 ThroughRelationship 边类型 Fl2Fl )")
     @PostMapping("/fl2fl")
-    fun fl2fl(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun fl2fl(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val rFlThroughFlList = rFlThroughFlService.select(SFilter.eq("projectId", projectId)).exec()
@@ -738,7 +739,7 @@ class RelToFromController {
      */
     @Operation(summary= "系统和业务空间关系-同步到中台", description = "系统所在业务空间(图类型 MechInArch 边类型 Sy2Bd ),系统服务于业务空间(图类型MechForArch  边类型 Sy2Bd )")
     @PostMapping("/sy2sp")
-    fun sy2sp(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse{
+    fun sy2sp(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse{
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             if (graphCode == "MechInArch") {
@@ -792,7 +793,7 @@ class RelToFromController {
      */
     @Operation(summary= "空间和空间的关系-同步到中台", description = "")
     @PostMapping("/sp2sp")
-    fun sp2sp(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
+    fun sp2sp(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val relContrast = Configure.relContrast(graphCode, type)
@@ -827,7 +828,7 @@ class RelToFromController {
      */
     @Operation(summary= "设备和设备的关系-同步到中台", description = "")
     @PostMapping("/eq2eq")
-    fun eq2eq(projectId: String,graphCode: String,type: String,isDel: Boolean = false) : SBaseResponse {
+    fun eq2eq(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false) : SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
             val relContrastEq = Configure.relContrastEq(graphCode, type)

+ 6 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/jms/DataCenterSync.kt

@@ -235,6 +235,9 @@ class DataCenterSync {
                             if (message.fromId!!.startsWith("Sy")) {
                                 var ids=  Gson().fromJson<ArrayList<String>>(message.toId,type)
                                 equipInSpaceSync.equipInSpaceCreate(message,"MechInArch","Sy2Sp",ids)
+                            } else if (message.fromId!!.startsWith("Sp")){
+                                var ids=  Gson().fromJson<ArrayList<String>>(message.toId,type)
+                                /******************************************************************************/
                             }
                         }
                     }
@@ -303,7 +306,6 @@ class DataCenterSync {
                                 equipInSpaceSync.equipInSpaceCreate(message,"MechForArch","Eq2Sp",ids)
                             }
                         }
-
                     }
                 }
                 "EquipinShaft" -> {
@@ -1112,6 +1114,9 @@ class DataCenterSync {
                         "12" -> { // 删除关系
                             equipInSpaceSync.delRel(message, "MechCtrl", "EqCtrl")
                         }
+                        "20" -> {
+                            automaticCalculationSync.eq2eqControlRelation1(message)
+                        }
                     }
                 }
                 "eq2eq_SensorRelationship_ss2eq" -> {

+ 2 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/models/api/obj/BuildingApi.kt

@@ -124,6 +124,8 @@ object BuildingApi {
         val url = "${opts.dataPlatform}/rwd/instance/object/delete?groupCode=$groupCode&projectId=${projectId}&appId=datacenter"
         val listId = ArrayList<String>()
         listId.add(buildingId)
+        logger.debug("删除建筑url= ${url}")
+        logger.debug("boby= ${listId.toJson()}")
         val postObject = SHttpUtil.postObject<MiddleGroundDataRespose>(url, listId)
         if (postObject.result == "success") {
             return true

+ 1 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/models/api/obj/FloorApi.kt

@@ -64,7 +64,7 @@ object FloorApi {
         val jsonObject2 =  JSONObject()
         jsonObject2["graphCode"] = "ArchSubset"
         jsonObject2["relCode"] = "Bd2Fl"
-        jsonObject2["objFrom"] = floorId
+        jsonObject2["objTo"] = floorId
         jsonObject["criteria"] = jsonObject2
         val postObject = SHttpUtil.postObject<MiddleGroundDataRespose>(url, jsonObject)
         if (postObject.result == "success"&&!postObject.data.isNullOrEmpty()) {

+ 1 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/EquipUtil.kt

@@ -2517,6 +2517,7 @@ object EquipUtil {
         }
         if (!equipment.cadId.isNullOrEmpty()){
             hashMap["cadId"] = equipment.cadId
+            hashMap["cADID"] = equipment.cadId
         }
         if (!equipment.bimId.isNullOrEmpty()){
             hashMap["bimId"] = equipment.bimId

+ 2 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/FloorUtil.kt

@@ -29,6 +29,7 @@ package com.persagy.server.syn.models.tools
 import com.google.gson.Gson
 import com.google.gson.reflect.TypeToken
 import com.persagy.base.extensions.toInt
+import com.persagy.base.extensions.toJson
 import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.datacenter.models.entities.assistant.PointPosition
@@ -239,7 +240,7 @@ object FloorUtil {
             hashMap["bimLocation"] = floor.bimLocation
         }
         if (!floor.outline.isNullOrEmpty()){
-            hashMap["outline"] = floor.outline.toString()
+            hashMap["outline"] = floor.outline!!.toJson()
         }
         if (floor.permanentPeopleNum!=null&&floor.permanentPeopleNum!=0){
             hashMap["permanentPeopleNum"] = floor.permanentPeopleNum

+ 1 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/SpaceUtil.kt

@@ -585,7 +585,7 @@ object SpaceUtil {
             hashMap["bimLocation"] = zoneSpace.bimLocation
         }
         if (!zoneSpace.outline.isNullOrEmpty()){
-            hashMap["outline"] = zoneSpace.outline.toString()
+            hashMap["outline"] = zoneSpace.outline!!.toJson()
         }
         if (zoneSpace.permanentPeopleNum!=null&&zoneSpace.permanentPeopleNum!=0){
             hashMap["permanentPeopleNum"] = zoneSpace.permanentPeopleNum

+ 2 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/SystemUtil.kt

@@ -209,6 +209,8 @@ object SystemUtil {
         }
         if (!generalSystem.cadId.isNullOrEmpty()){
             hashMap["cadId"] = generalSystem.cadId
+            hashMap["cADID"] = generalSystem.cadId
+
         }
         if (!generalSystem.bimId.isNullOrEmpty()){
             hashMap["bimId"] = generalSystem.bimId

+ 34 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/rel/AutomaticCalculationSync.kt

@@ -665,4 +665,38 @@ class AutomaticCalculationSync {
         }
     }
 
+    /**
+     * 设备控制关系
+     */
+    fun eq2eqControlRelation1(message: SynchronousMessageRel){
+        val dictProject = dictProjectService.select(SFilter.eq("id", message.projectId!!)).entity()
+        if (dictProject!=null) {
+            val rEq2SpList = rEq2EqService.select(SFilter.eq("projectId", message.projectId!!),SFilter.eq("type", "eq2eq_ControlRelation_1")).exec()
+            message.sign = 0
+            if (rEq2SpList.size>0) {
+                for (rEq2Sp in rEq2SpList) {
+                    try {
+                        /** 先执行删除 */
+                        val toJsonObj = Configure.toJsonObj("MechCtrl", "EqCtrl", rEq2Sp.id1!!, rEq2Sp.id2!!)
+                        val delRel = EquipApi.delRel(dictProject.groupCode!!, message.projectId!!, toJsonObj)
+                        /** 关系列表 */
+                        val toJsonObjArray =
+                            Configure.toJsonObjArray("MechCtrl", "EqCtrl", rEq2Sp.id1!!, rEq2Sp.id2!!)
+                        val createRel = EquipApi.createRel(dictProject.groupCode!!, message.projectId!!, toJsonObjArray)
+                        if (!createRel){
+                            message.sign = 2
+                            message.count +1
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                        message.sign = 2
+                        message.count +1
+                    }
+                }
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(message, arrayListOf("sign","count"))
+        }
+    }
+
 }

+ 40 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/rel/EquipinSpaceSync.kt

@@ -66,6 +66,46 @@ class EquipinSpaceSync {
     }
 
     /**
+     * 创建关系
+     *
+     * @param synchronousMessageRel     关系对象
+     * @param graphCode                 图类型
+     * @param relCode                   关系类型
+     */
+    fun equipInSpaceCreateTwo(synchronousMessageRel: SynchronousMessageRel,graphCode: String,relCode: String,fromIds:ArrayList<String>?){
+        try {
+
+            val dictProject = dictProjectService.select(SFilter.eq("id", synchronousMessageRel.projectId!!)).entity()
+            if (dictProject!=null) {
+                synchronousMessageRel.sign = 0
+                val toJsonObjArray :JSONArray
+                if (!fromIds.isNullOrEmpty()){
+                    /** 关系列表 */
+                    toJsonObjArray= Configure.toJsonObjFromList(graphCode, relCode, fromIds, synchronousMessageRel.fromId!!)
+                } else {
+                    /** 关系列表 */
+                    toJsonObjArray = Configure.toJsonObjArray(graphCode, relCode, synchronousMessageRel.fromId!!, synchronousMessageRel.toId!!)
+                }
+
+                val createRel = EquipApi.createRel(dictProject.groupCode!!, synchronousMessageRel.projectId!!, toJsonObjArray)
+                if (!createRel ){
+                    synchronousMessageRel.sign = 2
+                    synchronousMessageRel.count +1
+                }
+            } else {
+                synchronousMessageRel.sign = 2
+                synchronousMessageRel.count +1
+            }
+            /** 更改标记 */
+            synchronousMessageRelService.update(synchronousMessageRel, arrayListOf("sign","count"))
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    }
+
+
+
+    /**
      * 删除关系
      *
      * @param synchronousMessageRel     关系对象

+ 5 - 5
equip-component/src/main/kotlin/com/persagy/server/controllers/EquipController.kt

@@ -144,7 +144,7 @@ class EquipController {
     @PostMapping(value = ["/count"])
     fun count(@RequestBody request: SCountRequest): SCountResponse {
         val withFilterList = ArrayList<SFilter>()
-        withFilterList.add(SFilter.eq("projectId", SPageContext.getHeader("ProjectId").toString()))
+        withFilterList.add(SFilter.eq("projectId", SPageContext.getHeader("projectId").toString()))
         return EquipmentORComService.count(request,withFilterList)
     } // Function count()
 
@@ -157,7 +157,7 @@ class EquipController {
     @PostMapping(value = ["/pagequery"])
     fun pageQuery(@RequestBody request: SQueryRequest): SQueryResponse<Equipment> {
         val withFilterList = ArrayList<SFilter>()
-        withFilterList.add(SFilter.eq("projectId", SPageContext.getHeader("ProjectId").toString()))
+        withFilterList.add(SFilter.eq("projectId", SPageContext.getHeader("projectId").toString()))
         return EquipmentORComService.pageQuery(request,withFilterList)
     } // Function pageQuery()
 
@@ -175,7 +175,7 @@ class EquipController {
     @PostMapping(value = ["/zone-query"])
     fun zoneQuery(@RequestBody request: ZoneEquipQueryRequest): SQueryResponse<Equipment> {
         val withFilterList = ArrayList<SFilter>()
-        val projectId = SPageContext.getHeader("ProjectId").toString()
+        val projectId = SPageContext.getHeader("projectId").toString()
         withFilterList.add(SFilter.eq("projectId", projectId))
         withFilterList.add(SFilter.eq(CharLength("classCode", ""), 6))
         if(request.zoneId.isNullOrEmpty() && request.zoneType.isNullOrEmpty()) {
@@ -207,7 +207,7 @@ class EquipController {
     @PostMapping(value = ["/zone-component-query"])
     fun zoneComponentQuery(@RequestBody request: ZoneEquipQueryRequest): SQueryResponse<ComponentCascade> {
         val withFilterList = ArrayList<SFilter>()
-        val projectId = SPageContext.getHeader("ProjectId").toString()
+        val projectId = SPageContext.getHeader("projectId").toString()
         withFilterList.add(SFilter.eq("projectId", projectId))
         withFilterList.add(SFilter.eq(CharLength("classCode", ""), 8))
         if(request.zoneId.isNullOrEmpty() && request.zoneType.isNullOrEmpty()) {
@@ -253,7 +253,7 @@ class EquipController {
     @Operation(summary = "查询当前系统下的设备", description = "")
     @PostMapping(value = ["/sys-equip"])
     fun pageQuerySysEquip(@RequestBody request: SQueryRequest): SQueryResponse<SysEquip>{
-        return SysEquipService.pageQuery(request, arrayListOf(SFilter.eq("projectId", SPageContext.getHeader("ProjectId").toString())))
+        return SysEquipService.pageQuery(request, arrayListOf(SFilter.eq("projectId", SPageContext.getHeader("projectId").toString())))
     } // Function pageQuery()
 
     /**

+ 1 - 1
equip-component/src/main/kotlin/com/persagy/server/service/EquipmentProSyService.kt

@@ -62,7 +62,7 @@ object EquipmentProSyService : Service<EquipmentProSy>(SMybatisDao(EquipmentProS
     override fun onCreateBefore(equip: EquipmentProSy): Boolean {
         try {
             /** 查询准备类型 */
-            val projectId = SPageContext.getHeader("ProjectId")
+            val projectId = SPageContext.getHeader("projectId")
             if (!equip.id.isNullOrEmpty()) {
                 val isStartsWith = equip.id.toString().startsWith("Eq")
                 if (!isStartsWith) {

+ 2 - 2
equip-component/src/main/resources/application-prod.yml

@@ -19,9 +19,9 @@ spring:
 #    url:                                jdbc:postgresql://data-center:5432/datacenter
 #    username:                           postgres
 #    password:                           123qwe!@#
-#    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
+    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
 #    url:                                jdbc:postgresql://172.17.11.228:5432/datacenterlabsl
-    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
 #    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj