|
@@ -41,6 +41,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.joda.time.DateTime;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
|
import org.springframework.http.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
@@ -61,6 +62,7 @@ import java.util.*;
|
|
|
* @author dengsixing
|
|
|
* @since 2021-12-23
|
|
|
*/
|
|
|
+@RefreshScope
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper, SceneFileBuild> implements ISceneFileBuildService {
|
|
@@ -82,6 +84,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
@Value("${v3.controlUrl:#{null}}")
|
|
|
private String v3controlUrl;
|
|
|
|
|
|
+ @Value("${build.notSupport.beforeTime:202203}")
|
|
|
+ private String jgNotSupportBuildTime;
|
|
|
+
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
@@ -679,6 +684,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
// 判断是否是V3的场景
|
|
|
ScenePro scenePro = sceneProService.getOne(
|
|
|
new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
|
|
|
+
|
|
|
+ //激光场景校验是否能够计算
|
|
|
+ this.checkJgCanBuild(scenePro);
|
|
|
+
|
|
|
if (ObjectUtils.isEmpty(scenePro) || (!ObjectUtils.isEmpty(scenePro.getIsUpgrade()) && scenePro.getIsUpgrade() == 1)) {
|
|
|
scenePlusVO = buildScene(fileId, prefixBuffer.toString(), fdageJson, buildType, cameraType);
|
|
|
} else {
|
|
@@ -1039,6 +1048,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
public ResultData rebuildScene(String num,Boolean force,Boolean deleteExtras) throws IOException {
|
|
|
|
|
|
ScenePro scenePro = sceneProService.getByNum(num);
|
|
|
+
|
|
|
+ //激光场景校验是否能够计算
|
|
|
+ this.checkJgCanBuild(scenePro);
|
|
|
+
|
|
|
//如果是v3场景,不允许重算,需要升级v4后再调此接口进行重算
|
|
|
if(Objects.nonNull(scenePro) && (Objects.isNull(scenePro.getIsUpgrade())
|
|
|
|| scenePro.getIsUpgrade() != CommonStatus.YES.code().intValue())){
|
|
@@ -1117,6 +1130,39 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 由于算法不支持2022年三月份前的激光场景计算,这里需要校验是否是能计算,不能就退出重算
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private void checkJgCanBuild(ScenePro scenePro){
|
|
|
+
|
|
|
+ if(Objects.isNull(scenePro) || StrUtil.isEmpty(scenePro.getDataSource())){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ cn.hutool.core.date.DateTime limitTime = DateExtUtil.parse(jgNotSupportBuildTime, DateExtUtil.dateStyle10);
|
|
|
+ String dataSource = scenePro.getDataSource();
|
|
|
+ String sceneDateTimeStr = dataSource.substring(dataSource.lastIndexOf("_")).substring(0, 6);
|
|
|
+ //如果截取的时间串是空的,无法判断时间,就退出,正常走计算逻辑
|
|
|
+ if(StrUtil.isEmpty(sceneDateTimeStr)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ cn.hutool.core.date.DateTime sceneDateTime = null;
|
|
|
+ try{
|
|
|
+ sceneDateTime = DateExtUtil.parse(sceneDateTimeStr, DateExtUtil.dateStyle10);
|
|
|
+ if(Objects.isNull(sceneDateTime)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ //如果截取的时间串转换日期错误,无法判断时间,退出函数
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(sceneDateTime.before(limitTime)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5067);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public ResultData rebuildV3Scene(ScenePro scenePro,String num,Boolean force) throws IOException {
|
|
|
|
|
|
|