瀏覽代碼

2.0.0-2.0.1

dengsixing 1 月之前
父節點
當前提交
e1a2d0c713

+ 13 - 4
src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java

@@ -43,6 +43,8 @@ import java.util.stream.Collectors;
 @Service
 public class JmgaServiceImpl implements IJmgaService {
 
+    public static final String ipv4Pattern = "\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\b";
+
     @Autowired
     private IOrigFileUploadBatchService origFileUploadBatchService;
 
@@ -295,8 +297,8 @@ public class JmgaServiceImpl implements IJmgaService {
         //打包算法日志
         ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
         ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
-        String consoleLogPath = scenePlusExt.getDataSource() + "console.log";
-        String consoleOldLogPath = scenePlusExt.getDataSource() + "console.old.log";
+        String consoleLogPath = scenePlusExt.getDataSource() + "/console.log";
+        String consoleOldLogPath = scenePlusExt.getDataSource() + "/console.old.log";
         if(FileUtil.exist(consoleLogPath)){
             FileUtil.copy(consoleLogPath, logPath,true);
         }
@@ -312,6 +314,9 @@ public class JmgaServiceImpl implements IJmgaService {
             List<String> batchIdList = batchList.stream().map(v -> v.getBatchId()).collect(Collectors.toList());
             List<OrigFileUpload> uploadList = origFileUploadService.list(new LambdaQueryWrapper<OrigFileUpload>().in(OrigFileUpload::getBatchId, batchIdList));
             if(CollUtil.isNotEmpty(uploadList)){
+                uploadList.stream().forEach(v->{
+                    v.setFileUrl(v.getFileUrl().replaceAll(ipv4Pattern, "ip"));
+                });
                 EasyExcel.write(logPath.concat("origFileUpload.xlsx"), OrigFileUpload.class).sheet("origFileUpload").doWrite(uploadList);
             }
         }
@@ -330,7 +335,7 @@ public class JmgaServiceImpl implements IJmgaService {
         if(fYunFileService.fileExist(logName)){
             fYunFileService.copyFileInBucket(logName, logName + "-bak-" + DateExtUtil.format(Calendar.getInstance().getTime(), DateExtUtil.dateStyle11));
         }
-        fYunFileService.uploadFile(zipPath, "build_log/" + num + "/" + num + "-log");
+        fYunFileService.uploadFile(zipPath, logName);
 
     }
 
@@ -347,7 +352,11 @@ public class JmgaServiceImpl implements IJmgaService {
                 if(i > 7){
                     continue level;
                 }
-                FileUtil.copy(file.getAbsolutePath(), file.getAbsolutePath().replace(FileUtil.getParent(serverPath, 1), tmpPath), true);
+                String targetPath = file.getAbsolutePath().replace(FileUtil.getParent(serverPath, 1), tmpPath);
+                FileUtil.copy(file.getAbsolutePath(), targetPath, true);
+                String content = FileUtil.readUtf8String(targetPath);
+                content = content.replace("公安", "xx").replaceAll(ipv4Pattern, "ip");
+                FileUtil.writeUtf8String(content, targetPath);
             }
         }
     }

+ 1 - 1
src/main/resources/logback-nacos.xml

@@ -19,7 +19,7 @@
 	<!-- 定义日志文件总大小 -->
 	<property name="TOTAL_SIZE_CAP" value="20GB"/>
 	<!-- 定义单个日志文件大小 -->
-	<property name="MAX_FILE_SIZE" value="200MB"/>
+	<property name="MAX_FILE_SIZE" value="100MB"/>
 
 
 	<!-- 输出到控制台 -->