|
@@ -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);
|
|
|
}
|
|
|
}
|
|
|
}
|