|
@@ -1,5 +1,8 @@
|
|
|
package com.fdkankan.manage.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.io.FileUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -9,6 +12,7 @@ import com.fdkankan.manage.entity.*;
|
|
|
import com.fdkankan.manage.mapper.IScenePlusMapper;
|
|
|
import com.fdkankan.manage.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fdkankan.manage.util.ShellUtil;
|
|
|
import com.fdkankan.manage.vo.request.SceneParam;
|
|
|
import com.fdkankan.manage.vo.response.GroupByCount;
|
|
|
import com.fdkankan.manage.vo.response.UserAuthSceneVo;
|
|
@@ -16,6 +20,8 @@ import com.fdkankan.manage.vo.response.UserShareSceneVo;
|
|
|
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;
|
|
@@ -95,4 +101,29 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
|
|
|
wrapper.in(ScenePlus::getNum,numList);
|
|
|
return this.list(wrapper);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 场景错误日志需要打包:
|
|
|
+ * 表:
|
|
|
+ * select * from t_scene_build_process_log where num =
|
|
|
+ * select * from t_build_log where scene_num =
|
|
|
+ * 日志文件:
|
|
|
+ * oss目录:
|
|
|
+ * /oss/4dkankan/build_log/<num>(这个目录整个打包)
|
|
|
+ */
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getSceneBuildLog(String num) {
|
|
|
+ JSONArray listProcessLog = this.getBaseMapper().selectBuildProcessLog(num);
|
|
|
+ JSONArray listBuildLog = this.getBaseMapper().selectBuildLog(num);
|
|
|
+ String buildLogPath = "/oss/4dkankan/build_log/" + num;
|
|
|
+
|
|
|
+ if(!listProcessLog.isEmpty()){
|
|
|
+ FileUtil.writeString(listProcessLog.toJSONString(),new File(buildLogPath +"/process.log"), StandardCharsets.UTF_8);
|
|
|
+ }
|
|
|
+ if(!listBuildLog.isEmpty()){
|
|
|
+ FileUtil.writeString(listBuildLog.toJSONString(),new File(buildLogPath +"/build.log"), StandardCharsets.UTF_8);
|
|
|
+ }
|
|
|
+ ShellUtil.zip(buildLogPath,buildLogPath+"/"+num+".zip");
|
|
|
+ }
|
|
|
}
|