Kaynağa Gözat

********************WX************************
调整配置

zhangweixin 4 yıl önce
ebeveyn
işleme
290a888d2c

+ 82 - 0
equip-componnet/src/main/kotlin/com/persagy/server/controllers/ShaftController.kt

@@ -0,0 +1,82 @@
+package com.persagy.server.controllers
+
+import cn.sagacloud.server.datacenter.models.entities.Equipment
+import cn.sagacloud.server.datacenter.models.entities.GeneralSystem
+import cn.sagacloud.server.datacenter.models.entities.Shaft
+import cn.sagacloud.server.equipcomponent.models.entities.FloorCompon
+import cn.sagacloud.server.equipcomponent.models.requests.ShaftSpaceVertical
+import cn.sagacloud.server.equipcomponent.service.EquipmentService
+import cn.sagacloud.server.equipcomponent.service.EquipmentZoneService
+import cn.sagacloud.server.equipcomponent.service.GeneralSystemService
+import cn.sagacloud.server.equipcomponent.service.ShaftService
+import com.persagy.server.datacenter.models.entities.objects.Equipment
+import com.persagy.server.datacenter.models.entities.objects.GeneralSystem
+import com.persagy.server.datacenter.models.entities.objects.Shaft
+import com.persagy.server.models.objects.FloorCompon
+import com.persagy.service.models.requests.SQueryRequest
+import com.persagy.service.models.responses.SQueryResponse
+import com.sybotan.service.models.requests.SQueryRequest
+import com.sybotan.service.models.responses.SQueryResponse
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+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 张维新
+ */
+@Api(tags = ["竖井相关接口"])
+@RestController
+@RequestMapping("/shaft")
+class ShaftController {
+    @Autowired
+    lateinit var equipmentZoneService: EquipmentZoneService
+    /**
+     * 查询没有和当前竖井绑定的系统
+     *
+     * @param   shaftId     竖井id
+     */
+    @ApiOperation(value="查询没有和当前竖井绑定的系统", notes="")
+    @PostMapping(value = ["/unshaft-in-sys"])
+    fun unShaftSys(shaftId: String,@RequestBody request: SQueryRequest): SQueryResponse<GeneralSystem> {
+        return GeneralSystemService.unShaftSys(shaftId, request)
+    } // Function unSpaceSys()
+
+    /**
+     * 查询没有和当前竖井绑定的设备
+     */
+    @ApiOperation(value="查询没有和当前竖井绑定的设备", notes="")
+    @PostMapping(value = ["/unshaft-in-eq"])
+    fun  unShaftEq( shaftId: String,@RequestBody request: SQueryRequest): SQueryResponse<Equipment> {
+        return EquipmentService.pageQueryShaftEquip(shaftId,request)
+    } // Function unSpaceEq()
+
+    @ApiOperation(value="查询没有和当前竖井贯通的其它竖井", notes="")
+    @PostMapping(value = ["/unshaft-through-shaft"])
+    fun  unShaftThroughShaft(shaftId: String,@RequestBody request: SQueryRequest): SQueryResponse<Shaft> {
+        return ShaftService.unShaftThroughShaft(shaftId,request)
+    } // Function unSpaceEq()
+
+    @ApiOperation(value="查询竖井关联的空间垂直交通关系", notes="")
+    @PostMapping(value = ["/shaft-vertical-space"])
+    fun shaftSpaceVertical(@RequestBody request: ShaftSpaceVertical): SQueryResponse<FloorCompon>{
+//        equipmentZoneService.similars()
+        return ShaftService.shaftSpace(request)
+    } // Function shaftSpaceVertical()
+
+    /**
+     * 计算 和当前竖井有关联的空间的垂直交通关系
+     */
+    @ApiOperation(value="计算 和当前竖井有关联的空间的垂直交通关系", notes="")
+    @PostMapping(value = ["/vertical-space"])
+    fun shaftVerticalSp(@RequestBody request: ShaftSpaceVertical): SQueryResponse<FloorCompon>{
+        return ShaftService.spVerticalSp(request)
+    } // Fun
+
+
+}  // Class SpaceController

+ 8 - 0
equip-componnet/src/main/kotlin/com/persagy/server/dao/a.java

