Forráskód Böngészése

**************************************万达adm**********************************************
提交

zhangweixin 4 éve
szülő
commit
d48b5c6ecb

+ 42 - 4
data-core/src/main/kotlin/com/persagy/server/datacenter/datacenter/dao/mappers/SchemeMapper.kt

@@ -29,6 +29,7 @@ package com.persagy.server.datacenter.datacenter.dao.mappers
 import com.persagy.server.datacenter.models.entities.assistant.ModelKey
 import com.persagy.server.datacenter.models.entities.dict.Family
 import com.persagy.server.datacenter.wanda.obj.Building
+import com.persagy.server.datacenter.wanda.obj.Floor
 import org.apache.ibatis.annotations.Mapper
 import org.apache.ibatis.annotations.Param
 import org.apache.ibatis.annotations.Select
@@ -127,12 +128,49 @@ interface SchemeMapper {
     @Select("SELECT floor_id AS id FROM public.equipment WHERE project_id = #{projectId} AND  NOT floor_id IS NULL GROUP BY floor_id")
     fun floorId(@Param("projectId") projectId: String):ArrayList<Building>
 
+    /** 空间的建筑 id 统计 */
+    @Select("SELECT building_id AS id FROM public.zone_space_base WHERE project_id = #{projectId} AND  NOT building_id IS NULL GROUP BY building_id")
+    fun spBuildingId(@Param("projectId") projectId: String):ArrayList<Building>
+
+    /** 空间的楼层 id 统计 */
+    @Select("SELECT floor_id AS id FROM public.zone_space_base WHERE project_id = #{projectId} AND  NOT floor_id IS NULL GROUP BY floor_id")
+    fun spFloorId(@Param("projectId") projectId: String):ArrayList<Floor>
+
     /**
-     * 统计楼层id
+     * 统计楼层空间类型不为空的
+     */
+    @Select("SELECT building_id FROM public.zone_space_base WHERE project_id = #{projectId}  and NOT building_id IS NULL  AND object_type = #{zoneType} GROUP BY building_id")
+    fun spbuildingIdZoneType(@Param("projectId") projectId: String,@Param("zoneType") zoneType: String):ArrayList<Building>
+
+    /**
+     * 空间类型和关键字都不为空
+     */
+    @Select("SELECT building_id FROM zone_space_base WHERE project_id = #{projectId} AND NOT building_id IS NULL  AND  object_type = #{zoneType} AND   (local_name like'%#{vague}%' or  local_id  like '%#{vague}%') GROUP BY building_id ")
+    fun spbuildingIdVagueToZoneType(@Param("projectId") projectId: String,@Param("zoneType") zoneType: String,@Param("vague") vague: String):ArrayList<Building>
+
+    /**
+     * 关键字不为空的
      */
-    @Select("SELECT building_id FROM public.zone_space_base WHERE project_id = #{projectId} AND object_type = #{zoneType} GROUP BY building_id")
-    fun spbuildingId(@Param("projectId") projectId: String,@Param("zoneType") zoneType: String):ArrayList<Building>
+    @Select("SELECT building_id FROM zone_space_base WHERE project_id = #{projectId}  AND NOT building_id IS NULL  AND   (local_name like'%#{vague}%' or  local_id  like '%#{vague}%') GROUP BY building_id ")
+    fun spbuildingIdVague(@Param("projectId") projectId: String,@Param("vague") vague: String):ArrayList<Building>
 
+    /**
+     * 统计楼层空间类型不为空的
+     */
+    @Select("SELECT floor_id FROM public.zone_space_base WHERE project_id = #{projectId}  and NOT floor_id IS NULL  AND object_type = #{zoneType} GROUP BY floor_id")
+    fun spfloorIdZoneType(@Param("projectId") projectId: String,@Param("zoneType") zoneType: String):ArrayList<Floor>
+
+    /**
+     * 空间类型和关键字都不为空
+     */
+    @Select("SELECT floor_id FROM zone_space_base WHERE project_id = #{projectId} AND NOT floor_id IS NULL  AND  object_type = #{zoneType} AND   (local_name like'%#{vague}%' or  local_id  like '%#{vague}%') GROUP BY floor_id ")
+    fun spfloorIdVagueToZoneType(@Param("projectId") projectId: String,@Param("zoneType") zoneType: String,@Param("vague") vague: String):ArrayList<Floor>
+
+    /**
+     * 关键字不为空的
+     */
+    @Select("SELECT floor_id FROM zone_space_base WHERE project_id = #{projectId}   AND NOT floor_id IS NULL  AND   (local_name like'%#{vague}%' or  local_id  like '%#{vague}%') GROUP BY floor_id ")
+    fun spfloorIdVague(@Param("projectId") projectId: String,@Param("vague") vague: String):ArrayList<Floor>
 
 
-} // interface SchemeMapper
+}

