浏览代码

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

zhangweixin 4 年之前
父节点
当前提交
6d3d53a05a

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

@@ -192,7 +192,7 @@ open class Equipment : BaseInfo() {
     /** 对象类型 */
     @Schema(description = "对象类型")
     @Column(name = "object_type")
-    override var objectType: String? = "Equipment"
+    override var objectType: String? = "equipment"
 
     /** 项目自定义类型 */
     @Schema(description = "项目自定义类型")

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

@@ -65,11 +65,53 @@ object ComponentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
         }
         /** 项目id */
         component.projectId = Opt.projectId
+
+        if (component.classCode.isNullOrEmpty()) {
+            return false
+        }
+        if (!Opt.coming.isNullOrEmpty()) {
+            component.appId = Opt.coming
+        }
+        if(component.classCode!!.length<8){
+            val entity = EquipmentService.defClassService.select(
+                SFilter.eq("projectId", component.projectId!!),
+                SFilter.endWith("code", component.classCode!!)
+            ).entity()
+            if (entity!=null&&entity.code!!.length>=8){
+                component.classCode = entity.code
+            } else {
+                return false
+            }
+        } else {
+            val entity = EquipmentService.defClassService.select(
+                SFilter.eq("projectId", component.projectId!!),
+                SFilter.endWith("code", component.classCode!!)
+            ).entity()
+            if (entity == null) {
+                return false
+            }
+        }
+        /** 设备名字 */
+        if (component.name.isNullOrEmpty()) {
+            val entity = EquipmentService.defClassService.select(
+                SFilter.eq("projectId", component.projectId!!),
+                SFilter.eq("code", component.classCode!!)
+            ).entity()
+            if (entity!=null) {
+                component.name = ShaftNameUtil.shaftName(entity.name+"-")
+            }else {
+                component.name = ShaftNameUtil.shaftName("设备-")
+            }
+        }
+        if (!Opt.account.isNullOrEmpty()){
+            component.findPeople = Opt.account
+        }
+
         /** 部件名字 */
         if (component.name.isNullOrEmpty()) {
             component.name = ShaftNameUtil.shaftName("部件-")
         }
-        component.objectType = "Component"
+        component.objectType = "component"
         return true
     } // Function onCreateBefore()
 
@@ -93,6 +135,8 @@ object ComponentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
        return
     } // Function onCountBefore()
 