@@ -0,0 +1,8 @@
+package com.persagy.server.dao;
+
+/**
+ * @author wx
+ * @date 2020/9/28 9:26
+ */
+public class a {
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 152 - 0
equip-componnet/src/main/kotlin/com/persagy/server/dao/mappers/CustomSql.kt


+ 199 - 0
equip-componnet/src/main/kotlin/com/persagy/server/models/ComponentProperty.kt

@@ -0,0 +1,199 @@
+package com.persagy.server.models
+
+import com.alibaba.fastjson.annotation.JSONField
+import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import io.swagger.annotations.ApiModel
+import io.swagger.annotations.ApiModelProperty
+import javax.persistence.Column
+import javax.persistence.Table
+
+/**
+ * 部件关联的资产
+ *
+ * @author 张维新
+ */
+@ApiModel(description = "部件关联的资产")
+@Table(name = "v_component_property")
+class ComponentProperty : BaseInfo(){
+
+    /** 部件id */
+    @ApiModelProperty(value = "部件id",required = true)
+    @Column(name = "id")
+    @JSONField(name = "EquipID")
+    var id: String? = null
+
+    /** 部件名称 */
+    @ApiModelProperty(value = "部件名称",required = true)
+    @Column(name = "name")
+    @JSONField(name = "EquipName")
+    var name: String? = null
+
+    /** 部件本地编码 */
+    @ApiModelProperty(value = "部件本地编码")
+    @Column(name = "local_id")
+    @JSONField(name = "EquipLocalID")
+    var localId: String? = null
+
+    /** 部件本地名称 */
+    @ApiModelProperty(value = "部件本地名称")
+    @Column(name = "local_name")
+    @JSONField(name = "EquipLocalName")
+    var localName: String? = null
+
+    /** 部件二维码照片 */
+    @ApiModelProperty(value = "部件二维码照片")
+    @Column(name = "qr_code")
+    @JSONField(name = "EquipQRCode")
+    var qrCode: String? = null
+
+    /** 设计图纸中编码 */
+    @ApiModelProperty(value = "设计图纸中编码")
+    @Column(name = "cad_id")
+    @JSONField(name = "CADID")
+    var cadId: String? = null
+
+    /** BIM模型中编码 */
+    @ApiModelProperty(value = "BIM模型中编码")
+    @Column(name = "bim_id")
+    @JSONField(name = "BIMID")
+    var bimId: String? = null
+
+    /** BIM模型中坐标 */
+    @ApiModelProperty(value = "BIM模型中坐标")
+    @Column(name = "bim_location")
+    @JSONField(name = "BIMLocation")
+    var bimLocation: String? = null
+
+    /** 项目id */
+    @ApiModelProperty(value = "项目id",required = true)
+    @Column(name = "project_id")
+    @JSONField(name = "ProjectId")
+    var projectId: String? = null
+
+    /** 部件类型code */
+    @ApiModelProperty(value = "部件类型code")
+    @Column(name = "category")
+    @JSONField(name = "Category")
+    var category: String? = null
+
+    /** 部件所在建筑id */
+    @ApiModelProperty(value = "部件所在建筑id")
+    @Column(name = "building_id")
+    @JSONField(name = "BuildingId")
+    var buildingId: String? = null
+
+    /** 部件所在楼层id */
+    @ApiModelProperty(value = "部件所在楼层id")
+    @Column(name = "floor_id")
+    @JSONField(name = "FloorId")
+    var floorId: String? = null
+
+    /** 品牌型号id */
+    @ApiModelProperty(value = "品牌型号id")
+    @Column(name = "dp_manufacturer_id")
+    @JSONField(name = "DPManufacturerID")
+    var dpManufacturerID: String? = null
+
+    /** 供应商信息id */
+    @ApiModelProperty(value = "供应商信息id")
+    @Column(name = "dp_supplier_id")
+    @JSONField(name = "DPSupplierID")
+    var dpSupplierID: String? = null
+
+    /** 维修商信息id */
+    @ApiModelProperty(value = "维修商信息id")
+    @Column(name = "dp_maintainer_id")
+    @JSONField(name = "DPMaintainerID")
+    var dpMaintainerID: String? = null
+
+    /** 保险公司信息id */
+    @ApiModelProperty(value = "保险公司信息id")
+    @Column(name = "dp_insurer_id")
+    @JSONField(name = "DPInsurerID")
+    var dpInsurerID: String? = null
+
+    /** 设备型号id */
+    @ApiModelProperty(value = "设备型号id")
+    @Column(name = "dp_specification_id")
+    @JSONField(name = "DPSpecificationID")
+    var dpSpecificationID: String? = null
+
+    /** 品牌id */
+    @ApiModelProperty(value = "品牌id")
+    @Column(name = "dp_brand_id")
+    @JSONField(name = "DPBrandID")
+    var dpBrandID: String? = null
+
+//    /** 部件关联的资产id */
+//    @ApiModelProperty(value = "部件关联的资产id")
+//    @Column(name = "link_id")
+//    @JSONField(name = "LinkId")
+//    var linkId: String? = null
+
+    /** 台账参数 */
+    @ApiModelProperty(value = "台账参数")
+    @Column(name = "ledger_param")
+    @JSONField(name = "LedgerParam")
+    var ledgerParam: HashMap<String,Any?>? = null
+
+    /** 通讯参数 */
+    @ApiModelProperty(value = "通讯参数")
+    @Column(name = "comm_param")
+    @JSONField(name = "CommParam")
+    var commParam: HashMap<String,Any?>? = null
+
+    /** 技术参数 */
+    @ApiModelProperty(value = "技术参数")
+    @Column(name = "tech_param")
+    @JSONField(name = "TechParam")
+    var techParam: HashMap<String,Any?>? = null
+
+    /** 运行参数 */
+    @ApiModelProperty(value = "运行参数")
+    @Column(name = "run_param")
+    @JSONField(name = "RunParam")
+    var runParam: HashMap<String,Any?>? = null
+
+    /** 设定参数 */
+    @ApiModelProperty(value = "设定参数")
+    @Column(name = "setting_param")
+    @JSONField(name = "SettingParam")
+    var settingParam: HashMap<String,Any?>? = null
+
+    /** 报警信息 */
+    @ApiModelProperty(value = "报警信息")
+    @Column(name = "alram")
+    @JSONField(name = "Alram")
+    var alram: HashMap<String,Any?>? = null
+
+    /** 自定义 */
+    @ApiModelProperty(value = "自定义")
+    @Column(name = "custom_param")
+    @JSONField(name = "CustomParam")
+    var customParam: HashMap<String,Any?>? = null
+
+    /** 关联设备id */
+    @ApiModelProperty(value = "关联设备id")
+    @Column(name = "parent_id")
+    @JSONField(name = "ParentId")
+    var parentId: String? = null
+
+    /** 资产名称 */
+    @ApiModelProperty(value = "资产名称")
+    @Column(name = "property_name")
+    @JSONField(name = "PropertyName")
+    var propertyName: String? = null
+
+    /** 资产本地名称 */
+    @ApiModelProperty(value = "资产本地名称")
+    @Column(name = "property_local_name")
+    @JSONField(name = "PropertyLocalName")
+    var propertyLocalName: String? = null
+
+    /** 资产id */
+    @ApiModelProperty(value = "资产id")
+    @Column(name = "property_id")
+    @JSONField(name = "PropertyId")
+    var propertyId: String? = null
+
+} // Class ComponentProperty

+ 33 - 0
equip-componnet/src/main/kotlin/com/persagy/server/models/EquipDictStatistics.kt

@@ -0,0 +1,33 @@
+package com.persagy.server.models
+
+import com.alibaba.fastjson.annotation.JSONField
+import io.swagger.annotations.ApiModelProperty
+import java.io.Serializable
+import javax.persistence.Column
+
+/**
+ * 字典统计不能同步的设备
+ *
+ * @author 张维新
+ */
+class EquipDictStatistics : Serializable {
+
+    /** 类型 */
+    @ApiModelProperty(value = "类型")
+    @Column(name = "category")
+    @JSONField(name = "Category")
+    var category: String? = null
+
+    /** 类型名称 */
+    @ApiModelProperty(value = "类型名称")
+    @Column(name = "category_name")
+    @JSONField(name = "CategoryName")
+    var category_name: String? = null
+
+    /** 数量 */
+    @ApiModelProperty(value = "数量")
+    @Column(name = "count")
+    @JSONField(name = "Count")
+    var count: String? = null
+
+} // class EquipDictStatistics

+ 38 - 0
equip-componnet/src/main/kotlin/com/persagy/server/models/GatherInfoPoint.kt

@@ -0,0 +1,38 @@
+package com.persagy.server.models
+
+import com.alibaba.fastjson.annotation.JSONField
+import io.swagger.annotations.ApiModel
+import io.swagger.annotations.ApiModelProperty
+import java.io.Serializable
+
+/**
+ * 已采集信息点统计实体类
+ *
+ * @author 蒋湘江
+ */
+@ApiModel(description = "已采集信息点统计实体类")
+class GatherInfoPoint:Serializable {
+
+    /** 信息点总数(数字字典+自定义信息点) */
+    @ApiModelProperty(value = "信息点总数(数字字典+自定义信息点)")
+    @JSONField(name = "GatherInfoPointCounts")
+    var gatherInfoPointCounts : Int? = 0
+
+    /** 已采集的动态信息点总数 */
+    @ApiModelProperty(value = "已采集的动态信息点总数")
+    @JSONField(name = "GatherDynamicInfoPointCounts")
+    var gatherDynamicInfoPointCounts : Int? = 0
+
+    /** 已采集的静态信息点总数 */
+    @ApiModelProperty(value = "已采集的静态信息点总数")
+    @JSONField(name = "GatherStaticInfoPointCounts")
+    var gatherStaticInfoPointCounts : Int? = 0
+
+    /** 已采集的自定义信息点总数 */
+    @ApiModelProperty(value = "已采集的自定义信息点总数")
+    @JSONField(name = "GatherCustomInfoPointCounts")
+    var gatherCustomInfoPointCounts : Int? = 0
+
+
+
+}// Class GatherInfoPoint

+ 46 - 0
equip-componnet/src/main/kotlin/com/persagy/server/models/InfoPoint.kt

@@ -0,0 +1,46 @@
+package com.persagy.server.models
+
+import com.alibaba.fastjson.annotation.JSONField
+import io.swagger.annotations.ApiModel
+import io.swagger.annotations.ApiModelProperty
+import java.io.Serializable
+
+/**
+ * 信息点统计实体类
+ *
+ * @author 蒋湘江
+ */
+@ApiModel(description = "信息点统计实体类")
+class InfoPoint : Serializable {
+
+    /** 自定义信息点总数 */
+    @ApiModelProperty(value = "自定义信息点总数")
+    @JSONField(name = "CustomInfoPointCounts")
+    var customInfoPointCounts:Int?=0
+
+    /** 项目中设备用到的自定义信息点数 */
+    @ApiModelProperty(value = "项目中设备用到的自定义信息点数")
+    @JSONField(name = "CustomInfoPoint")
+    var customInfoPoint:Int?=0
+
+    /** 动态信息点总数 */
+    @ApiModelProperty(value = "动态信息点总数")
+    @JSONField(name = "DynamicInfoPointCounts")
+    var dynamicInfoPointCounts:Int?=0
+
+    /** 设备用到的动态信息点数 */
+    @ApiModelProperty(value = "设备用到的动态信息点数")
+    @JSONField(name = "DynamicInfoPoint")
+    var dynamicInfoPoint:Int?=0
+
+    /** 静态信息点总数 */
+    @ApiModelProperty(value = "静态信息点总数")
+    @JSONField(name = "StaticInfoPointCounts")
+    var staticInfoPointCounts:Int?=0
+
+    /** 设备用到的静态信息点数 */
+    @ApiModelProperty(value = "设备用到的静态信息点数")
+    @JSONField(name = "StaticInfoPoint")
+    var staticInfoPoint:Int?=0
+
+}// Class InfoPoint

+ 21 - 0
equip-componnet/src/main/kotlin/com/persagy/server/models/SpaceBdFl.kt

@@ -0,0 +1,21 @@
+package com.persagy.server.models
+
+import com.alibaba.fastjson.annotation.JSONField
+import java.io.Serializable
+
+/**
+ *空间多建筑楼层统计
+ *
+ * @author 张维新
+ */
+class SpaceBdFl : Serializable {
+
+    /** 空间id */
+    @JSONField(name = "SpaceId")
+    var space_id: String? = null
+
+    /** 数量 */
+    @JSONField(name = "Count")
+    var count: Int? = 0
+
+} //  class SpaceBdFl

+ 43 - 0
equip-componnet/src/main/kotlin/com/persagy/server/models/VEquipComponentCount.kt

@@ -0,0 +1,43 @@
+package com.persagy.server.models
+
+import com.alibaba.fastjson.annotation.JSONField
+import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import io.swagger.annotations.ApiModel
+import io.swagger.annotations.ApiModelProperty
+import javax.persistence.Column
+import javax.persistence.Table
+
+/**
+ * 当前设备分类名称
+ *
+ * @author 张维新
+ */
+@ApiModel(description = "当前设备分类名称")
+@Table(name = "v_equip_component_count")
+class VEquipComponentCount : BaseInfo(){
+
+    /** 设备id */
+    @ApiModelProperty(value = "设备id",required = true)
+    @Column(name = "id")
+    @JSONField(name = "Id")
+    var id: String? = null
+
+    /** 分类 */
+    @ApiModelProperty(value = "分类")
+    @Column(name = "category")
+    @JSONField(name = "Category")
+    var category: String? = null
+
+    /** 分类名称 */
+    @ApiModelProperty(value = "分类名称")
+    @Column(name = "category_name")
+    @JSONField(name = "CategoryName")
+    var categoryName: String? = null
+
+    /** 数量 */
+    @ApiModelProperty(value = "数量",required = true)
+    @Column(name = "count")
+    @JSONField(name = "count")
+    var count:Long? = null
+
+} // class VEquipComponentCount

+ 434 - 0
equip-componnet/src/main/kotlin/com/persagy/server/service/CustomSqlService.kt

@@ -0,0 +1,434 @@
+package com.persagy.server.service
+
+import com.persagy.server.dao.mappers.CustomSql
+import com.persagy.server.models.EquipDictStatistics
+import com.persagy.server.models.GatherInfoPoint
+import com.persagy.server.models.InfoPoint
+import com.persagy.server.models.objects.FloorCompon
+import com.persagy.service.SPageContext
+import com.persagy.service.models.enums.SResponseType
+import com.persagy.service.models.responses.SQueryResponse
+import org.slf4j.LoggerFactory
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Service
+
+/**
+ * 自定义sql  服务
+ */
+@Service
+class CustomSqlService {
+
+    /** 自定义查询 */
+    @Autowired
+    lateinit var mapper: CustomSql
+
+    companion object {
+        // 日志
+        private val logger = LoggerFactory.getLogger(CustomSqlService::class.java)
+    } // Companion object
+
+    /**
+     * 查询数据中心未转换到物理世界的数据
+     */
+    fun dataCenter(projectId: String): ArrayList<EquipDictStatistics>{
+
+        var datacenter= ArrayList<EquipDictStatistics>()
+        try {
+            datacenter = mapper.datacenter(projectId!!)
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return datacenter
+    } //
+
+    /**
+     * 查询物理世界未转换到数据中心的数据
+     */
+    fun dataPlatfrom(projectId: String): ArrayList<EquipDictStatistics>{
+
+        var datacenter= ArrayList<EquipDictStatistics>()
+        try {
+            datacenter = mapper.dataplatfrom(projectId!!)
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return datacenter
+    } //
+
+    /**
+     * 租户的建筑楼层
+     */
+    fun tenantBuildingFloor(projectId: String,objectType: String,tenantId: String): ArrayList<FloorCompon>{
+        var floorCounts = ArrayList<FloorCompon>()
+        try {
+            floorCounts = mapper.floorCounts(projectId, objectType, tenantId)
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return  floorCounts
+    } //
+
+
+    /**
+     * 统计设备信息点与总数据占比
+     */
+    fun infoPoints(): SQueryResponse<InfoPoint> {
+        return try {
+            val projectId =  SPageContext.getHeader("ProjectId").toString()
+            //项目中所有自定义信息点编码
+            var projectCustomInforPoints=mapper.projectCustomInforPoints(projectId!!)
+            //项目下所有动态信息点编码
+            var dynamicInfoPointCodes=mapper.dynamicInfoPointCodes(projectId!!)
+            //项目下所有静态信息点编码
+            var staticInfoPointCodes=mapper.staticInfoPointCodes(projectId!!)
+            //项目下所有的设备
+            val projectEquipment =mapper.projectEquipment(projectId!!)
+
+            var hashMap=calculate(dynamicInfoPointCodes,staticInfoPointCodes,projectCustomInforPoints,projectEquipment,0)
+
+            var infoPoint = InfoPoint()
+          infoPoint.customInfoPointCounts=mapper.customInfoPointCounts(projectId!!)
+          infoPoint.customInfoPoint=hashMap["customInfoPoint"]
+          infoPoint.dynamicInfoPointCounts=mapper.dynamicInfoPointCounts()
+          infoPoint.dynamicInfoPoint=hashMap["dynamicInfoPoint"]
+          infoPoint.staticInfoPointCounts=mapper.staticInfoPointCounts()
+          infoPoint.staticInfoPoint=hashMap["staticInfoPoint"]
+            val list = ArrayList<InfoPoint>()
+            val sQueryResponse = SQueryResponse<InfoPoint>(SResponseType.success)
+            list.add(infoPoint)
+            sQueryResponse.content = list
+                sQueryResponse
+        } catch ( e: Exception){
+            e.printStackTrace()
+            SQueryResponse(SResponseType.failure)
+        }
+    }
+
+
+    /**
+     * 统计设备信息点与需采集数据占比
+     */
+    fun gatherInfoPoints(): SQueryResponse<GatherInfoPoint> {
+        return try {
+            val projectId =  SPageContext.getHeader("ProjectId").toString()
+            //自定义信息点
+            var customInfoPointCounts=mapper.customInfoPointCounts(projectId)
+            //数字字典信息点总数
+            var controlInfoCounts=mapper.controlInfoCounts()
+
+            //项目下所有已采集自定义信息点编码
+            var gatherCustomInforPointCode=mapper.gatherCustomInforPointCode(projectId)
+            //项目下所有已采集的动态信息点编码
+            var gatherDynamicInfoCode=mapper.gatherDynamicInfoCode(projectId)
+            //项目下所有已采集静态信息点编码
+            var gatherStaticInfoCode=mapper.gatherStaticInfoCode(projectId)
+
+            //项目下所有的设备
+            var projectEquipment=mapper.projectEquipment(projectId)
+
+            var hashMap=calculate(gatherDynamicInfoCode,gatherStaticInfoCode,gatherCustomInforPointCode,projectEquipment,0)
+
+            var gatherInfoPoint=GatherInfoPoint()
+            gatherInfoPoint.gatherInfoPointCounts=customInfoPointCounts+controlInfoCounts
+            gatherInfoPoint.gatherCustomInfoPointCounts=hashMap["customInfoPoint"]
+            gatherInfoPoint.gatherDynamicInfoPointCounts=hashMap["dynamicInfoPoint"]
+            gatherInfoPoint.gatherStaticInfoPointCounts=hashMap["staticInfoPoint"]
+
+            var list=ArrayList<GatherInfoPoint>()
+            val sQueryResponse = SQueryResponse<GatherInfoPoint>(SResponseType.success)
+            list.add(gatherInfoPoint)
+            sQueryResponse.content = list
+            sQueryResponse
+        } catch ( e: Exception){
+            e.printStackTrace()
+            SQueryResponse(SResponseType.failure)
+        }
+    }
+
+
+    /**
+     * 统计系统信息点与需采集数据占比
+     */
+    fun systemInfoPoins():SQueryResponse<GatherInfoPoint>{
+        return try {
+            val projectId =  SPageContext.getHeader("ProjectId").toString()
+            //系统  数字字典信息点总数
+            var systemControlInfoCounts=mapper.systemControlInfoCounts()
+            //系统 项目下自定义信息点总数
+            var systemCustomInfoCounts=mapper.systemCustomInfoCounts(projectId)
+
+            //系统  已采集动态信息点编码
+            var systemDynamicInfoCode=mapper.systemDynamicInfoCode()
+            //系统 已采集静态信息点编码
+            var systemStaticInfoCode=mapper.systemStaticInfoCode()
+            //系统 已采集自定义信息点编码
+            var systemCustomInfoCode=mapper.systemCustomInfoCode(projectId)
+            //项目下所有的系统
+            var projectSystem=mapper.projectSystem(projectId)
+
+            var hashMap=calculate(systemDynamicInfoCode,systemStaticInfoCode,systemCustomInfoCode,projectSystem,1)
+
+            var gatherInfoPoint=GatherInfoPoint()
+            gatherInfoPoint.gatherInfoPointCounts=systemControlInfoCounts+systemCustomInfoCounts
+            gatherInfoPoint.gatherCustomInfoPointCounts=hashMap["customInfoPoint"]
+            gatherInfoPoint.gatherDynamicInfoPointCounts=hashMap["dynamicInfoPoint"]
+            gatherInfoPoint.gatherStaticInfoPointCounts=hashMap["staticInfoPoint"]
+
+            var list=ArrayList<GatherInfoPoint>()
+            val sQueryResponse = SQueryResponse<GatherInfoPoint>(SResponseType.success)
+            list.add(gatherInfoPoint)
+            sQueryResponse.content = list
+            sQueryResponse
+        } catch ( e: Exception){
+            e.printStackTrace()
+            SQueryResponse(SResponseType.failure)
+        }
+    }
+
+
+    /**
+     * 计算信息点
+     *
+     */
+    fun calculateInfoPoints(str: String,type:String, infoPointCodes:ArrayList<HashMap<String,String>>):HashMap<String,Any> {
+        var counts=0
+        var hashMap=HashMap<String,Any>()
+        val iterator = infoPointCodes.iterator()
+        while (iterator.hasNext()){
+            val next = iterator.next()
+            if(str.contains(next["info_point_code"].toString()) && type==next["type"]){
+                counts++
+                hashMap["next"]=next
+                iterator.remove()
+            }
+        }
+        hashMap["counts"]=counts
+        return hashMap
+    }
+
+    /**
+     * 计算动态、静态信息点
+     */
+    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> {
+        var hashMap = HashMap<String, Int>()
+        var dynamicInfoPoint = 0
+        var staticInfoPoint = 0
+        var customInfoPoint=0
+        val iterator1 = staticInfoPointCodes.iterator()
+        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"]) {
+                    staticInfoPoint++
+                    iterator1.remove()
+                }
+                if (equipmentInforPoint["local_name"] != null && "EquipLocalName" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
+                    staticInfoPoint++
+                    iterator1.remove()
+                }
+                if (equipmentInforPoint["local_name"] != null && "SysLocalName" == next["info_point_code"]) {
+                    staticInfoPoint++
+                    iterator1.remove()
+                }
+                if (equipmentInforPoint["qr_code"] != null && "EquipQRCode" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"]) {
+                    staticInfoPoint++
+                    iterator1.remove()
+                }
+                if (equipmentInforPoint["cad_id"] != null && "CADID" == next["info_point_code"] && equipmentInforPoint["category"] == next["type"] && num==0) {
+                    staticInfoPoint++
+                    iterator1.remove()
+                }
+                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["category"] == next["type"] && num==0) {
+                    staticInfoPoint++
+                    iterator1.remove()
+                }
+                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["category"] == next["type"]) {
+                    staticInfoPoint++
+                    iterator1.remove()
+                }
+                if (equipmentInforPoint["equip_serial"] != null && "EquipSerial" == next["info_point_code"] && equipmentInforPoint["category"] == 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"]) {
+                    staticInfoPoint++
+                    iterator1.remove()
+                }
+            }
+        }
+
+        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)
+                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"])
+            }
+        }
+
+        hashMap["dynamicInfoPoint"]=dynamicInfoPoint
+        hashMap["staticInfoPoint"]=staticInfoPoint
+        hashMap["customInfoPoint"]=customInfoPoint
+
+        return hashMap
+
+    }
+
+
+    /**
+     * 统计空间所在的多建筑多楼层的数量
+     */
+    fun spaceBdFls(projectId: String):Int{
+        val setId = HashSet<String>()
+        try {
+            val spaceFlList = mapper.spaceFl(projectId)
+            val spaceBdList = mapper.spaceBd(projectId)
+
+            if (!spaceFlList.isNullOrEmpty()){
+                for (space in spaceFlList){
+                    if (space.count!=null&&space.count!!>1){
+                        setId.add(space.space_id!!)
+                    }
+                }
+            }
+            if (!spaceBdList.isNullOrEmpty()){
+                for (space in spaceBdList){
+                    if (space.count!=null&&space.count!!>1){
+                        setId.add(space.space_id!!)
+                    }
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return setId.size
+    } //
+
+    /**
+     * 统计空间所在的多建筑多楼层的数量
+     */
+    fun spaceBdFlObj(projectId: String):HashSet<String>{
+        val setId = HashSet<String>()
+        try {
+            val spaceFlList = mapper.spaceFl(projectId)
+            val spaceBdList = mapper.spaceBd(projectId)
+
+            if (!spaceFlList.isNullOrEmpty()){
+                for (space in spaceFlList){
+                    if (space.count!=null&&space.count!!>1){
+                        setId.add(space.space_id!!)
+                    }
+                }
+            }
+            if (!spaceBdList.isNullOrEmpty()){
+                for (space in spaceBdList){
+                    if (space.count!=null&&space.count!!>1){
+                        setId.add(space.space_id!!)
+                    }
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return setId
+    } //
+
+
+
+
+} // class CustomSqlService

+ 20 - 0
equip-componnet/src/main/kotlin/com/persagy/server/service/EquipAssetComponentsReqponseService.kt

@@ -0,0 +1,20 @@
+package com.persagy.server.service
+
+import com.persagy.database.SQueryBuilder
+import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.datacenter.models.response.EquipAssetComponentsReqponse
+import com.persagy.service.SObjectService
+
+/**
+ *
+ */
+object EquipAssetComponentsReqponseService : SObjectService<EquipAssetComponentsReqponse>(SMybatisDao(EquipAssetComponentsReqponse::class.java)){
+
+
+    override fun onQueryBefore(queryBuilder: SQueryBuilder<EquipAssetComponentsReqponse>) {
+        super.onQueryBefore(queryBuilder)
+        queryBuilder.tableName = "v_equip_property"
+    }
+
+
+} // Fun

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1479 - 0
equip-componnet/src/main/kotlin/com/persagy/server/service/objects/EquipmentService.kt


+ 1 - 1
gradle.properties

@@ -28,7 +28,7 @@ SAGA_SERVICE_VERSION = 1.4.140
 
 PERSAGY_URL = http://www.persagy.cn
 PERSAGY_KOTLIN_VERSION = 1.4.114
-PERSAGY_SERVICE_VERSION = 1.4.151
+PERSAGY_SERVICE_VERSION = 1.4.152
 
 
 

+ 2 - 2
labsl/src/main/kotlin/com/persagy/server/labsl/LaBSLApp.kt

@@ -35,8 +35,8 @@ import org.springframework.context.annotation.ComponentScan
  *
  * @author  Andy
  */
-@ComponentScan(basePackages = ["com.persagy"])           // 配置组件扫描路径
-@MapperScan("com.persagy")                       // Mapper组件扫描路径
+@ComponentScan(basePackages = ["com.persagy.server"])           // 配置组件扫描路径
+@MapperScan("com.persagy.server")                       // Mapper组件扫描路径
 @SpringBootApplication
 open class LaBSLApp : SpringBootServletInitializer() {
     companion object {

+ 7 - 2
labsl/src/main/resources/application-prod.yml

@@ -2,10 +2,15 @@ server:
   port: 8080
 
 spring:
+#  datasource:
+#    url:                                jdbc:postgresql://172.17.11.228:5432/datacenter
+#    username:                           postgres
+#    password:                           123qwe!@#
+
   datasource:
-    url:                                jdbc:postgresql://172.17.11.228:5432/datacenter
+    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
     username:                           postgres
-    password:                           123qwe!@#
+    password:                           persagy_2020qwe!@#
 
   activemq:
     broker-url:                         tcp://activemq:61616

+ 7 - 2
meiku/src/main/resources/application-prod.yml

@@ -2,10 +2,15 @@ server:
   port: 8080
 
 spring:
+#  datasource:
+#    url:                                jdbc:postgresql://172.17.11.228:5432/datacenter
+#    username:                           postgres
+#    password:                           123qwe!@#
+
   datasource:
-    url:                                jdbc:postgresql://172.17.11.228:5432/datacenter
+    url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
     username:                           postgres
-    password:                           123qwe!@#
+    password:                           persagy_2020qwe!@#
 
   activemq:
     broker-url:                         tcp://activemq:61616