|
@@ -27,16 +27,20 @@
|
|
|
package com.persagy.server.syn.controllers
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject
|
|
|
+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.service.SObjectService
|
|
|
import com.persagy.service.models.enums.SResponseType
|
|
|
import com.persagy.service.models.responses.SBaseResponse
|
|
|
import io.swagger.v3.oas.annotations.Operation
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag
|
|
|
import org.slf4j.LoggerFactory
|
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
|
-import org.springframework.web.bind.annotation.GetMapping
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping
|
|
|
-import org.springframework.web.bind.annotation.RestController
|
|
|
+import org.springframework.web.bind.annotation.*
|
|
|
import org.springframework.web.client.RestTemplate
|
|
|
|
|
|
/**
|
|
@@ -53,6 +57,10 @@ class TestController {
|
|
|
// 日志
|
|
|
private val logger = LoggerFactory.getLogger(TestController::class.java)
|
|
|
} // Companion object
|
|
|
+ /** 信息点 */
|
|
|
+ private val defFuncIdService = SObjectService(SMybatisDao(DefFuncId::class.java))
|
|
|
+ /** 对照表 */
|
|
|
+ private val dictInfosWanDaService = SObjectService(SMybatisDao(DictInfosWanDa::class.java))
|
|
|
|
|
|
// 注意获取这个实例
|
|
|
@Autowired
|
|
@@ -73,5 +81,50 @@ class TestController {
|
|
|
return SBaseResponse(SResponseType.success)
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 造对照表数据
|
|
|
+ */
|
|
|
+ @Operation(summary = "造对照表数据", description = "",tags = ["001"])
|
|
|
+ @GetMapping(value = ["/test/analog/data"])
|
|
|
+ fun analogData(@RequestParam groupCode: String, @RequestBody types: ArrayList<String>): SBaseResponse{
|
|
|
+ for (type in 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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return SBaseResponse(SResponseType.success)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|