+
+
     override fun onDeleteBefore(cquipment: Equipment): Boolean {
         try {
             cquipment.objectType = "component"
@@ -108,6 +152,21 @@ object ComponentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
 
     override fun onUpdateBefore(entity: Equipment): Boolean {
         entity.objectType = "component"
+        if(entity.classCode!!.length<8){
+            val defClass = EquipmentService.defClassService.select(
+                SFilter.eq("projectId", Opt.projectId!!),
+                SFilter.endWith("code", entity.classCode!!)
+            ).entity()
+            if (defClass!=null){
+                entity.classCode = defClass.code
+            } else {
+                entity.classCode = null
+            }
+        }
+        if (entity.projectId.isNullOrEmpty()){
+            entity.projectId = Opt.projectId
+        }
+
         return super.onUpdateBefore(entity)
     }
 

+ 0 - 6
datacenter/src/main/kotlin/com/persagy/server/services/objects/ZoneSpaceBaseService.kt

@@ -604,10 +604,7 @@ object ZoneSpaceBaseService : ServiceSpace<ZoneSpace>(SMybatisDao(ZoneSpace::cla
             listtype.add("sp2sp_SpaceNeighborhood_5")
             listtype.add("sp2sp_TrafficNetwork_1")
             listtype.add("sp2sp_ConvectionNetwork_1")
-            listtype.add("sp2sp_ConvectionNetwork_2")
-            listtype.add("sp2sp_ConvectionNetwork_3")
             listtype.add("sp2sp_RadiationNetwork_1")
-            listtype.add("sp2sp_RadiationNetwork_2")
             for (type in listtype){
                 val entity = relationTypeProjectservice.select(SFilter.eq("projectId", projectId!!), SFilter.eq("relationType", type)).entity()
                 if (entity!=null){
@@ -830,10 +827,7 @@ object ZoneSpaceBaseService : ServiceSpace<ZoneSpace>(SMybatisDao(ZoneSpace::cla
             listtype.add("sp2sp_SpaceNeighborhood_5")
             listtype.add("sp2sp_TrafficNetwork_3")
             listtype.add("sp2sp_ConvectionNetwork_1")
-            listtype.add("sp2sp_ConvectionNetwork_2")
-            listtype.add("sp2sp_ConvectionNetwork_3")
             listtype.add("sp2sp_RadiationNetwork_1")
-            listtype.add("sp2sp_RadiationNetwork_2")
             for (type in listtype){
                 val entity = relationTypeProjectservice.select(SFilter.eq("projectId", projectId!!), SFilter.eq("relationType", type)).entity()
                 if (entity!=null){

+ 7 - 2
equip-component/src/main/kotlin/com/persagy/server/Opt.kt

@@ -95,7 +95,12 @@ object Opt {
     /** 供应合同 */
     val SUPPLIERCONTRACT = "supplierContract"
     /** 检测报告 */
-    val TESTREPORT = "TestReport"
+    val TESTREPORT = "testReport"
     /** 原厂证明 */
-    val ORIGINALCERTIFICATE = "OriginalCertificate"
+    val ORIGINALCERTIFICATE = "originalCertificate"
+
+    val FanCharacterCurve = "fanCharacterCurve"
+    val DesignIDGraph = "designIDGraph"
+
+
 }

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

@@ -320,7 +320,7 @@ class EquipController {
     @PostMapping(value = ["/equip-comm-del"])
     fun equipCommDel(@RequestBody sQueryRequest: SQueryRequest): SQueryResponse<EquipmentDel>{
         val withFilterList = ArrayList<SFilter>()
-        withFilterList.add(SFilter.eq("projectId", SPageContext.getHeader("ProjectId").toString()))
+        withFilterList.add(SFilter.eq("projectId", SPageContext.getHeader("projectId").toString()))
         return EquipDelService.pageQuery(sQueryRequest,withFilterList)
     } //
 

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

@@ -93,7 +93,7 @@ open class StatisticsController {
     @PostMapping(value = ["/eq2pe-count"])
     fun eq2peCount(): SCountResponse {
         return service.eq2peCount()
-    } // Function uneq2pe()
+    }
 
     /**
      * 岗位和关联的资产信息点值不一致的数据
@@ -102,7 +102,7 @@ open class StatisticsController {
     @PostMapping(value = ["/eq2pe-different"])
     fun eq2peDifferent(): SQueryResponse<ArrayList<EqpeDefferentReqponse>> {
         return service.eq2peDifferent()
-    } // Function uneq2pe()
+    }
 
     /**
      * 设备-未关联资产的设备
@@ -111,7 +111,7 @@ open class StatisticsController {
     @PostMapping(value = ["/uneq2pe-count"])
     fun uneq2pe(): SCountResponse {
         return service.uneq2pe()
-    } // Function uneq2pe()
+    }
 
     /**
      * 业务空间-各分区占比
@@ -127,7 +127,7 @@ open class StatisticsController {
             e.printStackTrace()
             SQueryResponse(SResponseType.failure, e.message.toString())
         }
-    } // Function spObjectType()
+    }
 
     /**
      * 业务空间-默认分区功能类型占比
@@ -143,7 +143,7 @@ open class StatisticsController {
             e.printStackTrace()
             SQueryResponse(SResponseType.failure, e.message.toString())
         }
-    } // Function generalSpFuncTypeCount()
+    }
 
     /**
      * 租户-关联业务空间完成度
@@ -152,7 +152,7 @@ open class StatisticsController {
     @PostMapping(value = ["/tenant2sp-count"])
     fun tenant2SpCount(): SCountResponse {
         return service.tenant2SpCount()
-    } // Function tenant2SpCount()
+    }
 
     /**
      * 竖井-关联业务空间完成度
@@ -161,7 +161,7 @@ open class StatisticsController {
     @PostMapping(value = ["/shaft2sp-count"])
     fun shaft2SpCount(): SCountResponse {
         return service.shaft2SpCount()
-    } // Function shaft2SpCount()
+    }
 
     /**
      * 竖井-按功能类型占比
@@ -172,12 +172,12 @@ open class StatisticsController {
        return try {
             val sQueryResponse = SQueryResponse<StatisticsCountResponse>(SResponseType.success)
             sQueryResponse.content = service.shaftFuncTypeCount()
-           sQueryResponse
+            sQueryResponse
         } catch (e: Exception) {
             e.printStackTrace()
            SQueryResponse(SResponseType.failure,e.message.toString())
         }
-    } // Function generalSpFuncTypeCount()
+    }
 
 
-} // Class StatisticsController
+}

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

@@ -128,7 +128,7 @@ interface StatisticsCountMapper {
     /**
      * 竖井-按功能类型占比
      */
-    @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}'")
+    @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>
 
     /**

+ 13 - 0
equip-component/src/main/kotlin/com/persagy/server/models/requests/EquipUpDateEnclosure.kt

@@ -109,4 +109,17 @@ class EquipUpDateEnclosure :Serializable {
     /** 原厂证明 */
     @Schema(description = "原厂证明",required = true)
     var originalCertificate: ArrayList<TaskPic>? = null
+
+
+    /** 原厂证明 */
+    @Schema(description = "原厂证明",required = true)
+    var fanCharacterCurve: ArrayList<TaskPic>? = null
+
+    /** 原厂证明 */
+    @Schema(description = "原厂证明",required = true)
+    var designIDGraph: ArrayList<TaskPic>? = null
+
+
+
+
 }

+ 7 - 2
equip-component/src/main/kotlin/com/persagy/server/service/EquipmentComService.kt

@@ -473,12 +473,17 @@ object EquipmentComService : Service<Equipment>(SMybatisDao(Equipment::class.jav
                         var equipment = iterator.next()
                         val equipFamily = equipFamilyService.select(SFilter.eq("equipCode", equipment.classCode!!)).entity()
                         var propertyList = ArrayList<Property>()
+                        if (equipFamily == null){
+                            propertyList = PropertyService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("family", equipFamily!!.family!!),SFilter.isNull("equipId")).exec()
+                        }
+
+
 //                        if (!equipment.buildingId.isNullOrEmpty()&&!equipment.floorId.isNullOrEmpty()){
 //                            propertyList = PropertyService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("floorId", equipment.floorId!!), SFilter.isNull("EquipmentId"), SFilter.eq("Family", equipFamily!!.family!!)).exec()
 //                        }else if (!equipment.buildingId.isNullOrEmpty()&&equipment.floorId.isNullOrEmpty()){
 //                            propertyList = PropertyService.select(SFilter.eq("projectId", projectId!!),SFilter.eq("buildingId", equipment.buildingId!!),SFilter.isNull("EquipmentId"), SFilter.eq("Family", equipFamily!!.family!!)).exec()
 //                        }else{
-                            propertyList = PropertyService.select(SFilter.eq("projectId", projectId!!), SFilter.eq("family", equipFamily!!.family!!),SFilter.isNull("equipId")).exec()
+
 //                        }
 //                        logger.debug("category = ${equipment.category}")
 //                        logger.debug("Family = ${equipFamily.family}")
@@ -567,7 +572,7 @@ object EquipmentComService : Service<Equipment>(SMybatisDao(Equipment::class.jav
                             equip.equipCategory   = equipCategory
                         }
                     }
-                    if (!equip.propertyList!!.isEmpty()){
+                    if (equip.propertyList!=null&&!equip.propertyList!!.isEmpty()){
                         for ( property in equip.propertyList!!){
                             if (!property.buildingId.isNullOrEmpty()){
 

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

@@ -580,4 +580,4 @@ open class StatisticsService{
         val projectId = SPageContext.getHeader("projectId").toString()
         return mapper.shaftFuncTypeCount(projectId)
     }
-} // Class StatisticsService
+}

+ 40 - 1
equip-component/src/main/kotlin/com/persagy/server/service/objects/EquipmentService.kt

@@ -998,9 +998,48 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
                         }
                     }
 
+                    if (!equipUpDateEnclosure.fanCharacterCurve.isNullOrEmpty()){
+                        val containsKey1 = equip!!.infos!!.containsKey(Opt.FanCharacterCurve)
+                        if (containsKey1) {
+
+                            if (!equip.infos!![Opt.FanCharacterCurve].toString().isNullOrEmpty()&&equip.infos!![Opt.FanCharacterCurve].toString()!="null"){
+                                val gson = Gson()
+                                val type  = object : TypeToken<ArrayList<TaskPic>>() {}.getType()
+                                val list: ArrayList<TaskPic> = gson.fromJson(equip.infos!![Opt.FanCharacterCurve]!!.toJson(), type)
+                                list.addAll(equipUpDateEnclosure.fanCharacterCurve!!)
+                                equip!!.infos!![Opt.FanCharacterCurve] = list
+                            }else {
+                                equip!!.infos!![Opt.FanCharacterCurve] = equipUpDateEnclosure.fanCharacterCurve!!
+                            }
+//                            val any = equip!!.infos!![Opt.ORIGINALCERTIFICATE] as JSONArray
+//                            any.addAll(equipUpDateEnclosure.originalCertificate!!)
+                        } else {
+                            equip!!.infos!![Opt.FanCharacterCurve] = equipUpDateEnclosure.fanCharacterCurve
+                        }
+                    }
+
+                    if (!equipUpDateEnclosure.designIDGraph.isNullOrEmpty()){
+                        val containsKey1 = equip!!.infos!!.containsKey(Opt.DesignIDGraph)
+                        if (containsKey1) {
+
+                            if (!equip.infos!![Opt.DesignIDGraph].toString().isNullOrEmpty()&&equip.infos!![Opt.DesignIDGraph].toString()!="null"){
+                                val gson = Gson()
+                                val type  = object : TypeToken<ArrayList<TaskPic>>() {}.getType()
+                                val list: ArrayList<TaskPic> = gson.fromJson(equip.infos!![Opt.DesignIDGraph]!!.toJson(), type)
+                                list.addAll(equipUpDateEnclosure.designIDGraph!!)
+                                equip!!.infos!![Opt.DesignIDGraph] = list
+                            }else {
+                                equip!!.infos!![Opt.DesignIDGraph] = equipUpDateEnclosure.designIDGraph!!
+                            }
+//                            val any = equip!!.infos!![Opt.ORIGINALCERTIFICATE] as JSONArray
+//                            any.addAll(equipUpDateEnclosure.originalCertificate!!)
+                        } else {
+                            equip!!.infos!![Opt.DesignIDGraph] = equipUpDateEnclosure.designIDGraph
+                        }
+                    }
+
                     /** 更新设备 */
                     EquipmentService.update(equip!!,null, SFilter.eq("projectId",projectId!!),SFilter.eq("id",equipUpDateEnclosure.equipId!!))
-
                 }
 
                 try {

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

@@ -20,8 +20,8 @@ spring:
 #    username:                           postgres
 #    password:                           123qwe!@#
 #    url:                                jdbc:postgresql://datacenter:5432/datacenter
-    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://192.168.64.14:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://datacenter:5432/datacenterlabsl
     username:                           postgres
 #    password:                           persagy_2020qwe!@#