Browse Source

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

weixinVSjinlai 4 years ago
parent
commit
c7577704c1

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

@@ -95,7 +95,86 @@ object DefFuncIdService: SObjectService<DefFuncId>(SMybatisDao(DefFuncId::class.
      *
      * @param category    分类
      */
-    fun dictEquipInfoQuery(category: String): 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.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>()
         val dictInfoResponse = DictInfoResponse()
         try {//        val dictInfosWanDaGroupList = dictInfosWanDaService.select(SFilter.eq("groupCode", Opt.groupCode!!), SFilter.eq("projectId", "0")
 //                ,SFilter.eq("classCode", category)).exec()
@@ -142,7 +221,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),
@@ -156,19 +235,18 @@ object DefFuncIdService: SObjectService<DefFuncId>(SMybatisDao(DefFuncId::class.
             dictInfoResponse.basicInfos = defFuncIdList
             dictInfoResponse.dictStages = dictStageList
             dictInfoResponse.result = SResponseType.success
-            return dictInfoResponse
+            sQueryResponse.content = ArrayList()
+            return sQueryResponse
             logger.debug("结束2*************************************************")
         } catch (e: Exception) {
             e.printStackTrace()
             dictInfoResponse.result = SResponseType.failure
             dictInfoResponse.message = "错误"
         }
-        return dictInfoResponse
+        return sQueryResponse
 
     }
 
 
 
-
-
 }