浏览代码

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

weixinVSjinlai 4 年之前
父节点
当前提交
08ea5d3ea4

+ 39 - 41
datasyn/src/main/kotlin/com/persagy/server/syn/controllers/TestController.kt

@@ -28,13 +28,11 @@ package com.persagy.server.syn.controllers
 
 import com.alibaba.fastjson.JSONObject
 import com.persagy.base.extensions.toJson
-import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
-import com.persagy.server.datacenter.models.entities.dictnew.DefClass
 import com.persagy.server.datacenter.models.entities.dictnew.DefFuncId
 import com.persagy.server.datacenter.wanda.dict.DictInfosWanDa
 import com.persagy.server.syn.models.response.GroupResponse
-import com.persagy.server.syn.models.test.Types
+import com.persagy.server.syn.models.test.TestType
 import com.persagy.service.SObjectService
 import com.persagy.service.models.enums.SResponseType
 import com.persagy.service.models.responses.SBaseResponse
@@ -87,45 +85,45 @@ class TestController {
      * 造对照表数据
      */
     @Operation(summary = "造对照表数据", description = "",tags = ["001"])
-    @GetMapping(value = ["/test/analog/data"])
-    fun analogData(@RequestParam groupCode: String): SBaseResponse{
-        logger.debug("数据= ${groupCode.toJson()}")
+    @PostMapping(value = ["/test/analog/data"])
+    fun analogData(@RequestParam groupCode: String,@RequestBody testType: TestType): SBaseResponse{
+        logger.debug("数据= ${testType.toJson()}")
         try {
-//            for (type in obj.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)
-//                        }
-//                    }
-//                }
-//            }
+            for (type in testType.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()
         }

+ 1 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/models/test/Types.kt

@@ -2,7 +2,7 @@ package com.persagy.server.syn.models.test
 
 import java.io.Serializable
 
-class Types: Serializable {
+class TestType: Serializable {
 
     var types : ArrayList<String>? = null