Browse Source

fix 数据迁移 导出脚本文件 处理数据中含有[] 导致sql执行失败

lvxianyun 2 năm trước cách đây
mục cha
commit
856b67461f

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

@@ -152,7 +152,9 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             if (objectDigital.getVirtualCodes() == null) {
                 sqls.append(objectDigital.getVirtualCodes()).append(",");
             } else {
-                sqls.append("'").append(objectDigital.getVirtualCodes()).append("',");
+                StringBuilder temp = new StringBuilder();
+                objectDigital.getVirtualCodes().forEach(str -> temp.append("\"").append(str).append("\"").append(","));
+                sqls.append("'[").append(StrUtil.sub(temp.toString(),0,-1)).append("]',");
             }
             if (objectDigital.getCreateApp() == null) {
                 sqls.append(objectDigital.getCreateApp()).append(",");