Ver código fonte

Merge branch 'release-内部接口鉴权' into test

# Conflicts:
#	pom.xml
#	src/main/java/com/fdkankan/contro/controller/InnerController.java
#	src/main/resources/mapper/contro/SceneUpgradeMapper.xml
dengsixing 1 mês atrás
pai
commit
70d23ebf37

+ 57 - 0
httpclient/FdkankanMiniClient.java

@@ -0,0 +1,57 @@
+//package com.fdkankan.scene.httpclient;
+//
+//import com.dtflys.forest.annotation.Get;
+//import com.dtflys.forest.annotation.Header;
+//import com.dtflys.forest.annotation.Post;
+//import com.dtflys.forest.annotation.Retry;
+//import com.dtflys.forest.annotation.Success;
+//import com.dtflys.forest.annotation.Var;
+//import com.dtflys.forest.callback.OnError;
+//import com.dtflys.forest.callback.OnSuccess;
+//import com.fdkankan.common.response.Result;
+//import java.util.Map;
+//import com.fdkankan.scene.bean.CameraBean;
+//import com.fdkankan.scene.bean.UserIncrementBean;
+//import com.fdkankan.scene.callback.FdkkMiniReqSuccessCondition;
+//
+///**
+// * <p>
+// * TODO
+// * </p>
+// *
+// * @author dengsixing
+// * @since 2022/4/24
+// **/
+//@Success(condition = FdkkMiniReqSuccessCondition.class)
+//public interface FdkankanMiniClient {
+//
+//    @Get(url="{url}"
+////        ,interceptor = TLogForestInterceptor.class    加这个拦截器,打印的tlog日志会详细一些,包括头信息等等
+//    )
+//    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+//    Result<String> getDataSyncType(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);
+//
+//    @Get("{url}")
+//    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+//    Result<UserIncrementBean> getUserIncrementByCameraId(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);
+//
+//    @Get("{url}")
+//    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+//    Result<CameraBean> getCameraByCameraId(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);
+//
+////    @Get(url="{url}")
+////    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+////    Result<SceneProV3> getSceneProByNum(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);
+//
+//    @Post(url="{url}")
+//    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+//    Result<Map<String, Object>> getIsLogin(@Var("url") String url, @Header("token") String token, OnSuccess<Result> onSuccess, OnError onError);
+//
+////    @Post(
+////        url = "${url}",
+////        contentType = "application/json"
+////    )
+////    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+////    Result upgradeToV4ResultSync(@Var("url") String url, @Body RequestSceneProV4 param, OnSuccess<Result> onSuccess, OnError onError);
+//
+//}

+ 33 - 0
httpclient/MyClient.java

@@ -0,0 +1,33 @@
+package com.fdkankan.scene.httpclient;
+
+
+import com.dtflys.forest.annotation.Get;
+import com.dtflys.forest.annotation.Var;
+import com.dtflys.forest.callback.OnProgress;
+import com.dtflys.forest.extensions.DownloadFile;
+import com.fdkankan.web.response.ResultData;
+
+import java.io.File;
+
+public interface MyClient {
+
+    /**
+     * 在方法上加上@DownloadFile注解
+     * dir属性表示文件下载到哪个目录
+     * filename属性表示文件下载成功后以什么名字保存,如果不填,这默认从URL中取得文件名
+     * OnProgress参数为监听上传进度的回调函数
+     */
+    @Get(url = "{url}")
+    @DownloadFile(dir = "{dir}", filename = "{filename}")
+    File downloadFile(@Var("url") String url, @Var("dir") String dir, @Var("filename")String filename);
+
+    /**
+     * 在方法上加上@DownloadFile注解
+     * dir属性表示文件下载到哪个目录
+     * filename属性表示文件下载成功后以什么名字保存,如果不填,这默认从URL中取得文件名
+     * OnProgress参数为监听上传进度的回调函数
+     */
+    @Get(url = "${url}?${params}")
+    ResultData get(@Var("url") String url, @Var("params") String params);
+
+}

+ 6 - 0
pom.xml

@@ -201,6 +201,12 @@
       <version>1.5.24</version>
     </dependency>
 
+    <dependency>
+      <groupId>com.fdkankan</groupId>
+      <artifactId>4dkankan-utils-sign</artifactId>
+      <version>3.0.0-SNAPSHOT</version>
+    </dependency>
+
   </dependencies>
   <build>
     <finalName>${artifactId}</finalName>

