Kaynağa Gözat

****************************************提交分类************************************

weixinVSjinlai 4 yıl önce
ebeveyn
işleme
8355a9e8d7

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

@@ -58,7 +58,7 @@ class DictCustomController {
      */
     @Operation(summary = "类型下信息点", description = "")
     @GetMapping(value = ["/equip/info"])
-    fun dictEquipInfoQuery(@RequestParam category: String): SQueryResponse<DictInfoResponse> {
+    fun dictEquipInfoQuery(@RequestParam category: String): DictInfoResponse {
         return DefFuncIdService.dictEquipInfoQuery(category)
     }
 }

+ 90 - 89
equip-component/src/main/kotlin/com/persagy/server/service/dict/DictDefClassService.kt

@@ -95,92 +95,14 @@ object DefFuncIdService: SObjectService<DefFuncId>(SMybatisDao(DefFuncId::class.
      *
      * @param category    分类
      */
-//    fun dictEquipInfoQuery(category: String): DictInfoResponse {
-//        val dictInfoResponse = DictInfoResponse()
-//        try {//        val dictInfosWanDaGroupList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", "0")
-////                ,SFilter.eq("classCode", category)).exec()
-////        val dictInfosWanDaProjectList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", Opt.projectId!!)
-////                ,SFilter.eq("classCode", category)).exec()
-//            var defFuncIdList = DefFuncIdService.select(SFilter.eq("projectId", Opt.projectId!!),
-//                    SFilter.inList("code", arrayListOf("bimTypeId","name","localName","localId"))).exec()
-//            if (defFuncIdList.size == 0 ) {
-//                defFuncIdList = DefFuncIdService.select(SFilter.eq("type","group"),
-//                        SFilter.inList("code", arrayListOf("bimTypeId","name","localName","localId"))).exec()
-//                if (defFuncIdList.size == 0) {
-//                    defFuncIdList = DefFuncIdService.select(SFilter.eq("type","common"),
-//                            SFilter.inList("code", arrayListOf("bimTypeId","name","localName","localId"))).exec()
-//                }
-//            }
-//            for (defFuncId in defFuncIdList) {
-//                if (defFuncId.code == "name"){
-//                    defFuncId.code = "systemCategory"
-//                    defFuncId.name = "系统分类"
-//                    defFuncId.aliasCode = "systemCategory"
-//                    defFuncId.aliasName = "系统分类"
-//                } else if (defFuncId.code == "localName"){
-//                    defFuncId.code = "codeName"
-//                    defFuncId.name = "设备类型名称"
-//                    defFuncId.aliasCode = "codeName"
-//                    defFuncId.aliasName = "设备类型名称"
-//                }
-//            }
-//
-//            val dictStageList = dictStageService.selectAll().exec()
-//            for (dictStage in dictStageList) {
-//                val dictInfosWanDaGroupList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", "0")
-//                        ,SFilter.eq("classCode", category),SFilter.eq("stage", dictStage.code!!)).exec()
-//                val dictInfosWanDaProjectList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", Opt.projectId!!)
-//                        ,SFilter.eq("classCode", category),SFilter.eq("stage", dictStage.code!!)).exec()
-//                if (dictInfosWanDaProjectList.size>0){
-//                    dictInfosWanDaGroupList.addAll(dictInfosWanDaProjectList)
-//                }
-//                var setCode = HashSet<String>()
-//                for (dictInfosWanDaGroup in dictInfosWanDaGroupList){
-//                    setCode.add(dictInfosWanDaGroup.code!!)
-//                }
-//                var funcIdList = DefFuncIdService.select(SFilter.eq("projectId", Opt.projectId!!),SFilter.eq("classCode", category),
-//                        SFilter.inList("code", setCode.toList())).order("code").exec()
-//                if (funcIdList.size == 0 ) {
-//                    funcIdList = DefFuncIdService.select(SFilter.eq("type","group"),
-//                             SFilter.eq("groupCode",Opt.groupCode!!),SFilter.eq("classCode", category),
-//                            SFilter.inList("code", setCode.toList())).order("code").exec()
-//                    if (funcIdList.size == 0) {
-//                        funcIdList = DefFuncIdService.select(SFilter.eq("type","common"),SFilter.eq("classCode", category),
-//                                SFilter.inList("code",  setCode.toList())).order("code").exec()
-//                    }
-//                }
-//                dictStage.infos = funcIdList
-//                logger.debug("阶段=${dictStage.code}*************************************************")
-//            }
-//            logger.debug("结束*************************************************")
-//            dictInfoResponse.basicInfos = defFuncIdList
-//            dictInfoResponse.dictStages = dictStageList
-//            dictInfoResponse.result = SResponseType.success
-//            return dictInfoResponse
-//            logger.debug("结束2*************************************************")
-//        } catch (e: Exception) {
-//            e.printStackTrace()
-//            dictInfoResponse.result = SResponseType.failure
-//            dictInfoResponse.message = "错误"
-//        }
-//        return dictInfoResponse
-//
-//    }
-
-
-    /**
-     * 类型下信息点查询
-     *
-     * @param category    分类
-     */
-    fun dictEquipInfoQuery(category: String): SQueryResponse<DictInfoResponse> {
-        val sQueryResponse = SQueryResponse<DictInfoResponse>()
+    fun dictEquipInfoQuery(category: String): DictInfoResponse {
         val dictInfoResponse = DictInfoResponse()
         try {//        val dictInfosWanDaGroupList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", "0")
 //                ,SFilter.eq("classCode", category)).exec()
 //        val dictInfosWanDaProjectList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", Opt.projectId!!)
 //                ,SFilter.eq("classCode", category)).exec()
             var defFuncIdList = DefFuncIdService.select(SFilter.eq("projectId", Opt.projectId!!),
+                    SFilter.eq("classCode", category),
                     SFilter.inList("code", arrayListOf("bimTypeId","name","localName","localId"))).exec()
 //            if (defFuncIdList.size == 0 ) {
 //                defFuncIdList = DefFuncIdService.select(SFilter.eq("type","group"),
@@ -221,7 +143,7 @@ object DefFuncIdService: SObjectService<DefFuncId>(SMybatisDao(DefFuncId::class.
                         SFilter.inList("code", setCode.toList())).order("code").exec()
 //                if (funcIdList.size == 0 ) {
 //                    funcIdList = DefFuncIdService.select(SFilter.eq("type","group"),
-//                            SFilter.eq("groupCode",Opt.groupCode!!),SFilter.eq("classCode", category),
+//                             SFilter.eq("groupCode",Opt.groupCode!!),SFilter.eq("classCode", category),
 //                            SFilter.inList("code", setCode.toList())).order("code").exec()
 //                    if (funcIdList.size == 0) {
 //                        funcIdList = DefFuncIdService.select(SFilter.eq("type","common"),SFilter.eq("classCode", category),
@@ -230,26 +152,105 @@ object DefFuncIdService: SObjectService<DefFuncId>(SMybatisDao(DefFuncId::class.
 //                }
                 dictStage.infos = funcIdList
                 logger.debug("阶段=${dictStage.code}*************************************************")
-        }
+            }
             logger.debug("结束*************************************************")
             dictInfoResponse.basicInfos = defFuncIdList
-//            dictInfoResponse.dictStages = dictStageList
+            dictInfoResponse.dictStages = dictStageList
             dictInfoResponse.result = SResponseType.success
-
-            val list = ArrayList<DictInfoResponse>()
-            list.add(dictInfoResponse)
-            sQueryResponse.content = list
-            return sQueryResponse
+            return dictInfoResponse
             logger.debug("结束2*************************************************")
         } catch (e: Exception) {
             e.printStackTrace()
             dictInfoResponse.result = SResponseType.failure
             dictInfoResponse.message = "错误"
         }
-        return sQueryResponse
+        return dictInfoResponse
 
     }
 
 
+    /**
+     * 类型下信息点查询
+     *
+     * @param category    分类
+     */
+//    fun dictEquipInfoQuery(category: String): SQueryResponse<DictInfoResponse> {
+//        val sQueryResponse = SQueryResponse<DictInfoResponse>()
+//        val dictInfoResponse = DictInfoResponse()
+//        try {//        val dictInfosWanDaGroupList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", "0")
+////                ,SFilter.eq("classCode", category)).exec()
+////        val dictInfosWanDaProjectList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", Opt.projectId!!)
+////                ,SFilter.eq("classCode", category)).exec()
+//            var defFuncIdList = DefFuncIdService.select(SFilter.eq("projectId", Opt.projectId!!),
+//                    SFilter.inList("code", arrayListOf("bimTypeId","name","localName","localId"))).exec()
+////            if (defFuncIdList.size == 0 ) {
+////                defFuncIdList = DefFuncIdService.select(SFilter.eq("type","group"),
+////                        SFilter.inList("code", arrayListOf("bimTypeId","name","localName","localId"))).exec()
+////                if (defFuncIdList.size == 0) {
+////                    defFuncIdList = DefFuncIdService.select(SFilter.eq("type","common"),
+////                            SFilter.inList("code", arrayListOf("bimTypeId","name","localName","localId"))).exec()
+////                }
+////            }
+//            for (defFuncId in defFuncIdList) {
+//                if (defFuncId.code == "name"){
+//                    defFuncId.code = "systemCategory"
+//                    defFuncId.name = "系统分类"
+//                    defFuncId.aliasCode = "systemCategory"
+//                    defFuncId.aliasName = "系统分类"
+//                } else if (defFuncId.code == "localName"){
+//                    defFuncId.code = "codeName"
+//                    defFuncId.name = "设备类型名称"
+//                    defFuncId.aliasCode = "codeName"
+//                    defFuncId.aliasName = "设备类型名称"
+//                }
+//            }
+//
+//            val dictStageList = dictStageService.selectAll().exec()
+//            for (dictStage in dictStageList) {
+//                val dictInfosWanDaGroupList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", "0")
+//                        ,SFilter.eq("classCode", category),SFilter.eq("stage", dictStage.code!!)).exec()
+//                val dictInfosWanDaProjectList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", Opt.projectId!!)
+//                        ,SFilter.eq("classCode", category),SFilter.eq("stage", dictStage.code!!)).exec()
+//                if (dictInfosWanDaProjectList.size>0){
+//                    dictInfosWanDaGroupList.addAll(dictInfosWanDaProjectList)
+//                }
+//                var setCode = HashSet<String>()
+//                for (dictInfosWanDaGroup in dictInfosWanDaGroupList){
+//                    setCode.add(dictInfosWanDaGroup.code!!)
+//                }
+//                var funcIdList = DefFuncIdService.select(SFilter.eq("projectId", Opt.projectId!!),SFilter.eq("classCode", category),
+//                        SFilter.inList("code", setCode.toList())).order("code").exec()
+////                if (funcIdList.size == 0 ) {
+////                    funcIdList = DefFuncIdService.select(SFilter.eq("type","group"),
+////                            SFilter.eq("groupCode",Opt.groupCode!!),SFilter.eq("classCode", category),
+////                            SFilter.inList("code", setCode.toList())).order("code").exec()
+////                    if (funcIdList.size == 0) {
+////                        funcIdList = DefFuncIdService.select(SFilter.eq("type","common"),SFilter.eq("classCode", category),
+////                                SFilter.inList("code",  setCode.toList())).order("code").exec()
+////                    }
+////                }
+//                dictStage.infos = funcIdList
+//                logger.debug("阶段=${dictStage.code}*************************************************")
+//        }
+//            logger.debug("结束*************************************************")
+//            dictInfoResponse.basicInfos = defFuncIdList
+////            dictInfoResponse.dictStages = dictStageList
+//            dictInfoResponse.result = SResponseType.success
+//
+//            val list = ArrayList<DictInfoResponse>()
+//            list.add(dictInfoResponse)
+//            sQueryResponse.content = list
+//            return sQueryResponse
+//            logger.debug("结束2*************************************************")
+//        } catch (e: Exception) {
+//            e.printStackTrace()
+//            dictInfoResponse.result = SResponseType.failure
+//            dictInfoResponse.message = "错误"
+//        }
+//        return sQueryResponse
+//
+//    }
+
+
 
 }