|
@@ -159,6 +159,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
private RabbitTemplate rabbitTemplate;
|
|
|
@Autowired
|
|
|
private IAiService aiService;
|
|
|
+ @Autowired
|
|
|
+ private IHaixinService haixinService;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -243,24 +245,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
ext.put("128G", 1);
|
|
|
}
|
|
|
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
- try {
|
|
|
- ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
- JyUser jyUser = scenePlusService.getJyUserByNum(num);
|
|
|
- param.put("event_type", "scene");
|
|
|
- param.put("event_content", "排队中");
|
|
|
- param.put("scene_num", num);
|
|
|
- param.put("event_time", new Date());
|
|
|
- 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);
|
|
|
- }catch (Exception e){
|
|
|
- log.info("推送事件失败,param:{}", param);
|
|
|
- }
|
|
|
+ jmgaService.sendStatus(num, "排队中");
|
|
|
|
|
|
boolean elastic = false;
|
|
|
if(CollUtil.isNotEmpty(elasticUserIds)){
|
|
@@ -312,29 +297,22 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //修改场景状态为失败,并打包日志
|
|
|
jmgaService.updateSceneFailAndZipLog(num, reason);
|
|
|
|
|
|
- this.sendFailToLaser(num);
|
|
|
-
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
- try {
|
|
|
- ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
- JyUser jyUser = scenePlusService.getJyUserByNum(num);
|
|
|
- param.put("event_type", "scene");
|
|
|
- param.put("event_content", "计算失败");
|
|
|
- param.put("scene_num", num);
|
|
|
- param.put("event_time", new Date());
|
|
|
- if(Objects.nonNull(scenePlus)){
|
|
|
- param.put("scene_title", scenePlus.getTitle());
|
|
|
+ //推送海鑫场景状态和进度
|
|
|
+ Map<String, Object> ext = message.getExt();
|
|
|
+ if(CollUtil.isNotEmpty(ext)){
|
|
|
+ Long sceneOrigBdId = (Long) ext.get("sceneOrigBdId");
|
|
|
+ if(sceneOrigBdId != null){
|
|
|
+ haixinService.syncRenderStatus(sceneOrigBdId, 4, null, "场景计算前置处理出错");
|
|
|
}
|
|
|
- param.put("ryid", jyUser.getRyId());
|
|
|
- param.put("ryno", jyUser.getRyNo());
|
|
|
- param.put("nick_name", jyUser.getRyNickName());
|
|
|
- jmgaService.sendStatus(param);
|
|
|
- }catch (Exception ex){
|
|
|
- log.info("推送事件失败,param:{}", param);
|
|
|
}
|
|
|
|
|
|
+ this.sendFailToLaser(num);
|
|
|
+
|
|
|
+ jmgaService.sendStatus(num, "计算失败");
|
|
|
+
|
|
|
throw e;
|
|
|
}
|
|
|
}
|
|
@@ -361,6 +339,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
String path = message.getPath();
|
|
|
boolean status = false;
|
|
|
String batchIds = (String) message.getExt().get("batchId");
|
|
|
+ Long sceneOrigBdId = (Long)message.getExt().get("sceneOrigBdId");
|
|
|
Long count = redisUtil.decr("modeling-count:" + sceneCode, 1);
|
|
|
log.info("场景:{},剩余计算次数:{}", sceneCode, count);
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
@@ -387,6 +366,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
if(count < 1){
|
|
|
jmgaService.updateSceneFailAndZipLog(sceneCode, "算法报错");
|
|
|
|
|
|
+ if(sceneOrigBdId != null){
|
|
|
+ haixinService.syncRenderStatus(sceneOrigBdId, 4, null, "算法失败");
|
|
|
+ }
|
|
|
+
|
|
|
this.sendFailToLaser(sceneCode);
|
|
|
|
|
|
String statusJsonKey = String.format(UploadFilePath.DATA_VIEW_PATH, sceneCode) + "status.json";
|
|
@@ -395,23 +378,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
statusJson.put("status", -1);
|
|
|
fYunFileService.uploadFile(statusJson.toJSONString().getBytes(StandardCharsets.UTF_8), statusJsonKey);
|
|
|
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
- try {
|
|
|
- JyUser jyUser = scenePlusService.getJyUserByNum(sceneCode);
|
|
|
- param.put("event_type", "scene");
|
|
|
- param.put("event_content", "计算失败");
|
|
|
- param.put("scene_num", sceneCode);
|
|
|
- param.put("event_time", new Date());
|
|
|
- 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);
|
|
|
- }catch (Exception e){
|
|
|
- log.info("推送事件失败,param:{}", param);
|
|
|
- }
|
|
|
+ jmgaService.sendStatus(sceneCode, "计算失败");
|
|
|
}
|
|
|
// redisUtil.set(String.format(RedisKey.SCENE_BUILD_FINISH_NUM, sceneCode), "-1");
|
|
|
return;
|
|
@@ -590,48 +557,24 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
|
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
- try {
|
|
|
- JyUser jyUser = scenePlusService.getJyUserByNum(sceneCode);
|
|
|
- param.put("event_type", "scene");
|
|
|
- param.put("event_content", "计算成功");
|
|
|
- param.put("scene_num", sceneCode);
|
|
|
- param.put("event_time", new Date());
|
|
|
- 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);
|
|
|
- }catch (Exception e){
|
|
|
- log.info("推送事件失败,param:{}", param);
|
|
|
+ if(sceneOrigBdId != null){
|
|
|
+ haixinService.syncRenderStatus(sceneOrigBdId, 4, null, "算法失败");
|
|
|
}
|
|
|
|
|
|
+ jmgaService.sendStatus(sceneCode, "计算成功");
|
|
|
+
|
|
|
}catch (Exception e){
|
|
|
log.error("场景计算结果处理出错,num"+sceneCode, e);
|
|
|
|
|
|
jmgaService.updateSceneFailAndZipLog(sceneCode, "后置处理异常");
|
|
|
|
|
|
+ if(sceneOrigBdId != null){
|
|
|
+ haixinService.syncRenderStatus(sceneOrigBdId, 4, null, "算法失败");
|
|
|
+ }
|
|
|
+
|
|
|
this.sendFailToLaser(sceneCode);
|
|
|
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
- try {
|
|
|
- JyUser jyUser = scenePlusService.getJyUserByNum(sceneCode);
|
|
|
- param.put("event_type", "scene");
|
|
|
- param.put("event_content", "计算失败");
|
|
|
- param.put("scene_num", sceneCode);
|
|
|
- if(Objects.nonNull(scenePlus)){
|
|
|
- param.put("scene_title", scenePlus.getTitle());
|
|
|
- }
|
|
|
- param.put("event_time", new Date());
|
|
|
- param.put("ryid", jyUser.getRyId());
|
|
|
- param.put("ryno", jyUser.getRyNo());
|
|
|
- param.put("nick_name", jyUser.getRyNickName());
|
|
|
- jmgaService.sendStatus(param);
|
|
|
- }catch (Exception ex){
|
|
|
- log.info("推送事件失败,param:{}", param);
|
|
|
- }
|
|
|
+ jmgaService.sendStatus(sceneCode, "计算失败");
|
|
|
|
|
|
throw e;
|
|
|
} finally {
|