Parcourir la source

调整测试类

lijie il y a 3 ans
Parent
commit
aa514fd833

+ 1 - 1
dmp-rwd-datautils/src/test/java/com/persagy/dmp/rwd/dic/ExcelUtils.java

@@ -29,7 +29,7 @@ public class ExcelUtils {
         if ("string".equalsIgnoreCase(type)) {
             if (cellType == CellType.STRING) {
                 String val = cell.getStringCellValue();
-                return val == null ? null : StrUtil.removeAll(val.trim(),StrUtil.C_CR, StrUtil.C_LF, StrUtil.C_TAB);
+                return val == null ? null : StrUtil.removeAll(val.trim(), StrUtil.C_CR, StrUtil.C_LF, StrUtil.C_TAB);
             } else if (cellType == CellType.NUMERIC) {
                 String ss = cell.getNumericCellValue() + "";
                 if (ss.matches("^[+-]?[\\d]+([\\.][\\d]+)?([Ee][+-]?[\\d]+)?$")){

+ 17 - 9
dmp-rwd-datautils/src/test/java/com/persagy/dmp/rwd/dic/ImportKnowledgeForEdit.java

@@ -2,6 +2,7 @@ package com.persagy.dmp.rwd.dic;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.criteria.JacksonCriteria;
 import com.persagy.common.date.DateUtils;
 import com.persagy.common.json.JacksonMapper;
 import com.persagy.dmp.rwd.enums.ObjType;
@@ -59,10 +60,10 @@ public class ImportKnowledgeForEdit {
 //        initToolOrMaterial(classes,"material","耗材类 ");
 //        writeFuncSqlToFile(classes, "material");
 //        classes.clear();
-//        // 省市区编号
-//        initCityLocation(classes,"cityLocation","省市区编号");
-//        writeFuncSqlToFile(classes, "cityLocation");
-//        classes.clear();
+        // 省市区编号
+        initCityLocation(classes,"cityLocation","省市区编号");
+        writeFuncSqlToFile(classes, "cityLocation");
+        classes.clear();
 //        // 气候分区
 //        initClimaticDivision(classes,"climaticDivision","气候分区");
 //        writeFuncSqlToFile(classes, "climaticDivision");
@@ -183,10 +184,10 @@ public class ImportKnowledgeForEdit {
 //        initFiveLevelData(classes,"hospitalItemizedTree","S4");
 //        writeFuncSqlToFile(classes, "hospitalItemizedTree");
 //        classes.clear();
-        // 对象间关系
-        initObjectRelation(classes,"objectRelation","新版");
-        writeFuncSqlToFile(classes, "objectRelation");
-        classes.clear();
+//        // 对象间关系
+//        initObjectRelation(classes,"objectRelation","新版");
+//        writeFuncSqlToFile(classes, "objectRelation");
+//        classes.clear();
     }
 
     private void initObjectRelation(List<RwdeditRefTypeInfosModel> models,String refKey,String sheetName) throws IOException {
@@ -2679,9 +2680,16 @@ public class ImportKnowledgeForEdit {
         writer.append("\n");
         writer.flush();
         writer.close();
+        System.out.println("[");
+        JacksonCriteria jacksonCriteria = JacksonCriteria.newInstance();
         for (RwdeditRefTypeInfosModel type : classes) {
-            System.out.println(JacksonMapper.toSimpleJson(type));
+            ObjectNode criteria = jacksonCriteria.getCriteria();
+            criteria.put("code",type.getCode());
+            criteria.put("name",type.getName().trim());
+            criteria.put("parentCode",type.getParentCode());
+            System.out.println(JacksonMapper.toSimpleJson(criteria)+",");
         }
+        System.out.println("]");
     }
 
     private String toSql(RwdeditRefTypeInfosModel model) {