+ 51 - 0
src/main/java/com/fdkankan/contro/Interceptor/LogProxy.java

@@ -0,0 +1,51 @@
+package com.fdkankan.contro.Interceptor;
+
+import com.alibaba.fastjson.JSON;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Arrays;
+import java.util.List;
+
+@Slf4j
+@Aspect
+@Component
+public class LogProxy {
+
+	@AfterReturning(value = "execution(* com.fdkankan.contro.controller.*.*(..))", returning = "result")
+	public void afterMethod(JoinPoint point, Object result){
+		String methodName = point.getSignature().getName();
+		List<Object> args = (List<Object>) Arrays.asList(point.getArgs()).stream().filter(v -> {
+			if(v instanceof MultipartFile){
+				return false;
+			}
+			if(v instanceof String && ((String) v).startsWith("data:image/png;base64")){
+				return false;
+			}
+			return true;
+		});
+		System.out.println("连接点方法为:" + methodName + ",参数为:" + JSON.toJSONString(args) + ",目标方法执行结果为:" + JSON.toJSONString(result));
+	}
+
+	@AfterThrowing(value = "execution(* com.fdkankan.kz.pms.controller.*.*.*(..))")
+	public void afterThrowing(JoinPoint point){
+		String methodName = point.getSignature().getName();
+		List<Object> args = (List<Object>) Arrays.asList(point.getArgs()).stream().filter(v -> {
+			if(v instanceof MultipartFile){
+				return false;
+			}
+			if(v instanceof String && ((String) v).startsWith("data:image/png;base64")){
+				return false;
+			}
+			return true;
+		});
+		System.out.println("连接点方法为:" + methodName + ",参数为:" + JSON.toJSONString(args));
+	}
+
+
+}

+ 87 - 0
src/main/java/com/fdkankan/contro/Interceptor/SignVerificationAspect.java

@@ -0,0 +1,87 @@
+package com.fdkankan.contro.Interceptor;
+
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.constant.ServerCode;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.contro.common.Result;
+import com.fdkankan.contro.httpclient.MyClient;
+import com.fdkankan.sign.RsaUtils;
+import com.fdkankan.sign.SignUtils;
+import lombok.extern.log4j.Log4j2;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.time.Instant;
+import java.util.HashMap;
+import java.util.Map;
+
+@Log4j2
+@Aspect
+@Component
+@Order(101)
+public class SignVerificationAspect {
+
+	private static final String GET_PRIVATEKEY_API = "/ucenter/_inner/pdsfsdfsrvateddsfeky/";
+
+	@Value("${ucenter.publicKey}")
+	private String publicKey;
+	@Value("${ucenter.appId}")
+	private String ucenterAppId;
+
+	@Value("${fdService.basePath}")
+	private String fdServiceBasePath;
+
+	@Resource
+	private MyClient myClient;
+
+	/**
+	 * 前置通知 用于判断用户协作场景是否有协作权限
+	 *
+	 * @param joinPoint
+	 *            切点
+	 * @throws IOException
+	 */
+	@Before("@annotation(com.fdkankan.contro.annotation.SignVerification)")
+	public void doBefore(JoinPoint joinPoint) throws Exception {
+		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+		String sign = request.getHeader("sign");
+		String appId = request.getHeader("appId");
+		if(StrUtil.isEmpty(sign) || StrUtil.isEmpty(appId)){
+			throw new BusinessException(ErrorCode.AUTH_FAIL);
+		}
+
+		//通过appid查询私钥
+		Instant now = Instant.now();
+		long epochSecond = now.getEpochSecond();
+		JSONObject playload = new JSONObject();
+		playload.put("appId", ucenterAppId);
+		playload.put("timestamp", epochSecond);
+		String ucenterSign = RsaUtils.encipher(playload.toJSONString(), publicKey);
+		Map<String, String> headerMap = new HashMap<>();
+		headerMap.put("sign", ucenterSign);
+		headerMap.put("appId", ucenterAppId);
+		String url = fdServiceBasePath + GET_PRIVATEKEY_API + appId;
+		Result result = myClient.get(url, headerMap);
+		if(result.getCode() != ServerCode.SUCCESS.code()){
+			throw new RuntimeException("系统异常");
+		}
+		String privateKey = (String) result.getData();
+
+		//签名解密
+		if(!SignUtils.checkSign(sign, appId, privateKey)){
+			throw new BusinessException(ErrorCode.AUTH_FAIL);
+		}
+	}
+
+}

