Parcourir la source

********************WX***********************
同步关系

zhangweixin il y a 4 ans
Parent
commit
d883fa4911
27 fichiers modifiés avec 3285 ajouts et 968 suppressions
  1. 1 1
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RSyInBd.kt
  2. 2 2
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/response/StatisticsCountResponse.kt
  3. 102 102
      datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/ManualRelationCalcService.kt
  4. 1 1
      datacenter/src/main/resources/application-dev.yml
  5. 9 9
      datacenter/src/main/resources/application-prod.yml
  6. 1 1
      datasyn/src/main/kotlin/com/persagy/server/syn/jms/MessageProcessing.kt
  7. 6 2
      datasyn/src/main/kotlin/com/persagy/server/syn/jms/RwdSync.kt
  8. 7 7
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/BuildingUtil.kt
  9. 3 3
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/EquipUtil.kt
  10. 7 7
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/FloorUtil.kt
  11. 7 7
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/ProjectUtil.kt
  12. 6 6
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/ShaftUtil.kt
  13. 6 6
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/SpaceUtil.kt
  14. 6 6
      datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/SystemUtil.kt
  15. 997 325
      datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/RwdRelationAdd.kt
  16. 1044 318
      datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/RwdRelationDel.kt
  17. 183 0
      equip-component/src/main/kotlin/com/persagy/server/controllers/StatisticsController.kt
  18. 19 8
      equip-component/src/main/kotlin/com/persagy/server/controllers/dict/DictCustomController.kt
  19. 14 28
      equip-component/src/main/kotlin/com/persagy/server/dao/mappers/CustomSql.kt
  20. 159 0
      equip-component/src/main/kotlin/com/persagy/server/dao/mappers/StatisticsCountMapper.kt
  21. 1 2
      equip-component/src/main/kotlin/com/persagy/server/models/ComponentProperty.kt
  22. 3 5
      equip-component/src/main/kotlin/com/persagy/server/models/EquipCompon.kt
  23. 2 2
      equip-component/src/main/kotlin/com/persagy/server/models/mappers/REquipComponMapper.kt
  24. 112 117
      equip-component/src/main/kotlin/com/persagy/server/service/CustomSqlService.kt
  25. 2 1
      equip-component/src/main/kotlin/com/persagy/server/service/REquipComponService.kt
  26. 583 0
      equip-component/src/main/kotlin/com/persagy/server/service/StatisticsService.kt
  27. 2 2
      gradle.properties

+ 1 - 1
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RSyInBd.kt

@@ -61,6 +61,6 @@ class RSyInBd : RBaseInfo() {
     /** 计算标记 1 为手动 2为自动 */
     @Schema(description = "计算标记 1 为手动 2为自动 ")
     @Column(name = "sign")
-    var sign: Int? = null
+    var sign: Int? = 1
 
 }

+ 2 - 2
data-core/src/main/kotlin/com/persagy/server/datacenter/models/response/StatisticsCountResponse.kt

@@ -39,12 +39,12 @@ open class StatisticsCountResponse : Serializable {
 
     /** name */
     @Schema(description = "name")
-    @JSONField(name = "Name")
+    @JSONField(name = "name")
     var name: String? = null
 
     /** count */
     @Schema(description = "count")
-    @JSONField(name = "Count")
+    @JSONField(name = "count")
     var count: Long? = null
 
 } // Class StatisticsCountResponse

+ 102 - 102
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/ManualRelationCalcService.kt

