|
@@ -4,8 +4,6 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.common.constant.ModelingBuildStatus;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
-import com.fdkankan.fyun.config.FYunFileConfig;
|
|
|
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
@@ -65,12 +63,6 @@ public class RabbitMqListener {
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
@Autowired
|
|
|
- private FYunFileServiceInterface fYunFileService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private FYunFileConfig fYunFileConfig;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private RabbitMqProducer rabbitMqProducer;
|
|
|
|
|
|
@Autowired
|
|
@@ -304,14 +296,6 @@ public class RabbitMqListener {
|
|
|
if(!buildStatus.equals(ModelingBuildStatus.REPEAT)){
|
|
|
//释放锁
|
|
|
redisUtil.del(String.format(RedisKey.SCENE_BUILDING, message.getSceneNum()));
|
|
|
-
|
|
|
- //生成status.json文件
|
|
|
- this.upoadLog(message.getSceneStatus(), message.getWebSite(),
|
|
|
- message.getSceneNum(),message.getThumb(),message.getPayStatus(), message.getDataSource());
|
|
|
-
|
|
|
- //如果是重复计算,没有走到计算逻辑,不需要上传日志文件
|
|
|
- String buildLogPath = String.format(UploadFilePath.BUILD_LOG_PATH, message.getSceneNum());
|
|
|
- buildLog.setLogDetailPath(fYunFileConfig+ buildLogPath + "console.log");
|
|
|
}
|
|
|
buildLog.setUpdateTime(new Date());
|
|
|
buildLogService.updateById(buildLog);
|
|
@@ -374,40 +358,6 @@ public class RabbitMqListener {
|
|
|
.build());
|
|
|
}
|
|
|
|
|
|
- private void upoadLog(Integer sceneStatus, String webSite, String num, String thumb, Integer payStatus, String dataSource){
|
|
|
- try{
|
|
|
- JSONObject statusJson = new JSONObject();
|
|
|
- //临时将-2改成1,app还没完全更新
|
|
|
- if(sceneStatus == -2){
|
|
|
- sceneStatus = 1;
|
|
|
- }else if(sceneStatus == -1){
|
|
|
- // 失败状态不予显示到客户端
|
|
|
- sceneStatus = 0;
|
|
|
- }
|
|
|
- statusJson.put("status", sceneStatus);
|
|
|
- statusJson.put("webSite", webSite);
|
|
|
- statusJson.put("sceneNum", num);
|
|
|
- statusJson.put("thumb", thumb);
|
|
|
- statusJson.put("payStatus", payStatus);
|
|
|
- FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+num+File.separator+"status.json", statusJson.toString());
|
|
|
-
|
|
|
- String dataPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
|
|
|
- String buildLogPath = String.format(UploadFilePath.BUILD_LOG_PATH, num);
|
|
|
-
|
|
|
- //todo 待删除old_path
|
|
|
- fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json",
|
|
|
- "data/data" + num + File.separator + "status.json");
|
|
|
-
|
|
|
- fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json",
|
|
|
- dataPath + "status.json");
|
|
|
-
|
|
|
- fYunFileService.uploadFile(dataSource + File.separator + "console.log", buildLogPath + "console.log");
|
|
|
-
|
|
|
- }catch (Exception e){
|
|
|
- log.error("上传日志失败!", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private void deleteCachesAndResult(String path){
|
|
|
//判断是否计算过资源,若计算过删除缓存, 如果caches中存在_images文件或者目录,就删除掉,否则就删除除了images以外的所有文件和目录
|
|
|
File caches = new File(path + File.separator + "caches");
|