|
@@ -167,7 +167,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
if(new File(message.getPath() + File.separator + "results").exists()){
|
|
if(new File(message.getPath() + File.separator + "results").exists()){
|
|
FileUtils.deleteDirectory(message.getPath() + File.separator + "results");
|
|
FileUtils.deleteDirectory(message.getPath() + File.separator + "results");
|
|
@@ -249,11 +248,18 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
Map<String, Object> param = new HashMap<>();
|
|
try {
|
|
try {
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
|
+ JyUser jyUser = scenePlusService.getJyUserByNum(num);
|
|
param.put("event_type", "排队中");
|
|
param.put("event_type", "排队中");
|
|
- param.put("event_content", "排队中");
|
|
|
|
|
|
+ param.put("event_content", "scene");
|
|
param.put("scene_num", num);
|
|
param.put("scene_num", num);
|
|
param.put("event_time", new Date());
|
|
param.put("event_time", new Date());
|
|
- param.put("ryid", scenePlusService.getRyIdByNum(num));
|
|
|
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
|
+ param.put("scene_title", scenePlus.getTitle());
|
|
|
|
+ }
|
|
|
|
+ param.put("ryid", jyUser.getRyId());
|
|
|
|
+ param.put("ryno", jyUser.getRyNo());
|
|
|
|
+ param.put("nick_name", jyUser.getRyNickName());
|
|
jmgaService.sendStatus(param);
|
|
jmgaService.sendStatus(param);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.info("推送事件失败,param:{}", param);
|
|
log.info("推送事件失败,param:{}", param);
|
|
@@ -276,6 +282,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
if(code == ErrorCode.FAILURE_CODE_4001.code()){
|
|
if(code == ErrorCode.FAILURE_CODE_4001.code()){
|
|
reason = "文件缺失,请重新上传";
|
|
reason = "文件缺失,请重新上传";
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ reason = "前置处理异常";
|
|
}
|
|
}
|
|
|
|
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
@@ -287,11 +295,18 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
Map<String, Object> param = new HashMap<>();
|
|
try {
|
|
try {
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
|
+ JyUser jyUser = scenePlusService.getJyUserByNum(num);
|
|
param.put("event_type", "计算失败");
|
|
param.put("event_type", "计算失败");
|
|
- param.put("event_content", "计算资源准备失败");
|
|
|
|
|
|
+ param.put("event_content", "scene");
|
|
param.put("scene_num", num);
|
|
param.put("scene_num", num);
|
|
param.put("event_time", new Date());
|
|
param.put("event_time", new Date());
|
|
- param.put("ryid", scenePlusService.getRyIdByNum(num));
|
|
|
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
|
+ param.put("scene_title", scenePlus.getTitle());
|
|
|
|
+ }
|
|
|
|
+ param.put("ryid", jyUser.getRyId());
|
|
|
|
+ param.put("ryno", jyUser.getRyNo());
|
|
|
|
+ param.put("nick_name", jyUser.getRyNickName());
|
|
jmgaService.sendStatus(param);
|
|
jmgaService.sendStatus(param);
|
|
}catch (Exception ex){
|
|
}catch (Exception ex){
|
|
log.info("推送事件失败,param:{}", param);
|
|
log.info("推送事件失败,param:{}", param);
|
|
@@ -318,21 +333,22 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
for (OrigFileUpload origFileUpload : fileList) {
|
|
for (OrigFileUpload origFileUpload : fileList) {
|
|
int times = 0;
|
|
int times = 0;
|
|
String filePath = homePath.concat(origFileUpload.getFileName());
|
|
String filePath = homePath.concat(origFileUpload.getFileName());
|
|
|
|
+ log.info("开始下载原始文件, url:{}, filePath:{}", origFileUpload.getFileUrl(), filePath);
|
|
do{
|
|
do{
|
|
try {
|
|
try {
|
|
++times;
|
|
++times;
|
|
- HttpUtil.downloadFile(origFileUpload.getFileUrl(), new File(filePath), 10 * 60 * 1000);
|
|
|
|
|
|
+ HttpUtil.downloadFile(origFileUpload.getFileUrl(), new File(filePath), 3 * 60 * 1000);
|
|
if(FileUtil.exist(filePath)){
|
|
if(FileUtil.exist(filePath)){
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.info("原始文件第{}次下载失败,fileUrl:{}, filePath:{}", origFileUpload.getFileUrl(), filePath);
|
|
|
|
|
|
+ log.info("原始文件第{}次下载失败,fileUrl:{}, filePath:{}", times, origFileUpload.getFileUrl(), filePath);
|
|
}
|
|
}
|
|
- }while (times < 4);
|
|
|
|
-
|
|
|
|
- if(!FileUtil.exist(filePath)){
|
|
|
|
- throw new RuntimeException("原始文件下载失败,fileUrl:" + origFileUpload.getFileUrl() + ", filePath:" + filePath);
|
|
|
|
- }
|
|
|
|
|
|
+ }while (times < 3);
|
|
|
|
+ log.info("下载原始文件结束, url:{}, filePath:{}", origFileUpload.getFileUrl(), filePath);
|
|
|
|
+// if(!FileUtil.exist(filePath)){
|
|
|
|
+// throw new RuntimeException("原始文件下载失败,fileUrl:" + origFileUpload.getFileUrl() + ", filePath:" + filePath);
|
|
|
|
+// }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -362,21 +378,22 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
int times = 0;
|
|
int times = 0;
|
|
String filePath = homePath.concat(relativeFilePath);
|
|
String filePath = homePath.concat(relativeFilePath);
|
|
|
|
+ log.info("开始下载原始文件, url:{}, filePath:{}", origFileUpload.getFileUrl(), filePath);
|
|
do{
|
|
do{
|
|
try {
|
|
try {
|
|
++times;
|
|
++times;
|
|
- HttpUtil.downloadFile(origFileUpload.getFileUrl(), new File(filePath), 10 * 60 * 1000);
|
|
|
|
|
|
+ HttpUtil.downloadFile(origFileUpload.getFileUrl(), new File(filePath), 3 * 60 * 1000);
|
|
if(FileUtil.exist(filePath)){
|
|
if(FileUtil.exist(filePath)){
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.info("原始文件第{}次下载失败,fileUrl:{}, filePath:{}", origFileUpload.getFileUrl(), filePath);
|
|
|
|
|
|
+ log.info("原始文件第{}次下载失败,fileUrl:{}, filePath:{}", times, origFileUpload.getFileUrl(), filePath);
|
|
}
|
|
}
|
|
}while (times < 4);
|
|
}while (times < 4);
|
|
-
|
|
|
|
- if(!FileUtil.exist(filePath)){
|
|
|
|
- throw new RuntimeException("原始文件下载失败,fileUrl:" + origFileUpload.getFileUrl() + ", filePath:" + filePath);
|
|
|
|
- }
|
|
|
|
|
|
+ log.info("下载原始文件结束, url:{}, filePath:{}", origFileUpload.getFileUrl(), filePath);
|
|
|
|
+// if(!FileUtil.exist(filePath)){
|
|
|
|
+// throw new RuntimeException("原始文件下载失败,fileUrl:" + origFileUpload.getFileUrl() + ", filePath:" + filePath);
|
|
|
|
+// }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -403,11 +420,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
String batchIds = (String) message.getExt().get("batchId");
|
|
String batchIds = (String) message.getExt().get("batchId");
|
|
Long count = redisUtil.decr("modeling-count:" + sceneCode, 1);
|
|
Long count = redisUtil.decr("modeling-count:" + sceneCode, 1);
|
|
log.info("场景:{},剩余计算次数:{}", sceneCode, count);
|
|
log.info("场景:{},剩余计算次数:{}", sceneCode, count);
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
try {
|
|
try {
|
|
|
|
|
|
//如果场景被删除,就无需往下运行了
|
|
//如果场景被删除,就无需往下运行了
|
|
- ScenePlus scenePlusByNum = scenePlusService.getScenePlusByNum(sceneCode);
|
|
|
|
- if(Objects.isNull(scenePlusByNum)){
|
|
|
|
|
|
+ if(Objects.isNull(scenePlus)){
|
|
log.info("场景已被删除,场景码:{}", sceneCode);
|
|
log.info("场景已被删除,场景码:{}", sceneCode);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -428,17 +445,24 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
if(count < 1){
|
|
if(count < 1){
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
|
|
|
|
+ .set(ScenePlus::getBuildFailReason, "算法报错")
|
|
.eq(ScenePlus::getNum, sceneCode));
|
|
.eq(ScenePlus::getNum, sceneCode));
|
|
|
|
|
|
this.sendFailToLaser(sceneCode);
|
|
this.sendFailToLaser(sceneCode);
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
Map<String, Object> param = new HashMap<>();
|
|
try {
|
|
try {
|
|
|
|
+ JyUser jyUser = scenePlusService.getJyUserByNum(sceneCode);
|
|
param.put("event_type", "计算失败");
|
|
param.put("event_type", "计算失败");
|
|
- param.put("event_content", "算法报错");
|
|
|
|
|
|
+ param.put("event_content", "scene");
|
|
param.put("scene_num", sceneCode);
|
|
param.put("scene_num", sceneCode);
|
|
param.put("event_time", new Date());
|
|
param.put("event_time", new Date());
|
|
- param.put("ryid", scenePlusService.getRyIdByNum(sceneCode));
|
|
|
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
|
+ param.put("scene_title", scenePlus.getTitle());
|
|
|
|
+ }
|
|
|
|
+ param.put("ryid", jyUser.getRyId());
|
|
|
|
+ param.put("ryno", jyUser.getRyNo());
|
|
|
|
+ param.put("nick_name", jyUser.getRyNickName());
|
|
jmgaService.sendStatus(param);
|
|
jmgaService.sendStatus(param);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.info("推送事件失败,param:{}", param);
|
|
log.info("推送事件失败,param:{}", param);
|
|
@@ -448,8 +472,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
|
|
-
|
|
|
|
Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
Map<String, String> uploadFiles = getUploadFiles(scenePlus,path,cameraType,fdageData);
|
|
Map<String, String> uploadFiles = getUploadFiles(scenePlus,path,cameraType,fdageData);
|
|
|
|
|
|
@@ -581,9 +603,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
|
|
|
|
//删除计算目录
|
|
//删除计算目录
|
|
-// if(CollUtil.isEmpty(notDeleteNasNumList) || !notDeleteNasNumList.contains(sceneCode)){
|
|
|
|
-// CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/"));
|
|
|
|
-// }
|
|
|
|
|
|
+ if(CollUtil.isEmpty(notDeleteNasNumList) || !notDeleteNasNumList.contains(sceneCode)){
|
|
|
|
+ CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/"));
|
|
|
|
+ }
|
|
|
|
|
|
//更新场景主表
|
|
//更新场景主表
|
|
//如果相机容量不足,需要把场景的paystatus改为容量不足状态
|
|
//如果相机容量不足,需要把场景的paystatus改为容量不足状态
|
|
@@ -613,11 +635,17 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
Map<String, Object> param = new HashMap<>();
|
|
try {
|
|
try {
|
|
|
|
+ JyUser jyUser = scenePlusService.getJyUserByNum(sceneCode);
|
|
param.put("event_type", "计算成功");
|
|
param.put("event_type", "计算成功");
|
|
- param.put("event_content", "计算成功");
|
|
|
|
|
|
+ param.put("event_content", "scene");
|
|
param.put("scene_num", sceneCode);
|
|
param.put("scene_num", sceneCode);
|
|
param.put("event_time", new Date());
|
|
param.put("event_time", new Date());
|
|
- param.put("ryid", scenePlusService.getRyIdByNum(sceneCode));
|
|
|
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
|
+ param.put("scene_title", scenePlus.getTitle());
|
|
|
|
+ }
|
|
|
|
+ param.put("ryid", jyUser.getRyId());
|
|
|
|
+ param.put("ryno", jyUser.getRyNo());
|
|
|
|
+ param.put("nick_name", jyUser.getRyNickName());
|
|
jmgaService.sendStatus(param);
|
|
jmgaService.sendStatus(param);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.info("推送事件失败,param:{}", param);
|
|
log.info("推送事件失败,param:{}", param);
|
|
@@ -628,17 +656,24 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
|
|
|
|
+ .set(ScenePlus::getBuildFailReason, "后置处理异常")
|
|
.eq(ScenePlus::getNum, sceneCode));
|
|
.eq(ScenePlus::getNum, sceneCode));
|
|
|
|
|
|
this.sendFailToLaser(sceneCode);
|
|
this.sendFailToLaser(sceneCode);
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
Map<String, Object> param = new HashMap<>();
|
|
try {
|
|
try {
|
|
|
|
+ JyUser jyUser = scenePlusService.getJyUserByNum(sceneCode);
|
|
param.put("event_type", "计算失败");
|
|
param.put("event_type", "计算失败");
|
|
- param.put("event_content", "计算结果处理失败");
|
|
|
|
|
|
+ param.put("event_content", "scene");
|
|
param.put("scene_num", sceneCode);
|
|
param.put("scene_num", sceneCode);
|
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
|
+ param.put("scene_title", scenePlus.getTitle());
|
|
|
|
+ }
|
|
param.put("event_time", new Date());
|
|
param.put("event_time", new Date());
|
|
- param.put("ryid", scenePlusService.getRyIdByNum(sceneCode));
|
|
|
|
|
|
+ param.put("ryid", jyUser.getRyId());
|
|
|
|
+ param.put("ryno", jyUser.getRyNo());
|
|
|
|
+ param.put("nick_name", jyUser.getRyNickName());
|
|
jmgaService.sendStatus(param);
|
|
jmgaService.sendStatus(param);
|
|
}catch (Exception ex){
|
|
}catch (Exception ex){
|
|
log.info("推送事件失败,param:{}", param);
|
|
log.info("推送事件失败,param:{}", param);
|