@@ -313,16 +313,16 @@ open class ManualRelationCalcService {
             val relPropertyList = relPropertyService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
 
             if (relPropertyList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (relPropertyList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -330,16 +330,16 @@ open class ManualRelationCalcService {
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -381,16 +381,16 @@ open class ManualRelationCalcService {
             val relPropertyList = relPropertyService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
 
             if (relPropertyList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (relPropertyList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -398,16 +398,16 @@ open class ManualRelationCalcService {
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = relShaftService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -448,16 +448,16 @@ open class ManualRelationCalcService {
             val relPropertyList = relEquipmentShaftService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
 
             if (relPropertyList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (relPropertyList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -465,16 +465,16 @@ open class ManualRelationCalcService {
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = relShaftService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -520,16 +520,16 @@ open class ManualRelationCalcService {
             val relPropertyList = relEquipmentShaftService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
 
             if (relPropertyList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (relPropertyList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -537,16 +537,16 @@ open class ManualRelationCalcService {
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -591,16 +591,16 @@ open class ManualRelationCalcService {
             val relPropertyList = EquipmentService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
 
             if (relPropertyList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (relPropertyList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -608,16 +608,16 @@ open class ManualRelationCalcService {
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = BuildingService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -657,16 +657,16 @@ open class ManualRelationCalcService {
 
             val generalSystemList = GeneralSystemService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (generalSystemList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (generalSystemList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -674,16 +674,16 @@ open class ManualRelationCalcService {
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -725,32 +725,32 @@ open class ManualRelationCalcService {
 
             val generalSystemList = GeneralSystemService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (generalSystemList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (generalSystemList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = relShaftService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -793,16 +793,16 @@ open class ManualRelationCalcService {
 
             val generalSystemList = GeneralSystemService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (generalSystemList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (generalSystemList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -810,16 +810,16 @@ open class ManualRelationCalcService {
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -863,16 +863,16 @@ open class ManualRelationCalcService {
 
             val generalSystemList = GeneralSystemService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (generalSystemList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (generalSystemList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -880,16 +880,16 @@ open class ManualRelationCalcService {
             for (fromContent in relationAddRequest.fromContent!!){
                 val relZoneSpaceList = BuildingService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (relZoneSpaceList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -947,16 +947,16 @@ open class ManualRelationCalcService {
              */
             val relZoneSpaceList = relZoneSpaceService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (relZoneSpaceList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (relZoneSpaceList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -967,16 +967,16 @@ open class ManualRelationCalcService {
                 val relZoneToSpaceList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!),
                     SFilter.not(SFilter.eq("id",relZoneSpace.id!!)),SFilter.eq("objectType",relZoneSpace.objectType!!)).exec()
                 if (relZoneToSpaceList.size == 0){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (relZoneToSpaceList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -1195,16 +1195,16 @@ open class ManualRelationCalcService {
             /** 强电类 */
             val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (equipmentList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (equipmentList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -1214,16 +1214,16 @@ open class ManualRelationCalcService {
                 val equipmentToList = EquipmentService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!),
                     SFilter.not(SFilter.eq("id",equipment.id!!))).exec()
                 if (equipmentToList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (equipmentToList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -1353,16 +1353,16 @@ open class ManualRelationCalcService {
             /** 暖通空调类 */
             val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (equipmentList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (equipmentList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -1372,16 +1372,16 @@ open class ManualRelationCalcService {
                 val equipmentToList = EquipmentService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!),
                     SFilter.not(SFilter.eq("id",equipment.id!!))).exec()
                 if (equipmentToList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (equipmentToList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -1658,16 +1658,16 @@ open class ManualRelationCalcService {
             /** 给排水类 和 消防类 */
             val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (equipmentList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (equipmentList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -1678,16 +1678,16 @@ open class ManualRelationCalcService {
                 val equipmentToList = EquipmentService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!),
                     SFilter.not(SFilter.eq("id",equipment.id!!))).exec()
                 if (equipmentToList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (equipmentToList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -1892,16 +1892,16 @@ open class ManualRelationCalcService {
             /** 给排水类 和 消防类 */
             val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (equipmentList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (equipmentList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -1912,16 +1912,16 @@ open class ManualRelationCalcService {
                 val equipmentToList = EquipmentService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!),
                     SFilter.not(SFilter.eq("id",equipment.id!!))).exec()
                 if (equipmentToList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (equipmentToList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -2011,16 +2011,16 @@ open class ManualRelationCalcService {
             /** 给排水类 和 消防类 */
             val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (equipmentList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (equipmentList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -2030,16 +2030,16 @@ open class ManualRelationCalcService {
                 /** 去除主对象空间id */
                 val equipmentToList = GeneralSystemService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (equipmentToList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (equipmentToList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -2103,16 +2103,16 @@ open class ManualRelationCalcService {
             /** 给排水类 和 消防类 */
             val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (equipmentList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (equipmentList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -2123,16 +2123,16 @@ open class ManualRelationCalcService {
                 /** 去除主对象空间id */
                 val equipmentToList = ZoneSpaceBaseService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (equipmentToList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (equipmentToList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
@@ -2171,16 +2171,16 @@ open class ManualRelationCalcService {
             /** 给排水类 和 消防类 */
             val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
             if (equipmentList.size<1){
-                /** 主对象编码不存在 */
+                /** 主对象不存在 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码不存在"
+                sCreateResponse.message = relationAddRequest.mainContent+":不存在"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
             if (equipmentList.size>1){
                 /** 主对象编码识别到多个实例 */
                 sCreateResponse.result = SResponseType.failure
-                sCreateResponse.message = relationAddRequest.mainContent+":编码存在多个实例"
+                sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
                 sCreateResponse.errorType = "1"
                 return sCreateResponse
             }
@@ -2191,16 +2191,16 @@ open class ManualRelationCalcService {
                 /** 去除主对象空间id */
                 val equipmentToList = ZoneSpaceBaseService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
                 if (equipmentToList.size<1){
-                    /** 从对象编码不存在 */
+                    /** 从对象不存在 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码不存在"
+                    sCreateResponse.message = fromContent+":不存在"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }
                 if (equipmentToList.size>1){
                     /** 从对象编码识别到多个实例 */
                     sCreateResponse.result = SResponseType.failure
-                    sCreateResponse.message = fromContent+":编码存在多个实例"
+                    sCreateResponse.message = fromContent+":存在多个实例"
                     sCreateResponse.errorType = "2"
                     return sCreateResponse
                 }

+ 1 - 1
datacenter/src/main/resources/application-dev.yml

@@ -30,7 +30,7 @@ server:
 
 spring:
   datasource:
-    name:                               revit-algorithm
+    name:                               datacenter
     type:                               com.alibaba.druid.pool.DruidDataSource
     driver-class-name:                  org.postgresql.Driver
 #    url:                                jdbc:postgresql://60.205.177.43:5432/datacenterlabsl

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

@@ -31,20 +31,20 @@ 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
 
-  rabbitmq:
-    host: 39.102.43.179
-    port: 9936
-    username: admin
-    password: brzj123456
-    #虚拟host 可以不设置,使用server默认host
-    virtual-host: /test
+#  rabbitmq:
+#    host: 39.102.43.179
+#    port: 9936
+#    username: admin
+#    password: brzj123456
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: /test
 
   servlet:
     multipart:

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

@@ -77,7 +77,7 @@ class MessageProcessing {
             if (messageTypeRwd!=0){
                 try {
                     messageTypeRwd = 0
-                    val syncRwdMessageList = syncRwdMessageService.select(SFilter.eq("projectId","Pj3702020002"),SFilter.not(SFilter.eq("state", 0))).order("lastUpdate").limit(1000).exec()
+                    val syncRwdMessageList = syncRwdMessageService.select(SFilter.not(SFilter.eq("state", 0))).order("lastUpdate").limit(1000).exec()
                     if (syncRwdMessageList.size >0){
                         rwdSync.dataSync(syncRwdMessageList)
                         messageTypeRwd = 1

+ 6 - 2
datasyn/src/main/kotlin/com/persagy/server/syn/jms/RwdSync.kt

@@ -63,6 +63,10 @@ class RwdSync {
     /** 空间 */
     @Autowired
     lateinit var rwdSpace: RwdSpace
+    /** 添加关系 */
+    lateinit var rwdRelationAdd: RwdRelationAdd
+    /** 删除关系 */
+    lateinit var rwdRelationDel: RwdRelationDel
 
     /**
      *
@@ -109,11 +113,11 @@ class RwdSync {
                 when(message.type){
                     Configure.RELATIONDELETE -> {
                         /** 删除关系 */
-
+                        rwdRelationDel.delRelation(message)
                     }
                     Configure.RELATIONCREATE -> {
                         /** 创建关系 */
-
+                        rwdRelationAdd.addRelation(message)
                     }
                 }
             }

+ 7 - 7
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/BuildingUtil.kt

@@ -394,43 +394,43 @@ object BuildingUtil {
                                     if (building.infos.isNullOrEmpty()){
                                         building.infos = HashMap<String,Any?>()
                                     }
-                                    building.infos!![key] = mapObj[key]!!.toString().toBoolean()
+                                    building.infos!![key] = mapObj[key]
                                 }
                                 "STRING" -> {
                                     if (building.infos.isNullOrEmpty()){
                                         building.infos = HashMap<String,Any?>()
                                     }
-                                    building.infos!![key] = mapObj[key]!!.toString()
+                                    building.infos!![key] = mapObj[key]
                                 }
                                 "DATETIME" -> {
                                     if (building.infos.isNullOrEmpty()){
                                         building.infos = HashMap<String,Any?>()
                                     }
-                                    building.infos!![key] = mapObj[key]!!.toString()
+                                    building.infos!![key] = mapObj[key]
                                 }
                                 "ATTACHMENT" -> {
                                     if (building.infos.isNullOrEmpty()){
                                         building.infos = HashMap<String,Any?>()
                                     }
-                                    building.infos!![key] = mapObj[key]!!.toString()
+                                    building.infos!![key] = mapObj[key]
                                 }
                                 "OBJECT" -> {
                                     if (building.infos.isNullOrEmpty()){
                                         building.infos = HashMap<String,Any?>()
                                     }
-                                    building.infos!![key] = mapObj[key]!!.toString()
+                                    building.infos!![key] = mapObj[key]
                                 }
                                 "ENUM" -> {
                                     if (building.infos.isNullOrEmpty()){
                                         building.infos = HashMap<String,Any?>()
                                     }
-                                    building.infos!![key] = mapObj[key]!!.toString()
+                                    building.infos!![key] = mapObj[key]
                                 }
                                 "MENUM" -> {
                                     if (building.infos.isNullOrEmpty()){
                                         building.infos = HashMap<String,Any?>()
                                     }
-                                    building.infos!![key] = mapObj[key]!!.toString()
+                                    building.infos!![key] = mapObj[key]
                                 }
                                 else -> {
                                     if (building.infos.isNullOrEmpty()){

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

@@ -2468,7 +2468,7 @@ object EquipUtil {
                                         if (equipment.infos.isNullOrEmpty()){
                                             equipment.infos = HashMap<String,Any?>()
                                         }
-                                        equipment.infos!![key] = mapObj[key]!!.toString().toBoolean()
+                                        equipment.infos!![key] = mapObj[key]
                                     }
                                     "STRING" -> {
                                         if (equipment.infos.isNullOrEmpty()){
@@ -2480,7 +2480,7 @@ object EquipUtil {
                                         if (equipment.infos.isNullOrEmpty()){
                                             equipment.infos = HashMap<String,Any?>()
                                         }
-                                        equipment.infos!![key] = mapObj[key]!!.toString()
+                                        equipment.infos!![key] = mapObj[key]
                                     }
                                     "ATTACHMENT" -> {
                                         if (equipment.infos.isNullOrEmpty()){
@@ -2492,7 +2492,7 @@ object EquipUtil {
                                         if (equipment.infos.isNullOrEmpty()){
                                             equipment.infos = HashMap<String,Any?>()
                                         }
-                                        equipment.infos!![key] = mapObj[key]!!.toString()
+                                        equipment.infos!![key] = mapObj[key]
                                     }
                                     "ENUM" -> {
                                         if (equipment.infos.isNullOrEmpty()){

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

@@ -110,43 +110,43 @@ object FloorUtil {
                                     if (floor.infos.isNullOrEmpty()){
                                         floor.infos = HashMap<String,Any?>()
                                     }
-                                    floor.infos!![key] = mapObj[key]!!.toString().toBoolean()
+                                    floor.infos!![key] = mapObj[key]!!.toString()
                                 }
                                 "STRING" -> {
                                     if (floor.infos.isNullOrEmpty()){
                                         floor.infos = HashMap<String,Any?>()
                                     }
-                                    floor.infos!![key] = mapObj[key]!!.toString()
+                                    floor.infos!![key] = mapObj[key]
                                 }
                                 "DATETIME" -> {
                                     if (floor.infos.isNullOrEmpty()){
                                         floor.infos = HashMap<String,Any?>()
                                     }
-                                    floor.infos!![key] = mapObj[key]!!.toString()
+                                    floor.infos!![key] = mapObj[key]
                                 }
                                 "ATTACHMENT" -> {
                                     if (floor.infos.isNullOrEmpty()){
                                         floor.infos = HashMap<String,Any?>()
                                     }
-                                    floor.infos!![key] = mapObj[key]!!.toString()
+                                    floor.infos!![key] = mapObj[key]
                                 }
                                 "OBJECT" -> {
                                     if (floor.infos.isNullOrEmpty()){
                                         floor.infos = HashMap<String,Any?>()
                                     }
-                                    floor.infos!![key] = mapObj[key]!!.toString()
+                                    floor.infos!![key] = mapObj[key]
                                 }
                                 "ENUM" -> {
                                     if (floor.infos.isNullOrEmpty()){
                                         floor.infos = HashMap<String,Any?>()
                                     }
-                                    floor.infos!![key] = mapObj[key]!!.toString()
+                                    floor.infos!![key] = mapObj[key]
                                 }
                                 "MENUM" -> {
                                     if (floor.infos.isNullOrEmpty()){
                                         floor.infos = HashMap<String,Any?>()
                                     }
-                                    floor.infos!![key] = mapObj[key]!!.toString()
+                                    floor.infos!![key] = mapObj[key]
                                 }
                                 else -> {
                                     if (floor.infos.isNullOrEmpty()){

+ 7 - 7
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/ProjectUtil.kt

@@ -111,43 +111,43 @@ object ProjectUtil {
                                     if (project.infos.isNullOrEmpty()){
                                         project.infos = HashMap<String,Any?>()
                                     }
-                                    project.infos!![key] = mapObj[key]!!.toString().toBoolean()
+                                    project.infos!![key] = mapObj[key]
                                 }
                                 "STRING" -> {
                                     if (project.infos.isNullOrEmpty()){
                                         project.infos = HashMap<String,Any?>()
                                     }
-                                    project.infos!![key] = mapObj[key]!!.toString()
+                                    project.infos!![key] = mapObj[key]
                                 }
                                 "DATETIME" -> {
                                     if (project.infos.isNullOrEmpty()){
                                         project.infos = HashMap<String,Any?>()
                                     }
-                                    project.infos!![key] = mapObj[key]!!.toString()
+                                    project.infos!![key] = mapObj[key]
                                 }
                                 "ATTACHMENT" -> {
                                     if (project.infos.isNullOrEmpty()){
                                         project.infos = HashMap<String,Any?>()
                                     }
-                                    project.infos!![key] = mapObj[key]!!.toString()
+                                    project.infos!![key] = mapObj[key]
                                 }
                                 "OBJECT" -> {
                                     if (project.infos.isNullOrEmpty()){
                                         project.infos = HashMap<String,Any?>()
                                     }
-                                    project.infos!![key] = mapObj[key]!!.toString()
+                                    project.infos!![key] = mapObj[key]
                                 }
                                 "ENUM" -> {
                                     if (project.infos.isNullOrEmpty()){
                                         project.infos = HashMap<String,Any?>()
                                     }
-                                    project.infos!![key] = mapObj[key]!!.toString()
+                                    project.infos!![key] = mapObj[key]
                                 }
                                 "MENUM" -> {
                                     if (project.infos.isNullOrEmpty()){
                                         project.infos = HashMap<String,Any?>()
                                     }
-                                    project.infos!![key] = mapObj[key]!!.toString()
+                                    project.infos!![key] = mapObj[key]
                                 }
                                 else -> {
                                     if (project.infos.isNullOrEmpty()){

+ 6 - 6
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/ShaftUtil.kt

@@ -109,7 +109,7 @@ object ShaftUtil {
                                     if (shaft.infos.isNullOrEmpty()){
                                         shaft.infos = HashMap<String,Any?>()
                                     }
-                                    shaft.infos!![key] = mapObj[key]!!.toString().toBoolean()
+                                    shaft.infos!![key] = mapObj[key]
                                 }
                                 "STRING" -> {
                                     if (shaft.infos.isNullOrEmpty()){
@@ -121,31 +121,31 @@ object ShaftUtil {
                                     if (shaft.infos.isNullOrEmpty()){
                                         shaft.infos = HashMap<String,Any?>()
                                     }
-                                    shaft.infos!![key] = mapObj[key]!!.toString()
+                                    shaft.infos!![key] = mapObj[key]
                                 }
                                 "ATTACHMENT" -> {
                                     if (shaft.infos.isNullOrEmpty()){
                                         shaft.infos = HashMap<String,Any?>()
                                     }
-                                    shaft.infos!![key] = mapObj[key]!!.toString()
+                                    shaft.infos!![key] = mapObj[key]
                                 }
                                 "OBJECT" -> {
                                     if (shaft.infos.isNullOrEmpty()){
                                         shaft.infos = HashMap<String,Any?>()
                                     }
-                                    shaft.infos!![key] = mapObj[key]!!.toString()
+                                    shaft.infos!![key] = mapObj[key]
                                 }
                                 "ENUM" -> {
                                     if (shaft.infos.isNullOrEmpty()){
                                         shaft.infos = HashMap<String,Any?>()
                                     }
-                                    shaft.infos!![key] = mapObj[key]!!.toString()
+                                    shaft.infos!![key] = mapObj[key]
                                 }
                                 "MENUM" -> {
                                     if (shaft.infos.isNullOrEmpty()){
                                         shaft.infos = HashMap<String,Any?>()
                                     }
-                                    shaft.infos!![key] = mapObj[key]!!.toString()
+                                    shaft.infos!![key] = mapObj[key]
                                 }
                                 else -> {
                                     if (shaft.infos.isNullOrEmpty()){

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

@@ -427,7 +427,7 @@ object SpaceUtil {
                                     if (zoneSpace.infos.isNullOrEmpty()){
                                         zoneSpace.infos = HashMap<String,Any?>()
                                     }
-                                    zoneSpace.infos!![key] = mapObj[key]!!.toString().toBoolean()
+                                    zoneSpace.infos!![key] = mapObj[key]
                                 }
                                 "STRING" -> {
                                     if (zoneSpace.infos.isNullOrEmpty()){
@@ -439,31 +439,31 @@ object SpaceUtil {
                                     if (zoneSpace.infos.isNullOrEmpty()){
                                         zoneSpace.infos = HashMap<String,Any?>()
                                     }
-                                    zoneSpace.infos!![key] = mapObj[key]!!.toString()
+                                    zoneSpace.infos!![key] = mapObj[key]
                                 }
                                 "ATTACHMENT" -> {
                                     if (zoneSpace.infos.isNullOrEmpty()){
                                         zoneSpace.infos = HashMap<String,Any?>()
                                     }
-                                    zoneSpace.infos!![key] = mapObj[key]!!.toString()
+                                    zoneSpace.infos!![key] = mapObj[key]
                                 }
                                 "OBJECT" -> {
                                     if (zoneSpace.infos.isNullOrEmpty()){
                                         zoneSpace.infos = HashMap<String,Any?>()
                                     }
-                                    zoneSpace.infos!![key] = mapObj[key]!!.toString()
+                                    zoneSpace.infos!![key] = mapObj[key]
                                 }
                                 "ENUM" -> {
                                     if (zoneSpace.infos.isNullOrEmpty()){
                                         zoneSpace.infos = HashMap<String,Any?>()
                                     }
-                                    zoneSpace.infos!![key] = mapObj[key]!!.toString()
+                                    zoneSpace.infos!![key] = mapObj[key]
                                 }
                                 "MENUM" -> {
                                     if (zoneSpace.infos.isNullOrEmpty()){
                                         zoneSpace.infos = HashMap<String,Any?>()
                                     }
-                                    zoneSpace.infos!![key] = mapObj[key]!!.toString()
+                                    zoneSpace.infos!![key] = mapObj[key]
                                 }
                                 else -> {
                                     if (zoneSpace.infos.isNullOrEmpty()){

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

@@ -107,7 +107,7 @@ object SystemUtil {
                                     if (generalSystem.infos.isNullOrEmpty()){
                                         generalSystem.infos = HashMap<String,Any?>()
                                     }
-                                    generalSystem.infos!![key] = mapObj[key]!!.toString().toBoolean()
+                                    generalSystem.infos!![key] = mapObj[key]
                                 }
                                 "STRING" -> {
                                     if (generalSystem.infos.isNullOrEmpty()){
@@ -119,31 +119,31 @@ object SystemUtil {
                                     if (generalSystem.infos.isNullOrEmpty()){
                                         generalSystem.infos = HashMap<String,Any?>()
                                     }
-                                    generalSystem.infos!![key] = mapObj[key]!!.toString()
+                                    generalSystem.infos!![key] = mapObj[key]
                                 }
                                 "ATTACHMENT" -> {
                                     if (generalSystem.infos.isNullOrEmpty()){
                                         generalSystem.infos = HashMap<String,Any?>()
                                     }
-                                    generalSystem.infos!![key] = mapObj[key]!!.toString()
+                                    generalSystem.infos!![key] = mapObj[key]
                                 }
                                 "OBJECT" -> {
                                     if (generalSystem.infos.isNullOrEmpty()){
                                         generalSystem.infos = HashMap<String,Any?>()
                                     }
-                                    generalSystem.infos!![key] = mapObj[key]!!.toString()
+                                    generalSystem.infos!![key] = mapObj[key]
                                 }
                                 "ENUM" -> {
                                     if (generalSystem.infos.isNullOrEmpty()){
                                         generalSystem.infos = HashMap<String,Any?>()
                                     }
-                                    generalSystem.infos!![key] = mapObj[key]!!.toString()
+                                    generalSystem.infos!![key] = mapObj[key]
                                 }
                                 "MENUM" -> {
                                     if (generalSystem.infos.isNullOrEmpty()){
                                         generalSystem.infos = HashMap<String,Any?>()
                                     }
-                                    generalSystem.infos!![key] = mapObj[key]!!.toString()
+                                    generalSystem.infos!![key] = mapObj[key]
                                 }
                                 else -> {
                                     if (generalSystem.infos.isNullOrEmpty()){

Fichier diff supprimé car celui-ci est trop grand
+ 997 - 325
datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/RwdRelationAdd.kt


Fichier diff supprimé car celui-ci est trop grand
+ 1044 - 318
datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/RwdRelationDel.kt


+ 183 - 0
equip-component/src/main/kotlin/com/persagy/server/controllers/StatisticsController.kt

@@ -0,0 +1,183 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                     :*$@@%$*:                         ;:                ;;    ;;
+ *                   :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                  :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                  =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                  =@*                                  %!              @ $= % %@=   =%@!      %=
+ *             *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *           %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *         ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *         $@*   ;@@@%=!:                *@*
+ *         =@$    ;;;!=%@@@@=!           =@!
+ *          %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *           ;%@@$=$@@%*       *@@@$=%@@%;
+ *              ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+package com.persagy.server.controllers
+
+
+import com.persagy.database.SFilter
+import com.persagy.server.datacenter.models.response.EqpeDefferentReqponse
+import com.persagy.server.datacenter.models.response.StatisticsCountResponse
+import com.persagy.server.service.StatisticsService
+import com.persagy.server.service.objects.EquipmentService
+import com.persagy.server.service.objects.PropertyService
+import com.persagy.service.SPageContext
+import com.persagy.service.models.enums.SResponseType
+import com.persagy.service.models.requests.SCountRequest
+import com.persagy.service.models.responses.SCountResponse
+import com.persagy.service.models.responses.SQueryResponse
+import io.swagger.v3.oas.annotations.Operation
+import io.swagger.v3.oas.annotations.tags.Tag
+import org.slf4j.LoggerFactory
+import org.springframework.beans.factory.annotation.Autowired
+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  邓婷婷
+ */
+@Tag(name = "统计接口")
+@RestController
+@RequestMapping("/statistics")
+open class StatisticsController {
+
+    companion object {
+        // 日志
+        private val logger = LoggerFactory.getLogger(StatisticsController::class.java)
+    } // Companion object
+
+    /** 实例化  对象 */
+    @Autowired
+    lateinit var service: StatisticsService
+
+
+    /**
+     * 台账中待删除的对象
+     */
+    @Operation(summary = "台账中待删除的对象", description = "传入条件:taskState = -1")
+    @PostMapping(value = ["/object-delete-count"])
+    fun objectDeleteCount(@RequestBody request: SCountRequest): SCountResponse {
+        val withFilterList = ArrayList<SFilter>()
+        withFilterList.add(SFilter.eq("projectId", SPageContext.getHeader("projectId").toString()))
+        val countResponse1 = EquipmentService.count(request, withFilterList)
+        val countResponse2 = PropertyService.count(request, withFilterList)
+        val count = countResponse1.count + countResponse2.count
+        return SCountResponse(count)
+    } // Function objectDeleteCount()
+
+
+    /**
+     * 不能同步到物理世界的关系数据
+     */
+    @Operation(summary = "不能同步到物理世界的关系数据", description = "")
+    @PostMapping(value = ["/unsyn-relation-count"])
+    fun unSynchronizeRelationCount(): SCountResponse {
+        return service.unSynchronizeRelation()
+    } // Function unSynchronizeRelation()
+
+    /**
+     * 岗位和关联的资产信息点值不一致
+     */
+    @Operation(summary = "岗位和关联的资产信息点值不一致", description = "")
+    @PostMapping(value = ["/eq2pe-count"])
+    fun eq2peCount(): SCountResponse {
+        return service.eq2peCount()
+    } // Function uneq2pe()
+
+    /**
+     * 岗位和关联的资产信息点值不一致的数据
+     */
+    @Operation(summary = "岗位和关联的资产信息点值不一致的数据", description = "")
+    @PostMapping(value = ["/eq2pe-different"])
+    fun eq2peDifferent(): SQueryResponse<ArrayList<EqpeDefferentReqponse>> {
+        return service.eq2peDifferent()
+    } // Function uneq2pe()
+
+    /**
+     * 设备-未关联资产的设备
+     */
+    @Operation(summary = "设备-未关联资产的设备", description = "")
+    @PostMapping(value = ["/uneq2pe-count"])
+    fun uneq2pe(): SCountResponse {
+        return service.uneq2pe()
+    } // Function uneq2pe()
+
+    /**
+     * 业务空间-各分区占比
+     */
+    @Operation(summary = "业务空间-各分区占比", description = "")
+    @PostMapping(value = ["/sp-objecttype-count"])
+    fun spObjectType(): SQueryResponse<StatisticsCountResponse> {
+        return try {
+            val sQueryResponse = SQueryResponse<StatisticsCountResponse>(SResponseType.success)
+            sQueryResponse.content = service.spObjectTypeCount()
+            sQueryResponse
+        } catch (e: Exception) {
+            e.printStackTrace()
+            SQueryResponse(SResponseType.failure, e.message.toString())
+        }
+    } // Function spObjectType()
+
+    /**
+     * 业务空间-默认分区功能类型占比
+     */
+    @Operation(summary = "业务空间-默认分区功能类型占比", description = "")
+    @PostMapping(value = ["/general-sp-functype-count"])
+    fun generalSpFuncTypeCount(): SQueryResponse<StatisticsCountResponse> {
+        return try {
+            val sQueryResponse = SQueryResponse<StatisticsCountResponse>(SResponseType.success)
+            sQueryResponse.content = service.generalSpFuncTypeCount()
+            sQueryResponse
+        } catch (e: Exception) {
+            e.printStackTrace()
+            SQueryResponse(SResponseType.failure, e.message.toString())
+        }
+    } // Function generalSpFuncTypeCount()
+
+    /**
+     * 租户-关联业务空间完成度
+     */
+    @Operation(summary = "租户-关联业务空间完成度", description = "")
+    @PostMapping(value = ["/tenant2sp-count"])
+    fun tenant2SpCount(): SCountResponse {
+        return service.tenant2SpCount()
+    } // Function tenant2SpCount()
+
+    /**
+     * 竖井-关联业务空间完成度
+     */
+    @Operation(summary = "竖井-关联业务空间完成度", description = "")
+    @PostMapping(value = ["/shaft2sp-count"])
+    fun shaft2SpCount(): SCountResponse {
+        return service.shaft2SpCount()
+    } // Function shaft2SpCount()
+
+    /**
+     * 竖井-按功能类型占比
+     */
+    @Operation(summary = "竖井-按功能类型占比", description = "")
+    @PostMapping(value = ["/shaft-functype-count"])
+    fun shaftFuncTypeCount(): SQueryResponse<StatisticsCountResponse> {
+       return try {
+            val sQueryResponse = SQueryResponse<StatisticsCountResponse>(SResponseType.success)
+            sQueryResponse.content = service.shaftFuncTypeCount()
+           sQueryResponse
+        } catch (e: Exception) {
+            e.printStackTrace()
+           SQueryResponse(SResponseType.failure,e.message.toString())
+        }
+    } // Function generalSpFuncTypeCount()
+
+
+} // Class StatisticsController

+ 19 - 8
equip-component/src/main/kotlin/com/persagy/server/controllers/dict/DictCustomController.kt

@@ -27,8 +27,15 @@
 package com.persagy.server.controllers.dict
 
 
+import com.persagy.database.SFilter
+import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.Opt
 import com.persagy.server.datacenter.models.entities.dictnew.DefFuncId
+import com.persagy.server.datacenter.models.jms.SynchronousMessage
 import com.persagy.server.service.dict.DictDefClassService
+import com.persagy.service.SObjectService
+import com.persagy.service.models.requests.SCountRequest
+import com.persagy.service.models.responses.SCountResponse
 import com.persagy.service.models.responses.SQueryResponse
 import io.swagger.v3.oas.annotations.Operation
 import io.swagger.v3.oas.annotations.tags.Tag
@@ -47,6 +54,8 @@ import org.springframework.web.bind.annotation.RestController
 @RequestMapping("/dict")
 class DictCustomController {
 
+    /** 缓存对象数据服务 - 数据中心到数据中台  */
+    var synchronousMessageObjService = SObjectService(SMybatisDao(SynchronousMessage::class.java))
     /**
      * 项目化字典类型
      */
@@ -110,14 +119,16 @@ class DictCustomController {
         return DictDefClassService.queryMOrL(dictTypeList)
     }
 
-//    /**
-//     * 获取不能同步到物理世界对象的数量
-//     */
-//    @Operation(summary = "获取不能同步到物理世界对象的数量", description = "")
-//    @PostMapping(value = ["/data-count"])
-//    fun objectCounts(@RequestBody request: SCountRequest): SCountResponse {
-//        return dictTypeConversionLogService.count(request,arrayListOf(SFilter.eq("projectId", SPageContext.getHeader("projectId").toString())))
-//    }  // Function objectCounts()
+    /**
+     * 获取不能同步到物理世界对象的数量
+     */
+    @Operation(summary = "获取不能同步到物理世界对象的数量", description = "")
+    @PostMapping(value = ["/data-count"])
+    fun objectCounts(@RequestBody request: SCountRequest): SCountResponse {
+        val messageList =
+            synchronousMessageObjService.select(SFilter.eq("projectId", Opt.projectId!!),SFilter.not(SFilter.eq("sign", 2))).order("createTime").exec()
+        return SCountResponse(messageList.size.toLong())
+    }  // Function objectCounts()
 
 
 

+ 14 - 28
equip-component/src/main/kotlin/com/persagy/server/dao/mappers/CustomSql.kt

@@ -64,30 +64,23 @@ interface CustomSql {
     //设备 统计信息点与总数据占比
 
     /** 动态信息点总数 */
-    @Select("select count(*) from dict.property_def_control_info where length(type) = 4 and datatype in " +
-            "(select datatype from dict.property_def where datatype like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc')")
+    @Select("select count(*) from dict.property_def_control_info where length(type) = 4 and datatype in (select datatype from dict.property_def where datatype like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc')")
     fun dynamicInfoPointCounts(): Int
 
     /** 项目下所有动态信息点编码 */
-    @Select("select info_point_code,type from dict.property_def_control_info where type in" +
-            " (select category from public.equipment where project_id= #{projectId} GROUP BY category) and datatype in " +
-            "(select datatype from dict.property_def_control_info where datatype like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc')")
+    @Select("select code AS info_point_code,class_code AS type from dict.def_funcid where class_code in (select class_code from public.equipment where project_id= #{projectId} GROUP BY class_code) and category !='STATIC'")
     fun dynamicInfoPointCodes(projectId: String): ArrayList<HashMap<String,String>>
 
     /** 静态信息点总数 */
-    @Select("select count(*) from dict.property_def_control_info where length(type) = 4 and datatype not in " +
-            "(select datatype from dict.property_def_control_info where datatype like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc')")
+    @Select("select count(*) from dict.def_funcid where project_id = #{projectId} AND length('class_code') = 6 and category ='STATIC'")
     fun staticInfoPointCounts(): Int
 
     /** 项目下所有静态信息点编码 */
-    @Select("select info_point_code,type from dict.property_def_control_info where type in(select category" +
-            " from public.equipment where project_id= #{projectId} GROUP BY category) and datatype not in " +
-            "(select datatype from dict.property_def where datatype like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc')")
+    @Select("select code AS info_point_code,class_code AS type from dict.def_funcid where class_code in(select class_code from public.equipment where project_id= #{projectId} GROUP BY class_code) and category ='STATIC'")
     fun staticInfoPointCodes(projectId: String): ArrayList<HashMap<String,String>>
 
     /** 项目下所有的设备 */
-    @Select("select id,name,local_id,local_name,qr_code,cad_id,bim_id,bim_location,category,ledger_param,comm_param,tech_param," +
-            "run_param,setting_param,alram,tech_param_general,run_param_general,equip_serial,family_name,family_symbol,custom_param from public.equipment where project_id=#{projectId}")
+    @Select("select id,name,local_id,local_name,cad_id,bim_id,bim_location,class_code,infos,equip_serial,family_name,family_symbol from public.equipment where project_id=#{projectId}")
     fun projectEquipment(projectId: String):ArrayList<HashMap<String,Any>>
 
     /** 项目中自定义信息点总数 */
@@ -104,20 +97,16 @@ interface CustomSql {
     //设备 统计信息点与需采集数据占比
 
     /** 设备 数字字典信息点总数 */
-    @Select("select count(*) from dict.property_def_control_info where length(type) = 4")
-    fun controlInfoCounts():Int
+    @Select("select count(*) from dict.def_funcid where project_id = #{projectId} AND length(class_code) = 6")
+    fun controlInfoCounts(projectId: String):Int
 
     /** 项目下所有已采集的动态信息点编码 */
-    @Select("select info_point_code,type from dict.property_def_control_info where type" +
-            " in(select category from public.equipment where project_id= #{projectId} GROUP BY category) and datatype in" +
-            " (select datatype from dict.property_def_control_info where datatype like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc') and visible=TRUE")
+    @Select("select code AS info_point_code, class_code AS type from dict.def_funcid_project where class_code in(select class_code from public.equipment where project_id= #{projectId} GROUP BY class_code) and category !='STATIC' and visible=TRUE")
     fun gatherDynamicInfoCode(projectId: String): ArrayList<HashMap<String,String>>
 
 
     /** 项目下所有已采集静态信息点编码 */
-    @Select("select info_point_code,type from dict.property_def_control_info where type in(select category" +
-            " from public.equipment where project_id= #{projectId} GROUP BY category) and datatype not in " +
-            "(select datatype from dict.property_def_control_info where datatype like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc') and visible=TRUE")
+    @Select("select code AS info_point_code, class_code AS type from dict.def_funcid_project where class_code in(select class_code from public.equipment where project_id= #{projectId} GROUP BY class_code) and category ='STATIC' and visible=TRUE")
     fun gatherStaticInfoCode(projectId: String): ArrayList<HashMap<String,String>>
 
     /** 项目下所有已采集自定义信息点编码*/
@@ -128,8 +117,8 @@ interface CustomSql {
     //系统 统计信息点与需采集数据占比
 
     /** 系统  数字字典信息点总数 */
-    @Select("select count(*) from dict.property_def where length(type)=2 and type not in ('WS','WE','SP','SE','OT','FF','CF','AC')")
-    fun systemControlInfoCounts():Int
+    @Select("select count(*) from dict.def_funcid where project_id = #{projectId} AND length(class_code)= 4 ")
+    fun systemControlInfoCounts(projectId: String):Int
 
     /** 系统 项目下自定义信息点总数 */
     @Select("select count(*) from dict.data_platform_scheme_info where length(type)=2 and" +
@@ -137,14 +126,11 @@ interface CustomSql {
     fun systemCustomInfoCounts(projectId: String): Int
 
     /** 系统  已采集动态信息点编码 */
-    @Select("select info_point_code,type from dict.property_def where (length(type)=2 or type='GeneralSystem') and type not in" +
-            " ('WS','WE','SP','SE','OT','FF','CF','AC') and datatype in (select datatype from dict.property_def where datatype" +
-            " like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc') and visible=TRUE")
+    @Select("select code AS info_point_code,class_code AS type from dict.def_funcid where  project_id = #{projectId} AND (length(class_code)=4)  and category !='STATIC' and visible=TRUE")
     fun systemDynamicInfoCode():ArrayList<HashMap<String,String>>
 
     /** 系统 已采集静态信息点编码 */
-    @Select("select info_point_code,type from dict.property_def where (length(type)=2 or type='GeneralSystem') and type not in ('WS','WE','SP','SE','OT','FF','CF','AC') and datatype not in" +
-            " (select datatype from dict.property_def where datatype like '%v' or datatype like '%p' or datatype = 'Inst' or datatype = 'Acc') and visible=TRUE")
+    @Select("select code AS info_point_code,class_code AS type from dict.def_funcid where  project_id = #{projectId} AND (length(class_code)=4)  and category ='STATIC' and visible=TRUE")
     fun systemStaticInfoCode():ArrayList<HashMap<String,String>>
 
     /** 系统 已采集自定义信息点编码 */
@@ -153,7 +139,7 @@ interface CustomSql {
     fun systemCustomInfoCode(projectId: String):ArrayList<HashMap<String,String>>
 
     /** 项目下所有系统 */
-    @Select("select id,name,local_id,local_name,cad_id,bim_id,setting_param,tech_param,run_param,custom_param,category from public.general_system where project_id=#{projectId}")
+    @Select("select id,name,local_id,local_name,cad_id,bim_id,infos,class_code from public.general_system where project_id=#{projectId}")
     fun projectSystem(projectId: String):ArrayList<HashMap<String,Any>>
 
 

+ 159 - 0
equip-component/src/main/kotlin/com/persagy/server/dao/mappers/StatisticsCountMapper.kt

@@ -0,0 +1,159 @@
+package com.persagy.server.dao.mappers
+
+
+import com.persagy.server.datacenter.models.entities.task.CategoryStatistics
+import com.persagy.server.datacenter.models.entities.task.EquipmentTaskTwo
+import com.persagy.server.datacenter.models.response.StatisticsCountResponse
+import org.apache.ibatis.annotations.Mapper
+import org.apache.ibatis.annotations.Select
+import org.springframework.stereotype.Repository
+
+/**
+ * 统计
+ *
+ * @author 邓婷婷
+ */
+@Mapper
+@Repository
+interface StatisticsCountMapper {
+
+
+    /**
+     * 竖井-楼层  不能同步到物理世界的关系数量
+     */
+    @Select(" select COALESCE(sum(num),0) from " +
+            "(select count(distinct shaft_id) num from r_sh_in_fl  where project_id = #{projectId} group by shaft_id HAVING count(floor_id)>1) a")
+    fun sh2flCount(projectId: String): Long
+
+    /**
+     * 竖井-建筑  不能同步到物理世界的关系数量
+     */
+    @Select(" select COALESCE(sum(num),0) from " +
+            "(select count(distinct shaft_id) num from r_sh_in_bd  where project_id = #{projectId} and shaft_id not in " +
+            "(select shaft_id from r_sh_in_fl  where project_id = #{projectId} group by shaft_id HAVING count(floor_id)>1) group by shaft_id HAVING count(building_id)>1) a")
+    fun sh2bdCount(projectId: String): Long
+
+
+    /**
+     * 系统-楼层  不能同步到物理世界的关系数量
+     */
+    @Select(" select COALESCE(sum(num),0) from " +
+            "(select count(distinct sys_id) num from r_sy_in_fl  where project_id = #{projectId} group by sys_id HAVING count(floor_id)>1) a ")
+    fun sy2flCount(projectId: String): Long
+
+    /**
+     * 系统-建筑  不能同步到物理世界的关系数量
+     */
+    @Select(" select COALESCE(sum(num),0) from " +
+            "(select count(distinct sys_id) num from r_sy_in_bd  where project_id = #{projectId} and sys_id not in " +
+            "(select sys_id from r_sy_in_fl  where project_id = #{projectId} group by sys_id HAVING count(floor_id)>1) group by sys_id HAVING count(building_id)>1) a")
+    fun sy2bdCount(projectId: String): Long
+
+
+    /**
+     * 岗位和关联的资产信息点值不一致
+     */
+    @Select(" select count(p.id) from " +
+            "property p,equipment e where " +
+            "p.equip_id = e.id  and p.project_id = #{projectId} and " +
+            "(COALESCE(p.name,'') != COALESCE(e.name,'')  or COALESCE(p.local_id,'') != COALESCE(e.local_id,'')  or COALESCE(p.local_name,'') != COALESCE(e.local_name,'') or " +
+            "COALESCE(p.qr_code,'') != COALESCE(e.qr_code,'') or COALESCE(p.cad_id,'') != COALESCE(e.cad_id,'') or COALESCE(p.bim_id,'') != COALESCE(e.bim_id,'') or " +
+            "COALESCE(p.bim_location,'') != COALESCE(e.bim_location,'') or COALESCE(p.building_id,'') != COALESCE(e.building_id,'') or " +
+            "COALESCE(p.floor_id,'') != COALESCE(e.floor_id,'') or COALESCE(p.ledger_param ::text,'') != COALESCE(e.ledger_param ::text,'') or COALESCE(p.comm_param ::text,'') != COALESCE(e.comm_param ::text,'') or " +
+            "COALESCE(p.tech_param ::text,'') != COALESCE(e.tech_param ::text,'') or COALESCE(p.run_param ::text,'') != COALESCE(e.run_param ::text,'') or COALESCE(p.setting_param ::text,'') != COALESCE(e.setting_param ::text,'') or " +
+            "COALESCE(p.alram ::text,'') != COALESCE(e.alram ::text,'') or COALESCE(p.custom_param ::text,'') != COALESCE(e.custom_param ::text,'') or COALESCE(p.dp_manufacturer_id,'') != COALESCE(e.dp_manufacturer_id,'') or " +
+            "COALESCE(p.dp_supplier_id,'') != COALESCE(e.dp_supplier_id,'') or COALESCE(p.dp_maintainer_id,'') != COALESCE(e.dp_maintainer_id,'') or COALESCE(p.dp_insurer_id,'') != COALESCE(e.dp_insurer_id,'') or " +
+            "COALESCE(p.temp_sensor ::text,'') != COALESCE(e.temp_sensor ::text,'') or COALESCE(p.tech_param_general ::text,'') != COALESCE(e.tech_param_general ::text,'') or " +
+            "COALESCE(p.run_param_general ::text,'') != COALESCE(e.run_param_general ::text,'') or COALESCE(p.speed_sensor ::text,'') != COALESCE(e.speed_sensor ::text,'') or " +
+            "COALESCE(p.sound_sensor ::text,'') != COALESCE(e.sound_sensor ::text,'') or COALESCE(p.humidity_sensor ::text,'') != COALESCE(e.humidity_sensor ::text,'') or " +
+            "COALESCE(p.press_transd ::text,'') != COALESCE(e.press_transd ::text,'') or COALESCE(p.heat_sensor ::text,'') != COALESCE(e.heat_sensor ::text,'') or COALESCE(p.flow_sensor ::text,'') != COALESCE(e.flow_sensor ::text,'') or " +
+            "COALESCE(p.electricity_sensor ::text,'') != COALESCE(e.electricity_sensor ::text,'') or COALESCE(p.displ_sensor ::text,'') != COALESCE(e.displ_sensor ::text,'') or " +
+            "COALESCE(p.concent_sensor ::text,'') != COALESCE(e.concent_sensor ::text,'') or COALESCE(p.image_sensor ::text,'') != COALESCE(e.image_sensor ::text,'') or " +
+            "COALESCE(p.feedback_param ::text,'') != COALESCE(e.feedback_param ::text,'') or COALESCE(p.man_flow_sensor ::text,'') != COALESCE(e.man_flow_sensor ::text,'') or " +
+            "COALESCE(p.dp_specification_id,'') != COALESCE(e.dp_specification_id,'') or COALESCE(p.dp_brand_id,'') != COALESCE(e.dp_brand_id,'') or COALESCE(p.equip_serial,0) != COALESCE(e.equip_serial,0))")
+    fun eq2peCount(projectId: String): Long
+
+
+    /**
+     * 岗位和关联的资产信息点值不一致数据
+     */
+    @Select("select p.name,p.local_id,p.local_name,p.qr_code,p.cad_id,p.bim_id,p.bim_location,p.ledger_param,p.comm_param,p.tech_param,p.run_param," +
+            "p.setting_param,p.alram,p.custom_param,p.dp_manufacturer_id,p.dp_supplier_id,p.dp_maintainer_id,p.dp_insurer_id,p.temp_sensor,p.tech_param_general," +
+            "p.run_param_general,p.speed_sensor,p.sound_sensor,p.humidity_sensor,p.press_transd,p.heat_sensor,p.flow_sensor,p.electricity_sensor,p.displ_sensor," +
+            "p.concent_sensor,p.image_sensor,p.feedback_param,p.man_flow_sensor,p.dp_specification_id,p.dp_brand_id,p.equip_serial,e.name as _name," +
+            "e.local_id as _local_id,e.local_name as _local_name,e.qr_code as _qr_code,e.cad_id as _cad_id,e.bim_id as _bim_id,e.bim_location as _bim_location," +
+            "e.ledger_param as _ledger_param,e.comm_param as _comm_param,e.tech_param as _tech_param,e.run_param as _run_param,e.setting_param as _setting_param," +
+            "e.alram as _alram,e.custom_param as _custom_param,e.dp_manufacturer_id as _dp_manufactuer_id,e.dp_supplier_id as _dp_supplier_id,e.dp_maintainer_id as _dp_maintainer_id," +
+            "e.dp_insurer_id as _dp_insurer_id,e.temp_sensor as _temp_sensor,e.tech_param_general as _tech_param_general,e.run_param_general as _run_param_general," +
+            "e.speed_sensor as _speed_sensor,e.sound_sensor as _sound_sensor,e.humidity_sensor as _humidity_sensor,e.press_transd as _press_transd,e.heat_sensor as _heat_sensor," +
+            "e.flow_sensor as _flow_sensor,e.electricity_sensor as _electricity_sensor,e.displ_sensor as _displ_sensor,e.concent_sensor as _concent_sensor," +
+            "e.image_sensor as _image_sensor,e.feedback_param as _feedback_param,e.man_flow_sensor as _man_flow_sensor,e.dp_specification_id as _dp_specification_id," +
+            "e.dp_brand_id as _dp_brand_id,e.equip_serial as _equip_serial from property p,equipment e where p.equip_id = e.id  and p.project_id =#{projectId}")
+    fun eq2peDifferent(projectId: String): ArrayList<HashMap<String,Any>>
+
+
+
+
+    /**
+     * 设备-未关联资产的设备
+     */
+    @Select("select count(id) from equipment where id not in (select equip_id from property where equip_id is not null and project_id = #{projectId}) and project_id = #{projectId}")
+    fun uneq2peCount(projectId: String): Long
+
+
+    /**
+     * 业务空间-各分区占比
+     */
+    @Select("select object_type as name,count(id) as count from zone_space_base where object_type is not null and project_id = #{projectId} group by object_type")
+    fun spObjectTypeCount(projectId: String): ArrayList<StatisticsCountResponse>
+
+    /**
+     * 业务空间-默认分区功能类型占比
+     */
+    @Select("select func_type as name , count(id) as count from zone_space_base where func_type is not null and project_id = #{projectId}  AND object_type = 'GeneralZone' group by func_type")
+    fun generalSpFuncTypeCount(projectId: String): ArrayList<StatisticsCountResponse>
+
+    /**
+     * 租户-关联业务空间完成度
+     */
+    @Select("select count(distinct tn_id) from relationship.r_tn2sp where project_id = #{projectId} and type = 'tn2sp'")
+    fun tenant2SpCount(projectId: String): Long
+
+    /**
+     * 竖井-关联业务空间完成度
+     */
+    @Select("select count(distinct sh_id) from relationship.r_sh2sp where project_id = #{projectId} and type = 'sh2sp'")
+    fun shaft2SpCount(projectId: String): Long
+
+    /**
+     * 竖井-按功能类型占比
+     */
+    @Select("select infos#>>'{ShaftFuncType}' as name ,count(id) as count  from shaft where  project_id = #{projectId} AND NOT infos#>>'{ShaftFuncType}' is null GROUP BY infos#>>'{ShaftFuncType}'")
+    fun shaftFuncTypeCount(projectId: String): ArrayList<StatisticsCountResponse>
+
+    /**
+     * 统计设备任务下的部件类型以及数量
+     */
+    @Select("SELECT category as code,(SELECT name FROM dict.class_def WHERE id = category) as name, COUNT(category) FROM scantask.equip_scan_task WHERE task_parent_id = #{id} AND parent_id = #{equipId} GROUP BY category")
+    fun categoryStatistics(id: String,equipId: String): ArrayList<CategoryStatistics>
+
+    /**
+     * 统计模型设备部件类型以及数量
+     */
+    @Select("SELECT category as code,(SELECT name FROM dict.class_def WHERE id = category) as name, COUNT(category) FROM scantask.model_scan_task WHERE task_parent_id = #{id} AND parent_id = #{equipId} GROUP BY category")
+    fun categoryStatisticsModel(id: String,equipId: String): ArrayList<CategoryStatistics>
+
+    /**
+     * 查询 当前模型文件下指定元空间内的设备
+     */
+    @Select("SELECT id,name,local_id,local_name,cad_id,bim_id,category FROM equipment e WHERE project_id = #{projectId} AND bim_location  IS NOT null  AND model_id = #{modelId} AND is_point_in_polygon_v2_str(split_part(e.bim_location, E',', 1) , split_part(e.bim_location, E',', 2) , (SELECT outline FROM zone_ispace WHERE project_id= #{projectId} AND bim_id = #{bimId})) AND (e.task_state IS null OR e.task_state = 0 OR task_state = -1) ORDER BY create_time , e.id")
+    fun equipInISpace(projectId: String,modelId: String,bimId: String): ArrayList<EquipmentTaskTwo>
+
+    /**
+     * 查询 当前模型文件下指定元空间内的设备
+     */
+    @Select("SELECT id,name,local_id,local_name,cad_id,bim_id,category FROM equipment e WHERE project_id = #{projectId} AND bim_location  IS NOT null AND category = #{category} AND model_id = #{modelId} AND is_point_in_polygon_v2_str(split_part(e.bim_location, E',', 1) , split_part(e.bim_location, E',', 2) , (SELECT outline FROM zone_ispace WHERE project_id= #{projectId} AND bim_id = #{bimId})) AND (e.task_state IS null OR e.task_state = 0 OR task_state = -1) ORDER BY create_time , e.id")
+    fun equipInISpaceTwo(projectId: String,modelId: String,bimId: String,category: String): ArrayList<EquipmentTaskTwo>
+
+
+} // Interface StatisticsCountMapper

+ 1 - 2
equip-component/src/main/kotlin/com/persagy/server/models/ComponentProperty.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.models
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -88,7 +87,7 @@ class ComponentProperty : BaseInfo(){
 
     /** 部件类型code */
     @Schema(description = "部件类型code")
-    @Column(name = "category")
+    @Column(name = "class_code")
     var category: String? = null
 
     /** 部件所在建筑id */

+ 3 - 5
equip-component/src/main/kotlin/com/persagy/server/models/EquipCompon.kt

@@ -39,20 +39,18 @@ class EquipCompon : Serializable {
 
     /** 编码 */
     @Schema(description = "编码")
-    @Column(name = "id")
-    @JSONField(name = "Code")
-    var id : String? = null
+    @Column(name = "code")
+    @JSONField(name = "code")
+    var code : String? = null
 
     /** 名称 */
     @Schema(description = "名称")
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name : String? = null
 
     /** 数量 */
     @Schema(description = "数量")
     @Column(name = "count")
-    @JSONField(name = "Count")
     var count : Long? = null
 
 } // Class EquipCompon

+ 2 - 2
equip-component/src/main/kotlin/com/persagy/server/models/mappers/REquipComponMapper.kt

@@ -40,7 +40,7 @@ import org.springframework.stereotype.Repository
 @Repository
 interface REquipComponMapper {
     /** 统计项目下允许创建的部件类型,以及项目下创建的部件数量 */
-    @Select("SELECT code,name,(select count(1) from public.equipment where parent_id = #{projectId} AND class_code = code) FROM dict.def_class WHERE group_code = (SELECT group_code FROM dict.project WHERE id = #{projectId}) AND equipment_code = #{category} AND project_id = #{projectId}")
-    fun getEquipCompon(projectId: String,category: String): List<EquipCompon>
+    @Select("SELECT code,name,(select count('class_code') from public.equipment where parent_id = #{id} AND class_code = code GROUP BY class_code ) FROM dict.def_class WHERE  equipment_code = #{category} AND project_id = #{projectId}")
+    fun getEquipCompon(projectId: String,id:String,category: String): List<EquipCompon>
 
 }

+ 112 - 117
equip-component/src/main/kotlin/com/persagy/server/service/CustomSqlService.kt

@@ -103,7 +103,7 @@ class CustomSqlService {
         return try {
             val projectId =  SPageContext.getHeader("projectId").toString()
             //项目中所有自定义信息点编码
-            var projectCustomInforPoints=mapper.projectCustomInforPoints(projectId!!)
+//            var projectCustomInforPoints=mapper.projectCustomInforPoints(projectId!!)
             //项目下所有动态信息点编码
             var dynamicInfoPointCodes=mapper.dynamicInfoPointCodes(projectId!!)
             //项目下所有静态信息点编码
@@ -111,12 +111,12 @@ class CustomSqlService {
             //项目下所有的设备
             val projectEquipment =mapper.projectEquipment(projectId!!)
 
-            var hashMap=calculate(dynamicInfoPointCodes,staticInfoPointCodes,projectCustomInforPoints,projectEquipment,0)
+            var hashMap=calculate(dynamicInfoPointCodes,staticInfoPointCodes,projectEquipment,0)
 
             var infoPoint = InfoPoint()
-          infoPoint.customInfoPointCounts=mapper.customInfoPointCounts(projectId!!)
+//          infoPoint.customInfoPointCounts=mapper.customInfoPointCounts(projectId!!)
           infoPoint.customInfoPoint=hashMap["customInfoPoint"]
-          infoPoint.dynamicInfoPointCounts=mapper.dynamicInfoPointCounts()
+//          infoPoint.dynamicInfoPointCounts=mapper.dynamicInfoPointCounts()
           infoPoint.dynamicInfoPoint=hashMap["dynamicInfoPoint"]
           infoPoint.staticInfoPointCounts=mapper.staticInfoPointCounts()
           infoPoint.staticInfoPoint=hashMap["staticInfoPoint"]
@@ -138,13 +138,13 @@ class CustomSqlService {
     fun gatherInfoPoints(): SQueryResponse<GatherInfoPoint> {
         return try {
             val projectId =  SPageContext.getHeader("projectId").toString()
-            //自定义信息点
-            var customInfoPointCounts=mapper.customInfoPointCounts(projectId)
+//            //自定义信息点
+//            var customInfoPointCounts=mapper.customInfoPointCounts(projectId)
             //数字字典信息点总数
-            var controlInfoCounts=mapper.controlInfoCounts()
+            var controlInfoCounts=mapper.controlInfoCounts(projectId)
 
             //项目下所有已采集自定义信息点编码
-            var gatherCustomInforPointCode=mapper.gatherCustomInforPointCode(projectId)
+//            var gatherCustomInforPointCode=mapper.gatherCustomInforPointCode(projectId)
             //项目下所有已采集的动态信息点编码
             var gatherDynamicInfoCode=mapper.gatherDynamicInfoCode(projectId)
             //项目下所有已采集静态信息点编码
@@ -153,10 +153,10 @@ class CustomSqlService {
             //项目下所有的设备
             var projectEquipment=mapper.projectEquipment(projectId)
 
-            var hashMap=calculate(gatherDynamicInfoCode,gatherStaticInfoCode,gatherCustomInforPointCode,projectEquipment,0)
-
+            var hashMap=calculate(gatherDynamicInfoCode,gatherStaticInfoCode,projectEquipment,0)
+//
             var gatherInfoPoint=GatherInfoPoint()
-            gatherInfoPoint.gatherInfoPointCounts=customInfoPointCounts+controlInfoCounts
+            gatherInfoPoint.gatherInfoPointCounts=controlInfoCounts
             gatherInfoPoint.gatherCustomInfoPointCounts=hashMap["customInfoPoint"]
             gatherInfoPoint.gatherDynamicInfoPointCounts=hashMap["dynamicInfoPoint"]
             gatherInfoPoint.gatherStaticInfoPointCounts=hashMap["staticInfoPoint"]
@@ -180,23 +180,23 @@ class CustomSqlService {
         return try {
             val projectId =  SPageContext.getHeader("projectId").toString()
             //系统  数字字典信息点总数
-            var systemControlInfoCounts=mapper.systemControlInfoCounts()
-            //系统 项目下自定义信息点总数
-            var systemCustomInfoCounts=mapper.systemCustomInfoCounts(projectId)
+            var systemControlInfoCounts=mapper.systemControlInfoCounts(projectId)
+//            //系统 项目下自定义信息点总数
+//            var systemCustomInfoCounts=mapper.systemCustomInfoCounts(projectId)
 
             //系统  已采集动态信息点编码
             var systemDynamicInfoCode=mapper.systemDynamicInfoCode()
             //系统 已采集静态信息点编码
             var systemStaticInfoCode=mapper.systemStaticInfoCode()
             //系统 已采集自定义信息点编码
-            var systemCustomInfoCode=mapper.systemCustomInfoCode(projectId)
+//            var systemCustomInfoCode=mapper.systemCustomInfoCode(projectId)
             //项目下所有的系统
             var projectSystem=mapper.projectSystem(projectId)
 
-            var hashMap=calculate(systemDynamicInfoCode,systemStaticInfoCode,systemCustomInfoCode,projectSystem,1)
+            var hashMap=calculate(systemDynamicInfoCode,systemStaticInfoCode,projectSystem,1)
 
             var gatherInfoPoint=GatherInfoPoint()
-            gatherInfoPoint.gatherInfoPointCounts=systemControlInfoCounts+systemCustomInfoCounts
+            gatherInfoPoint.gatherInfoPointCounts=systemControlInfoCounts
             gatherInfoPoint.gatherCustomInfoPointCounts=hashMap["customInfoPoint"]
             gatherInfoPoint.gatherDynamicInfoPointCounts=hashMap["dynamicInfoPoint"]
             gatherInfoPoint.gatherStaticInfoPointCounts=hashMap["staticInfoPoint"]
@@ -236,7 +236,7 @@ class CustomSqlService {
     /**
      * 计算动态、静态信息点
      */
-    fun calculate(dynamicInfoPointCodes:ArrayList<HashMap<String,String>>,staticInfoPointCodes:ArrayList<HashMap<String,String>>,customInfoPointCodes:ArrayList<HashMap<String,String>>,projectEquipment:ArrayList<HashMap<String,Any>>,num:Int):HashMap<String,Int> {
+    fun calculate(dynamicInfoPointCodes:ArrayList<HashMap<String,String>>,staticInfoPointCodes:ArrayList<HashMap<String,String>>,projectEquipment:ArrayList<HashMap<String,Any>>,num:Int):HashMap<String,Int> {
         var hashMap = HashMap<String, Int>()
         var dynamicInfoPoint = 0
         var staticInfoPoint = 0
@@ -245,71 +245,71 @@ class CustomSqlService {
         for (equipmentInforPoint in projectEquipment) {
             while (iterator1.hasNext()) {
                 val next = iterator1.next()
-                if (equipmentInforPoint["id"] != null && "EquipID" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
-                    staticInfoPoint++
-                    iterator1.remove()
-                }
-                if (equipmentInforPoint["id"] != null && "SysID" == next["info_point_code"] && "GeneralSystem" == next["type"]) {
-                    staticInfoPoint++
-                    iterator1.remove()
-                }
-                if (equipmentInforPoint["name"] != null && "EquipName" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
-                    staticInfoPoint++
-                    iterator1.remove()
-                }
-                if (equipmentInforPoint["name"] != null && "SysName" == next["info_point_code"]) {
-                    staticInfoPoint++
-                    iterator1.remove()
-                }
-                if (equipmentInforPoint["local_id"] != null && "EquipLocalID" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
-                    staticInfoPoint++
-                    iterator1.remove()
-                }
-                if (equipmentInforPoint["local_id"] != null && "SysLocalID" == next["info_point_code"]) {
+                if (equipmentInforPoint["id"] != null && "id" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["local_name"] != null && "EquipLocalName" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
+//                if (equipmentInforPoint["id"] != null && "id" == next["info_point_code"] && "GeneralSystem" == next["type"]) {
+//                    staticInfoPoint++
+//                    iterator1.remove()
+//                }
+                if (equipmentInforPoint["name"] != null && "name" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["local_name"] != null && "SysLocalName" == next["info_point_code"]) {
+//                if (equipmentInforPoint["name"] != null && "name" == next["info_point_code"]) {
+//                    staticInfoPoint++
+//                    iterator1.remove()
+//                }
+                if (equipmentInforPoint["local_id"] != null && "localId" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["qr_code"] != null && "EquipQRCode" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
+//                if (equipmentInforPoint["local_id"] != null && "localId" == next["info_point_code"]) {
+//                    staticInfoPoint++
+//                    iterator1.remove()
+//                }
+                if (equipmentInforPoint["local_name"] != null && "localName" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["cad_id"] != null && "CADID" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"] && num==0) {
+//                if (equipmentInforPoint["local_name"] != null && "localName" == next["info_point_code"]) {
+//                    staticInfoPoint++
+//                    iterator1.remove()
+//                }
+                if (equipmentInforPoint["qr_code"] != null && "qRCode" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["cad_id"] != null && "CADID" == next["info_point_code"] && num==1) {
+                if (equipmentInforPoint["cad_id"] != null && "cADID" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"] && num==0) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["bim_id"] != null && "BIMID" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"] && num==0) {
+//                if (equipmentInforPoint["cad_id"] != null && "cADID" == next["info_point_code"] && num==1) {
+//                    staticInfoPoint++
+//                    iterator1.remove()
+//                }
+                if (equipmentInforPoint["bim_id"] != null && "bimId" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"] && num==0) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["bim_id"] != null && "BIMID" == next["info_point_code"] && num==1) {
+//                if (equipmentInforPoint["bim_id"] != null && "bimId" == next["info_point_code"] && num==1) {
+//                    staticInfoPoint++
+//                    iterator1.remove()
+//                }
+                if (equipmentInforPoint["bim_location"] != null && "bimLocation" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["bim_location"] != null && "BIMLocation" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
+                if (equipmentInforPoint["equip_serial"] != null && "equipSerial" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["equip_serial"] != null && "EquipSerial" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
+                if (equipmentInforPoint["family_name"] != null && "bimFamilyName" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
-                if (equipmentInforPoint["family_name"] != null && "BIMFamilyName" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
-                    staticInfoPoint++
-                    iterator1.remove()
-                }
-                if (equipmentInforPoint["family_symbol"] != null && "BIMFamilySymbol" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
+                if (equipmentInforPoint["family_symbol"] != null && "bimFamilySymbol" == next["info_point_code"] && equipmentInforPoint["class_code"] == next["type"]) {
                     staticInfoPoint++
                     iterator1.remove()
                 }
@@ -317,75 +317,70 @@ class CustomSqlService {
         }
 
         for (equipmentInforPoint in projectEquipment) {
-            if (equipmentInforPoint["ledger_param"] != null) {
-                var dynamic=calculateInfoPoints(equipmentInforPoint["ledger_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
-                var static=calculateInfoPoints(equipmentInforPoint["ledger_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
-                dynamicInfoPoint += dynamic["counts"] as Int
-                staticInfoPoint +=dynamic["counts"] as Int
-                dynamicInfoPointCodes.remove(dynamic["next"])
-                staticInfoPointCodes.remove(static["next"])
-            }
-            if (equipmentInforPoint["comm_param"] != null) {
-                var dynamic=calculateInfoPoints(equipmentInforPoint["comm_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
-                var static=calculateInfoPoints(equipmentInforPoint["comm_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
+            if (equipmentInforPoint["infos"] != null) {
+                var dynamic=calculateInfoPoints(equipmentInforPoint["infos"].toString(), equipmentInforPoint["class_code"].toString(), dynamicInfoPointCodes)
+                var static=calculateInfoPoints(equipmentInforPoint["infos"].toString(), equipmentInforPoint["class_code"].toString(), staticInfoPointCodes)
                 dynamicInfoPoint += dynamic["counts"] as Int
                 staticInfoPoint +=dynamic["counts"] as Int
                 dynamicInfoPointCodes.remove(dynamic["next"])
                 staticInfoPointCodes.remove(static["next"])
             }
-            if (equipmentInforPoint["tech_param"] != null) {
-                var dynamic=calculateInfoPoints(equipmentInforPoint["tech_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
-                var static=calculateInfoPoints(equipmentInforPoint["tech_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
-                dynamicInfoPoint += dynamic["counts"] as Int
-                staticInfoPoint +=dynamic["counts"] as Int
-                dynamicInfoPointCodes.remove(dynamic["next"])
-                staticInfoPointCodes.remove(static["next"])
-            }
-            if (equipmentInforPoint["run_param"] != null) {
-                var dynamic=calculateInfoPoints(equipmentInforPoint["run_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
-                var static=calculateInfoPoints(equipmentInforPoint["run_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
-                dynamicInfoPoint += dynamic["counts"] as Int
-                staticInfoPoint +=dynamic["counts"] as Int
-                dynamicInfoPointCodes.remove(dynamic["next"])
-                staticInfoPointCodes.remove(static["next"])
-            }
-            if (equipmentInforPoint["setting_param"] != null) {
-                var dynamic=calculateInfoPoints(equipmentInforPoint["setting_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
-                var static=calculateInfoPoints(equipmentInforPoint["setting_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
-                dynamicInfoPoint += dynamic["counts"] as Int
-                staticInfoPoint +=dynamic["counts"] as Int
-                dynamicInfoPointCodes.remove(dynamic["next"])
-                staticInfoPointCodes.remove(static["next"])
-            }
-            if (equipmentInforPoint["alram"] != null) {
-                var dynamic=calculateInfoPoints(equipmentInforPoint["alram"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
-                var static=calculateInfoPoints(equipmentInforPoint["alram"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
-                dynamicInfoPoint += dynamic["counts"] as Int
-                staticInfoPoint +=dynamic["counts"] as Int
-                dynamicInfoPointCodes.remove(dynamic["next"])
-                staticInfoPointCodes.remove(static["next"])
-            }
-            if (equipmentInforPoint["tech_param_general"] != null) {
-                var dynamic=calculateInfoPoints(equipmentInforPoint["tech_param_general"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
-                var static=calculateInfoPoints(equipmentInforPoint["tech_param_general"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
-                dynamicInfoPoint += dynamic["counts"] as Int
-                staticInfoPoint +=dynamic["counts"] as Int
-                dynamicInfoPointCodes.remove(dynamic["next"])
-                staticInfoPointCodes.remove(static["next"])
-            }
-            if (equipmentInforPoint["run_param_general"] != null) {
-                var dynamic=calculateInfoPoints(equipmentInforPoint["run_param_general"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
-                var static=calculateInfoPoints(equipmentInforPoint["run_param_general"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
-                dynamicInfoPoint += dynamic["counts"] as Int
-                staticInfoPoint +=dynamic["counts"] as Int
-                dynamicInfoPointCodes.remove(dynamic["next"])
-                staticInfoPointCodes.remove(static["next"])
-            }
-            if (equipmentInforPoint["custom_param"]!=null){
-                var custom=calculateInfoPoints(equipmentInforPoint["custom_param"].toString(),equipmentInforPoint["category"].toString(),customInfoPointCodes)
-                customInfoPoint+=custom["counts"] as Int
-                customInfoPointCodes.remove(custom["next"])
-            }
+//            if (equipmentInforPoint["comm_param"] != null) {
+//                var dynamic=calculateInfoPoints(equipmentInforPoint["comm_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
+//                var static=calculateInfoPoints(equipmentInforPoint["comm_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
+//                dynamicInfoPoint += dynamic["counts"] as Int
+//                staticInfoPoint +=dynamic["counts"] as Int
+//                dynamicInfoPointCodes.remove(dynamic["next"])
+//                staticInfoPointCodes.remove(static["next"])
+//            }
+//            if (equipmentInforPoint["tech_param"] != null) {
+//                var dynamic=calculateInfoPoints(equipmentInforPoint["tech_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
+//                var static=calculateInfoPoints(equipmentInforPoint["tech_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
+//                dynamicInfoPoint += dynamic["counts"] as Int
+//                staticInfoPoint +=dynamic["counts"] as Int
+//                dynamicInfoPointCodes.remove(dynamic["next"])
+//                staticInfoPointCodes.remove(static["next"])
+//            }
+//            if (equipmentInforPoint["run_param"] != null) {
+//                var dynamic=calculateInfoPoints(equipmentInforPoint["run_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
+//                var static=calculateInfoPoints(equipmentInforPoint["run_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
+//                dynamicInfoPoint += dynamic["counts"] as Int
+//                staticInfoPoint +=dynamic["counts"] as Int
+//                dynamicInfoPointCodes.remove(dynamic["next"])
+//                staticInfoPointCodes.remove(static["next"])
+//            }
+//            if (equipmentInforPoint["setting_param"] != null) {
+//                var dynamic=calculateInfoPoints(equipmentInforPoint["setting_param"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
+//                var static=calculateInfoPoints(equipmentInforPoint["setting_param"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
+//                dynamicInfoPoint += dynamic["counts"] as Int
+//                staticInfoPoint +=dynamic["counts"] as Int
+//                dynamicInfoPointCodes.remove(dynamic["next"])
+//                staticInfoPointCodes.remove(static["next"])
+//            }
+//            if (equipmentInforPoint["alram"] != null) {
+//                var dynamic=calculateInfoPoints(equipmentInforPoint["alram"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
+//                var static=calculateInfoPoints(equipmentInforPoint["alram"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
+//                dynamicInfoPoint += dynamic["counts"] as Int
+//                staticInfoPoint +=dynamic["counts"] as Int
+//                dynamicInfoPointCodes.remove(dynamic["next"])
+//                staticInfoPointCodes.remove(static["next"])
+//            }
+//            if (equipmentInforPoint["tech_param_general"] != null) {
+//                var dynamic=calculateInfoPoints(equipmentInforPoint["tech_param_general"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
+//                var static=calculateInfoPoints(equipmentInforPoint["tech_param_general"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
+//                dynamicInfoPoint += dynamic["counts"] as Int
+//                staticInfoPoint +=dynamic["counts"] as Int
+//                dynamicInfoPointCodes.remove(dynamic["next"])
+//                staticInfoPointCodes.remove(static["next"])
+//            }
+//            if (equipmentInforPoint["run_param_general"] != null) {
+//                var dynamic=calculateInfoPoints(equipmentInforPoint["run_param_general"].toString(), equipmentInforPoint["category"].toString(), dynamicInfoPointCodes)
+//                var static=calculateInfoPoints(equipmentInforPoint["run_param_general"].toString(), equipmentInforPoint["category"].toString(), staticInfoPointCodes)
+//                dynamicInfoPoint += dynamic["counts"] as Int
+//                staticInfoPoint +=dynamic["counts"] as Int
+//                dynamicInfoPointCodes.remove(dynamic["next"])
+//                staticInfoPointCodes.remove(static["next"])
+//            }
         }
 
         hashMap["dynamicInfoPoint"]=dynamicInfoPoint

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

@@ -27,6 +27,7 @@
 package com.persagy.server.service
 
 
+import com.persagy.server.Opt
 import com.persagy.server.models.EquipCompon
 import com.persagy.server.models.mappers.REquipComponMapper
 import com.persagy.server.models.requests.RSQueryResponse
@@ -54,7 +55,7 @@ open class REquipComponService {
      */
     open fun getEquipCompon(id:String, category: String): RSQueryResponse<EquipCompon> {
         return try {
-            val equipComponList = mapper.getEquipCompon(id, category)
+            val equipComponList = mapper.getEquipCompon(Opt.projectId!!,id, category)
             val rsQueryResponse = RSQueryResponse<EquipCompon>()
             rsQueryResponse.content = equipComponList
             rsQueryResponse.total = equipComponList.size.toLong()

+ 583 - 0
equip-component/src/main/kotlin/com/persagy/server/service/StatisticsService.kt

@@ -0,0 +1,583 @@
+package com.persagy.server.service
+
+import com.persagy.database.SFilter
+import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.dao.mappers.StatisticsCountMapper
+import com.persagy.server.datacenter.models.jms.SynchronousMessageRel
+import com.persagy.server.datacenter.models.response.EqpeDefferentReqponse
+import com.persagy.server.datacenter.models.response.StatisticsCountResponse
+import com.persagy.service.SObjectService
+import com.persagy.service.SPageContext
+import com.persagy.service.models.enums.SResponseType
+import com.persagy.service.models.responses.SCountResponse
+import com.persagy.service.models.responses.SQueryResponse
+import org.slf4j.LoggerFactory
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Service
+import java.util.*
+import kotlin.collections.ArrayList
+import kotlin.collections.HashMap
+
+
+/**
+ * 统计
+ *
+ * @author  邓婷婷
+ */
+@Service
+open class StatisticsService{
+
+    // 日志
+    private val logger = LoggerFactory.getLogger(StatisticsService::class.java)
+    var synchronousMessageRelService = SObjectService(SMybatisDao(SynchronousMessageRel::class.java))
+
+    /** 实例化 mapper 对象 */
+    @Autowired
+    lateinit var mapper: StatisticsCountMapper
+
+    /**
+     * 不能同步到物理世界的关系数据
+     */
+    fun unSynchronizeRelation(): SCountResponse {
+        val projectId = SPageContext.getHeader("projectId").toString()
+        val exec = synchronousMessageRelService.select(SFilter.eq("projectId", projectId),SFilter.eq("sign", 2)).exec()
+        return SCountResponse(exec.size.toLong())
+    }
+
+    /**
+     * 岗位和关联的资产信息点值不一致
+     */
+    fun eq2peCount(): SCountResponse {
+        val projectId = SPageContext.getHeader("projectId").toString()
+//        val count = mapper.eq2peCount(projectId)
+
+        return SCountResponse(0)
+    }
+
+    /**
+     * 岗位和关联的资产信息点值不一致数据
+     */
+    fun eq2peDifferent(): SQueryResponse<ArrayList<EqpeDefferentReqponse>> {
+        return try {
+            val projectId =  SPageContext.getHeader("projectId").toString()
+
+            var list=ArrayList<EqpeDefferentReqponse>()
+            //岗位和关联的资产数据
+            var lis=mapper.eq2peDifferent(projectId)
+            for (li in lis) {
+                var eqpeDefferentReqponse=EqpeDefferentReqponse()
+                var property= TreeMap<String,Any>()
+                var equipment=TreeMap<String,Any>()
+                if (li["name"]!=li["_name"]){
+                    if (li["name"]==null){
+                        property["资产名称"]=" "
+                    }else{
+                        property["资产名称"]= li["name"] as Any
+                    }
+                    if (li["_name"]==null){
+                        equipment["岗位名称"]=" "
+                    }else{
+                        equipment["岗位名称"]= li["_name"] as Any
+                    }
+
+                }
+                if (li["local_id"]!=li["_local_id"]){
+                    if (li["local_id"]==null){
+                        property["资产本地编码"]=" "
+                    }else{
+                        property["资产本地编码"] = li["local_id"] as Any
+                    }
+                    if (li["_local_id"]==null){
+                        equipment["岗位本地编码"]=" "
+                    }else{
+                        equipment["岗位本地编码"] = li["_local_id"] as Any
+                    }
+                }
+                if (li["local_name"]!=li["_local_name"]){
+                    if (li["local_name"]==null){
+                        property["资产本地名称"]=" "
+                    }else{
+                        property["资产本地名称"] = li["local_name"] as Any
+                    }
+                    if (li["_local_name"]==null){
+                        equipment["岗位本地名称"]=" "
+                    }else{
+                        equipment["岗位本地名称"] = li["_local_name"] as Any
+                    }
+                }
+                if (li["qr_code"]!=li["_qr_code"]){
+                    if (li["qr_code"]==null){
+                        property["资产二维码图片"]=" "
+                    }else{
+                        property["资产二维码图片"] = li["qr_code"] as Any
+                    }
+                    if (li["_qr_code"]==null){
+                        equipment["岗位二维码图片"]=" "
+                    }else{
+                        equipment["岗位二维码图片"] = li["_qr_code"] as Any
+                    }
+                }
+                if (li["cad_id"]!=li["_cad_id"]){
+                    if (li["cad_id"]==null){
+                        property["设计图纸中编码"]=" "
+                    }else{
+                        property["设计图纸中编码"] = li["cad_id"] as Any
+                    }
+                    if (li["_cad_id"]==null){
+                        equipment["设计图纸中编码"]=" "
+                    }else{
+                        equipment["设计图纸中编码"] = li["_cad_id"] as Any
+                    }
+                }
+                if (li["bim_location"]!=li["_bim_location"]){
+                    if (li["bim_location"]==null){
+                        property["BIM模型中坐标"]=" "
+                    }else{
+                        property["BIM模型中坐标"] = li["bim_location"] as Any
+                    }
+                    if (li["_bim_location"]==null){
+                        equipment["BIM模型中坐标"]=" "
+                    }else{
+                        equipment["BIM模型中坐标"] = li["_bim_location"] as Any
+                    }
+                }
+                if (li["bim_id"]!=li["_bim_id"]){
+                    if (li["bim_id"]==null){
+                        property["BIM模型中编码"]=" "
+                    }else{
+                        property["BIM模型中编码"] = li["bim_id"] as Any
+                    }
+                    if (li["_bim_id"]==null){
+                        equipment["BIM模型中编码"]=" "
+                    }else{
+                        equipment["BIM模型中编码"] = li["_bim_id"] as Any
+                    }
+                }
+                if (li["ledger_param"]!=li["_ledger_param"]){
+                    if (li["ledger_param"]==null){
+                        property["台账参数"]=" "
+                    }else{
+                        property["台账参数"] = li["ledger_param"] as Any
+                    }
+                    if (li["_ledger_param"]==null){
+                        equipment["台账参数"]=" "
+                    }else{
+                        equipment["台账参数"] = li["_ledger_param"] as Any
+                    }
+                }
+                if (li["comm_param"]!=li["_comm_param"]){
+                    if (li["comm_param"]==null){
+                        property["通讯参数"]=" "
+                    }else{
+                        property["通讯参数"] = li["comm_param"] as Any
+                    }
+                    if (li["_comm_param"]==null){
+                        equipment["通讯参数"]=" "
+                    }else {
+                        equipment["通讯参数"] = li["_comm_param"] as Any
+                    }
+                }
+                if (li["tech_param"]!=li["_tech_param"]){
+                    if (li["tech_param"]==null){
+                        property["技术参数"]=" "
+                    }else{
+                        property["技术参数"] = li["tech_param"] as Any
+                    }
+                    if (li["_tech_param"]==null){
+                        equipment["技术参数"]=" "
+                    }else{
+                        equipment["技术参数"] = li["_tech_param"] as Any
+                    }
+                }
+                if (li["run_param"]!=li["_run_param"]){
+                    if (li["run_param"]==null){
+                        property["运行参数"]=" "
+                    }else{
+                        property["运行参数"] = li["run_param"] as Any
+                    }
+                    if (li["_run_param"]==null){
+                        equipment["运行参数"]=" "
+                    }else{
+                        equipment["运行参数"] = li["_run_param"] as Any
+                    }
+                }
+                if (li["setting_param"]!=li["_setting_param"]){
+                    if (li["setting_param"]==null){
+                        property["设定参数"]=" "
+                    }else{
+                        property["设定参数"] = li["setting_param"] as Any
+                    }
+                    if (li["_setting_param"]==null){
+                        equipment["设定参数"]=" "
+                    }else{
+                        equipment["设定参数"] = li["_setting_param"] as Any
+                    }
+                }
+                if (li["alram"]!=li["_alram"]){
+                    if (li["alram"]==null){
+                        property["报警信息"]=" "
+                    }else{
+                        property["报警信息"] = li["alram"] as Any
+                    }
+                    if (li["_alram"]==null){
+                        equipment["报警信息"]=" "
+                    }else{
+                        equipment["报警信息"] = li["_alram"] as Any
+                    }
+                }
+                if (li["custom_param"]!=li["_custom_param"]){
+                    if (li["custom_param"]==null){
+                        property["自定义参数"]=" "
+                    }else{
+                        property["自定义参数"] = li["custom_param"] as Any
+                    }
+                    if (li["_custom_param"]==null){
+                        equipment["自定义参数"]=" "
+                    }else{
+                        equipment["自定义参数"] = li["_custom_param"] as Any
+                    }
+                }
+                if (li["dp_manufacturer_id"]!=li["_dp_manufacturer_id"]){
+                    if (li["dp_manufacturer_id"]==null){
+                        property["品牌型号id"]=" "
+                    }else{
+                        property["品牌型号id"] = li["dp_manufacturer_id"] as Any
+                    }
+                    if (li["_dp_manufacturer_id"]==null){
+                        equipment["品牌型号id"]=" "
+                    }else{
+                        equipment["品牌型号id"] = li["_dp_manufacturer_id"] as Any
+                    }
+                }
+                if (li["dp_supplier_id"]!=li["_dp_supplier_id"]){
+                    if (li["dp_supplier_id"]==null){
+                        property["供应商信息id"]=" "
+                    }else{
+                        property["供应商信息id"] = li["dp_supplier_id"] as Any
+                    }
+                    if (li["_dp_supplier_id"]==null){
+                        equipment["供应商信息id"]=" "
+                    }else{
+                        equipment["供应商信息id"] = li["_dp_supplier_id"] as Any
+                    }
+                }
+                if (li["dp_maintainer_id"]!=li["_dp_maintainer_id"]){
+                    if (li["dp_maintainer_id"]==null){
+                        property["维修商信息id"]=" "
+                    }else{
+                        property["维修商信息id"] = li["dp_maintainer_id"] as Any
+                    }
+                    if (li["_dp_maintainer_id"]==null){
+                        equipment["维修商信息id"]=" "
+                    }else{
+                        equipment["维修商信息id"] = li["_dp_maintainer_id"] as Any
+                    }
+                }
+                if (li["dp_insurer_id"]!=li["_dp_insurer_id"]){
+                    if (li["dp_insurer_id"]==null){
+                        property["保险公司信息id"]=" "
+                    }else{
+                        property["保险公司信息id"] = li["dp_insurer_id"] as Any
+                    }
+                    if (li["_dp_insurer_id"]==null){
+                        equipment["保险公司信息id"]=" "
+                    }else{
+                        equipment["保险公司信息id"] = li["_dp_insurer_id"] as Any
+                    }
+                }
+                if (li["temp_sensor"]!=li["_temp_sensor"]){
+                    if (li["temp_sensor"]==null){
+                        property["温度传感器"]=" "
+                    }else{
+                        property["温度传感器"] = li["temp_sensor"] as Any
+                    }
+                    if (li["_temp_sensor"]==null){
+                        equipment["温度传感器"]=" "
+                    }else{
+                        equipment["温度传感器"] = li["_temp_sensor"] as Any
+                    }
+                }
+                if (li["tech_param_general"]!=li["_tech_param_general"]){
+                    if (li["tech_param_general"]==null){
+                        property["技术参数-通用"]=" "
+                    }else{
+                        property["技术参数-通用"] = li["tech_param_general"] as Any
+                    }
+                    if (li["_tech_param_general"]==null){
+                        equipment["技术参数-通用"]=" "
+                    }else{
+                        equipment["技术参数-通用"] = li["_tech_param_general"] as Any
+                    }
+                }
+                if (li["run_param_general"]!=li["_run_param_general"]){
+                    if (li["run_param_general"]==null){
+                        property["运行参数-通用"]=" "
+                    }else{
+                        property["运行参数-通用"] = li["run_param_general"] as Any
+                    }
+                    if (li["_run_param_general"]==null){
+                        equipment["运行参数-通用"]=" "
+                    }else{
+                        equipment["运行参数-通用"] = li["_run_param_general"] as Any
+                    }
+                }
+                if (li["speed_sensor"]!=li["_speed_sensor"]){
+                    if (li["speed_sensor"]==null){
+                        property["速度传感器"]=" "
+                    }else{
+                        property["速度传感器"] = li["speed_sensor"] as Any
+                    }
+                    if (li["_speed_sensor"]==null){
+                        equipment["速度传感器"]=" "
+                    }else{
+                        equipment["速度传感器"] = li["_speed_sensor"] as Any
+                    }
+                }
+                if (li["sound_sensor"]!=li["_sound_sensor"]){
+                    if (li["sound_sensor"]==null){
+                        property["声音传感器"]=" "
+                    }else{
+                        property["声音传感器"] = li["sound_sensor"] as Any
+                    }
+                    if (li["_sound_sensor"]==null){
+                        equipment["声音传感器"]=" "
+                    }else{
+                        equipment["声音传感器"] = li["_sound_sensor"] as Any
+                    }
+                }
+                if (li["humidity_sensor"]!=li["_humidity_sensor"]){
+                    if (li["humidity_sensor"]==null){
+                        property["湿度传感器"]=" "
+                    }else{
+                        property["湿度传感器"] = li["humidity_sensor"] as Any
+                    }
+                    if (li["_humidity_sensor"]==null){
+                        equipment["湿度传感器"]=" "
+                    }else{
+                        equipment["湿度传感器"] = li["_humidity_sensor"] as Any
+                    }
+                }
+                if (li["press_transd"]!=li["_press_transd"]){
+                    if (li["press_transd"]==null){
+                        property["压力传感器"]=" "
+                    }else{
+                        property["压力传感器"] = li["press_transd"] as Any
+                    }
+                    if (li["_press_transd"]==null){
+                        equipment["压力传感器"]=" "
+                    }else{
+                        equipment["压力传感器"] = li["_press_transd"] as Any
+                    }
+                }
+                if (li["heat_sensor"]!=li["_heat_sensor"]){
+                    if (li["heat_sensor"]==null){
+                        property["热量传感器"]=" "
+                    }else{
+                        property["热量传感器"] = li["heat_sensor"] as Any
+                    }
+                    if (li["_heat_sensor"]==null){
+                        equipment["热量传感器"]=" "
+                    }else{
+                        equipment["热量传感器"] = li["_heat_sensor"] as Any
+                    }
+                }
+                if (li["flow_sensor"]!=li["_flow_sensor"]){
+                    if (li["flow_sensor"]==null){
+                        property["流量传感器"]=" "
+                    }else{
+                        property["流量传感器"] = li["flow_sensor"] as Any
+                    }
+                    if (li["_flow_sensor"]==null){
+                        equipment["流量传感器"]=" "
+                    }else{
+                        equipment["流量传感器"] = li["_flow_sensor"] as Any
+                    }
+                }
+                if (li["electricity_sensor"]!=li["_electricity_sensor"]){
+                    if (li["electricity_sensor"]==null){
+                        property["电度传感器"]=" "
+                    }else{
+                        property["电度传感器"] = li["electricity_sensor"] as Any
+                    }
+                    if (li["_electricity_sensor"]==null){
+                        equipment["电度传感器"]=" "
+                    }else{
+                        equipment["电度传感器"] = li["_electricity_sensor"] as Any
+                    }
+                }
+                if (li["displ_sensor"]!=li["_displ_sensor"]){
+                    if (li["displ_sensor"]==null){
+                        property["位移传感器"]=" "
+                    }else{
+                        property["位移传感器"] = li["displ_sensor"] as Any
+                    }
+                    if (li["_displ_sensor"]==null){
+                        equipment["位移传感器"]=" "
+                    }else{
+                        equipment["位移传感器"] = li["_displ_sensor"] as Any
+                    }
+                }
+                if (li["concent_sensor"]!=li["_concent_sensor"]){
+                    if (li["concent_sensor"]==null){
+                        property["浓度传感器"]=" "
+                    }else{
+                        property["浓度传感器"] = li["concent_sensor"] as Any
+                    }
+                    if (li["_concent_sensor"]==null){
+                        equipment["浓度传感器"]=" "
+                    }else{
+                        equipment["浓度传感器"] = li["_concent_sensor"] as Any
+                    }
+                }
+                if (li["image_sensor"]!=li["_image_sensor"]){
+                    if (li["image_sensor"]==null){
+                        property["图像传感器"]=" "
+                    }else{
+                        property["图像传感器"] = li["image_sensor"] as Any
+                    }
+                    if (li["_image_sensor"]==null){
+                        equipment["图像传感器"]=" "
+                    }else{
+                        equipment["图像传感器"] = li["_image_sensor"] as Any
+                    }
+                }
+                if (li["feedback_param"]!=li["_feedback_param"]){
+                    if (li["feedback_param"]==null){
+                        property["反馈参数"]=" "
+                    }else{
+                        property["反馈参数"] = li["feedback_param"] as Any
+                    }
+                    if (li["_feedback_param"]==null){
+                        equipment["反馈参数"]=" "
+                    }else{
+                        equipment["反馈参数"] = li["_feedback_param"] as Any
+                    }
+                }
+                if (li["man_flow_sensor"]!=li["_man_flow_sensor"]){
+                    if (li["man_flow_sensor"]==null){
+                        property["人流量传感器"]=" "
+                    }else{
+                        property["人流量传感器"] = li["man_flow_sensor"] as Any
+                    }
+                    if (li["_man_flow_sensor"]==null){
+                        equipment["人流量传感器"]=" "
+                    }else{
+                        equipment["人流量传感器"] = li["_man_flow_sensor"] as Any
+                    }
+                }
+                if (li["dp_specification_id"]!=li["_dp_specification_id"]){
+                    if (li["dp_specification_id"]==null){
+                        property["设备型号id"]=" "
+                    }else{
+                        property["设备型号id"] = li["dp_specification_id"] as Any
+                    }
+                    if (li["_dp_specification_id"]==null){
+                        equipment["设备型号id"]=" "
+                    }else{
+                        equipment["设备型号id"] = li["_dp_specification_id"] as Any
+                    }
+                }
+                if (li["dp_brand_id"]!=li["_dp_brand_id"]){
+                    if (li["dp_brand_id"]==null){
+                        property["品牌id"]=" "
+                    }else{
+                        property["品牌id"] = li["dp_brand_id"] as Any
+                    }
+                    if (li["_dp_brand_id"]==null){
+                        equipment["品牌id"]=" "
+                    }else{
+                        equipment["品牌id"] = li["_dp_brand_id"] as Any
+                    }
+                }
+                if (li["equip_serial"]!=li["_equip_serial"]) {
+                    if (li["equip_serial"]==null){
+                        property["设备序号"]=" "
+                    }else{
+                        property["设备序号"] = li["equip_serial"] as Any
+                    }
+                    if (li["_equip_serial"]==null){
+                        equipment["设备序号"]=" "
+                    }else{
+                        equipment["设备序号"] = li["_equip_serial"] as Any
+                    }
+                }
+                eqpeDefferentReqponse.property=property
+                eqpeDefferentReqponse.equipment=equipment
+                list.add(eqpeDefferentReqponse)
+
+            }
+            val sQueryResponse = SQueryResponse<ArrayList<EqpeDefferentReqponse>>(SResponseType.success)
+            sQueryResponse.content = listOf(list)
+            sQueryResponse
+        } catch ( e: Exception){
+            e.printStackTrace()
+            SQueryResponse(SResponseType.failure)
+        }
+    }
+
+    /**
+     * 设备-未关联资产的设备
+     */
+    fun uneq2pe(): SCountResponse {
+        val projectId = SPageContext.getHeader("projectId").toString()
+        val count = mapper.uneq2peCount(projectId)
+        return SCountResponse(count)
+    }
+
+    /**
+     * 业务空间-各分区占比
+     */
+    fun spObjectTypeCount(): ArrayList<StatisticsCountResponse> {
+        val projectId = SPageContext.getHeader("projectId").toString()
+        val list = mapper.spObjectTypeCount(projectId)
+        val map = HashMap<String, Long>()
+        for (obj in list) {
+            map.put(obj.name!!, obj.count!!)
+        }
+        val array = arrayListOf("HeatingZone","CleanZone","DomesticWaterSupplyZone","NetworkZone","TenantZone","AirConditioningZone","FunctionZone","FireZone","SecurityZone","GeneralZone","PowerSupplyZone","LightingZone")
+
+        for(type in array){
+            if(!map.containsKey(type)){
+                val obj = StatisticsCountResponse()
+                obj.name = type
+                obj.count = 0
+                list.add(obj)
+            }
+        }
+        return list
+    }
+
+    /**
+     * 业务空间-默认分区功能类型占比
+     */
+    fun generalSpFuncTypeCount(): ArrayList<StatisticsCountResponse> {
+        val projectId = SPageContext.getHeader("projectId").toString()
+        return mapper.generalSpFuncTypeCount(projectId)
+    }
+
+    /**
+     * 租户-关联业务空间完成度
+     */
+    fun tenant2SpCount(): SCountResponse {
+        val projectId = SPageContext.getHeader("projectId").toString()
+        val count = mapper.tenant2SpCount(projectId)
+        return SCountResponse(count)
+    }
+
+    /**
+     * 竖井-关联业务空间完成度
+     */
+    fun shaft2SpCount(): SCountResponse {
+        val projectId = SPageContext.getHeader("projectId").toString()
+        val count = mapper.shaft2SpCount(projectId)
+        return SCountResponse(count)
+    }
+
+    /**
+     * 竖井-按功能类型占比
+     */
+    fun shaftFuncTypeCount(): ArrayList<StatisticsCountResponse> {
+        val projectId = SPageContext.getHeader("projectId").toString()
+        return mapper.shaftFuncTypeCount(projectId)
+    }
+} // Class StatisticsService

+ 2 - 2
gradle.properties

@@ -25,8 +25,8 @@
 #
 
 PERSAGY_URL = http://www.persagy.cn
-PERSAGY_KOTLIN_VERSION = 1.4.116
-PERSAGY_SERVICE_VERSION = 1.4.157
+PERSAGY_KOTLIN_VERSION = 1.4.120
+PERSAGY_SERVICE_VERSION = 1.4.162
 
 MAVEN_REPO_PUBLIC_URL = http://dev.dp.sagacloud.cn:8082/repository/maven-public/
 MAVEN_REPO_RELEASE_URL = http://dev.dp.sagacloud.cn:8082/repository/maven-releases/