+ 1 - 0
src/main/java/com/fdkankan/contro/ModelingControlApplication.java

@@ -24,6 +24,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @MapperScan("com.fdkankan.**.mapper")
 @ForestScan(basePackages = "com.fdkankan.contro.httpclient")
 @EnableDiscoveryClient
+@ForestScan(basePackages = "com.fdkankan.contro.httpclient")
 public class ModelingControlApplication {
     public static void main(String[] args) {
         SpringApplication.run(ModelingControlApplication.class, args);

+ 10 - 0
src/main/java/com/fdkankan/contro/annotation/SignVerification.java

@@ -0,0 +1,10 @@
+package com.fdkankan.contro.annotation;
+
+import java.lang.annotation.*;
+
+@Target({ElementType.PARAMETER, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface SignVerification {
+    String description() default "";
+}

+ 2 - 0
src/main/java/com/fdkankan/contro/controller/InnerController.java

@@ -1,5 +1,6 @@
 package com.fdkankan.contro.controller;
 
+import com.fdkankan.contro.annotation.SignVerification;
 import com.fdkankan.contro.service.IInnerService;
 import com.fdkankan.web.response.ResultData;
 import lombok.extern.log4j.Log4j2;
@@ -19,6 +20,7 @@ public class InnerController {
     @Autowired
     private IInnerService innerService;
 
+    @SignVerification
     @GetMapping("uploadArtificialResult")
     public ResultData uploadArtificialResult(String num) throws Exception {
         innerService.uploadArtificialResult(num);

+ 28 - 4
src/main/java/com/fdkankan/contro/controller/SceneFileController.java

@@ -6,13 +6,17 @@ import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.constant.SceneSource;
 import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.contro.common.Result;
+import com.fdkankan.contro.annotation.SignVerification;
 import com.fdkankan.contro.entity.ScenePlus;
 import com.fdkankan.contro.service.IAppCameraFailLogService;
 import com.fdkankan.contro.service.ISceneFileBuildService;
+import com.fdkankan.contro.service.ISceneProService;
 import com.fdkankan.contro.service.IScenePlusService;
 import com.fdkankan.contro.service.ISceneUploadCountService;
 import com.fdkankan.contro.vo.ReportFailLogVO;
 import com.fdkankan.contro.vo.ResponseSceneFile;
+import com.fdkankan.contro.vo.SceneParam;
 import com.fdkankan.contro.vo.SceneUploadCountParamVO;
 import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.web.response.ResultData;
@@ -36,17 +40,16 @@ public class SceneFileController{
 
     @Autowired
     private ISceneFileBuildService sceneFileBuildService;
-
     @Resource
     private FYunFileServiceInterface fYunFileService;
-
     @Autowired
     private ISceneUploadCountService sceneUploadCountService;
-
     @Autowired
     private IAppCameraFailLogService appCameraFailLogService;
     @Autowired
     private IScenePlusService scenePlusService;
+    @Autowired
+    ISceneProService sceneProService;
 
 
     /**
@@ -88,11 +91,14 @@ public class SceneFileController{
      * @param params
      * @return
      */
+    @SignVerification
     @PostMapping("reverseScene")
     public ResultData reverseScene(@RequestBody JSONObject params) throws Exception {
         return sceneFileBuildService.reverseScene(params);
     }
 
+
+    @SignVerification
     @GetMapping("rebuildScene")
     public ResultData rebuildScene(@RequestParam(value = "num") String num,
                                    @RequestParam(value = "force",defaultValue = "false") Boolean force ,
@@ -145,7 +151,7 @@ public class SceneFileController{
         return map;
     }
 
-
+    @SignVerification
     @GetMapping("copyDataAndBuild")
     public ResultData copyDataAndBuild(@RequestParam(value = "dataSource") String dataSource,@RequestParam(value = "sceneVer") String sceneVer,
                                        @RequestParam(value = "sourceBucket") String sourceBucket) throws Exception {
@@ -157,12 +163,14 @@ public class SceneFileController{
      * @param param
      * @return
      */
+    @SignVerification
     @PostMapping("/increSceneUploadCount")
     public ResultData increSceneUploadCount(@RequestBody @Valid SceneUploadCountParamVO param){
         sceneUploadCountService.increSceneUploadCount(param);
         return ResultData.ok();
     }
 
+    @SignVerification
     @PostMapping("/reportFailLog")
     public ResultData reportFailLog(@RequestBody @Valid ReportFailLogVO param){
         appCameraFailLogService.reportFailLog(param);
@@ -173,9 +181,25 @@ public class SceneFileController{
      * 计算理光相机格式场景
      * @return
      */
+    @SignVerification
     @PostMapping("uploadLiguang")
     public ResultData uploadLiguang(String num, String snCode, String ossPath) throws Exception {
         return sceneFileBuildService.uploadLiguang(num, snCode, ossPath);
     }
 
+    /**
+     *
+     * 激光场景生成obj文件
+     */
+    @SignVerification
+    @PostMapping(value = "/generateObjFile")
+    public Result generateObjFile(@RequestBody SceneParam requestScene) throws Exception{
+        String num = requestScene.getSceneNum();
+        if (StringUtils.isEmpty(num)) {
+            throw new BusinessException(ErrorCode.FAILURE_CODE_3001);
+        }
+        sceneProService.generateObjFile(num);
+        return Result.success();
+    }
+
 }

+ 20 - 0
src/main/java/com/fdkankan/contro/httpclient/LaserAddressSource.java

@@ -0,0 +1,20 @@
+package com.fdkankan.contro.httpclient;
+
+import com.dtflys.forest.callback.AddressSource;
+import com.dtflys.forest.http.ForestAddress;
+import com.dtflys.forest.http.ForestRequest;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LaserAddressSource implements AddressSource {
+
+    @Value("${4dkk.laserService.basePath}")
+    private String basePath;
+
+
+    @Override
+    public ForestAddress getAddress(ForestRequest forestRequest) {
+        return new ForestAddress("","",null,basePath);
+    }
+}

+ 17 - 0
src/main/java/com/fdkankan/contro/httpclient/LaserClient.java

@@ -0,0 +1,17 @@
+package com.fdkankan.contro.httpclient;
+
+import com.dtflys.forest.annotation.Address;
+import com.dtflys.forest.annotation.Get;
+import com.fdkankan.contro.common.Result;
+
+/**
+ * 获取,调用激光服务
+ */
+@Address(source = LaserAddressSource.class)
+public interface LaserClient {
+
+
+    @Get("/laser/init/${0}")
+    Result getSceneByNum(String num);
+
+}

+ 18 - 0
src/main/java/com/fdkankan/contro/httpclient/MyClient.java

@@ -0,0 +1,18 @@
+package com.fdkankan.contro.httpclient;
+
+
+import com.dtflys.forest.annotation.Get;
+import com.dtflys.forest.annotation.Header;
+import com.dtflys.forest.annotation.Var;
+import com.fdkankan.contro.common.Result;
+
+import java.util.Map;
+
+public interface MyClient {
+
+    @Get(url = "${url}")
+    Result get(@Var("url") String url, @Header Map<String, String> headerMap);
+
+
+
+}

+ 1 - 1
src/main/java/com/fdkankan/contro/service/ISceneProService.java

@@ -18,5 +18,5 @@ public interface ISceneProService extends IService<ScenePro> {
     Long sumUsedSpaceByCameraId(Long cameraId, String spaceTypeStr);
 
 
-
+    void generateObjFile(String num);
 }

+ 149 - 4
src/main/java/com/fdkankan/contro/service/impl/SceneProServiceImpl.java

@@ -1,18 +1,33 @@
 package com.fdkankan.contro.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+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.CommonStatus;
-import com.fdkankan.common.constant.PayStatus;
-import com.fdkankan.common.constant.SceneStatus;
-import com.fdkankan.common.constant.SpaceType;
+import com.fdkankan.common.constant.*;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.contro.common.Result;
+import com.fdkankan.contro.entity.ScenePlus;
+import com.fdkankan.contro.entity.ScenePlusExt;
 import com.fdkankan.contro.entity.ScenePro;
+import com.fdkankan.contro.httpclient.LaserClient;
 import com.fdkankan.contro.mapper.ISceneProMapper;
+import com.fdkankan.contro.mapper.ISceneUpgradeMapper;
+import com.fdkankan.contro.service.IScenePlusExtService;
+import com.fdkankan.contro.service.IScenePlusService;
 import com.fdkankan.contro.service.ISceneProService;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
 
+import javax.annotation.Resource;
 import java.util.List;
 import java.util.Objects;
 
@@ -28,6 +43,21 @@ import java.util.Objects;
 @Service
 public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro> implements ISceneProService {
 
+    @Value("${queue.modeling.obj.modeling-pre}")
+    private String queueObjModelingPre;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Resource
+    private FYunFileServiceInterface fYunFileService;
+    @Resource
+    private LaserClient laserClient;
+    @Autowired
+    private ISceneUpgradeMapper sceneUpgradeMapper;
+    @Resource
+    private RabbitMqProducer mqProducer;
+    @Autowired
+    private IScenePlusExtService scenePlusExtService;
+
     @Override
     public ScenePro getByNum(String num) {
         return this.getOne(new LambdaQueryWrapper<ScenePro>().eq(ScenePro::getNum, num));
@@ -58,4 +88,119 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         }
         return 0L;
     }
+
+    @Override
+    public void generateObjFile(String num) {
+        ScenePro sceneProEntity = this.getByNum(num);
+
+        if(ObjectUtils.isEmpty(sceneProEntity) && sceneProEntity.getIsUpgrade() == 1){
+            generatePlusObjFile(num);
+            return;
+        }
+
+        if(sceneProEntity.getSceneSource() != 4 && sceneProEntity.getSceneSource() != 5){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_3003, "只能操作激光场景");
+        }
+
+        // 拷贝文件
+        String path = sceneProEntity.getDataSource();
+        String ossPath = path.replace("/mnt/data","home")+"/data.fdage";
+        if(!fYunFileService.fileExist(ossPath)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_3037);
+        }
+
+        // 获取最新的场景名称
+        Result laserSceneByNum = laserClient.getSceneByNum(num);
+        if(laserSceneByNum.getCode() != HttpStatus.OK.value()){
+            throw new RuntimeException("获取激光转台场景失败!");
+        }
+        JSONObject sceneInfo = JSONObject.parseObject(JSONObject.toJSONString(laserSceneByNum.getData()));
+        LambdaUpdateWrapper<ScenePro> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper
+                .set(ScenePro::getStatus, 0)
+                .set(ScenePro::getIsObj, 1)
+                .set(ScenePro::getIsUpgrade, 2)   //   升级中
+                .set(ScenePro::getSceneName, sceneInfo.getString("title"))
+                .eq(ScenePro::getNum, sceneProEntity.getNum());
+        this.update(updateWrapper);
+
+        //同步到scenePlus、scenePlus
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        if(Objects.nonNull(scenePlus)){
+            sceneUpgradeMapper.deleteScenePlus(num);
+            sceneUpgradeMapper.deleteScenePlusExt(scenePlus.getId());
+        }
+        sceneUpgradeMapper.transferScenePlus(num);
+        scenePlus = scenePlusService.getScenePlusByNum(num);
+        String sceneKind = sceneProEntity.getSceneScheme() == 3 ? SceneKind.FACE.code():SceneKind.TILES.code();
+        sceneUpgradeMapper.transferScenePlusExt(num, scenePlus.getId(), sceneKind);
+
+        log.info("开始发送激光场景生成obj mq消息");
+
+        // 发送MQ
+        BuildSceneCallMessage mqMsg = new BuildSceneCallMessage();
+        mqMsg.setSceneNum(sceneProEntity.getNum());
+        mqMsg.setAlgorithm(sceneProEntity.getAlgorithm());
+        mqMsg.setBuildType(sceneProEntity.getBuildType());
+        mqMsg.setPath(sceneProEntity.getDataSource());
+        mqProducer.sendByWorkQueue(queueObjModelingPre,mqMsg);
+    }
+
+    public void generatePlusObjFile(String num) {
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+
+        if(ObjectUtils.isEmpty(scenePlus)){
+            throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
+        }
+
+        if(scenePlus.getSceneSource() != 4 && scenePlus.getSceneSource() !=5){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_3003, "只能操作激光场景");
+        }
+
+        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+
+        String ossPath = scenePlusExt.getDataSource().replace("/mnt/data","home")+"/data.fdage";
+        if(!fYunFileService.fileExist(ossPath)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_3037);
+
+        }
+
+        // 获取最新的场景名称
+        Result laserSceneByNum = laserClient.getSceneByNum(num);
+        if(laserSceneByNum.getCode() != HttpStatus.OK.value()){
+            throw new RuntimeException("获取激光转台场景失败!");
+        }
+        JSONObject sceneInfo = JSONObject.parseObject(JSONObject.toJSONString(laserSceneByNum.getData()));
+        LambdaUpdateWrapper<ScenePlus> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper
+                .set(ScenePlus::getSceneStatus, 0)
+                .set(ScenePlus::getTitle, sceneInfo.getString("title"))
+                .eq(ScenePlus::getNum, num);
+        scenePlusService.update(updateWrapper);
+
+        LambdaUpdateWrapper<ScenePlusExt> plusExtUpdateWrapper = new LambdaUpdateWrapper<>();
+        plusExtUpdateWrapper
+                .set(ScenePlusExt::getIsObj, 1)
+                .eq(ScenePlusExt::getPlusId, scenePlus.getId());
+        scenePlusExtService.update(plusExtUpdateWrapper);
+
+        log.info("开始发送激光场景生成obj mq消息");
+
+        // 发送MQ
+        BuildSceneCallMessage mqMsg = new BuildSceneCallMessage();
+        mqMsg.setSceneNum(num);
+        mqMsg.setAlgorithm(scenePlusExt.getAlgorithm());
+        mqMsg.setBuildType(scenePlusExt.getBuildType());
+        mqMsg.setPath(scenePlusExt.getDataSource());
+        mqProducer.sendByWorkQueue(queueObjModelingPre,mqMsg);
+    }
+
+    public JSONObject getSceneByNum(String num) {
+        Result result = laserClient.getSceneByNum(num);
+        if(result.getCode() != HttpStatus.OK.value()){
+            log.error("获取激光转台场景失败!");
+            return null;
+        }
+        return JSONObject.parseObject(JSONObject.toJSONString(result.getData()));
+    }
 }

+ 40 - 0
src/main/java/com/fdkankan/contro/vo/SceneParam.java

@@ -0,0 +1,40 @@
+package com.fdkankan.contro.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class SceneParam{
+    private String sceneSource;
+    private Long folderId;
+    private Integer folderType;
+    private Long userId;
+    private List<String> sourceList;
+    private List<String> numList;
+    private Integer hasFolder =1;   // 0 不包含文件夹,1包含
+
+    private String sceneName;       //场景名称
+    private String snCode;          //相机snCode
+    private List<String> snCodes;
+
+    private String userName;        //协作者名称
+
+    private String sceneNum;
+
+    private Integer type;
+
+    private Integer haveVoid;
+    private Integer status;
+
+    private Integer isObj;
+
+    private String startTime;
+    private String endTime;
+    private String num;
+
+    private String searchKey;
+    private Integer cameraId;
+    private Integer location;
+    private String platform;
+}

+ 5 - 0
src/main/resources/bootstrap-dev.yml

@@ -33,6 +33,11 @@ spring:
           - data-id: common-scaling.yaml
             group: DEFAULT_GROUP
             refresh: true
+
+          - data-id: forest-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
+
       discovery:
         server-addr: ${spring.cloud.nacos.config.server-addr}
         namespace: ${spring.cloud.nacos.config.namespace}

+ 4 - 0
src/main/resources/bootstrap-pro.yml

@@ -37,6 +37,10 @@ spring:
           - data-id: common-logback-config.yaml
             group: DEFAULT_GROUP
             refresh: true
+
+          - data-id: forest-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         server-addr: ${spring.cloud.nacos.config.server-addr}
         namespace: ${spring.cloud.nacos.config.namespace}

+ 4 - 0
src/main/resources/bootstrap-test.yml

@@ -37,6 +37,10 @@ spring:
           - data-id: common-logback-config.yaml
             group: DEFAULT_GROUP
             refresh: true
+
+          - data-id: forest-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         server-addr: ${spring.cloud.nacos.config.server-addr}
         namespace: ${spring.cloud.nacos.config.namespace}

+ 1 - 1
src/main/resources/mapper/contro/SceneUpgradeMapper.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.fdkankan.contro.mapper.ISceneUpgradeMapper">
+<mapper namespace="com.fdkankan.ucenter.mapper.ISceneUpgradeMapper">
 
   <insert id="transferScenePlus" parameterType="java.lang.String">
     INSERT INTO t_scene_plus (