+ 20 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/RFl2SpFloor.kt

@@ -0,0 +1,20 @@
+package com.persagy.server.datacenter.wanda.rel
+
+import com.persagy.service.models.annotations.SCascade
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Table
+
+/**
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2021/3/1 14:03
+ */
+@Schema(name = "关系楼层信息实体类")
+@Table(name = "v_floor_buildingname")
+class RFl2SpFloor : RelFloor() {
+
+    /** 级联-对象 */
+    @Schema(description = "级联-对象")
+    @SCascade(table="public.zone_space_base", idColumn="floor_id", childIdColumn="id")
+    var objectInfo: ArrayList<RelZoneSpaceBd>? = null
+}

+ 101 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/RSp2SpTwo.kt

@@ -0,0 +1,101 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.datacenter.wanda.rel
+
+import com.persagy.server.datacenter.models.entities.base.RBaseInfo
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+
+/**
+ * 空间和空间关系
+ *
+ * @author 张维新
+ */
+@Schema(description = "空间和空间关系")
+@Table(name = "v_space_sp2sp")
+class RSp2SpTwo : RBaseInfo(){
+
+    /** 空间Id */
+    @Schema(description = "空间Id")
+    @Id
+    @Column(name = "id1")
+    var id1: String? = null
+
+    /** 空间Id */
+    @Schema(description = "空间Id")
+    @Id
+    @Column(name = "id2")
+    var id2: String? = null
+
+    /** 项目Id */
+    @Schema(description = "项目Id")
+    @Id
+    @Column(name = "project_id")
+    var projectId: String? = null
+
+    /** 类型 */
+    @Schema(description = "类型 " )
+    @Id
+    @Column(name = "type")
+    var type: String? = null
+
+    /** 空间类型 */
+    @Schema(description = "空间类型 " )
+    @Id
+    @Column(name = "zone_type")
+    var zoneType: String? = null
+
+    /** 图类型编码 */
+    @Schema(description = "图类型编码")
+    @Id
+    @Column(name = "graph_code")
+    var graphCode: String? = null
+
+    /** 本地名称 */
+    @Schema(description = "本地名称")
+    @Column(name = "local_name1")
+    var localName1: String? = null
+
+    /** 本地编码 */
+    @Schema(description = "本地编码")
+    @Column(name = "local_id1")
+    var localId1: String? = null
+
+    /** 本地名称 */
+    @Schema(description = "本地名称")
+    @Column(name = "local_name2")
+    var localName2: String? = null
+
+    /** 本地编码 */
+    @Schema(description = "本地编码")
+    @Column(name = "local_id2")
+    var localId2: String? = null
+
+
+}

+ 0 - 2
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/RelFloor.kt

@@ -26,9 +26,7 @@
 
 package com.persagy.server.datacenter.wanda.rel
 
-import com.persagy.server.datacenter.models.entities.assistant.PointPosition
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
-import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
 import javax.persistence.Id

+ 113 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/RelGeneralSystem.kt

