|
@@ -3,14 +3,14 @@ package com.fdkankan.contro.mq.service.impl;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.common.constant.CommonSuccessStatus;
|
|
import com.fdkankan.common.constant.CommonSuccessStatus;
|
|
|
import com.fdkankan.contro.entity.ScenePlus;
|
|
import com.fdkankan.contro.entity.ScenePlus;
|
|
|
import com.fdkankan.contro.entity.ScenePlusExt;
|
|
import com.fdkankan.contro.entity.ScenePlusExt;
|
|
|
|
|
+import com.fdkankan.contro.entity.SceneZxgd;
|
|
|
import com.fdkankan.contro.mq.service.IBuildSceneService;
|
|
import com.fdkankan.contro.mq.service.IBuildSceneService;
|
|
|
-import com.fdkankan.contro.service.IBuildSceneDTService;
|
|
|
|
|
-import com.fdkankan.contro.service.IBuildService;
|
|
|
|
|
-import com.fdkankan.contro.service.IScenePlusExtService;
|
|
|
|
|
-import com.fdkankan.contro.service.IScenePlusService;
|
|
|
|
|
|
|
+import com.fdkankan.contro.service.*;
|
|
|
import com.fdkankan.fyun.config.FYunFileConfig;
|
|
import com.fdkankan.fyun.config.FYunFileConfig;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
@@ -56,10 +56,14 @@ public class BuildZXGDSceneServiceImpl implements IBuildSceneService {
|
|
|
private IBuildSceneDTService buildSceneDTService;
|
|
private IBuildSceneDTService buildSceneDTService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IBuildService buildService;
|
|
private IBuildService buildService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISceneZxgdService sceneZxgdService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void buildScenePre(BuildSceneCallMessage message) throws Exception{
|
|
public void buildScenePre(BuildSceneCallMessage message) throws Exception{
|
|
|
String num = message.getSceneNum();
|
|
String num = message.getSceneNum();
|
|
|
|
|
+ String fileId = (String) message.getExt().get("fileId");
|
|
|
|
|
+ String unicode = (String) message.getExt().get("unicode");
|
|
|
try {
|
|
try {
|
|
|
String dataSource = (String)message.getExt().get("path");
|
|
String dataSource = (String)message.getExt().get("path");
|
|
|
String bizType = (String)message.getExt().get("bizType");
|
|
String bizType = (String)message.getExt().get("bizType");
|
|
@@ -85,6 +89,7 @@ public class BuildZXGDSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
log.error("知象光电计算前置处理出错,num"+num, e);
|
|
log.error("知象光电计算前置处理出错,num"+num, e);
|
|
|
|
|
+ this.updateStatus(fileId, unicode, CommonSuccessStatus.FAIL.code());
|
|
|
buildSceneDTService.handBaseFail("知象光电计算资源准备异常!", message.getPath(), num, "计算控制服务器");
|
|
buildSceneDTService.handBaseFail("知象光电计算资源准备异常!", message.getPath(), num, "计算控制服务器");
|
|
|
throw e;
|
|
throw e;
|
|
|
}
|
|
}
|
|
@@ -109,6 +114,7 @@ public class BuildZXGDSceneServiceImpl implements IBuildSceneService {
|
|
|
@Override
|
|
@Override
|
|
|
public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
|
Map<String, Object> ext = message.getExt();
|
|
Map<String, Object> ext = message.getExt();
|
|
|
|
|
+ String fileId = (String) ext.get("fileId");
|
|
|
String unicode = (String) ext.get("unicode");
|
|
String unicode = (String) ext.get("unicode");
|
|
|
String path = message.getPath();
|
|
String path = message.getPath();
|
|
|
try {
|
|
try {
|
|
@@ -121,6 +127,7 @@ public class BuildZXGDSceneServiceImpl implements IBuildSceneService {
|
|
|
if (!message.getBuildSuccess()) {
|
|
if (!message.getBuildSuccess()) {
|
|
|
// 发送钉钉消息,计算失败
|
|
// 发送钉钉消息,计算失败
|
|
|
String logUrl = String.format(logUrlFormat,fYunFileConfig.getHost(),unicode,fYunFileConfig.getHost(),unicode);
|
|
String logUrl = String.format(logUrlFormat,fYunFileConfig.getHost(),unicode,fYunFileConfig.getHost(),unicode);
|
|
|
|
|
+ this.updateStatus(fileId, unicode, CommonSuccessStatus.FAIL.code());
|
|
|
buildSceneDTService.handModelFail("计算知象光电", message.getPath(), unicode, message.getHostName(), logUrl);
|
|
buildSceneDTService.handModelFail("计算知象光电", message.getPath(), unicode, message.getHostName(), logUrl);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -132,12 +139,22 @@ public class BuildZXGDSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/"));
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/"));
|
|
|
|
|
|
|
|
|
|
+ this.updateStatus(fileId, unicode, CommonSuccessStatus.SUCCESS.code());
|
|
|
|
|
+
|
|
|
log.info("知象光电计算结果处理结束,场景码:{}", unicode);
|
|
log.info("知象光电计算结果处理结束,场景码:{}", unicode);
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
log.error("知象光电计算结果处理出错,unicode"+unicode, e);
|
|
log.error("知象光电计算结果处理出错,unicode"+unicode, e);
|
|
|
|
|
+ this.updateStatus(fileId, unicode, CommonSuccessStatus.FAIL.code());
|
|
|
buildSceneDTService.handBaseFail("知象光电计算结果处理出错!", message.getPath(), unicode, "计算控制服务器");
|
|
buildSceneDTService.handBaseFail("知象光电计算结果处理出错!", message.getPath(), unicode, "计算控制服务器");
|
|
|
throw e;
|
|
throw e;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void updateStatus(String fileId, String unicode, int status){
|
|
|
|
|
+ sceneZxgdService.update(new LambdaUpdateWrapper<SceneZxgd>()
|
|
|
|
|
+ .eq(SceneZxgd::getFileId, fileId)
|
|
|
|
|
+ .eq(SceneZxgd::getUnicode, unicode)
|
|
|
|
|
+ .set(SceneZxgd::getStatus, status));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|