|
@@ -1,47 +1,22 @@
|
|
|
package com.fdkankan.contro.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
-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.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.fdkankan.common.constant.CameraConstant;
|
|
|
-import com.fdkankan.common.constant.CommonStatus;
|
|
|
-import com.fdkankan.common.constant.ConstantUrl;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
-import com.fdkankan.common.constant.SceneStatus;
|
|
|
-import com.fdkankan.common.exception.BusinessException;
|
|
|
-import com.fdkankan.common.util.FileUtils;
|
|
|
-import com.fdkankan.contro.entity.Camera;
|
|
|
-import com.fdkankan.contro.entity.CameraDetail;
|
|
|
-import com.fdkankan.contro.entity.SSOUser;
|
|
|
import com.fdkankan.contro.entity.ScenePlus;
|
|
|
import com.fdkankan.contro.entity.ScenePlusExt;
|
|
|
-import com.fdkankan.contro.entity.ScenePro;
|
|
|
import com.fdkankan.contro.mapper.IScenePlusMapper;
|
|
|
import com.fdkankan.contro.service.ICameraDetailService;
|
|
|
-import com.fdkankan.contro.service.ICameraService;
|
|
|
import com.fdkankan.contro.service.IScenePlusExtService;
|
|
|
import com.fdkankan.contro.service.IScenePlusService;
|
|
|
-import com.fdkankan.contro.service.ISceneProService;
|
|
|
-import com.fdkankan.contro.service.IUserService;
|
|
|
-import com.fdkankan.contro.vo.ScenePlusVO;
|
|
|
-import com.fdkankan.fyun.constant.FYunTypeEnum;
|
|
|
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
-import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
-import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
-import java.io.File;
|
|
|
-import java.util.Date;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.joda.time.DateTime;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
-import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -89,29 +64,43 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
|
|
|
|
|
|
@Override
|
|
|
public String getDataSourceLikeUnicode(String unicode) {
|
|
|
-
|
|
|
- ScenePlusExt scenePlusExt = scenePlusExtService.getOne(
|
|
|
+ // 防止plus表删除,ext表未删除
|
|
|
+ List<ScenePlusExt> scenePlusExts = scenePlusExtService.list(
|
|
|
new LambdaQueryWrapper<ScenePlusExt>().like(ScenePlusExt::getDataSource, unicode)
|
|
|
.eq(ScenePlusExt::getRecStatus,"A"));
|
|
|
|
|
|
- if(Objects.isNull(scenePlusExt)){
|
|
|
+ if (ObjectUtils.isEmpty(scenePlusExts)) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- return scenePlusExt.getDataSource();
|
|
|
+ if (scenePlusExts.size() > 1) {
|
|
|
+ for (ScenePlusExt scenePlusExt : scenePlusExts) {
|
|
|
+ ScenePlus plus = getById(scenePlusExt.getPlusId());
|
|
|
+ if (!ObjectUtils.isEmpty(plus) && plus.getRecStatus().equals("A")) {
|
|
|
+ return scenePlusExt.getDataSource();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return scenePlusExts.get(0).getDataSource();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public ScenePlus getByFileId(String fileId) {
|
|
|
+ // 防止plus表删除,ext表未删除
|
|
|
+ List<ScenePlusExt> scenePlusExts = scenePlusExtService.list(
|
|
|
+ new LambdaQueryWrapper<ScenePlusExt>().like(ScenePlusExt::getDataSource, fileId)
|
|
|
+ .eq(ScenePlusExt::getRecStatus, "A"));
|
|
|
|
|
|
- ScenePlusExt scenePlusExt = scenePlusExtService.getOne(
|
|
|
- new LambdaQueryWrapper<ScenePlusExt>().like(ScenePlusExt::getDataSource, fileId)
|
|
|
- .eq(ScenePlusExt::getRecStatus,"A"));
|
|
|
-
|
|
|
- if(Objects.isNull(scenePlusExt)){
|
|
|
+ if (ObjectUtils.isEmpty(scenePlusExts)) {
|
|
|
return null;
|
|
|
}
|
|
|
- return this.getById(scenePlusExt.getPlusId());
|
|
|
+ for (ScenePlusExt scenePlusExt : scenePlusExts) {
|
|
|
+ ScenePlus plus = getById(scenePlusExt.getPlusId());
|
|
|
+ if (!ObjectUtils.isEmpty(plus) && plus.getRecStatus().equals("A")) {
|
|
|
+ return plus;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
}
|