@@ -0,0 +1,113 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.datacenter.wanda.rel
+
+import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.service.models.annotations.SCascade
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+
+/**
+ * 系统信息实体类
+ *
+ * @author 张维新
+ */
+@Schema(description = "系统信息实体类")
+@Table(name = "general_system")
+open class RelGeneralSystem : BaseInfo() {
+
+    /** 系统ID */
+    @Schema(description = "系统ID")
+    @Id
+    @Column(name = "id")
+    var id: String? = null
+
+    /** 系统名称 */
+    @Schema(description = "系统名称")
+    @Column(name = "name")
+    var name: String? = null
+
+    /** 系统本地编码 */
+    @Schema(description = "系统本地编码")
+    @Column(name = "local_id")
+    var localId: String? = null
+
+    /** 系统本地名称 */
+    @Schema(description = "系统本地名称")
+    @Column(name = "local_name")
+    var localName: String? = null
+
+
+    /** BIM模型中编码 */
+    @Schema(description = "BIM模型中编码")
+    @Column(name = "bim_id")
+    var bimId: String? = null
+
+    /** 系统分类 */
+    @Schema(description = "系统分类",required = true)
+    @Column(name = "class_code")
+    var classCode: String? = null
+
+    /** 项目id */
+    @Schema(description = "项目id",required = true)
+    @Column(name = "project_id")
+    var projectId: String? = null
+
+    /** 建筑id */
+    @Schema(description = "建筑id")
+    @Column(name = "building_id")
+    var buildingId: String? = null
+
+    /** 楼层id */
+    @Schema(description = "楼层id")
+    @Column(name = "floor_id")
+    var floorId: String? = null
+
+
+    /** 对象类型 */
+    @Schema(description = "对象类型")
+    @Column(name = "object_type")
+    override var objectType: String? = "system"
+
+    /** 专业名称 */
+//    @Schema(description = "专业名称")
+//    @Column(name = "major_name",insertable = false,updatable = false)
+//    var majorName: String? = null
+
+
+    /** 设备数量 */
+    @Schema(description = "设备数量")
+    @Column(name = "category_name",insertable = false,updatable = false)
+    var categoryName: String? = null
+
+
+
+
+
+}

+ 23 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/RelSp2SpSpace.kt

@@ -0,0 +1,23 @@
+package com.persagy.server.datacenter.wanda.rel
+
+import com.persagy.service.models.annotations.SCascade
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Table
+
+/**
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2021/3/1 15:24
+ */
+@Schema(description = "空间父类实体类")
+@Table(name = "v_space_building_floor")
+class RelSp2SpSpace: RelZoneSpaceBd() {
+
+
+    /** 级联-设备服务的建筑 */
+    @Schema(description = "级联-设备服务的建筑")
+    @SCascade(table="relationship.r_sp2sp", idColumn="id1", childIdColumn="id2")
+    var objectInfo: ArrayList<RelZoneSpaceBd>? = null
+
+
+}

+ 23 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/RelSy2EqSystem.kt

@@ -0,0 +1,23 @@
+package com.persagy.server.datacenter.wanda.rel
+
+import com.persagy.service.models.annotations.SCascade
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Table
+
+/**
+ * 系统
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2021/3/1 18:27
+ */
+@Schema(description = "系统信息实体类")
+@Table(name = "general_system")
+class RelSy2EqSystem : RelGeneralSystem() {
+
+    /** 级联-设备服务的建筑 */
+    @Schema(description = "级联-设备服务的建筑")
+    @SCascade(table="relationship.r_sy_eq", idColumn="sy_id", childIdColumn="eq_id")
+    var objectInfo: ArrayList<EquipmentBase>? = null
+
+
+}

+ 1 - 1
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/RelZoneSpaceBd.kt

@@ -12,7 +12,7 @@ import javax.persistence.Table
  */
 @Schema(description = "空间父类实体类")
 @Table(name = "v_space_building_floor")
