|
@@ -1,4 +1,4 @@
|
|
|
-package com.lantone.qc.kernel;
|
|
|
+package com.lantone.qc.kernel.web.controller;
|
|
|
|
|
|
import com.lantone.qc.kernel.analysis.QCAnalysis;
|
|
|
import com.lantone.qc.pub.jdbc.MysqlJdbc;
|
|
@@ -6,13 +6,12 @@ import com.lantone.qc.pub.model.OutputInfo;
|
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
|
import com.lantone.qc.pub.model.vo.QueryVo;
|
|
|
import com.lantone.qc.pub.res.Response;
|
|
|
+import com.lantone.qc.pub.util.PropertiesUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.sql.Connection;
|
|
|
import java.sql.ResultSet;
|
|
@@ -40,8 +39,11 @@ public class QCTestController {
|
|
|
@PostMapping("rec_test")
|
|
|
public Response<OutputInfo> extract(String caseIds) {
|
|
|
Response response = new Response();
|
|
|
+ PropertiesUtil propertiesUtil = new PropertiesUtil("kernel.properties");
|
|
|
|
|
|
- MysqlJdbc mysqlJdbc = new MysqlJdbc("root", "lantone", "jdbc:mysql://192.168.2.236:3306/sys-mrqc?useUnicode=true&characterEncoding=UTF-8");
|
|
|
+ MysqlJdbc mysqlJdbc = new MysqlJdbc(propertiesUtil.getProperty("mysql.test.user"),
|
|
|
+ propertiesUtil.getProperty("mysql.test.password"),
|
|
|
+ propertiesUtil.getProperty("mysql.test.url"));
|
|
|
Connection conn = mysqlJdbc.connect();
|
|
|
Statement st = null;
|
|
|
ResultSet rs = null;
|
|
@@ -56,12 +58,14 @@ public class QCTestController {
|
|
|
"where qmap.cases_id = qi.id and qmap.cases_entry_id = entry.id and entry.cases_id = ca.id ";
|
|
|
|
|
|
if (!StringUtils.isNotEmpty(caseIds)) {
|
|
|
- sql = sql + " and cases_id in (" + caseIds + ")";
|
|
|
+ sql = sql + " and entry.cases_id in (" + caseIds + ")";
|
|
|
}
|
|
|
+ sql = sql + " order by qi.id";
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
rs = st.executeQuery(sql);
|
|
|
-
|
|
|
+ //条目数据结构, Key = 条目Code value = 条目属性{"precode":"BEH0002,BEH0003","title":"症状缺少时间描述"}
|
|
|
Map<String, Map<String, String>> catalogueMap = new HashMap<>();
|
|
|
+ //测试条目编码和qc_inputcases_mapping 的id,为了更新每个条目是否验证通过
|
|
|
Map<String, String> updateMap = new HashMap<>();
|
|
|
|
|
|
List<Map<String, Map<String, String>>> catalogueList = new ArrayList<>();
|
|
@@ -75,7 +79,7 @@ public class QCTestController {
|
|
|
r3 = rs.getString(3);
|
|
|
r4 = rs.getString(4);
|
|
|
r5 = rs.getString(5);
|
|
|
- if (!textId.equals(r1)) {
|
|
|
+ if (!textId.equals(r2)) {
|
|
|
if (StringUtils.isNotEmpty(textId)) {
|
|
|
catalogueList.add(catalogueMap);
|
|
|
updateList.add(updateMap);
|
|
@@ -96,6 +100,7 @@ public class QCTestController {
|
|
|
content.put("content", textList.get(i));
|
|
|
medrecVo.setContent(content);
|
|
|
|
|
|
+
|
|
|
List<MedrecVo> medrec = new ArrayList<>();
|
|
|
medrec.add(medrecVo);
|
|
|
|