Browse Source

fix adm 数据迁移 新增sql脚本 方式 info 脚本处理

lvxianyun 2 years ago
parent
commit
b5e80437ee

+ 2 - 2
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/controller/DataMigrationController.java

@@ -182,12 +182,12 @@ public class DataMigrationController {
             buff.flush();
             buff.close();
         } catch (Exception e) {
-            log.error("导出文件文件出错:{}",e);
+            log.error(String.format("导出文件文件出错:{}",e));
         } finally {try {
             buff.close();
             outStr.close();
         } catch (Exception e) {
-            log.error("关闭流对象出错 e:{}",e);
+            log.error(String.format("关闭流对象出错 e:{}",e));
         }
         }
     }

+ 19 - 3
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineInfoMigration.java

@@ -155,27 +155,37 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             sqls.append("'").append(infoDefine.getProjectId()).append("',");
             sqls.append("'").append(infoDefine.getCategory()).append("',");
             sqls.append("'").append(infoDefine.getFirstTag()).append("',");
-            sqls.append("'").append(infoDefine.getSecondTag()).append("',");
+            if (infoDefine.getSecondTag() == null) {
+                infoDefine.getSecondTag();
+            } else {
+                sqls.append("'").append(infoDefine.getSecondTag()).append("',");
+            }
+
             sqls.append("'").append(infoDefine.getPriority()).append("',");
             sqls.append("'").append(infoDefine.getInputMode()).append("',");
+
             if (infoDefine.getUnit() == null) {
                 sqls.append(infoDefine.getUnit()).append(",");
             } else {
                 sqls.append("'").append(infoDefine.getUnit()).append("',");
             }
+
             sqls.append("'").append(infoDefine.getDataType()).append("',");
             sqls.append(infoDefine.getIsMultiple()?1:0).append(",");
             sqls.append(infoDefine.getIsRegion()?1:0).append(",");
+
             if (infoDefine.getFormater() == null) {
                 sqls.append(infoDefine.getFormater()).append(",");
             } else {
                 sqls.append("'").append(infoDefine.getFormater()).append("',");
             }
+
             if (infoDefine.getDataSource() == null) {
                 sqls.append(infoDefine.getDataSource()).append(",");
             } else {
                 sqls.append("'").append(infoDefine.getDataSource()).append("',");
             }
+
             if (infoDefine.getRemark() == null) {
                 sqls.append(infoDefine.getRemark()).append(",");
             } else {
@@ -184,7 +194,13 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             sqls.append(infoDefine.getSubFlag()?1:0).append(",");
             sqls.append(infoDefine.getWeakPoint()?1:0).append(",");
             sqls.append(infoDefine.getShowOrder()).append(",");
-            sqls.append("'").append(infoDefine.getVersion()).append("',");
+
+            if (infoDefine.getVersion() == null) {
+                infoDefine.getVersion();
+            } else {
+                sqls.append("'").append(infoDefine.getVersion()).append("',");
+            }
+
             sqls.append(infoDefine.getSourceFrom()).append(",");
             sqls.append("'").append(infoDefine.getCreator()).append("',");
             sqls.append("'").append(infoDefine.getCreationTime()).append("',");
@@ -197,7 +213,7 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             if (infoDefine.getModifiedTime() == null) {
                 sqls.append(infoDefine.getModifiedTime()).append(",");
             } else {
-                sqls.append("'").append(infoDefine.getModifiedTime()).append(",");
+                sqls.append("'").append(infoDefine.getModifiedTime()).append("',");
             }
             sqls.append(infoDefine.getValid());
             sqls.append(")\n ,");