-class RelZoneSpaceBd : SpaceBaseZone() {
+open class RelZoneSpaceBd : SpaceBaseZone() {
 
     /** 楼层名称 */
     @Schema(description = "楼层名称")

+ 26 - 0
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/graphtype/DownloadsService.kt

@@ -0,0 +1,26 @@
+package com.persagy.server.datacenter.services.graphtype
+
+import org.apache.poi.xssf.usermodel.XSSFWorkbook
+import org.springframework.stereotype.Service
+import java.io.IOException
+import javax.servlet.http.HttpServletResponse
+
+/**
+ * @author wx  <zhangweixin></zhangweixin>@sagacloud.com>
+ * @date 2021/3/1 10:35
+ */
+@Service
+class DownloadsService {
+
+    @Throws(IOException::class)
+    fun downloadsEquip(response: HttpServletResponse) {
+        val workbook = XSSFWorkbook(DownloadsService::class.java.classLoader.getResourceAsStream("excel/信息点汇总表(汇总)帮助文档.xlsx"))
+        response.characterEncoding = "utf-8"
+        response.contentType = "application/octet-stream"
+        val downloadFileName = String("help-document.xlsx".toByteArray(charset("gbk")), charset("iso8859-1"))
+        response.setHeader("Content-Disposition", "attachment;fileName="
+                + downloadFileName)
+        response.flushBuffer()
+        workbook.write(response.outputStream)
+    }
+}

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

@@ -24,7 +24,7 @@
  * *********************************************************************************************************************
  */
 
-package com.persagy.server.services.graphtype
+package com.persagy.server.datacenter.services.graphtype
 
 import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
@@ -66,6 +66,14 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
         SSpringContextUtil.getBean(IRelationExcelImportMapper::class.java) as IRelationExcelImportMapper
     }
 
+    /** 导入excel对应的Mapper */
+    val downloadsService by lazy {
+        SSpringContextUtil.getBean(DownloadsService::class.java) as DownloadsService
+    }
+
+
+
+
     private val codeColMap by lazy {
         val map = HashMap<String, String>()
         map["对象ID"] = "id"
@@ -119,6 +127,20 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
         workbook.write(response.outputStream)
     } // Function templateDownloads()
 
+
+    /**
+     * 下载模板
+     * @param   response        应答体
+     */
+    fun downloadsEquip(response: HttpServletResponse) {
+        val workbook = XSSFWorkbook(RelationTypeProjectService::class.java.classLoader.getResourceAsStream("excel/信息点汇总表(汇总)帮助文档.xlsx"))
+        response.contentType = "application/octet-stream"
+        response.setCharacterEncoding("utf-8")
+        response.setHeader("Content-disposition", "attachment;filename=信息点汇总表(汇总)帮助文档.xlsx")
+        response.flushBuffer()
+        workbook.write(response.outputStream)
+    } // Function templateDownloads()
+
     /**
      * 下载报告
      *

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 473 - 528
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/relation_calc/ManualRelationCalcService.kt


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

@@ -28,6 +28,7 @@ package com.persagy.server.datacenter.wanda.controllers.obj
 
 import com.persagy.database.SFilter
 import com.persagy.server.Opt
+import com.persagy.server.datacenter.services.graphtype.RelationTypeProjectService
 import com.persagy.server.datacenter.services.objects.EquipmentService
 import com.persagy.server.datacenter.wanda.obj.Equipment
 import com.persagy.service.models.requests.SCountRequest
@@ -41,6 +42,7 @@ import com.persagy.service.models.responses.SQueryResponse
 import io.swagger.v3.oas.annotations.Operation
 import io.swagger.v3.oas.annotations.tags.Tag
 import org.springframework.web.bind.annotation.*
+import javax.servlet.http.HttpServletResponse
 
 /**
  * 设备接口
@@ -109,4 +111,14 @@ open class EquipController {
         return EquipmentService.count(request, arrayListOf(SFilter.eq("projectId", Opt.projectId!!)))
     }
 
+
+    /**
+     * 帮助模板下载
+     */
+    @Operation(summary="帮助模板下载", description ="")
+    @GetMapping(value = ["/downloads"])
+    fun  downloads(response: HttpServletResponse){
+        RelationTypeProjectService.downloadsService.downloadsEquip(response)
+    }
+
 }

+ 5 - 1
datacenter/src/main/kotlin/com/persagy/server/datacenter/wanda/controllers/relation/GraphicTypeController.kt

@@ -27,6 +27,7 @@ import com.persagy.server.datacenter.models.entities.graphtype.block.ConnectedBl
 import com.persagy.server.datacenter.models.entities.graphtype.block.ConnectedBlockSource
 import com.persagy.server.datacenter.models.entities.graphtype.block.ConnectedBlockSourceRequest
 import com.persagy.server.datacenter.services.graphtype.GraphicTypeMapperService
+import com.persagy.server.datacenter.services.graphtype.RelationTypeProjectService
 import com.persagy.server.services.graphtype.*
 import com.persagy.service.SObjectService
 import com.persagy.service.SPageContext
@@ -86,7 +87,7 @@ open class GraphicTypeController {
      */
     @Operation(summary="下载模板", description= "")
     @GetMapping(value = ["/template/downloads"])
-    fun templateDownloads(@RequestBody response: HttpServletResponse) {
+    fun templateDownloads(response: HttpServletResponse) {
         RelationTypeProjectService.templateDownloads(response)
     } // Fun templateDownloads
 
@@ -153,4 +154,7 @@ open class GraphicTypeController {
         val service = SObjectService(RelationTypeProject::class.java)
         return service.pageQuery(request, arrayListOf(SFilter.eq("projectId", SPageContext.getHeader("ProjectId").toString())))
     } // Fun replaceConnectedBlockSource()
+
+
+
 } // Class EquipScanTaskController

BIN
datacenter/src/main/resources/excel/信息点汇总表(汇总)帮助文档.xlsx