Procházet zdrojové kódy

**********************************wx*************************
深化点表

weixinVSjinlai před 4 roky
rodič
revize
454a9213b3

+ 5 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/RelationTypeProject.kt

@@ -174,6 +174,11 @@ open class RelationTypeProject : RBaseInfo() {
     @Column(name = "from_object")
     @Column(name = "from_object")
     var fromObject: String? = null
     var fromObject: String? = null
 
 
+    /** 文件名 */
+    @Schema(description = "文件名")
+    @Column(name = "file_name")
+    var fileName: String? = null
+
     /** 机电系统类型 */
     /** 机电系统类型 */
     @Schema(description = "机电系统类型")
     @Schema(description = "机电系统类型")
     @Column(name = "mep_system_type")
     @Column(name = "mep_system_type")

+ 2 - 2
datacenter/src/main/kotlin/com/persagy/server/controllers/graphtype/GraphicTypeController.kt

@@ -180,9 +180,9 @@ open class GraphicTypeController {
      */
      */
     @Operation(summary = "导入excel-点表", description = "")
     @Operation(summary = "导入excel-点表", description = "")
     @PostMapping("/import/point")
     @PostMapping("/import/point")
-    fun importExcelPointLocalId(@RequestParam("file") file: MultipartFile) : SBaseResponse{
+    fun importExcelPointLocalId(@RequestParam("file") file: MultipartFile,@RequestParam relType: String) : SBaseResponse{
         try {
         try {
-            return RelationTypeProjectService.importExcelPoint(file)
+            return RelationTypeProjectService.importExcelPoint(file,relType)
         }catch (e : Exception){
         }catch (e : Exception){
             return SBaseResponse(SResponseType.failure,"error:" + e.message)
             return SBaseResponse(SResponseType.failure,"error:" + e.message)
         }
         }

+ 48 - 385
datacenter/src/main/kotlin/com/persagy/server/services/graphtype/RelationTypeProjectService.kt

@@ -32,6 +32,7 @@ import com.persagy.base.extensions.toJson
 import com.persagy.database.SFilter
 import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.Opt
 import com.persagy.server.Opt
+import com.persagy.server.datacenter.models.entities.dictnew.DefFuncId
 import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
 import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelZoneSpace
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelZoneSpace
 import com.persagy.server.datacenter.models.entities.objects.Equipment
 import com.persagy.server.datacenter.models.entities.objects.Equipment
@@ -80,6 +81,9 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
         SSpringContextUtil.getBean(IRelationExcelImportMapper::class.java) as IRelationExcelImportMapper
         SSpringContextUtil.getBean(IRelationExcelImportMapper::class.java) as IRelationExcelImportMapper
     }
     }
 
 
+    /** 信息点 */
+    private val dictDefFuncId = SObjectService(SMybatisDao(DefFuncId::class.java))
+
     private val spaceService = SObjectService(SMybatisDao(RelZoneSpace::class.java))
     private val spaceService = SObjectService(SMybatisDao(RelZoneSpace::class.java))
 
 
     private val codeColMap by lazy {
     private val codeColMap by lazy {
@@ -566,13 +570,13 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
      * @param   zoneType        业务空间类型
      * @param   zoneType        业务空间类型
      * @return  应答体
      * @return  应答体
      */
      */
-    fun importExcelPoint(file: MultipartFile): SBaseResponse {
+    fun importExcelPoint(file: MultipartFile,relType: String): SBaseResponse {
         try {
         try {
             if (file.isEmpty) {
             if (file.isEmpty) {
                 throw Exception("未选择文件")
                 throw Exception("未选择文件")
             }
             }
 
 
-            val projectId = SPageContext.getHeader("ProjectId")
+            val projectId = SPageContext.getHeader("projectId")
             // 转为 XSSFWorkbook 对象
             // 转为 XSSFWorkbook 对象
             val workbook = XSSFWorkbook(file.inputStream)
             val workbook = XSSFWorkbook(file.inputStream)
             // 读取第一个 sheet
             // 读取第一个 sheet
@@ -608,13 +612,23 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
             workbook.write(os)
             workbook.write(os)
             os.flush()
             os.flush()
             os.close()
             os.close()
+            try {
+                val relationTypeProjectService = SObjectService(SMybatisDao(RelationTypeProject::class.java))
+                val relationType = relationTypeProjectService.select(SFilter.eq("projectId", projectId!!),SFilter.eq("relationType", relType)).entity()
+                if (relationType!=null){
+                    relationType.fileName = fileName
+                    relationType.computingTime = IdUtils.time()
+                    relationTypeProjectService.update(relationType)
+                }
+            } catch (e: Exception) {
+                e.printStackTrace()
+            }
+
             return SBaseResponse(SResponseType.success,fileName)
             return SBaseResponse(SResponseType.success,fileName)
-//            return SBaseResponse(SResponseType.success)
         } catch (e: Exception) {
         } catch (e: Exception) {
             e.printStackTrace()
             e.printStackTrace()
             return SBaseResponse(SResponseType.failure, e.message!!)
             return SBaseResponse(SResponseType.failure, e.message!!)
         }
         }
-        return SBaseResponse(SResponseType.success)
     } // Fun importExcel()
     } // Fun importExcel()
 
 
     /**
     /**
@@ -657,34 +671,34 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
 
 
                         val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId), SFilter.eq("localId", id0.trim())).exec()
                         val equipmentList = EquipmentService.select(SFilter.eq("projectId", projectId), SFilter.eq("localId", id0.trim())).exec()
                         if (equipmentList.isEmpty()){
                         if (equipmentList.isEmpty()){
-                            row.createCell(4).setCellValue("不存在")
+                            row.createCell(4).setCellValue("本地编码不存在")
                         }else if (equipmentList.size>1) {
                         }else if (equipmentList.size>1) {
-                            row.createCell(4).setCellValue("重复")
+                            row.createCell(4).setCellValue("本地编码重复")
                         }else {
                         }else {
-
-
-                            val equip = equipUpdate(equipmentList[0], id1, id2, id3)
-                            val request = SUpdateRequest<Equipment>()
-                            request.content = arrayListOf(equip)
-                            try {
-                                val updateList = EquipmentService.updateList(request)
-                                if (updateList.result == SResponseType.success){
-                                    row.createCell(4).setCellValue("成功")
-                                }else{
+                            val entity = dictDefFuncId.select(SFilter.eq("type", equipmentList[0].classCode!!), SFilter.eq("code", id1)).entity()
+                            if (entity == null) {
+                                row.createCell(4).setCellValue("信息点不存在")
+                            }else {
+                                val equip = equipUpdate(equipmentList[0], id1, id2, id3)
+                                val request = SUpdateRequest<Equipment>()
+                                request.content = arrayListOf(equip)
+                                try {
+                                    val updateList = EquipmentService.updateList(request)
+                                    if (updateList.result == SResponseType.success){
+                                        row.createCell(4).setCellValue("成功")
+                                    }else{
+                                        row.createCell(4).setCellValue("失败")
+                                    }
+                                } catch (e: Exception) {
+                                    e.printStackTrace()
                                     row.createCell(4).setCellValue("失败")
                                     row.createCell(4).setCellValue("失败")
                                 }
                                 }
-                            } catch (e: Exception) {
-                                e.printStackTrace()
-                                row.createCell(4).setCellValue("失败")
                             }
                             }
-                            row.createCell(4).setCellValue("成功")
                         }
                         }
                     }else {
                     }else {
                         row.createCell(4).setCellValue("信息不全")
                         row.createCell(4).setCellValue("信息不全")
                     }
                     }
                 }
                 }
-
-
             } catch (e: Exception) {
             } catch (e: Exception) {
                 e.printStackTrace()
                 e.printStackTrace()
                 row.createCell(4).setCellValue("失败")
                 row.createCell(4).setCellValue("失败")
@@ -695,366 +709,16 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
     } // Fun readExcelRelation()
     } // Fun readExcelRelation()
 
 
     fun equipUpdate(equipment: Equipment,id1: String,id2: String,id3: String):Equipment {
     fun equipUpdate(equipment: Equipment,id1: String,id2: String,id3: String):Equipment {
-//        val entity = dPropertyDefProjectservice.select(SFilter.eq("type", equipment.category!!), SFilter.eq("infoPointCode", id1)).entity()
-//        logger.debug("信息点1=${equipment.category}")
-//        logger.debug("信息点=${entity?.toJson()}")
-//        if (entity!=null){
-//
-//            if (entity.firstTag == "LedgerParam"){
-//                if (equipment.ledgerParam.isNullOrEmpty()){
-//                    equipment.ledgerParam = HashMap<String,Any?>()
-//                }
-//
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.ledgerParam!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.ledgerParam!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.ledgerParam!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.ledgerParam!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "CommParam") {
-//                /** 通讯参数 */
-//                if (equipment.commParam.isNullOrEmpty()){
-//                    equipment.commParam = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.commParam!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.commParam!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.commParam!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.commParam!![id1] = "$id2-$id3"
-//                }
-//            }else if (entity.firstTag == "TechParam") {
-//                /** 技术参数 */
-//                if (equipment.techParam.isNullOrEmpty()){
-//                    equipment.techParam = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.techParam!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.techParam!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.techParam!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.techParam!![id1] = "$id2-$id3"
-//                }
-//
-//
-//            }else if (entity.firstTag == "RunParam") {
-//                /** 运行参数 */
-//                if (equipment.runParam.isNullOrEmpty()){
-//                    equipment.runParam = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.runParam!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.runParam!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.runParam!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.runParam!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "SettingParam") {
-//                /** 设定参数 */
-//                if (equipment.settingParam.isNullOrEmpty()){
-//                    equipment.settingParam = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.settingParam!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.settingParam!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.settingParam!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.settingParam!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "Alram") {
-//                /** 报警消息 */
-//                if (equipment.alram.isNullOrEmpty()){
-//                    equipment.alram = HashMap<String,Any?>()
-//                }
-//                equipment.alram!![id1] = "$id2-$id3"
-//
-//            }else if (entity.firstTag == "TempSensor") {
-//                /** 温度传感器 */
-//                if (equipment.tempSensor.isNullOrEmpty()){
-//                    equipment.tempSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.tempSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.tempSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.tempSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.tempSensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "TechParamGeneral") {
-//                /** 技术参数-通用 */
-//                if (equipment.techParamGeneral.isNullOrEmpty()){
-//                    equipment.techParamGeneral = HashMap<String,Any?>()
-//                }
-//                equipment.techParamGeneral!![id1] = "$id2-$id3"
-//            }else if (entity.firstTag == "RunParamGeneral") {
-//                /** 运行参数-通用 */
-//                if (equipment.runParamGeneral.isNullOrEmpty()){
-//                    equipment.runParamGeneral = HashMap<String,Any?>()
-//                }
-//                equipment.runParamGeneral!![id1] = "$id2-$id3"
-//            }else if (entity.firstTag == "SpeedSensor") {
-//                /** 速度传感器 */
-//                if (equipment.speedSensor.isNullOrEmpty()){
-//                    equipment.speedSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.speedSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.speedSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.speedSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.speedSensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "SoundSensor") {
-//                /** 声音传感器 */
-//                if (equipment.soundSensor.isNullOrEmpty()){
-//                    equipment.soundSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.soundSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.soundSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.soundSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.soundSensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "HumiditySensor") {
-//                /** 湿度传感器 */
-//                if (equipment.humiditySensor.isNullOrEmpty()){
-//                    equipment.humiditySensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.humiditySensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.humiditySensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.humiditySensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.humiditySensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "PressTransd") {
-//                /** 压力传感器 */
-//                if (equipment.pressTransd.isNullOrEmpty()){
-//                    equipment.pressTransd = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.pressTransd!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.pressTransd!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.pressTransd!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.pressTransd!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "HeatSensor") {
-//                /** 热量传感器 */
-//                if (equipment.heatSensor.isNullOrEmpty()){
-//                    equipment.heatSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.heatSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.heatSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.heatSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.heatSensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "FlowSensor") {
-//                /** 流量传感器 */
-//                if (equipment.flowSensor.isNullOrEmpty()){
-//                    equipment.flowSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.flowSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.flowSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.flowSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.flowSensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "ElectricitySensor") {
-//                /** 电度传感器 */
-//                if (equipment.electricitySensor.isNullOrEmpty()){
-//                    equipment.electricitySensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.electricitySensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.electricitySensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.electricitySensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.electricitySensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "DisplSensor") {
-//                /** 位移传感器 */
-//                if (equipment.displSensor.isNullOrEmpty()){
-//                    equipment.displSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.displSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.displSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.displSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.displSensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "ConcentSensor") {
-//                /** 浓度传感器 */
-//                if (equipment.concentSensor.isNullOrEmpty()){
-//                    equipment.concentSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.concentSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.concentSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.concentSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.concentSensor!![id1] = "$id2-$id3"
-//                }
-//
-//            }else if (entity.firstTag == "ImageSensor") {
-//                /** 图像传感器 */
-//                if (equipment.imageSensor.isNullOrEmpty()){
-//                    equipment.imageSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.imageSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.imageSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.imageSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.imageSensor!![id1] = "$id2-$id3"
-//                }
-//            }else if (entity.firstTag =="ManFlowSensor"){
-//                /** 人流量传感器 */
-//                if (equipment.manFlowSensor.isNullOrEmpty()){
-//                    equipment.manFlowSensor = HashMap<String,Any?>()
-//                }
-//                if (!entity.secondTag.isNullOrEmpty()){
-//                    val containsKey = equipment.manFlowSensor!!.containsKey(entity.secondTag!!)
-//                    if (containsKey){
-//                        val photoDocMap = equipment.manFlowSensor!![entity.secondTag!!] as JSONObject
-//                        photoDocMap[id1] = "$id2-$id3"
-//                    }else{
-//                        val mapPic = HashMap<String,Any>()
-//                        mapPic[id1] = "$id2-$id3"
-//                        equipment.manFlowSensor!![entity.secondTag!!] = mapPic
-//                    }
-//                }else{
-//                    equipment.manFlowSensor!![id1] = "$id2-$id3"
-//                }
-//            }else {
-//                /** 自定义 */
-//                if (equipment.customParam.isNullOrEmpty()){
-//                    equipment.customParam = HashMap<String,Any?>()
-//                }
-//                equipment.customParam!![id1] = "$id2-$id3"
-//            }
-//
-//        }else{
-//            /** 自定义 */
-//            if (equipment.customParam.isNullOrEmpty()){
-//                equipment.customParam = HashMap<String,Any?>()
-//            }
-//            equipment.customParam!![id1] = "$id2-$id3"
-//        }
+        val entity = dictDefFuncId.select(SFilter.eq("type", equipment.classCode!!), SFilter.eq("code", id1)).entity()
+        logger.debug("信息点1=${equipment.classCode}")
+        logger.debug("信息点=${entity?.toJson()}")
+        if (entity!=null) {
+
+            if (equipment.infos.isNullOrEmpty()) {
+                equipment.infos = HashMap()
+            }
+            equipment.infos!![id1] = "$id2-$id3"
+        }
         return equipment
         return equipment
     }
     }
 
 
@@ -1069,7 +733,6 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
         var path:String
         var path:String
         val projectId = SPageContext.getHeader("projectId")
         val projectId = SPageContext.getHeader("projectId")
 
 
-
         val tomcat_path = System.getProperty("user.dir")
         val tomcat_path = System.getProperty("user.dir")
 
 
         //获取tomcat中项目同级路径
         //获取tomcat中项目同级路径
@@ -1089,7 +752,7 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
         response.setHeader("Content-disposition", "attachment;filename=${key}")
         response.setHeader("Content-disposition", "attachment;filename=${key}")
         response.flushBuffer()
         response.flushBuffer()
         workbook.write(response.outputStream)
         workbook.write(response.outputStream)
-    } // Function templateDownloads()
+    }
 
 
-} // Class RelationTypeProjectService
+}