Parcourir la source

********************WX******************
处理问题

zhangweixin il y a 4 ans
Parent
commit
e3241a0176

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

@@ -87,18 +87,18 @@ interface IRelationCalcMapper {
 //     */
 //    @Select("delete from 'relationship.r_eq2sp' as r where r.sign0 = 3 and r.project_id = #{projectId}")
 //    fun deletesp( projectId: String): Int?
-
-    /**
-     * 插入关联业务空间
-     *
-     *@param projectId 项目id
-     */
-    @Insert("insert into relationship.r_eq2sp(eq_id, sp_id, project_id, sign, type, zone_type,sign0) " +
-            "select eq.id2 as eqid,ep.sp_id as spid,ep.project_id as project_id,ep.sign as sign,'eq2sp_for',ep.zone_type as zone_type,3  from relationship.r_eq2eq  as eq " +
-            "inner join relationship.r_eq2sp  as ep on eq.id1 = ep.eq_id  where ep.project_id = #{projectId} union\n" +
-            "select eq.id1 as eqid,ep.sp_id as spid,ep.project_id as project_id,ep.sign as sign,'eq2sp_for',ep.zone_type as zone_type,3  from relationship.r_eq2eq  as eq " +
-            "inner join relationship.r_eq2sp as ep  on eq.id2= ep.eq_id where ep.project_id = #{projectId}")
-    fun insertsp( projectId: String): Int?
+//
+//    /**
+//     * 插入关联业务空间
+//     *
+//     *@param projectId 项目id
+//     */
+//    @Insert("insert into relationship.r_eq2sp(eq_id, sp_id, project_id, sign, type, zone_type,sign0) " +
+//            "select eq.id2 as eqid,ep.sp_id as spid,ep.project_id as project_id,ep.sign as sign,'eq2sp_for',ep.zone_type as zone_type,3  from relationship.r_eq2eq  as eq " +
+//            "inner join relationship.r_eq2sp  as ep on eq.id1 = ep.eq_id  where ep.project_id = #{projectId} union\n" +
+//            "select eq.id1 as eqid,ep.sp_id as spid,ep.project_id as project_id,ep.sign as sign,'eq2sp_for',ep.zone_type as zone_type,3  from relationship.r_eq2eq  as eq " +
+//            "inner join relationship.r_eq2sp as ep  on eq.id2= ep.eq_id where ep.project_id = #{projectId}")
+//    fun insertsp( projectId: String): Int?
 
     /**
      * 楼层贯通关系

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

@@ -414,7 +414,7 @@ open class RelationCalcService {
                 try {
                     /** 发送消息 */
                     rabbitMqService.sendRel(Opt.projectId!!, "Fl2Fl_Through", "20", "123", "456")
-                    val entity = RUpDateEquipAndSapceService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId), SFilter.eq("relationTypeCode", "Fl2Fl")).entity()
+                    val entity = RUpDateEquipAndSapceService.relationTypeProjectservice.select(SFilter.eq("projectId", projectId), SFilter.eq("relationType", "Fl2Fl")).entity()
                     if (entity != null) {
                         entity.computationalState = 1
                         entity.computingTime = IdUtils.time()
@@ -1120,10 +1120,6 @@ open class RelationCalcService {
 
             /*************************上面添加数据**********************************/
 
-//            REq2SpService.delete(SFilter.eq("projectId", projectId),
-//                     SFilter.eq("type", "eq2sp_for"))
-            val r2 = mapper.insertsp(projectId)
-//                logger.debug("设备关联业务空间计算结果= ${r1}+${r2}")
 
             if (result != null && result == 0) {
                 try {
@@ -1153,8 +1149,12 @@ open class RelationCalcService {
                             , SFilter.eq("type", "eq2sp_in")).exec()
                     if (rEq2SpList.size > 0) {
                         for (rEq2Sp in rEq2SpList) {
-                            rEq2Sp.type = "eq2sp_for"
-                            REq2SpService.replace(rEq2Sp)
+                            try {
+                                rEq2Sp.type = "eq2sp_for"
+                                REq2SpService.replace(rEq2Sp)
+                            } catch (e: Exception) {
+                                e.toString()
+                            }
                         }
                     }
                 }

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

@@ -34,8 +34,8 @@ spring:
     type:                               com.alibaba.druid.pool.DruidDataSource
     driver-class-name:                  org.postgresql.Driver
 #    url:                                jdbc:postgresql://60.205.177.43:5432/datacenterlabsl
-#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
-    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
+    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
 #    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
     username:                           postgres
 #    password:                           persagy_2020qwe!@#

+ 12 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/controllers/dict/DictGatherControllers.kt

@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.Operation
 import io.swagger.v3.oas.annotations.tags.Tag
 import org.springframework.web.bind.annotation.GetMapping
 import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RequestParam
 import org.springframework.web.bind.annotation.RestController
 
 /**
@@ -25,4 +26,15 @@ class DictGatherControllers {
         return DClassDefService.dictPlatformInfoGather()
     }
 
+    /**
+     * 平台字典 详细信息点
+     */
+    @Operation(summary = "001、平台字典对象信息点-存入数据中心-制定类型更新", description = "")
+    @GetMapping(value = ["/dict-platform-info-code"])
+    fun dictPlatformInfoCode(@RequestParam code: String): SBaseResponse {
+        return DClassDefService.dictPlatformInfoGatherCode(code)
+    }
+
+
+
 }

+ 171 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/services/dict/DClassDefService.kt

@@ -1403,4 +1403,175 @@ object DClassDefService : SObjectService<DefClass>(SMybatisDao(DefClass::class.j
     } // Fun dictPlatformInfo()
 
 
+    /**
+     * 字典对象的详细信息点 - 平台级信息点更新需采集信息点
+     */
+    fun dictPlatformInfoGatherCode(code: String): SBaseResponse{
+        val sBaseResponse = SBaseResponse()
+        val defClassList = defClassService.select(SFilter.eq("code", code),SFilter.eq("type", "common")).exec()
+        if (defClassList.size>0){
+            for (defClass in defClassList){
+                val dictPlatformInfoList = DictTypeApi.dictPlatformInfo(defClass.code!!, defClass.type!!)
+//                defFuncIdService.delete(SFilter.eq("classCode", defClass.code!!),SFilter.eq("groupCode", "0"))
+                if (!dictPlatformInfoList.isNullOrEmpty()){
+                    for (dictPlatformInfo in dictPlatformInfoList){
+                        /** 开头字母大写转小写 */
+                        val defFuncId = DefFuncIdGather()
+                        defFuncId.canSub = dictPlatformInfo.canSub
+                        defFuncId.category = dictPlatformInfo.category
+                        defFuncId.classCode = defClass.code
+                        if (dictPlatformInfo.code == "equipLocalID"){
+                            defFuncId.code = "localId"
+                        }else if (dictPlatformInfo.code == "equipLocalName"){
+                            defFuncId.code = "localName"
+                        }else if (dictPlatformInfo.code == "sysLocalID"){
+                            defFuncId.code = "localId"
+                        }else if (dictPlatformInfo.code == "sysLocalName"){
+                            defFuncId.code = "localName"
+                        }else if (dictPlatformInfo.code == "tenantLocalID"){
+                            defFuncId.code = "localId"
+                        }else if (dictPlatformInfo.code =="tenantLocalName"){
+                            defFuncId.code = "localName"
+                        }else if (dictPlatformInfo.code == "roomLocalID"){
+                            defFuncId.code = "localId"
+                        }else if (dictPlatformInfo.code == "roomLocalName"){
+                            defFuncId.code = "localName"
+                        }else if (dictPlatformInfo.code == "shaftLocalID"){
+                            defFuncId.code = "localId"
+                        }else if (dictPlatformInfo.code == "shaftLocalName"){
+                            defFuncId.code = "localName"
+                        }else if (dictPlatformInfo.code == "shaftID"){
+                            defFuncId.code = "id"
+                        }else if (dictPlatformInfo.code == "shaftName"){
+                            defFuncId.code = "name"
+                        }else if (dictPlatformInfo.code == "equipID"){
+                            defFuncId.code = "id"
+                        }else if (dictPlatformInfo.code == "equipName"){
+                            defFuncId.code = "name"
+                        }else if (dictPlatformInfo.code == "sysID"){
+                            defFuncId.code = "id"
+                        }else if (dictPlatformInfo.code == "sysName"){
+                            defFuncId.code = "name"
+                        }else if (dictPlatformInfo.code == "tenantID"){
+                            defFuncId.code = "id"
+                        }else if (dictPlatformInfo.code == "tenantName"){
+                            defFuncId.code = "name"
+                        }else if (dictPlatformInfo.code == "roomID"){
+                            defFuncId.code = "id"
+                        }else if (dictPlatformInfo.code == "roomName"){
+                            defFuncId.code = "name"
+                        }else if (dictPlatformInfo.code == "projID"){
+                            defFuncId.code = "id"
+                        }else if (dictPlatformInfo.code == "projName"){
+                            defFuncId.code = "name"
+                        }else if (dictPlatformInfo.code == "projLocalName"){
+                            defFuncId.code = "localId"
+                        }else if (dictPlatformInfo.code == "projLocalName"){
+                            defFuncId.code = "localName"
+                        }else if (dictPlatformInfo.code == "flootID"){
+                            defFuncId.code = "id"
+                        }else if (dictPlatformInfo.code == "flootName"){
+                            defFuncId.code = "name"
+                        }else if (dictPlatformInfo.code == "floorLocalName"){
+                            defFuncId.code = "localId"
+                        }else if (dictPlatformInfo.code == "floorLocalName"){
+                            defFuncId.code = "localName"
+                        }else if (dictPlatformInfo.code == "buildID"){
+                            defFuncId.code = "id"
+                        }else if (dictPlatformInfo.code == "buildName"){
+                            defFuncId.code = "name"
+                        }else if (dictPlatformInfo.code == "buildLocalID"){
+                            defFuncId.code = "localId"
+                        }else if (dictPlatformInfo.code == "buildLocalName"){
+                            defFuncId.code = "localName"
+                        }else{
+                            defFuncId.code = dictPlatformInfo.code
+                        }
+
+                        defFuncId.id = dictPlatformInfo.id
+//                        defFuncId.code = dictPlatformInfo.code
+                        defFuncId.dataSource = dictPlatformInfo.dataSource
+                        logger.debug("数据= ${dictPlatformInfo.dataSource?.toJson()}")
+                        defFuncId.dataType = dictPlatformInfo.dataType
+                        defFuncId.firstName = dictPlatformInfo.firstTag
+                        if (!dictPlatformInfo.firstTag.isNullOrEmpty()){
+                            defFuncId.firstTag = ParamTools.TwoLevelCode(dictPlatformInfo.firstTag!!)
+                        }
+                        defFuncId.formater = dictPlatformInfo.formater
+                        defFuncId.groupCode = dictPlatformInfo.groupCode
+                        defFuncId.idx = dictPlatformInfo.idx
+                        defFuncId.inputMode = dictPlatformInfo.inputMode
+                        defFuncId.isMultiple = dictPlatformInfo.isMultiple
+                        defFuncId.isRegion = dictPlatformInfo.isRegion
+                        defFuncId.name = dictPlatformInfo.name
+                        defFuncId.note = dictPlatformInfo.note
+                        defFuncId.priority = dictPlatformInfo.priority
+                        defFuncId.projectId = dictPlatformInfo.projectId
+                        defFuncId.readonly = dictPlatformInfo.readonly
+                        defFuncId.secondName = dictPlatformInfo.secondTag
+                        if (!dictPlatformInfo.secondTag.isNullOrEmpty()){
+                            defFuncId.secondTag = ParamTools.TwoLevelCode(dictPlatformInfo.secondTag!!)
+                        }
+                        defFuncId.subFlag = dictPlatformInfo.subFlag
+                        defFuncId.type = dictPlatformInfo.type
+                        defFuncId.unit = dictPlatformInfo.unit
+                        defFuncId.origCode = dictPlatformInfo.origCode
+                        defFuncId.origDataType = dictPlatformInfo.origDataType
+                        defFuncId.aliasCode = dictPlatformInfo.aliasCode
+                        defFuncId.aliasName = dictPlatformInfo.aliasName
+                        if (!defFuncId.name.isNullOrEmpty()){
+                            /** 排序 */
+                            if (defFuncId.name!! == "设备本地编码"||defFuncId.name!! == "楼层本地编码"){
+                                defFuncId.sort = 1
+                            }else if (defFuncId.name!! == "设备本地名称"|| defFuncId.name!! == "楼层本地名称"){
+                                defFuncId.sort = 2
+                            }else if (defFuncId.name!! == "设备二维码图片"){
+                                defFuncId.sort = 3
+                            }else if (defFuncId.name!! == "设计图纸中编码"){
+                                defFuncId.sort = 4
+                            }else if (defFuncId.name!! == "设备ID"){
+                                defFuncId.sort = 101
+                            }else if (defFuncId.name!! == "设备名称"){
+                                defFuncId.sort = 102
+                            }else if (defFuncId.name!! == "BIM模型中编码"){
+                                defFuncId.sort = 103
+                            }else if (defFuncId.name!! == "BIM模型中坐标"){
+                                defFuncId.sort = 104
+                            }else if (defFuncId.firstName != null&& defFuncId.firstName == "台账参数"){
+                                defFuncId.sort = 10
+                            }else if(defFuncId.firstName != null&& defFuncId.firstName == "通讯参数"){
+                                defFuncId.sort = 20
+                            }else {
+                                defFuncId.sort = 60
+                            }
+                        }
+
+//                        val dicConfigureEditable = ParamTools.dicConfigureEditable()
+//                        val containsKey = dicConfigureEditable.containsKey(defFuncId.code!!)
+//                        if (containsKey){
+//                            defFuncId.editable = false
+//                            defFuncId.unDisabled = false
+//                            defFuncId.visible = false
+//                        }
+//                        val dicConfigure = ParamTools.dicConfigure()
+//                        if (defFuncId.code!=null){
+//                            val containsKey = dicConfigure.containsKey(defFuncId.code!!)
+//                            if (containsKey){
+//                                defFuncId.editable = true
+//                                defFuncId.unDisabled = false
+//                                defFuncId.visible = true
+//                            }
+//                        }
+                        defFuncIdGather.replace(defFuncId)
+                    }
+                }
+            }
+            sBaseResponse.result = SResponseType.success
+        } else {
+            sBaseResponse.result = SResponseType.failure
+        }
+        return sBaseResponse
+    } // Fun dictPlatformInfo()
+
+
 } // Object DClassDefService

+ 2 - 2
datasyn/src/main/resources/application-dev.yml

@@ -6,8 +6,8 @@ spring:
     #    username:                           postgres
     #    password:                           123qwe!@#
 #    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
-#    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
-    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
+    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
+#    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
     username:                           postgres
     #    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj