cc 3 tygodni temu
rodzic
commit
c7874d3c35

+ 15 - 122
ai-server/src/main/java/com/zsjz/ai/module/eds/utils/Bcp.java → ai-server/src/main/java/com/zsjz/ai/module/eds/utils/Eds.java

@@ -12,6 +12,7 @@ import com.zsjz.ai.common.exception.ServerException;
 import com.zsjz.ai.common.utils.Z7;
 import com.zsjz.ai.module.eds.anno.EdsFields;
 import com.zsjz.ai.module.eds.po.*;
+import com.zsjz.ai.module.eds.po.base.EdsBaseAccountCommon;
 import com.zsjz.ai.module.eds.po.base.EdsBaseWmChatCommon;
 import com.zsjz.ai.module.eds.po.base.EdsBaseWmCommerceCommon;
 import com.zsjz.ai.module.eds.po.base.EdsBaseWmEmailCommon;
@@ -36,12 +37,12 @@ import java.util.stream.Collectors;
 import static java.util.stream.Collectors.*;
 
 /**
- * bcp 数据包解析与入库工具。
+ * Eds 数据包解析与入库工具。
  *
  * @author zsjz
  */
 @Slf4j
-public class Bcp {
+public class Eds {
 
     /**
      * 按类缓存的列名到字段映射
@@ -66,7 +67,7 @@ public class Bcp {
     public static final String HEAD_DN = "WA_COMMON_010017";
 
     /**
-     * bcp 格式节点标识
+     * Eds 格式节点标识
      */
     public static final String FORMAT_BCP_DN = "WA_COMMON_010013";
 
@@ -132,12 +133,12 @@ public class Bcp {
     public static final String CHARSET_IK = "I010039";
 
     /**
-     * bcp 数据文件描述节点标识
+     * Eds 数据文件描述节点标识
      */
     public static final String BCP_FILE_DN = "WA_COMMON_010014";
 
     /**
-     * bcp 文件相对路径键名
+     * Eds 文件相对路径键名
      */
     public static final String BCP_FILE_PATH_IK = "H040003";
 
@@ -147,12 +148,12 @@ public class Bcp {
     public static final String BCP_FILE_NAME_IK = "H010020";
 
     /**
-     * bcp 文件记录数键名
+     * Eds 文件记录数键名
      */
     public static final String BCP_FILE_DATA_SIZE_IK = "I010034";
 
     /**
-     * bcp 字段结构节点标识
+     * Eds 字段结构节点标识
      */
     public static final String BCP_FIELD_DN = "WA_COMMON_010015";
 
@@ -187,18 +188,9 @@ public class Bcp {
     //private static final List<String> NOT_FIELD = Lists.newArrayList("id", "md5", "caseId");
 
     public static LocalDateTime timestampToLocalDateTime(String timestampStr) {
-        LocalDateTime result;
         try {
             String str = com.zsjz.ai.common.utils.DateUtil.dateStrToLocalDateTime(timestampStr);
             return LocalDateTimeUtil.parse(str, "yyyy-MM-dd HH:mm:ss");
-          /*  if (timestampStr.length() <= 10) {
-                result = Instant.ofEpochSecond(Long.parseLong(timestampStr)).atZone(DEFAULT_ZONE).toLocalDateTime();
-            } else {
-                result = Instant.ofEpochMilli(Long.parseLong(timestampStr)).atZone(DEFAULT_ZONE).toLocalDateTime();
-            }
-            if (result.isBefore(MIN_DATE) || result.isAfter(MAX_DATE)) {
-                result = DEFAULT_DATE;
-            }*/
         } catch (Exception e) {
             log.error("日期{}转换错误", timestampStr, e);
         }
@@ -215,7 +207,7 @@ public class Bcp {
      * 获取类对应的字段映射,键为数据字段名。
      */
     public static Map<String, Field> getFieldMap(Class<?> cls) {
-        return Bcp.CACHE_FIELD_MAP.computeIfAbsent(cls, clsKey -> {
+        return Eds.CACHE_FIELD_MAP.computeIfAbsent(cls, clsKey -> {
             Field[] declaredFields = ReflectUtil.getFields(clsKey);
             Map<String, Field> result = new HashMap<>();
             for (Field field : declaredFields) {
@@ -241,16 +233,16 @@ public class Bcp {
      * 获取类对应的字段信息(带缓存)
      */
     public static EdsEntityFieldInfo getPojoFieldInfo(Class<?> cls) {
-        return Bcp.CACHE_POJO_FIELD_INFO_MAP.computeIfAbsent(cls, clsKey -> {
+        return Eds.CACHE_POJO_FIELD_INFO_MAP.computeIfAbsent(cls, clsKey -> {
             //取全部字段
-            Collection<Field> fields = Bcp.getFieldMap(clsKey).values();
+            Collection<Field> fields = Eds.getFieldMap(clsKey).values();
             List<Field> timeArray = new ArrayList<>();
             Field deleteStatusField = null;
             for (Field field : fields) {
                 String fieldType = field.getType().getName();
                 if (fieldType.endsWith(Cnst.LOCAL_DATE_TIME)) {
                     timeArray.add(field);
-                } else if (Bcp.DELETE_STATUS_STR.equals(field.getName())) {
+                } else if (Eds.DELETE_STATUS_STR.equals(field.getName())) {
                     deleteStatusField = field;
                 }
             }
@@ -278,91 +270,9 @@ public class Bcp {
      * @return 是否解压成功
      */
     public static boolean unBcpZip(Path zipPath, String destPath, String filename) {
-//        String testFileCmd = OsUtils.get7z() + " t " + zipPath.toString();
-//        String a = RuntimeUtil.execForStr(testFileCmd);
-//        if (a.contains("ERROR")) {
-//            return false;
-//        }
-//
-//        //long unzipBegin = System.currentTimeMillis();
-//        String execCmd = OsUtils.get7z() + " x " + zipPath + " -o" + destPath + " -aoa";
-//        String b = RuntimeUtil.execForStr(execCmd);
-//        return !b.contains("ERROR");
-
         return Z7.unZip(zipPath, destPath, "");
-
-        /*try (ZipFile zipFile = new ZipFile(zipPath.toFile())) {
-            //校验文件是否损坏
-            if (!zipFile.isValidZipFile()) {
-                //移动清除错误包,并更新错误信息
-                moveAndClearErrorZip(zipPath, null, filename, "zip文件已损坏,请重新上传!", "errorDir");
-                return false;
-            }
-
-            //校验是否加密
-            if (zipFile.isEncrypted()) {
-                try {
-                    // WA压缩包 密码规则同HLHT文档
-                    String passwordWa = DigestUtil.md5Hex(filename).substring(1, 7).toLowerCase();
-                    //zipFile = new ZipFile(zipPath.toFile(), passwordWa.toCharArray());
-                    zipFile.setPassword(passwordWa.toCharArray());
-                    //执行解压
-                    zipFile.extractAll(destPath);
-                } catch (ZipException e) {
-                    // JW压缩包 密码规则同pdf文档 互联互通为.zip文件无法解析 todo
-                    filename = filename.split("\\.")[0] + ".ZIP";
-                    String passwordJW = DigestUtil.md5Hex(filename).substring(0, 4) + DigestUtil.md5Hex(filename)
-                            .substring(DigestUtil.md5Hex(filename).length() - 4);
-                    //zipFile = new ZipFile(zipPath.toFile(), passwordJW.toCharArray());
-                    zipFile.setPassword(passwordJW.toCharArray());
-                    //执行解压
-                    try {
-                        zipFile.extractAll(destPath);
-                    } catch (ZipException e1) {
-                        moveAndClearErrorZip(zipPath, null, filename, "ZIP文件解压失败,请重新上传!", "errorDir");
-                        log.warn("包:{},解压失败,无法解析", filename);
-                        return false;
-                    }
-                }
-            } else {
-                log.info("包:{},无密码解压", filename);
-                //执行解压
-                ZipUtil.unzip(zipPath.toString(), destPath, Charset.forName("GBK"));
-            }
-            long unzipEnd = System.currentTimeMillis();
-            log.info("包:{},解压完成,耗时(ms):{}.", filename, unzipEnd - unzipBegin);
-        } catch (Exception e) {
-            moveAndClearErrorZip(zipPath, null, filename, "zip文件解压失败,请重新上传!", "errorDir");
-            log.warn("包:{},解压失败,无法解析", filename, e);
-            return false;
-        }
-
-        //更新解析进度为6%
-        return true;*/
     }
 
-    public static void createZip(Path path, String password) {
-        Path filePath = path.getParent();
-        Path zipFilePath = filePath.resolve(path.getFileName() + DateUtil.today() + ".zip");
-        try (ZipFile zipFile = new ZipFile(zipFilePath.toFile(), password.toCharArray())) {
-            ZipParameters zipParameters = new ZipParameters();
-            zipParameters.setEncryptFiles(true);
-            zipParameters.setEncryptionMethod(EncryptionMethod.AES);
-            List<File> files = FileUtil.loopFiles(path, 1, null);
-            for (File file : files) {
-                if (file.isDirectory()) {
-                    zipFile.addFolder(file, zipParameters);
-                } else {
-                    zipFile.addFile(file, zipParameters);
-                }
-            }
-        } catch (Exception ignored) {
-
-        }
-        //生成加密压缩包
-    }
-
-
     public static boolean isExistXml(Path indexXmlPathWa) {
         return !Files.exists(indexXmlPathWa);
     }
@@ -377,10 +287,6 @@ public class Bcp {
      */
     public static void moveAndClearErrorZip(Path zipPath, String extractDir, String filename, String errorMessage, String errorDir) {
         try {
-            //更新错误信息
-            //updateErrorMessage(importList, errorMessage);
-            //将异常zip包移动到异常目录
-            // moveErrorZip(zipPath, filename, errorDir);
             if (extractDir != null) {
                 //删除解压产物
                 FileUtil.del(extractDir);
@@ -408,12 +314,7 @@ public class Bcp {
                 .map(data -> (EdsBaseWmChatCommon) data)
                 .filter(data -> data.getContactAccountType() != null && data.getAccount() != null)
                 .collect(groupingBy(EdsBaseWmChatCommon::getContactAccountType,
-                        groupingBy((e) -> {
-//                            if (e.getAccount().equals("未知内容") && e.getAccountId() != null && !e.getAccountId().isEmpty()) {
-//                                return e.getAccountId();
-//                            }
-                            return e.getAccount();
-                        }, mapping(data -> (Object) data, toList()))));
+                        groupingBy(EdsBaseAccountCommon::getAccount, mapping(data -> (Object) data, toList()))));
     }
 
     //电子邮件类按工具类型与账号分组
@@ -438,12 +339,7 @@ public class Bcp {
         return dataList.stream()
                 .map(data -> (EdsBaseWmCommerceCommon) data)
                 .filter(data -> data.getNetworkApp() != null && (data.getAccount() != null || data.getAccountId() != null))
-                .collect(groupingBy(EdsBaseWmCommerceCommon::getNetworkApp, groupingBy((e) -> {
-//                    if (e.getAccount().equals("未知内容") && e.getAccountId() != null && !e.getAccountId().isEmpty()) {
-//                        return e.getAccountId();
-//                    }
-                    return e.getAccount();
-                }, mapping(data -> (Object) data, toList()))));
+                .collect(groupingBy(EdsBaseWmCommerceCommon::getNetworkApp, groupingBy(EdsBaseAccountCommon::getAccount, mapping(data -> (Object) data, toList()))));
     }
 
 
@@ -473,10 +369,7 @@ public class Bcp {
                                                           Map<String, Map<String, List<Object>>> groupByAppTypeAccount) {
         return groupByAppTypeAccount.entrySet().stream()
                 .flatMap(appTypeEntry ->
-                        appTypeEntry.getValue().entrySet().stream().map(accountEntry -> {
-                            EdsDirTreeCount edsDirTreeCount = new EdsDirTreeCount(cid, dirTree, null, null, appTypeEntry.getKey(), accountEntry.getKey());
-                            return edsDirTreeCount;
-                        }))
+                        appTypeEntry.getValue().keySet().stream().map(s -> new EdsDirTreeCount(cid, dirTree, null, null, appTypeEntry.getKey(), s)))
                 .collect(Collectors.toList());
     }
 

+ 16 - 16
ai-server/src/main/java/com/zsjz/ai/module/eds/xml/DataInfo.java

@@ -5,7 +5,7 @@ import com.thoughtworks.xstream.annotations.XStreamAlias;
 import com.thoughtworks.xstream.annotations.XStreamImplicit;
 
 import com.zsjz.ai.common.exception.ServerException;
-import com.zsjz.ai.module.eds.utils.Bcp;
+import com.zsjz.ai.module.eds.utils.Eds;
 import lombok.Data;
 
 import java.lang.reflect.Field;
@@ -71,7 +71,7 @@ public class DataInfo {
      * 取小写表名
      */
     public String getTableName() {
-        if (tableName == null && (tableName = getValByIk(Bcp.TABLE_NAME_IK)) != null) {
+        if (tableName == null && (tableName = getValByIk(Eds.TABLE_NAME_IK)) != null) {
             tableName = tableName.toLowerCase();
         }
         return tableName;
@@ -81,31 +81,31 @@ public class DataInfo {
      * 取列分隔符(缺省制表符)
      */
     public Pattern getColumnSeparator() {
-        String columnSeparator = getValByIk(Bcp.COLUMN_SEPARATOR_IK);
-        return StrUtil.isEmpty(columnSeparator) ? Bcp.COLUMN_SEPARATOR_DEFAULT : Pattern.compile(columnSeparator);
+        String columnSeparator = getValByIk(Eds.COLUMN_SEPARATOR_IK);
+        return StrUtil.isEmpty(columnSeparator) ? Eds.COLUMN_SEPARATOR_DEFAULT : Pattern.compile(columnSeparator);
     }
 
     /**
      * 取行分隔符(缺省回车换行)
      */
     public Pattern getLineSeparator() {
-        String lineSeparator = getValByIk(Bcp.LINE_SEPARATOR_IK);
-        return StrUtil.isEmpty(lineSeparator) ? Bcp.LINE_SEPARATOR_DEFAULT : Pattern.compile(lineSeparator);
+        String lineSeparator = getValByIk(Eds.LINE_SEPARATOR_IK);
+        return StrUtil.isEmpty(lineSeparator) ? Eds.LINE_SEPARATOR_DEFAULT : Pattern.compile(lineSeparator);
     }
 
     /**
      * 取数据起始行
      */
     public int getStartingLine() {
-        String startingLine = getValByIk(Bcp.STARTING_LINE_IK);
-        return StrUtil.isEmpty(startingLine) ? Bcp.STARTING_LINE_DEFAULT : Integer.parseInt(startingLine);
+        String startingLine = getValByIk(Eds.STARTING_LINE_IK);
+        return StrUtil.isEmpty(startingLine) ? Eds.STARTING_LINE_DEFAULT : Integer.parseInt(startingLine);
     }
 
     /**
      * 取字符集(缺省 UTF-8)
      */
     public Charset getCharset() {
-        String charset = getValByIk(Bcp.CHARSET_IK);
+        String charset = getValByIk(Eds.CHARSET_IK);
         if (StrUtil.isEmpty(charset)) {
             return StandardCharsets.UTF_8;
         } else {
@@ -134,14 +134,14 @@ public class DataInfo {
      */
     public List<Path> getBcpFileList(Path bcpDirPath) {
         //定位 bcp 文件描述数据集
-        Dataset bcpFileDataset = getDatasetByDn(Bcp.BCP_FILE_DN);
+        Dataset bcpFileDataset = getDatasetByDn(Eds.BCP_FILE_DN);
         //拼接每个文件的完整路径
         return bcpFileDataset.getDataInfoList().stream().map(dataInfo -> {
-            String secondDir = dataInfo.getValByIk(Bcp.BCP_FILE_PATH_IK);
+            String secondDir = dataInfo.getValByIk(Eds.BCP_FILE_PATH_IK);
             if (StrUtil.isNotEmpty(secondDir)) {
-                return bcpDirPath.resolve(secondDir + "/" + dataInfo.getValByIk(Bcp.BCP_FILE_NAME_IK));
+                return bcpDirPath.resolve(secondDir + "/" + dataInfo.getValByIk(Eds.BCP_FILE_NAME_IK));
             }
-            return bcpDirPath.resolve(dataInfo.getValByIk(Bcp.BCP_FILE_NAME_IK));
+            return bcpDirPath.resolve(dataInfo.getValByIk(Eds.BCP_FILE_NAME_IK));
         }).collect(Collectors.toList());
     }
 
@@ -150,16 +150,16 @@ public class DataInfo {
      */
     public int getBcpFileDataSize() {
         //定位 bcp 文件描述数据集
-        Dataset bcpFileDataset = getDatasetByDn(Bcp.BCP_FILE_DN);
+        Dataset bcpFileDataset = getDatasetByDn(Eds.BCP_FILE_DN);
         //累加各文件记录数
-        return bcpFileDataset.getDataInfoList().stream().mapToInt(dataInfo -> Integer.parseInt(dataInfo.getValByIk(Bcp.BCP_FILE_DATA_SIZE_IK))).sum();
+        return bcpFileDataset.getDataInfoList().stream().mapToInt(dataInfo -> Integer.parseInt(dataInfo.getValByIk(Eds.BCP_FILE_DATA_SIZE_IK))).sum();
     }
 
     /**
      * 取 bcp 列名数组
      */
     public String[] getBcpFieldNameArr() {
-        List<Item> bcpFieldList = getDatasetByDn(Bcp.BCP_FIELD_DN).getDataInfoList().get(0).getItemList();
+        List<Item> bcpFieldList = getDatasetByDn(Eds.BCP_FIELD_DN).getDataInfoList().get(0).getItemList();
         return bcpFieldList.stream().map(item -> item.getEng().toLowerCase()).toArray(String[]::new);
     }
 

+ 9 - 9
ai-server/src/main/java/com/zsjz/ai/module/eds/xml/DataProcess.java

@@ -124,10 +124,10 @@ public class DataProcess {
         this.dataInfo = dataInfo;
         this.cls = cls;
         //取实体字段映射
-        Map<String, Field> fieldMap = Bcp.getFieldMap(cls);
+        Map<String, Field> fieldMap = Eds.getFieldMap(cls);
         //筛选必须有值的时间字段
-        this.mustHasTimeFieldArr = Arrays.stream(Bcp.getPojoFieldInfo(cls).getTimeFieldArr())
-                                         .filter(field -> Bcp.MUST_HAS_VALUE_FIELD_SET.contains(field.getName())).toArray(Field[]::new);
+        this.mustHasTimeFieldArr = Arrays.stream(Eds.getPojoFieldInfo(cls).getTimeFieldArr())
+                                         .filter(field -> Eds.MUST_HAS_VALUE_FIELD_SET.contains(field.getName())).toArray(Field[]::new);
         //初始化分隔符、起始行、编码与字段数组
         this.columnSeparator = dataInfo.getColumnSeparator();
         this.startIndex = dataInfo.getStartingLine() - 1;
@@ -200,12 +200,12 @@ public class DataProcess {
                     System.out.println("12312");
                 }*/
                 //采集编号列统一赋值
-                if (StrUtil.isNotEmpty(cid) && Bcp.CID_FILED_NAME.equals(field.getName())) {
+                if (StrUtil.isNotEmpty(cid) && Eds.CID_FILED_NAME.equals(field.getName())) {
                     ReflectUtil.setFieldValue(obj, field, cid);
                 } else if (StrUtil.endWith(field.getType().getName(), Cnst.LOCAL_DATE_TIME)) {
-                    ReflectUtil.setFieldValue(obj, field, Bcp.timestampToLocalDateTime(fieldValue));
+                    ReflectUtil.setFieldValue(obj, field, Eds.timestampToLocalDateTime(fieldValue));
                 } else if (StrUtil.endWith(field.getType().getName(), Cnst.LOCAL_DATE)) {
-                    ReflectUtil.setFieldValue(obj, field, Bcp.timestampToLocalDate(fieldValue));
+                    ReflectUtil.setFieldValue(obj, field, Eds.timestampToLocalDate(fieldValue));
                 } else {
                     try {
                         EdsFields annotation = field.getAnnotation(EdsFields.class);
@@ -225,7 +225,7 @@ public class DataProcess {
             //补齐缺失的必填时间
             for (Field field : this.mustHasTimeFieldArr) {
                 if (ObjUtil.isNull(ReflectUtil.getFieldValue(obj, field))) {
-                    ReflectUtil.setFieldValue(obj, field, Bcp.TIME_DEFAULT_VALUE);
+                    ReflectUtil.setFieldValue(obj, field, Eds.TIME_DEFAULT_VALUE);
                 }
             }
             Consumer<Object> consumer = (Consumer<Object>) BeanMapperGenerator.BEAN_MAPPERS_MAP.get(cls);
@@ -264,7 +264,7 @@ public class DataProcess {
         Field mailSendTimeField = null;
         Field[] timeFieldArr = edsEntityFieldInfo.getTimeFieldArr();
         for (Field field : timeFieldArr) {
-            if (field.getName().equals(Bcp.MAIL_SEND_TIME)) {
+            if (field.getName().equals(Eds.MAIL_SEND_TIME)) {
                 mailSendTimeField = field;
                 break;
             }
@@ -325,7 +325,7 @@ public class DataProcess {
             if (mediaTypeField != null) {
                 typeCode = (String) ReflectUtil.getFieldValue(data, mediaTypeField);
             }
-            if (typeCode != null && Bcp.FILE_TYPE_SET.contains(typeCode)) {
+            if (typeCode != null && Eds.FILE_TYPE_SET.contains(typeCode)) {
                 String filePathStr = (String) ReflectUtil.getFieldValue(data, fileField);
                 //取文件相对路径
                 if (StrUtil.isEmpty(filePathStr)) {

+ 8 - 8
ai-server/src/main/java/com/zsjz/ai/module/eds/xml/EdsExtra.java

@@ -11,7 +11,7 @@ import com.zsjz.ai.module.eds.enums.EdsEntityEnum;
 import com.zsjz.ai.module.eds.mapper.EdsImportMaterialMapper;
 import com.zsjz.ai.module.eds.po.EdsEntityFieldInfo;
 import com.zsjz.ai.module.eds.po.basic.EdsMforensics010100;
-import com.zsjz.ai.module.eds.utils.Bcp;
+import com.zsjz.ai.module.eds.utils.Eds;
 import com.zsjz.ai.module.eds.utils.EtlRedisKey;
 import com.zsjz.ai.module.eds.utils.PojoConstant;
 import lombok.RequiredArgsConstructor;
@@ -64,15 +64,15 @@ public class EdsExtra {
         String filename = dto.getFileName();
         //计算解压目录并解压
         Path zipPathParent = zipPath.getParent();
-        Path zipEtrDir = zipPathParent.resolve(filename.substring(0, filename.length() - Bcp.ZIP.length()));
-        if (!Bcp.unBcpZip(zipPath, zipEtrDir.toString(), filename)) {
+        Path zipEtrDir = zipPathParent.resolve(filename.substring(0, filename.length() - Eds.ZIP.length()));
+        if (!Eds.unBcpZip(zipPath, zipEtrDir.toString(), filename)) {
             String errMsg = StrUtil.format("数据包[{}]无法解析:压缩包损坏无法解压。", filename);
             //edsImportListMapper.updateById(new EdsImportList(dto.getImportId(), 3, 5, "100", errMsg));
             return;
         }
 
         //读取包内索引文件
-        Path xmlPath = zipEtrDir.resolve(Bcp.ZIP_INDEX_XML_FILENAME);
+        Path xmlPath = zipEtrDir.resolve(Eds.ZIP_INDEX_XML_FILENAME);
         //确认索引文件存在
         if (!Files.exists(xmlPath)) {
             String errMsg = StrUtil.format("数据包[{}]无法解析:基本信息文件不存在。", filename);
@@ -104,7 +104,7 @@ public class EdsExtra {
             return;
         }
         //清洗采集编号
-        ctId = Bcp.formatCtId(ctId);
+        ctId = Eds.formatCtId(ctId);
         //校验采集编号
         if (!verifyProcessStep(baseInfoList.size(), ctId, dto.getCaseId())) {
             String errMsg = StrUtil.format("数据包[{}]:采集编号异常或数据包已提取。", filename);
@@ -161,14 +161,14 @@ public class EdsExtra {
 
     public void exec(DataInfo dataInfo, Message xmlMessage) {
         //确定表名与实体信息
-        String tableName = dataInfo.getValByIk(Bcp.TABLE_NAME_IK).toLowerCase();
+        String tableName = dataInfo.getValByIk(Eds.TABLE_NAME_IK).toLowerCase();
         Class<?> cls = EdsEntityEnum.findClsByTableName(tableName);
         //校验表是否有对应实体
         if (cls == null) {
             //无对应实体,直接返回
             return;
         }
-        EdsEntityFieldInfo edsEntityFieldInfo = Bcp.getPojoFieldInfo(cls);
+        EdsEntityFieldInfo edsEntityFieldInfo = Eds.getPojoFieldInfo(cls);
         DataProcess dataProcess = new DataProcess(dataInfo, cls);
         dataProcess.setCid(xmlMessage.getCollectTargetId());
         dataProcess.setCaseId(xmlMessage.getCaseId());
@@ -243,7 +243,7 @@ public class EdsExtra {
      * @param dto 提取任务信息
      */
     public void finish(ExtraFileDTO dto) {
-        Bcp.delZip(dto.getBcpDir(), dto.getZipPath());
+        Eds.delZip(dto.getBcpDir(), dto.getZipPath());
         //GovExecPool.EXC.execute(() -> Bcp.createZip(dto.getBcpDir(), dto.getUserAcnt()));
         String errMsg = StrUtil.format("数据包[{}]:已提取完成。", dto.getFileName());
         String dataCnt = EtlRedisKey.BCP_DATA_CNT + dto.getCti();

+ 5 - 5
ai-server/src/main/java/com/zsjz/ai/module/eds/xml/Message.java

@@ -10,7 +10,7 @@ import com.thoughtworks.xstream.annotations.XStreamAlias;
 import com.thoughtworks.xstream.annotations.XStreamOmitField;
 
 import com.zsjz.ai.module.eds.enums.EdsEntityEnum;
-import com.zsjz.ai.module.eds.utils.Bcp;
+import com.zsjz.ai.module.eds.utils.Eds;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 
@@ -69,9 +69,9 @@ public class Message {
      */
     public List<DataInfo> getDataInfoList() {
         if (dataInfoList == null) {
-            dataInfoList = dataset.getDataInfoList().get(0).getDatasetByDn(Bcp.FORMAT_BCP_DN).getDataInfoList();
+            dataInfoList = dataset.getDataInfoList().get(0).getDatasetByDn(Eds.FORMAT_BCP_DN).getDataInfoList();
             //按表名排序,保证基础信息先入库
-            dataInfoList.sort(Comparator.comparing(dataInfo -> dataInfo.getValByIk(Bcp.TABLE_NAME_IK)));
+            dataInfoList.sort(Comparator.comparing(dataInfo -> dataInfo.getValByIk(Eds.TABLE_NAME_IK)));
         }
         return dataInfoList;
     }
@@ -83,7 +83,7 @@ public class Message {
         TableName indexAnno = cls.getAnnotation(TableName.class);
         String tableName = indexAnno.value();
         for (DataInfo dataInfo : getDataInfoList()) {
-            String bcpTableName = dataInfo.getValByIk(Bcp.TABLE_NAME_IK);
+            String bcpTableName = dataInfo.getValByIk(Eds.TABLE_NAME_IK);
             if (StrUtil.equalsIgnoreCase(tableName, bcpTableName)) {
                 return dataInfo;
             }
@@ -109,7 +109,7 @@ public class Message {
      * 按映射信息反查实体类
      */
     public Class<?> getClsByDataInfo(DataInfo dataInfo) {
-        String tableName = dataInfo.getValByIk(Bcp.TABLE_NAME_IK).toLowerCase();
+        String tableName = dataInfo.getValByIk(Eds.TABLE_NAME_IK).toLowerCase();
         return EdsEntityEnum.findClsByTableName(tableName);
     }