|
@@ -2,6 +2,7 @@ package com.fdkankan.contro.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
@@ -73,11 +74,11 @@ public class Scene3dNumServiceImpl extends ServiceImpl<IScene3dNumMapper, Scene3
|
|
|
private ICameraTypeService cameraTypeService;
|
|
private ICameraTypeService cameraTypeService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public String generateSceneNum(Integer cameraType) throws Exception {
|
|
|
|
|
|
|
+ public String generateSceneNum(Integer cameraType, JSONObject dataFdage) throws Exception {
|
|
|
// 从缓存中获取
|
|
// 从缓存中获取
|
|
|
String sceneNum = redisUtil.lLeftPop(RedisKey.FDKANKAN_SCENE_NUMS);
|
|
String sceneNum = redisUtil.lLeftPop(RedisKey.FDKANKAN_SCENE_NUMS);
|
|
|
if(Objects.nonNull(sceneNum)){
|
|
if(Objects.nonNull(sceneNum)){
|
|
|
- return addPrefix(sceneNum,cameraType);
|
|
|
|
|
|
|
+ return addPrefix(sceneNum,cameraType, null);
|
|
|
}
|
|
}
|
|
|
//为了防止场景量暴增导致定时任务来还不急处理,如果上面redis获取不到,需要调用一下生成场景码方法
|
|
//为了防止场景量暴增导致定时任务来还不急处理,如果上面redis获取不到,需要调用一下生成场景码方法
|
|
|
log.warn("定时任务没有生成足够的场景码,此处实时调用批量生成场景码程序");
|
|
log.warn("定时任务没有生成足够的场景码,此处实时调用批量生成场景码程序");
|
|
@@ -90,7 +91,7 @@ public class Scene3dNumServiceImpl extends ServiceImpl<IScene3dNumMapper, Scene3
|
|
|
dingTalkSendUtils.sendActioncardMsgToDingRobot(content, "场景码穷尽告警");
|
|
dingTalkSendUtils.sendActioncardMsgToDingRobot(content, "场景码穷尽告警");
|
|
|
throw new Exception("场景计算获取场景码失败");
|
|
throw new Exception("场景计算获取场景码失败");
|
|
|
}
|
|
}
|
|
|
- return addPrefix(sceneNum,cameraType);
|
|
|
|
|
|
|
+ return addPrefix(sceneNum,cameraType,null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -127,17 +128,27 @@ public class Scene3dNumServiceImpl extends ServiceImpl<IScene3dNumMapper, Scene3
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private String addPrefix(String num,Integer camType){
|
|
|
|
|
- if(camType == null){
|
|
|
|
|
- return num;
|
|
|
|
|
|
|
+ private String addPrefix(String num, Integer camType, String pluginPrefix) {
|
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
|
|
+
|
|
|
|
|
+ // 相机前缀
|
|
|
|
|
+ if (camType != null) {
|
|
|
|
|
+ CameraType cameraType = cameraTypeService.getByCamType(camType);
|
|
|
|
|
+ if (cameraType != null && StrUtil.isNotBlank(cameraType.getScenePrefix())) {
|
|
|
|
|
+ sb.append(cameraType.getScenePrefix());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- CameraType cameraType = cameraTypeService.getByCamType(camType);
|
|
|
|
|
- if(Objects.isNull(cameraType)){
|
|
|
|
|
- return num;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 插件前缀
|
|
|
|
|
+ if (StrUtil.isNotBlank(pluginPrefix)) {
|
|
|
|
|
+ sb.append(pluginPrefix).append("-");
|
|
|
}
|
|
}
|
|
|
- return cameraType.getScenePrefix() + num;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ sb.append(num);
|
|
|
|
|
+ return sb.toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void batchCreateSceneNum(boolean force) {
|
|
public void batchCreateSceneNum(boolean force) {
|
|
|
if (!force) {
|
|
if (!force) {
|