|
@@ -9,6 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.common.util.DateUtil;
|
|
|
+import com.fdkankan.manage.common.ResultCode;
|
|
|
+import com.fdkankan.manage.common.SensitiveWordReplacer;
|
|
|
+import com.fdkankan.manage.exception.BusinessException;
|
|
|
import com.fdkankan.manage.httpClient.service.LaserService;
|
|
|
import com.fdkankan.manage.entity.*;
|
|
|
import com.fdkankan.manage.mapper.IScenePlusMapper;
|
|
@@ -21,15 +24,14 @@ import com.fdkankan.manage.vo.response.AgentNewLogVo;
|
|
|
import com.fdkankan.manage.vo.response.GroupByCount;
|
|
|
import com.fdkankan.manage.vo.response.UserAuthSceneVo;
|
|
|
import com.fdkankan.manage.vo.response.UserShareSceneVo;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -46,6 +48,18 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
|
|
|
ISceneProService sceneProService;
|
|
|
@Autowired
|
|
|
LaserService laserService;
|
|
|
+ @Autowired
|
|
|
+ ISceneBuildProcessLogService sceneBuildProcessLogService;
|
|
|
+ @Autowired
|
|
|
+ IBuildLogService buildLogService;
|
|
|
+ @Autowired
|
|
|
+ IOrigFileUploadBatchService origFileUploadBatchService;
|
|
|
+ @Autowired
|
|
|
+ IOrigFileUploadService origFileUploadService;
|
|
|
+ @Autowired
|
|
|
+ IExcelService excelService;
|
|
|
+ @Autowired
|
|
|
+ IScenePlusExtService scenePlusExtService;
|
|
|
|
|
|
@Override
|
|
|
public ScenePlus getByNum(String sceneNum) {
|
|
@@ -119,34 +133,57 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
|
|
|
* oss目录:
|
|
|
* /oss/4dkankan/build_log/<num>(这个目录整个打包)
|
|
|
*/
|
|
|
- @Autowired
|
|
|
- ISceneBuildProcessLogService sceneBuildProcessLogService;
|
|
|
- @Autowired
|
|
|
- IBuildLogService buildLogService;
|
|
|
- @Autowired
|
|
|
- IExcelService excelService;
|
|
|
-
|
|
|
@Override
|
|
|
public String getSceneBuildLog(String num) {
|
|
|
String buildLogPath = "/oss/4dkankan/build_log/" + num;
|
|
|
String zipName = num+".zip";
|
|
|
-
|
|
|
if(!new File(buildLogPath).exists()){
|
|
|
- return null;
|
|
|
+ new File(buildLogPath).mkdirs();
|
|
|
}
|
|
|
- List<SceneBuildProcessLog> listProcessLog = sceneBuildProcessLogService.getByNum(num);
|
|
|
- List<BuildLog> listBuildLog = buildLogService.getByNum(num);
|
|
|
|
|
|
+ ScenePlus scenePlus = this.getByNum(num);
|
|
|
+ if(scenePlus == null ){
|
|
|
+ throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
|
|
|
+ }
|
|
|
+ ScenePlusExt ext = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
+ if(ext == null ){
|
|
|
+ throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(ext.getDataSource())){
|
|
|
+ String[] split = ext.getDataSource().split("/");
|
|
|
+ String uuid = split[split.length-1];
|
|
|
+ List<OrigFileUploadBatch> batchList = origFileUploadBatchService.getByUuid(uuid);
|
|
|
+ if(!batchList.isEmpty()){
|
|
|
+ excelService.commonExport(batchList,OrigFileUploadBatch.class,buildLogPath +"/origFileUploadBatch.xlsx");
|
|
|
+
|
|
|
+ Set<String> batchIds = batchList.stream().map(OrigFileUploadBatch::getBatchId).collect(Collectors.toSet());
|
|
|
+ List<OrigFileUpload> origFileUploads = origFileUploadService.getByBatchIds(batchIds);
|
|
|
+ if(!origFileUploads.isEmpty()){
|
|
|
+ excelService.commonExport(origFileUploads,OrigFileUpload.class,buildLogPath +"/origFileUpload.xlsx");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<SceneBuildProcessLog> listProcessLog = sceneBuildProcessLogService.getByNum(num);
|
|
|
if(!listProcessLog.isEmpty()){
|
|
|
excelService.commonExport(listProcessLog,SceneBuildProcessLog.class,buildLogPath +"/process.xlsx");
|
|
|
}
|
|
|
+
|
|
|
+ List<BuildLog> listBuildLog = buildLogService.getByNum(num);
|
|
|
if(!listBuildLog.isEmpty()){
|
|
|
excelService.commonExport(listBuildLog,BuildLog.class,buildLogPath +"/build.xlsx");
|
|
|
}
|
|
|
+
|
|
|
+ String modelingLogPath = "www/VR/4dkankan/modeling-control/logs";
|
|
|
+ File modelingLogFile = new File(buildLogPath + "/logs");
|
|
|
+ FileUtil.copyContent(new File(modelingLogPath),modelingLogFile,true);
|
|
|
+
|
|
|
+ SensitiveWordReplacer.processDirectory(modelingLogFile.getPath());
|
|
|
+
|
|
|
ShellUtil.zip(buildLogPath,zipName);
|
|
|
|
|
|
if(!new File(buildLogPath +"/" + zipName).exists()){
|
|
|
- return null;
|
|
|
+ throw new BusinessException(ResultCode.BUILD_LOG_ERROR);
|
|
|
}
|
|
|
return buildLogPath.replace("4dkankan/","") +"/"+zipName;
|
|
|
}
|