|
@@ -3,11 +3,13 @@ package com.qmth.cet.plug.service.impl;
|
|
|
import com.qmth.cet.plug.contant.SystemConstant;
|
|
|
import com.qmth.cet.plug.enums.ExceptionResultEnum;
|
|
|
import com.qmth.cet.plug.lock.LockService;
|
|
|
+import com.qmth.cet.plug.service.ExeInvokerService;
|
|
|
import com.qmth.cet.plug.service.LogicService;
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
@@ -16,6 +18,8 @@ import java.io.*;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -30,9 +34,72 @@ import java.util.stream.Collectors;
|
|
|
public class LogicServiceImpl implements LogicService {
|
|
|
private final static Logger log = LoggerFactory.getLogger(LogicServiceImpl.class);
|
|
|
|
|
|
+ @Value("${com.qmth.cet4.dir}")
|
|
|
+ String cet4Dir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.cet4.card}")
|
|
|
+ String cet4Card;
|
|
|
+
|
|
|
+ @Value("${com.qmth.cet6.dir}")
|
|
|
+ String cet6Dir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.cet6.card}")
|
|
|
+ String cet6Card;
|
|
|
+
|
|
|
+ @Value("${com.qmth.fayu.dir}")
|
|
|
+ String fayuDir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.fayu.card}")
|
|
|
+ String fayuCard;
|
|
|
+
|
|
|
+ @Value("${com.qmth.riyu4.dir}")
|
|
|
+ String riyu4Dir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.riyu4.card}")
|
|
|
+ String riyu4Card;
|
|
|
+
|
|
|
+ @Value("${com.qmth.riyu6.dir}")
|
|
|
+ String riyu6Dir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.riyu6.card}")
|
|
|
+ String riyu6Card;
|
|
|
+
|
|
|
+ @Value("${com.qmth.eyu4.dir}")
|
|
|
+ String eyu4Dir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.eyu4.card}")
|
|
|
+ String eyu4Card;
|
|
|
+
|
|
|
+ @Value("${com.qmth.eyu6.dir}")
|
|
|
+ String eyu6Dir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.eyu6.card}")
|
|
|
+ String eyu6Card;
|
|
|
+
|
|
|
+ @Value("${com.qmth.deyu4.dir}")
|
|
|
+ String deyu4Dir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.deyu4.card}")
|
|
|
+ String deyu4Card;
|
|
|
+
|
|
|
+ @Value("${com.qmth.deyu6.dir}")
|
|
|
+ String deyu6Dir;
|
|
|
+
|
|
|
+ @Value("${com.qmth.deyu6.card}")
|
|
|
+ String deyu6Card;
|
|
|
+
|
|
|
+ @Value("${com.qmth.cpu.count}")
|
|
|
+ String cpuNumStr;
|
|
|
+
|
|
|
+ @Value("${com.qmth.overall.subdir}")
|
|
|
+ String overallSubdir;
|
|
|
+
|
|
|
@Resource
|
|
|
LockService lockService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ ExeInvokerService exeInvokerService;
|
|
|
+
|
|
|
/**
|
|
|
* 执行解析数据
|
|
|
*
|
|
@@ -40,12 +107,19 @@ public class LogicServiceImpl implements LogicService {
|
|
|
* @param projectPath
|
|
|
* @param rootDirName
|
|
|
* @param executor
|
|
|
+ * @param cardPath
|
|
|
*/
|
|
|
@Override
|
|
|
- public void execFile(String fileName, String projectPath, String rootDirName, ExecutorService executor) throws IOException, InterruptedException {
|
|
|
+ public void execFile(String fileName, String projectPath, String rootDirName, ExecutorService executor, String cardPath) throws IOException, InterruptedException {
|
|
|
+ log.info("dirPath:{},cardPath:{}", fileName, cardPath);
|
|
|
File mkdir = new File(fileName);
|
|
|
if (!mkdir.exists()) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception(rootDirName + "目录不存在");
|
|
|
+// throw ExceptionResultEnum.ERROR.exception(rootDirName + "目录不存在");
|
|
|
+ log.info("dirPath:[{}]未找到", fileName, cardPath);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Objects.isNull(overallSubdir) || Objects.equals(overallSubdir, "")) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("请配置全局子目录com.qmth.overall.subdir属性");
|
|
|
}
|
|
|
if (mkdir.isDirectory()) {
|
|
|
File[] files = mkdir.listFiles();
|
|
@@ -55,9 +129,24 @@ public class LogicServiceImpl implements LogicService {
|
|
|
mkdirFileList = SystemConstant.analyzeDir(files[i], mkdirFileList);
|
|
|
}
|
|
|
log.info("mkdirFileList:{}", mkdirFileList);
|
|
|
+ //过滤子目录
|
|
|
+ overallSubdir = overallSubdir.replaceAll(",", ",");
|
|
|
+ String[] overallSubdirStrs = StringUtils.split(overallSubdir, ",");
|
|
|
+ List<File> mkdirFileTempList = new ArrayList<>(mkdirFileList.size());
|
|
|
+ for (File file : mkdirFileList) {
|
|
|
+ String rootFilePath = file.getAbsolutePath();
|
|
|
+ for (int i = 0; i < overallSubdirStrs.length; i++) {
|
|
|
+ if (rootFilePath.endsWith(overallSubdirStrs[i])) {
|
|
|
+ mkdirFileTempList.add(file);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(mkdirFileTempList)) {
|
|
|
+ mkdirFileList.clear();
|
|
|
+ mkdirFileList.addAll(mkdirFileTempList);
|
|
|
+ }
|
|
|
for (File file : mkdirFileList) {
|
|
|
- String rootPath = file.getAbsolutePath();
|
|
|
- rootPath = rootDirName + rootPath.replaceAll(fileName, "");
|
|
|
+ String rootPath = rootDirName + fileName.substring(fileName.lastIndexOf(File.separator), fileName.length());
|
|
|
File root = new File(projectPath, rootPath);
|
|
|
if (!root.exists()) {
|
|
|
root.mkdirs();
|
|
@@ -68,12 +157,12 @@ public class LogicServiceImpl implements LogicService {
|
|
|
log.info("lockKey:{}", lockKey);
|
|
|
String finalRootPath = rootPath;
|
|
|
executor.submit(() -> {
|
|
|
- log.info("启动新线程===>id:{},name:{}", Thread.currentThread().getId(), Thread.currentThread().getName());
|
|
|
+ log.info("启动线程===>id:{},name:{}", Thread.currentThread().getId(), Thread.currentThread().getName());
|
|
|
for (; ; ) {
|
|
|
- boolean scanLock = lockService.lock(lockKey, lockKey, SystemConstant.LOCK_TIME_OUT);//30分钟
|
|
|
+ boolean scanLock = lockService.lock(lockKey, lockKey, SystemConstant.LOCK_TIME_OUT);//60分钟
|
|
|
if (scanLock) {
|
|
|
try {
|
|
|
- this.scanTxtExecLogic(projectPath, finalRootPath, file);//扫描txt处理
|
|
|
+ this.scanTxtExecLogic(projectPath, finalRootPath, file, cardPath);//扫描txt处理
|
|
|
} catch (Exception e) {
|
|
|
log.error(SystemConstant.LOG_ERROR, e);
|
|
|
} finally {
|
|
@@ -94,15 +183,80 @@ public class LogicServiceImpl implements LogicService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 执行逻辑
|
|
|
+ *
|
|
|
+ * @throws IOException
|
|
|
+ * @throws InterruptedException
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void execLogic() throws IOException, InterruptedException {
|
|
|
+ log.info("execLogic is come in");
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ StringJoiner stringJoiner = new StringJoiner("");
|
|
|
+ String projectPath = System.getProperty("user.dir");
|
|
|
+ int cpuNum = Runtime.getRuntime().availableProcessors();
|
|
|
+ if (Objects.nonNull(cpuNumStr) && !Objects.equals(cpuNumStr, "")) {
|
|
|
+ cpuNum = Integer.parseInt(cpuNumStr);
|
|
|
+ }
|
|
|
+ log.info("cpuNum:{}", cpuNum);
|
|
|
+ ExecutorService executor = Executors.newFixedThreadPool(Math.abs(cpuNum / 2));
|
|
|
+ if (Objects.nonNull(cet4Dir) && !Objects.equals(cet4Dir, "") &&
|
|
|
+ Objects.nonNull(cet4Card) && !Objects.equals(cet4Card, "")) {
|
|
|
+ this.execFile(cet4Dir, projectPath, "cet4", executor, cet4Card);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(cet6Dir) && !Objects.equals(cet6Dir, "") &&
|
|
|
+ Objects.nonNull(cet6Card) && !Objects.equals(cet6Card, "")) {
|
|
|
+ this.execFile(cet6Dir, projectPath, "cet6", executor, cet6Card);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(fayuDir) && !Objects.equals(fayuDir, "") &&
|
|
|
+ Objects.nonNull(fayuCard) && !Objects.equals(fayuCard, "")) {
|
|
|
+ this.execFile(fayuDir, projectPath, "fayu", executor, fayuCard);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(riyu4Dir) && !Objects.equals(riyu4Dir, "") &&
|
|
|
+ Objects.nonNull(riyu4Card) && !Objects.equals(riyu4Card, "")) {
|
|
|
+ this.execFile(riyu4Dir, projectPath, "riyu4", executor, riyu4Card);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(riyu6Dir) && !Objects.equals(riyu6Dir, "") &&
|
|
|
+ Objects.nonNull(riyu6Card) && !Objects.equals(riyu6Card, "")) {
|
|
|
+ this.execFile(riyu6Dir, projectPath, "riyu6", executor, riyu6Card);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(eyu4Dir) && !Objects.equals(eyu4Dir, "") &&
|
|
|
+ Objects.nonNull(eyu4Card) && !Objects.equals(eyu4Card, "")) {
|
|
|
+ this.execFile(eyu4Dir, projectPath, "eyu4", executor, eyu4Card);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(eyu6Dir) && !Objects.equals(eyu6Dir, "") &&
|
|
|
+ Objects.nonNull(eyu6Card) && !Objects.equals(eyu6Card, "")) {
|
|
|
+ this.execFile(eyu6Dir, projectPath, "eyu6", executor, eyu6Card);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(deyu4Dir) && !Objects.equals(deyu4Dir, "") &&
|
|
|
+ Objects.nonNull(deyu4Card) && !Objects.equals(deyu4Card, "")) {
|
|
|
+ this.execFile(deyu4Dir, projectPath, "deyu4", executor, deyu4Card);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(deyu6Dir) && !Objects.equals(deyu6Dir, "") &&
|
|
|
+ Objects.nonNull(deyu6Card) && !Objects.equals(deyu6Card, "")) {
|
|
|
+ this.execFile(deyu6Dir, projectPath, "deyu6", executor, deyu6Card);
|
|
|
+ }
|
|
|
+ executor.shutdown();
|
|
|
+ while (!executor.awaitTermination(1, TimeUnit.MINUTES)) {
|
|
|
+ log.info("线程池没有关闭");
|
|
|
+ }
|
|
|
+ log.info("线程池已经关闭");
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
+ stringJoiner.add("============耗时============:").add((end - start) / 1000 + "").add("秒");
|
|
|
+ log.info("request:{}", stringJoiner.toString());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 扫描文件执行逻辑
|
|
|
*
|
|
|
* @param projectPath
|
|
|
* @param rootPath
|
|
|
* @param file
|
|
|
+ * @param cardPath
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
- protected void scanTxtExecLogic(String projectPath, String rootPath, File file) throws IOException, InterruptedException {
|
|
|
+ protected void scanTxtExecLogic(String projectPath, String rootPath, File file, String cardPath) throws IOException, InterruptedException {
|
|
|
//扫描txt处理
|
|
|
File[] fileArray = file.listFiles();
|
|
|
List<File> fileList = new ArrayList<>(Arrays.asList(fileArray));
|
|
@@ -149,7 +303,9 @@ public class LogicServiceImpl implements LogicService {
|
|
|
}
|
|
|
|
|
|
//temp临时目录
|
|
|
- String tempDir = file.getAbsolutePath() + File.separator + "temp" + File.separator;
|
|
|
+ File tempDirFile = new File(projectPath, rootPath + File.separator + "temp");
|
|
|
+// String tempDir = file.getAbsolutePath() + File.separator + "temp";
|
|
|
+ String tempDir = tempDirFile.getAbsolutePath();
|
|
|
File tempFileDir = new File(tempDir);
|
|
|
if (!tempFileDir.exists()) {
|
|
|
tempFileDir.mkdirs();
|
|
@@ -166,7 +322,7 @@ public class LogicServiceImpl implements LogicService {
|
|
|
} else {
|
|
|
IOUtils.write(scanSj.toString().getBytes(StandardCharsets.UTF_8), new FileOutputStream(tempScanTxt));
|
|
|
}
|
|
|
- this.execCmd(tempScanTxt, tempScanResultTxt, projectPath, rootPath);
|
|
|
+ this.execCmd(cardPath, tempScanTxt, tempScanResultTxt, projectPath, rootPath);
|
|
|
}
|
|
|
if (max == size) {
|
|
|
break;
|
|
@@ -182,90 +338,92 @@ public class LogicServiceImpl implements LogicService {
|
|
|
/**
|
|
|
* 执行cmd
|
|
|
*
|
|
|
+ * @param cardPath
|
|
|
* @param tempScanTxt
|
|
|
* @param tempScanResultTxt
|
|
|
* @param projectPath
|
|
|
* @param rootPath
|
|
|
* @throws InterruptedException
|
|
|
+ * @throws IOException
|
|
|
*/
|
|
|
- protected void execCmd(File tempScanTxt, File tempScanResultTxt, String projectPath, String rootPath) throws InterruptedException, IOException {
|
|
|
- int randIntRange = new Random().nextInt(10);
|
|
|
- Thread.sleep(1000 * randIntRange);
|
|
|
+ protected void execCmd(String cardPath, File tempScanTxt, File tempScanResultTxt, String projectPath, String rootPath) throws InterruptedException, IOException {
|
|
|
+// int randIntRange = new Random().nextInt(10);
|
|
|
+// Thread.sleep(1000 * randIntRange);
|
|
|
+// ByteArrayOutputStream ou = new ByteArrayOutputStream();
|
|
|
+// IOUtils.copy(new FileInputStream(tempScanTxt), ou);
|
|
|
+// String string = new String(ou.toByteArray(), StandardCharsets.UTF_8);
|
|
|
+// String[] strs = StringUtils.split(string, "\r\n");
|
|
|
+// List<String> scanList = new ArrayList<>(Arrays.asList(strs));
|
|
|
+// StringJoiner scanSj = new StringJoiner("\r\n");//全量扫描数据
|
|
|
+// for (int i = 0; i < scanList.size(); i++) {
|
|
|
+// String s = scanList.get(i);
|
|
|
+// int range = new Random().nextInt(3);
|
|
|
+// s += "," + range;
|
|
|
+// scanSj.add(s);
|
|
|
+// scanList.set(i, s);
|
|
|
+// }
|
|
|
+// IOUtils.write(scanSj.toString().getBytes(StandardCharsets.UTF_8), new FileOutputStream(tempScanResultTxt));
|
|
|
+
|
|
|
+ exeInvokerService.invokeExternalExe(cardPath, tempScanTxt.getAbsolutePath(), tempScanResultTxt.getAbsolutePath());
|
|
|
+ //读取扫描tempresult数据
|
|
|
ByteArrayOutputStream ou = new ByteArrayOutputStream();
|
|
|
- IOUtils.copy(new FileInputStream(tempScanTxt), ou);
|
|
|
+ IOUtils.copy(new FileInputStream(tempScanResultTxt), ou);
|
|
|
String string = new String(ou.toByteArray(), StandardCharsets.UTF_8);
|
|
|
String[] strs = StringUtils.split(string, "\r\n");
|
|
|
List<String> scanList = new ArrayList<>(Arrays.asList(strs));
|
|
|
- StringJoiner scanSj = new StringJoiner("\r\n");//全量扫描数据
|
|
|
- for (int i = 0; i < scanList.size(); i++) {
|
|
|
- String s = scanList.get(i);
|
|
|
- //偶数
|
|
|
- if (i % 2 == 0) {
|
|
|
- s += ",0";
|
|
|
- scanSj.add(s);
|
|
|
- } else {
|
|
|
- s += ",1";
|
|
|
- scanSj.add(s);
|
|
|
- }
|
|
|
- scanList.set(i, s);
|
|
|
- }
|
|
|
- IOUtils.write(scanSj.toString().getBytes(StandardCharsets.UTF_8), new FileOutputStream(tempScanResultTxt));
|
|
|
|
|
|
- //读取result数据
|
|
|
- StringJoiner scanSuccessSj = new StringJoiner("\r\n");//全量扫描数据
|
|
|
- StringJoiner scanErrorSj = new StringJoiner("\r\n");//全量扫描数据
|
|
|
+// StringJoiner scanSuccessSj = new StringJoiner("\r\n");
|
|
|
+ StringJoiner scanCheckSj = new StringJoiner("\r\n");
|
|
|
for (String s : scanList) {
|
|
|
- if (s.endsWith("0")) {
|
|
|
- scanSuccessSj.add(s);
|
|
|
- } else if (s.endsWith("1")) {
|
|
|
- scanErrorSj.add(s);
|
|
|
+ if (s.endsWith("1") || s.endsWith("2")) {
|
|
|
+ scanCheckSj.add(s);
|
|
|
}
|
|
|
}
|
|
|
- this.successTxtExecLogic(projectPath, rootPath, scanSuccessSj);
|
|
|
- this.errorTxtExecLogic(projectPath, rootPath, scanErrorSj);
|
|
|
+// this.successTxtExecLogic(projectPath, rootPath, scanSuccessSj);
|
|
|
+ this.checkCsvExecLogic(projectPath, rootPath, scanCheckSj);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 执行成功文件逻辑
|
|
|
- *
|
|
|
- * @param projectPath
|
|
|
- * @param rootPath
|
|
|
- * @throws IOException
|
|
|
- */
|
|
|
- protected void successTxtExecLogic(String projectPath, String rootPath, StringJoiner sj) throws IOException {
|
|
|
- File successTxtFile = new File(projectPath, rootPath + File.separator + "success.txt");
|
|
|
- if (!successTxtFile.exists()) {
|
|
|
- successTxtFile.createNewFile();
|
|
|
- IOUtils.write(sj.toString().getBytes(StandardCharsets.UTF_8), new FileOutputStream(successTxtFile));
|
|
|
- } else {
|
|
|
- //读取文件数据
|
|
|
- ByteArrayOutputStream ou = new ByteArrayOutputStream();
|
|
|
- IOUtils.copy(new FileInputStream(successTxtFile), ou);
|
|
|
- String string = new String(ou.toByteArray(), StandardCharsets.UTF_8);
|
|
|
- StringJoiner scanSj = new StringJoiner("\r\n");//全量扫描数据
|
|
|
- scanSj.add(string);
|
|
|
- String temp = new String(string);
|
|
|
- String[] strs = StringUtils.split(temp, "\r\n");
|
|
|
- List<String> scanList = new ArrayList<>(Arrays.asList(strs));
|
|
|
- Map<String, String> scanMap = scanList.stream().collect(Collectors.toMap(m -> m, Function.identity()));
|
|
|
-
|
|
|
- //读取传来的临时数据
|
|
|
- String[] strsTemp = StringUtils.split(sj.toString(), "\r\n");
|
|
|
- List<String> scanTempList = new ArrayList<>(Arrays.asList(strsTemp));
|
|
|
-
|
|
|
- boolean write = false;
|
|
|
- for (int y = 0; y < scanTempList.size(); y++) {
|
|
|
- String path = scanTempList.get(y);
|
|
|
- if (!scanMap.containsKey(path)) {
|
|
|
- scanSj.add(path);
|
|
|
- write = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (write) {
|
|
|
- IOUtils.write(scanSj.toString().getBytes(StandardCharsets.UTF_8), new FileOutputStream(successTxtFile));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 执行成功文件逻辑
|
|
|
+// *
|
|
|
+// * @param projectPath
|
|
|
+// * @param rootPath
|
|
|
+// * @throws IOException
|
|
|
+// */
|
|
|
+// protected void successTxtExecLogic(String projectPath, String rootPath, StringJoiner sj) throws IOException {
|
|
|
+// File successTxtFile = new File(projectPath, rootPath + File.separator + "success.txt");
|
|
|
+// if (!successTxtFile.exists()) {
|
|
|
+// successTxtFile.createNewFile();
|
|
|
+// IOUtils.write(sj.toString().getBytes(StandardCharsets.UTF_8), new FileOutputStream(successTxtFile));
|
|
|
+// } else {
|
|
|
+// //读取文件数据
|
|
|
+// ByteArrayOutputStream ou = new ByteArrayOutputStream();
|
|
|
+// IOUtils.copy(new FileInputStream(successTxtFile), ou);
|
|
|
+// String string = new String(ou.toByteArray(), StandardCharsets.UTF_8);
|
|
|
+// StringJoiner scanSj = new StringJoiner("\r\n");//全量扫描数据
|
|
|
+// scanSj.add(string);
|
|
|
+// String temp = new String(string);
|
|
|
+// String[] strs = StringUtils.split(temp, "\r\n");
|
|
|
+// List<String> scanList = new ArrayList<>(Arrays.asList(strs));
|
|
|
+// Map<String, String> scanMap = scanList.stream().collect(Collectors.toMap(m -> m, Function.identity()));
|
|
|
+//
|
|
|
+// //读取传来的临时数据
|
|
|
+// String[] strsTemp = StringUtils.split(sj.toString(), "\r\n");
|
|
|
+// List<String> scanTempList = new ArrayList<>(Arrays.asList(strsTemp));
|
|
|
+//
|
|
|
+// boolean write = false;
|
|
|
+// for (int y = 0; y < scanTempList.size(); y++) {
|
|
|
+// String path = scanTempList.get(y);
|
|
|
+// if (!scanMap.containsKey(path)) {
|
|
|
+// scanSj.add(path);
|
|
|
+// write = true;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (write) {
|
|
|
+// IOUtils.write(scanSj.toString().getBytes(StandardCharsets.UTF_8), new FileOutputStream(successTxtFile));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 执行错误文件逻辑
|
|
@@ -274,8 +432,8 @@ public class LogicServiceImpl implements LogicService {
|
|
|
* @param rootPath
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
- protected void errorTxtExecLogic(String projectPath, String rootPath, StringJoiner sj) throws IOException {
|
|
|
- File errorTxtFile = new File(projectPath, rootPath + File.separator + "error.txt");
|
|
|
+ protected void checkCsvExecLogic(String projectPath, String rootPath, StringJoiner sj) throws IOException {
|
|
|
+ File errorTxtFile = new File(projectPath, rootPath + File.separator + "check.csv");
|
|
|
if (!errorTxtFile.exists()) {
|
|
|
errorTxtFile.createNewFile();
|
|
|
IOUtils.write(sj.toString().getBytes(StandardCharsets.UTF_8), new FileOutputStream(errorTxtFile));
|