Просмотр исходного кода

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

weixinVSjinlai 4 лет назад
Родитель
Сommit
309374b4a6

+ 35 - 31
datasyn/src/main/kotlin/com/persagy/server/syn/controllers/TestController.kt

@@ -90,40 +90,44 @@ class TestController {
     @GetMapping(value = ["/test/analog/data"])
     fun analogData(@RequestParam groupCode: String, @RequestBody types: Types): SBaseResponse{
         logger.debug("数据= ${types.toJson()}")
-        for (type in types.types!!) {
-            val defFuncIdList = defFuncIdService.select(SFilter.eq("classCode", type), SFilter.eq("projectId", "Pj4403070003")).exec()
-            for (defFuncId in defFuncIdList){
-                if (!defFuncId.firstName.isNullOrEmpty()){
-                    if (defFuncId.firstName == "台账参数"){
-                        val dictInfosWanDa = DictInfosWanDa()
-                        dictInfosWanDa.classCode = type
-                        dictInfosWanDa.code = defFuncId.code
-                        dictInfosWanDa.groupCode = groupCode
-                        dictInfosWanDa.projectId = "0"
-                        dictInfosWanDa.name = defFuncId.name
-                        dictInfosWanDa.stage = "mdc"
-                        dictInfosWanDaService.replace(dictInfosWanDa)
-                    }else if (defFuncId.firstName == "技术参数") {
-                        val dictInfosWanDa = DictInfosWanDa()
-                        dictInfosWanDa.classCode = type
-                        dictInfosWanDa.code = defFuncId.code
-                        dictInfosWanDa.groupCode = groupCode
-                        dictInfosWanDa.projectId = "0"
-                        dictInfosWanDa.name = defFuncId.name
-                        dictInfosWanDa.stage = "dpm"
-                        dictInfosWanDaService.replace(dictInfosWanDa)
-                    } else if (defFuncId.firstName == "运行参数"||defFuncId.firstName == "设定参数") {
-                        val dictInfosWanDa = DictInfosWanDa()
-                        dictInfosWanDa.classCode = type
-                        dictInfosWanDa.code = defFuncId.code
-                        dictInfosWanDa.groupCode = groupCode
-                        dictInfosWanDa.projectId = "0"
-                        dictInfosWanDa.name = defFuncId.name
-                        dictInfosWanDa.stage = "moms"
-                        dictInfosWanDaService.replace(dictInfosWanDa)
+        try {
+            for (type in types.types!!) {
+                val defFuncIdList = defFuncIdService.select(SFilter.eq("classCode", type), SFilter.eq("projectId", "Pj4403070003")).exec()
+                for (defFuncId in defFuncIdList){
+                    if (!defFuncId.firstName.isNullOrEmpty()){
+                        if (defFuncId.firstName == "台账参数"){
+                            val dictInfosWanDa = DictInfosWanDa()
+                            dictInfosWanDa.classCode = type
+                            dictInfosWanDa.code = defFuncId.code
+                            dictInfosWanDa.groupCode = groupCode
+                            dictInfosWanDa.projectId = "0"
+                            dictInfosWanDa.name = defFuncId.name
+                            dictInfosWanDa.stage = "mdc"
+                            dictInfosWanDaService.replace(dictInfosWanDa)
+                        }else if (defFuncId.firstName == "技术参数") {
+                            val dictInfosWanDa = DictInfosWanDa()
+                            dictInfosWanDa.classCode = type
+                            dictInfosWanDa.code = defFuncId.code
+                            dictInfosWanDa.groupCode = groupCode
+                            dictInfosWanDa.projectId = "0"
+                            dictInfosWanDa.name = defFuncId.name
+                            dictInfosWanDa.stage = "dpm"
+                            dictInfosWanDaService.replace(dictInfosWanDa)
+                        } else if (defFuncId.firstName == "运行参数"||defFuncId.firstName == "设定参数") {
+                            val dictInfosWanDa = DictInfosWanDa()
+                            dictInfosWanDa.classCode = type
+                            dictInfosWanDa.code = defFuncId.code
+                            dictInfosWanDa.groupCode = groupCode
+                            dictInfosWanDa.projectId = "0"
+                            dictInfosWanDa.name = defFuncId.name
+                            dictInfosWanDa.stage = "moms"
+                            dictInfosWanDaService.replace(dictInfosWanDa)
+                        }
                     }
                 }
             }
+        } catch (e: Exception) {
+            e.printStackTrace()
         }
         return SBaseResponse(SResponseType.success)
     }