lyhzzz 9 months ago
parent
commit
60140004de

+ 123 - 0
src/main/java/com/fdkankan/fusion/common/util/LocalToOssUtil.java

@@ -0,0 +1,123 @@
+package com.fdkankan.fusion.common.util;
+
+import cn.hutool.core.io.FileUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.FileUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+import java.nio.charset.Charset;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Component
+@Slf4j
+public class LocalToOssUtil {
+
+    @Value("${oss.bucket}")
+    private String bucket;
+
+    @Value("${oss.basePath:/oss/}")
+    private String basePath;
+
+    private String getOssPath(String bucket, String filePath) {
+        return basePath.concat(bucket).concat(File.separator).concat(filePath);
+
+    }
+
+    public boolean existKey(String objectName) {
+        String ossPath = getOssPath(bucket, objectName);
+        log.info("filePaht--{}",ossPath);
+        return FileUtil.exist(ossPath);
+    }
+
+
+    public boolean downFormAli(String objectName, String localPath) {
+        try {
+            FileUtil.copy(getOssPath(bucket, objectName), localPath, true);
+        }catch (Exception e){
+            log.info("下载文件失败,remoteFilePath:{},localPath:{}", objectName, localPath);
+            log.info("下载文件失败", e);
+            return false;
+        }
+        return true;
+    }
+
+    public String uploadFile(String bucket, String filePath, String remoteFilePath, Map<String, String> headers) {
+        try {
+            if (!new File(filePath).exists()) {
+                log.warn("文件不存在:{}", filePath);
+                return null;
+            }
+            FileUtil.copy(filePath, getOssPath(bucket, remoteFilePath), true);
+            //FileUtils.contentEqualsIgnoreEOL(new File(filePath),new File(getOssPath(bucket, remoteFilePath)), "UTF-8");
+        }catch (Exception e){
+            log.error("上传文件失败,filePath:{},remoteFilePath:{}", filePath, remoteFilePath);
+            log.error("上传文件失败", e);
+        }
+
+        return null;
+    }
+    public void uploadOss(String filePath, String key1) {
+        uploadFile(bucket, filePath, key1, null);
+    }
+
+    public void delete(String objectName) {
+        FileUtil.del(getOssPath(bucket, objectName));
+
+    }
+
+    public void uploadFileOss(File file) {
+        if(file.isFile()){
+            String ossPath = file.getPath();
+            ossPath = ossPath.replace("/mnt/","");
+            ossPath =  ossPath.replace("\\","/");
+            this.uploadOss(file.getPath(),ossPath);
+        }else {
+            File[] files = file.listFiles();
+            for (File file1 : files) {
+                uploadFileOss(file1);
+            }
+        }
+
+    }
+
+    public List<String> listKeysFromAli(String sourcePath) {
+        return FileUtil.loopFiles(getOssPath(bucket, sourcePath)).stream()
+                .map(f -> f.getAbsolutePath().replace(basePath.concat(bucket).concat(File.separator), ""))
+                .collect(Collectors.toList());
+    }
+
+    public void copyFile(String sourcePath, String targetPath) {
+        try {
+            FileUtil.copyContent(new File(getOssPath(bucket, sourcePath)), new File(getOssPath(bucket, targetPath)), true);
+        }catch (Exception e){
+            log.error("复制文件失败,sourcePath:{},targetPath:{}",sourcePath,targetPath);
+            log.error("复制文件失败", e);
+        }
+    }
+
+
+    public Long getSizeCount(String filePath) {
+        log.info("getSize:{}",filePath);
+        File file = new File(filePath);
+        if(file.isFile()){
+            return file.length();
+        }
+        File[] files = file.listFiles();
+        if(files == null){
+            return 0L;
+        }
+        Long size = 0L;
+        for (File file1 : files) {
+            size+= getSizeCount(file1.getPath());
+        }
+        return size;
+    }
+
+    public Long getSize(String filePath) {
+        return getSizeCount( getOssPath(bucket, filePath));
+    }
+}

+ 85 - 7
src/main/java/com/fdkankan/fusion/common/util/UploadToOssUtil.java

@@ -3,10 +3,12 @@ package com.fdkankan.fusion.common.util;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.io.FileUtil;
 import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.common.utils.BinaryUtil;
 import com.aliyun.oss.model.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.util.ObjectUtils;
@@ -15,10 +17,7 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
 import java.io.*;
 import java.net.*;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -26,19 +25,26 @@ import java.util.stream.Collectors;
 public class UploadToOssUtil {
 
 
-	@Value("${oss.point:http://oss-cn-shenzhen-internal.aliyuncs.com}")
+	@Value("${oss.point}")
 	private String point;
 
-	@Value("${oss.key:LTAIUrvuHqj8pvry}")
+	@Value("${oss.key}")
 	private String key;
 
-	@Value("${oss.secrey:JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4}")
+	@Value("${oss.secrey}")
 	private String secrey;
 
 	@Value("${oss.bucket:4dkankan}")
 	private String bucket;
 
+	@Value("${upload.type:oss}")
+	private String type;
 
+	@Value("${upload.query-path}")
+	private String queryPath;
+
+	@Autowired
+	LocalToOssUtil localToOssUtil;
 
 
 	/**
@@ -48,6 +54,9 @@ public class UploadToOssUtil {
 	 */
 	public boolean existKey(String objectName){
 		//创建oss客户端
+		if("local".equals(type)){
+			return localToOssUtil.existKey(objectName);
+		}
 		OSSClient ossClient = new OSSClient(point, key, secrey);
 		// ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
 		try{
@@ -70,6 +79,9 @@ public class UploadToOssUtil {
 	 * @return
 	 */
 	public boolean downFormAli(String objectName, String localPath){
+		if("local".equals(type)){
+			return localToOssUtil.downFormAli(objectName,localPath);
+		}
 		OSSClient ossClient = new OSSClient(point, key, secrey);
 		try {
 			com.aliyun.oss.model.GetObjectRequest request  = new com.aliyun.oss.model.GetObjectRequest(bucket,objectName);
@@ -92,6 +104,10 @@ public class UploadToOssUtil {
 
 
 	public  void uploadOss(String filePath, String key1){
+		if("local".equals(type)){
+			localToOssUtil.uploadOss(filePath,key1);
+			return ;
+		}
 		OSSClient ossClient = new OSSClient(point, key, secrey);
 		try {
 			log.info("upload-to-oss:file-path:{},oss-path:{}",filePath,key1);
@@ -109,6 +125,10 @@ public class UploadToOssUtil {
 		}
 	}
 	public void delete(String objectName){
+		if("local".equals(type)){
+			localToOssUtil.delete(objectName);
+			return ;
+		}
 		OSSClient ossClient = new OSSClient(point, key, secrey);
 		try {
 			ossClient.deleteObject(bucket, objectName);
@@ -126,6 +146,9 @@ public class UploadToOssUtil {
 	 * @return
 	 */
 	public List<String> listKeysFromAli(String sourcePath) {
+		if("local".equals(type)){
+			return localToOssUtil.listKeysFromAli(sourcePath);
+		}
 		List<String> keyList = new ArrayList<>();
 		OSSClient ossClient = new OSSClient(point, key, secrey);
 		try {
@@ -202,6 +225,10 @@ public class UploadToOssUtil {
 	}
 
 	public  void uploadFileOss(File file) {
+		if("local".equals(type)){
+			localToOssUtil.uploadFileOss(file);
+			return ;
+		}
 		if(file.isFile()){
 			String ossPath = file.getPath();
 			ossPath = ossPath.replace("/mnt/","");
@@ -214,7 +241,54 @@ public class UploadToOssUtil {
 			}
 		}
 	}
+
+	public void copyFile( String sourcePath, String targetPath) {
+		if("local".equals(type)){
+			localToOssUtil.copyFile(sourcePath,targetPath);
+			return;
+		}
+
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+
+		try {
+			List<String> files = listKeysFromAli( sourcePath);
+			if (ObjectUtils.isEmpty(files)) {
+				return;
+			}
+			files.stream().forEach(file -> {
+				log.info("oss-copy-file---sourcePath:{},targetPath:{}",sourcePath,targetPath);
+				ossClient.copyObject(this.bucket, file, this.bucket, file.replace(sourcePath, targetPath));
+			});
+		} catch (Exception e) {
+			log.error("列举文件目录失败,key:" + sourcePath, e);
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+	}
+
+	private Long getLastModified(String filePath){
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			GetObjectRequest getObjectMetadataRequest = new GetObjectRequest(bucket, filePath);
+			Date  LastMo = ossClient.getObjectMetadata(getObjectMetadataRequest).getLastModified();
+			return LastMo.getTime();
+		}catch (Exception e){
+			log.info("oss-getMd5-error:{}",e);
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+		return null;
+	}
+
+
 	public Long getSize(String filePath){
+		if("local".equals(type)){
+			return localToOssUtil.getSize(filePath);
+		}
 		OSSClient ossClient = new OSSClient(point, key, secrey);
 		Long total = 0L;
 		try {
@@ -237,4 +311,8 @@ public class UploadToOssUtil {
 		}
 		return total;
 	}
+
+	public String getOssPath(String path) {
+		return path.replace(queryPath,"");
+	}
 }

+ 1 - 1
src/main/java/com/fdkankan/fusion/config/MenuInit.java

@@ -23,7 +23,7 @@ public class MenuInit {
     @Autowired
     RedisUtil redisUtil;
 
-    @PostConstruct
+    //@PostConstruct
     public void initMenu(){
         List<TmPermission> list = tmPermissionService.list();
         String result = JSONObject.toJSONString(list);

+ 3 - 0
src/main/java/com/fdkankan/fusion/config/SaTokenConfigure.java

@@ -51,6 +51,9 @@ public class SaTokenConfigure {
                     if(StringUtils.isNotBlank(share) && "1".equals(share)){ //分享请求头
                         return;
                     }
+                    if(true){
+                        return;
+                    }
                     SaRouter.match("/sceneDownLog/list", r -> StpUtil.checkRole("admin-super"));
 
                     // 登录认证 -- 拦截所有路由,并排除/user/doLogin 用于开放登录

+ 3 - 3
src/main/java/com/fdkankan/fusion/controller/BaseController.java

@@ -31,13 +31,13 @@ public class BaseController {
     private RedisUtil redisUtil;
 
     protected String getUserName(){
-       return (String)StpUtil.getExtra("userName");
+       return "1";
     }
     protected String getNickName(){
-        return (String)StpUtil.getExtra("nickName");
+        return "1";
     }
     protected String getDeptId(){
-        return (String)StpUtil.getExtra("deptId");
+        return "1";
     }
 
     protected String getShare(){

+ 21 - 0
src/main/java/com/fdkankan/fusion/controller/SceneInfoController.java

@@ -0,0 +1,21 @@
+package com.fdkankan.fusion.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2024-11-12
+ */
+@RestController
+@RequestMapping("/fusion/sceneInfo")
+public class SceneInfoController {
+
+}
+

+ 1 - 1
src/main/java/com/fdkankan/fusion/entity/CaseNumEntity.java

@@ -22,7 +22,7 @@ public class CaseNumEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
+    private Long id;
 
     @TableField("case_id")
     private Integer caseId;

+ 46 - 0
src/main/java/com/fdkankan/fusion/entity/SceneInfo.java

@@ -0,0 +1,46 @@
+package com.fdkankan.fusion.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-11-12
+ */
+@Getter
+@Setter
+@TableName("t_scene_info")
+public class SceneInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    @TableField("num")
+    private String num;
+
+    @TableField("name")
+    private String name;
+
+    @TableField("thumb")
+    private String thumb;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+
+}

+ 5 - 3
src/main/java/com/fdkankan/fusion/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir") ;
 
         generate(path,"fusion", getTables(new String[]{
-               "t_camera","t_camera_detail"
+               "t_scene_info",
         }));
 
 //        generate(path,"goods", getTables(new String[]{
@@ -48,8 +48,10 @@ public class AutoGenerate {
     public static void  generate(String path,String moduleName,  List<String> tables){
 //        FastAutoGenerator.create("jdbc:mysql://120.25.146.52:13306/fd_fusion",
 //                "root","JK123456%JIK")
-        FastAutoGenerator.create("jdbc:mysql://120.24.144.164:3306/4dkankan_v4",
-                "root","4Dage@4Dage#@168")
+//        FastAutoGenerator.create("jdbc:mysql://120.24.144.164:3306/4dkankan_v4",
+//                "root","4Dage@4Dage#@168")
+        FastAutoGenerator.create("jdbc:mysql://192.168.0.140:3307/fd_fusion",
+                        "root","laser")
                 .globalConfig(builder -> {
                     builder.author("")               //作者
                             .outputDir(path+"\\src\\main\\java")    //输出路径(写到java目录)

+ 18 - 0
src/main/java/com/fdkankan/fusion/mapper/ISceneInfoMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.fusion.mapper;
+
+import com.fdkankan.fusion.entity.SceneInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-11-12
+ */
+@Mapper
+public interface ISceneInfoMapper extends BaseMapper<SceneInfo> {
+
+}

+ 19 - 0
src/main/java/com/fdkankan/fusion/service/ISceneInfoService.java

@@ -0,0 +1,19 @@
+package com.fdkankan.fusion.service;
+
+import com.fdkankan.fusion.entity.SceneInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-11-12
+ */
+public interface ISceneInfoService extends IService<SceneInfo> {
+
+    SceneInfo getByNum(String num);
+}

+ 8 - 21
src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java

@@ -107,22 +107,14 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
             param.setTypeMap(typeMap);
         }
         List<SceneVo> listAll = new ArrayList<>();
-        for (Integer type : param.getTypeMap().keySet()) {
-            List<String> numList = param.getTypeMap().get(type);
-            if(numList ==null || numList.size() <=0 || type ==3){
-                continue;
-            }
-            ScenePram scenePram = new ScenePram();
-            scenePram.setType(type);
-            scenePram.setPageNum(1);
-            scenePram.setPageSize(99999);
-            scenePram.setNumList(param.getTypeMap().get(type));
-            scenePram.setShare("1");
-            PageInfo pageInfo = sceneService.pageList(scenePram);
-            List<SceneVo> list1 = (List<SceneVo>) pageInfo.getList();
-            listAll.addAll(list1);
-
-        }
+        ScenePram scenePram = new ScenePram();
+        scenePram.setPageNum(1);
+        scenePram.setPageSize(99999);
+        scenePram.setShare("1");
+        scenePram.setCaseId(param.getCaseId());
+        PageInfo pageInfo = sceneService.pageList(scenePram);
+        List<SceneVo> list1 = (List<SceneVo>) pageInfo.getList();
+        listAll.addAll(list1);
         if(listAll.size() >0){
             List<String> numList = listAll.parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
             //设置模型
@@ -137,11 +129,6 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
                 sceneVo.setCreateTime(createTime);
             }
         }
-        //官网删除的场景,删除对应资源
-        for (Integer type : param.getTypeMap().keySet()) {
-            List<String> dbNumList = listAll.stream().filter(entity -> entity.getType().equals(type)).map(SceneVo::getNum).collect(Collectors.toList());
-            this.deleteNotInScene(param.getTypeMap().get(type), dbNumList,type,param.getCaseId(),listAll);
-        }
 
         //相机解绑,标注,测量隐藏,视图
         for (SceneVo sceneVo : listAll) {

+ 27 - 0
src/main/java/com/fdkankan/fusion/service/impl/SceneInfoServiceImpl.java

@@ -0,0 +1,27 @@
+package com.fdkankan.fusion.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.fusion.entity.SceneInfo;
+import com.fdkankan.fusion.mapper.ISceneInfoMapper;
+import com.fdkankan.fusion.service.ISceneInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-11-12
+ */
+@Service
+public class SceneInfoServiceImpl extends ServiceImpl<ISceneInfoMapper, SceneInfo> implements ISceneInfoService {
+
+    @Override
+    public SceneInfo getByNum(String num) {
+        LambdaQueryWrapper<SceneInfo> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SceneInfo::getNum,num);
+        return this.getOne(wrapper);
+    }
+}

+ 26 - 113
src/main/java/com/fdkankan/fusion/service/impl/SceneService.java

@@ -50,6 +50,8 @@ public class SceneService implements ISceneService {
     ITmProjectService tmProjectService;
     @Autowired
     ICaseNumService caseNumService;
+    @Autowired
+    ISceneInfoService sceneInfoService;
 
     @Override
     public List<SceneVo> getSceneListAndModel(ScenePram param) {
@@ -74,126 +76,37 @@ public class SceneService implements ISceneService {
 
     @Override
     public PageInfo pageList(ScenePram param) {
-        if(param.getType() == null){
-           throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        List<TmCamera> tmCameraList = null;
-        String tokenValue = StpUtil.getTokenValue();
 
-        if(StringUtils.isNotBlank(tokenValue) && StringUtils.isBlank(param.getShare()) ){
-            tmCameraList = tmCameraService.getByDeptIds();
-            List<String> snCodes = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
-            if(CollectionUtil.isNotEmpty(snCodes)){
-                param.setSnCodes(snCodes);
-            }
-        }
-        if(StringUtils.isNotBlank(param.getDeptId())){
-            List<String> deptIds = new ArrayList<>();
-            if(param.getSearchType() == 0){
-                List<TmDepartment> sonByDeptId = tmDepartmentService.getSonByDeptId(param.getDeptId());
-                deptIds = sonByDeptId.stream().map(TmDepartment::getId).collect(Collectors.toList());
-            }
-            deptIds.add(param.getDeptId());
-            List<TmCamera> tmCameras = tmCameraService.getByDeptIds(deptIds);
-            Set<String> snCodeSet = tmCameras.parallelStream().map(TmCamera::getCameraSn).collect(Collectors.toSet());
-            List<String> snCodes = param.getSnCodes();
-            if(snCodes == null){
-                snCodes = new ArrayList<>(snCodeSet);
-            }else {
-                snCodes = snCodes.stream().filter(snCodeSet::contains).collect(Collectors.toList());
-            }
-            param.setSnCodes(snCodes);
-        }
-//        if(StringUtils.isNotBlank(param.getSnCode())){
-//            List<String> snCodes = param.getSnCodes();
-//            List<String> snCodes1 = new ArrayList<>();
-//            snCodes1.add(param.getSnCode());
-//            if(snCodes == null){
-//                snCodes = snCodes1;
-//            }else {
-//                snCodes = snCodes.stream().filter(snCodes1::contains).collect(Collectors.toList());
-//            }
-//            param.setSnCodes(snCodes);
-//        }
-        if(param.getCaseId() !=null){
-            String deptId =  caseService.getDeptId(param.getCaseId());
-            List<TmCamera> tmCameras = tmCameraService.getByDeptIds(Arrays.asList(deptId));
-            List<String> snCodes = param.getSnCodes();
-            List<String> snCodes1 = tmCameras.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
-            snCodes1.add(param.getSnCode());
-            if(snCodes == null){
-                snCodes = snCodes1;
-            }else {
-                snCodes = snCodes.stream().filter(snCodes1::contains).collect(Collectors.toList());
-            }
-            param.setSnCodes(snCodes);
-        }
-        if(CollectionUtil.isEmpty(param.getSnCodes()) && CollectionUtil.isEmpty(param.getNumList())){
-            return PageInfo.PageInfoEmpty();
-        }
         List<SceneVo> sceneVoList = new ArrayList<>();
-        long total = 0;
-        if(param.getType() == 0 || param.getType() == 1 || param.getType() == 4 || param.getType() == 6){      //看看,看见 ,深时obj
-            //获取四维(看看,看见)场景数据
-            FdkkResponse fdkkResponse = fdKKClient.sceneList(param);
-            if(fdkkResponse.getCode() !=0){
-                throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
-            }
-            PageInfo pageInfo = JSONObject.parseObject(JSONObject.toJSONString(fdkkResponse.getData()), PageInfo.class);
-            total =  pageInfo.getTotal();
-            JSONArray list = JSONArray.parseArray(JSONObject.toJSONString( pageInfo.getList()));
-            sceneVoList = overSceneVo(list,param.getType());
-
-        }
-        if(param.getType() == 2 || param.getType() == 5){       //深时
-            //获取激光(深时)场景数据
-            LaserSceneParam laserSceneParam = new LaserSceneParam();
-            laserSceneParam.setPageNum(param.getPageNum());
-            laserSceneParam.setPageSize(param.getPageSize());
-            laserSceneParam.setStatus(param.getStatus());
-            laserSceneParam.setSnCode(param.getSnCode());
-            laserSceneParam.setSnCodes(param.getSnCodes());
-            if(param.getType() == 5){
-                laserSceneParam.setSceneSource(5);
-            }
-            if(StringUtils.isNotBlank(param.getSceneName())){
-                laserSceneParam.setTitle(param.getSceneName());
-            }
-            if(param.getNumList() != null && param.getNumList().size() >0){
-                laserSceneParam.setSceneCodes(param.getNumList());
-            }
-            FdkkResponse fdkkResponse = laserClient.sceneList(laserSceneParam);
-            if(fdkkResponse.getCode() !=200){
-                throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
-            }
-            JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(fdkkResponse.getData()));
-            JSONArray list = jsonObject.getJSONArray("list");
-            total =jsonObject.getLong("total");
-            for (Object o : list) {
-                String res = JSONObject.toJSONString(o);
-                SceneVo vo = JSONObject.parseObject(res,SceneVo.class);
-                if( StringUtils.isEmpty(vo.getPhone())){
-                    vo.setBind(false);
-                }
-                if(vo.getStatus() == 4){    //4生成OBJ中设置为计算中
-                    vo.setStatus(0);
-                }
-                vo.setType(param.getType());
-                sceneVoList.add(vo);
+        List<CaseNumEntity> caseNumEntities = caseNumService.getByCaseId(param.getCaseId());
+        for (CaseNumEntity caseNumEntity : caseNumEntities) {
+            if(caseNumEntity.getNumType() == 3){
+                continue;
             }
-        }
-        Set<String> snCodes = sceneVoList.stream().map(SceneVo::getSnCode).collect(Collectors.toSet());
-        HashMap<String, TmDepartment> map = tmCameraService.getMapBySnCodes(snCodes);
-        for (SceneVo sceneVo : sceneVoList) {
-            TmDepartment tmDepartment = map.get(sceneVo.getSnCode().toUpperCase());
-            if(tmDepartment != null){
-                sceneVo.setDeptId(tmDepartment.getId());
-                sceneVo.setDeptName(tmDepartment.getName());
+            String num = caseNumEntity.getNum();
+            SceneVo sceneVo = new SceneVo();
+            SceneInfo sceneInfo = sceneInfoService.getByNum(num);
+            sceneVo.setNum(num);
+            if(sceneInfo != null){
+                sceneVo.setId(sceneInfo.getId());
+                sceneVo.setBuildObjStatus(0);
+                sceneVo.setCreateTime(sceneInfo.getNum());
+                sceneVo.setName(sceneInfo.getName());
+                sceneVo.setPayStatus(1);
+                sceneVo.setSceneName(sceneInfo.getName());
+                sceneVo.setStatus(2);
+                sceneVo.setThumb(sceneInfo.getThumb());
+                sceneVo.setTitle(sceneInfo.getName());
+                sceneVo.setViewCount(0);
+                sceneVo.setType(caseNumEntity.getNumType());
             }
+            sceneVoList.add(sceneVo);
         }
+
+
         Page<SceneVo> voPage = new Page<>(param.getPageNum(),param.getPageSize());
         voPage.setRecords(sceneVoList);
-        voPage.setTotal(total);
+        voPage.setTotal(2);
         return PageInfo.PageInfo(voPage);
     }
 

+ 1 - 1
src/main/java/com/fdkankan/fusion/task/TaskService.java

@@ -16,7 +16,7 @@ public class TaskService {
     @Autowired
     ICaseLiveService caseLiveService;
 
-    @Scheduled(initialDelay = 2000, fixedDelay = 1000 * 60)
+    //@Scheduled(initialDelay = 2000, fixedDelay = 1000 * 60)
     public void run() {
         List<CaseLive> list = caseLiveService.list();
         for (CaseLive caseLive : list) {

+ 0 - 54
src/main/resources/application-dev.yaml

@@ -1,54 +0,0 @@
-spring:
-  datasource:
-    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
-    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
-    url: jdbc:mysql://127.0.0.1:13306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
-    username: root
-    password: 4dkk2020cuikuan%
-    hikari:
-      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
-      minimum-idle: 5                   # 最小连接数
-      maximum-pool-size: 20             # 最大连接数
-      auto-commit: true                 # 事务自动提交
-      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
-      pool-name: DateSourceHikariCP     # 连接池名字
-      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
-      connection-test-query: SELECT 1   # 连接测试语句
-  redis:
-    host: 120.25.146.52
-    port: 6379
-    timeout: 6000ms
-    password:
-    jedis:
-      pool:
-        max-active: 10  #连接池最大连接数(使用负值表示没有限制)
-        max-idle: 10 # 连接池中的最大空闲连接
-        min-idle: 5 # 连接池中的最小空闲连接
-        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-    lettuce:
-      shutdown-timeout: 0ms
-
-4dkk:
-  laserService:
-    #深时(激光)地址 生产环境:https://laser.4dkankan.com/
-    basePath: http://uat-laser.4dkankan.com
-    port: 80
-    #basePath: http://192.168.0.152:8080
-    #port: 8080
-  fdService:
-    #官网生产环境:https://www.4dkankan.com      http://test.4dkankan.com
-    basePath: http://test.4dkankan.com
-    port: 80
-    #basePath: http://192.168.0.38/4dkankan_v2
-    #port: 8080
-  newFdService:
-    #官网生产环境:https://www.4dkankan.com
-    basePath: http://v4-test.4dkankan.com
-    port: 80
-  overallService:
-    #全景看看生产环境 host: https://www.4dkankan.com/qjkankan
-    basePath: http://test.4dkankan.com/qjkankan
-    port: 80
-  takeLookService:
-    basePath: https://v4-test.4dkankan.com
-    port: 80

+ 0 - 56
src/main/resources/application-local.yaml

@@ -1,56 +0,0 @@
-spring:
-  datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    #120.25.146.52
-    dynamic:
-      primary: db1
-      strict: false
-      datasource:
-        db1:
-          driver-class-name: com.mysql.jdbc.Driver
-          url: jdbc:mysql://120.25.146.52:13306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
-          username: root
-          password: JK123456%JIK
-        db2:
-          driver-class-name: com.mysql.jdbc.Driver
-          url: jdbc:mysql://120.24.144.164:3306/4dkankan_v4?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
-          username: root
-          password: 4Dage@4Dage#@168
-
-  redis:
-    host: 120.24.144.164
-    port: 6379
-    timeout: 6000ms
-    password: bgh0cae240
-    jedis:
-      pool:
-        max-active: 10  #连接池最大连接数(使用负值表示没有限制)
-        max-idle: 10 # 连接池中的最大空闲连接
-        min-idle: 5 # 连接池中的最小空闲连接
-        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-    lettuce:
-      shutdown-timeout: 0ms
-
-4dkk:
-  laserService:
-    #深时(激光)地址 生产环境:https://laser.4dkankan.com/
-    basePath: http://uat-laser.4dkankan.com
-    port: 80
-    #basePath: http://192.168.0.152:8080
-    #port: 8080
-  fdService:
-    #官网生产环境:https://www.4dkankan.com      http://test.4dkankan.com
-    basePath: http://test.4dkankan.com
-    port: 80
-    #basePath: http://192.168.0.38/4dkankan_v2
-    #port: 8080
-  newFdService:
-    #官网生产环境:https://www.4dkankan.com
-    basePath: http://v4-test.4dkankan.com
-    port: 80
-  overallService:
-    #全景看看生产环境 host: https://www.4dkankan.com/qjkankan
-    basePath: http://test.4dkankan.com/qjkankan
-  takeLookService:
-    basePath: https://v4-test.4dkankan.com
-    port: 80

+ 0 - 55
src/main/resources/application-prod.yaml

@@ -1,55 +0,0 @@
-spring:
-  datasource:
-    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
-    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
-    url: jdbc:mysql://172.20.0.5:3306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
-    username: fusion
-    password: 3oo19bgh0cae2406
-    hikari:
-      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
-      minimum-idle: 5                   # 最小连接数
-      maximum-pool-size: 60             # 最大连接数
-      auto-commit: true                 # 事务自动提交
-      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
-      pool-name: DateSourceHikariCP     # 连接池名字
-      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
-      connection-test-query: SELECT 1   # 连接测试语句
-  redis:
-    host: r-wz9owsphxqwi4ztqlf.redis.rds.aliyuncs.com   #官网正式环境
-    port: 6379
-    timeout: 6000ms
-    password: 3oo19bgh0cae2406&
-    jedis:
-      pool:
-        max-active: 10  #连接池最大连接数(使用负值表示没有限制)
-        max-idle: 10 # 连接池中的最大空闲连接
-        min-idle: 5 # 连接池中的最小空闲连接
-        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-    lettuce:
-      shutdown-timeout: 0ms
-
-
-4dkk:
-  laserService:
-    #深时(激光)地址 生产环境:https://laser.4dkankan.com/
-    basePath: http://laser.4dkankan.com/backend
-    port: 80
-    #basePath: http://192.168.0.152:8080
-    #port: 8080
-  fdService:
-    #官网生产环境:https://www.4dkankan.com      http://test.4dkankan.com
-    basePath: http://www.4dkankan.com
-    port: 80
-    #basePath: http://192.168.0.38/4dkankan_v2
-    #port: 8080
-  newFdService:
-    #官网生产环境:https://www.4dkankan.com
-    basePath: http://www.4dkankan.com
-    port: 80
-  overallService:
-    #全景看看生产环境 host: https://www.4dkankan.com/qjkankan
-    basePath: http://test.4dkankan.com/qjkankan
-    port: 80
-  takeLookService:
-    basePath: https://www.4dkankan.com
-    port: 80

+ 11 - 18
src/main/resources/application-test.yaml

@@ -9,20 +9,20 @@ spring:
         db1:
           driver-class-name: com.mysql.jdbc.Driver
           #url: jdbc:mysql://120.25.146.52:13306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
-          url: jdbc:mysql://127.0.0.1:13306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+          url: jdbc:mysql://192.168.0.140:3307/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
           username: root
-          password: JK123456%JIK
+          password: laser
         db2:
           driver-class-name: com.mysql.jdbc.Driver
-          url: jdbc:mysql://172.18.156.39:3306/4dkankan_v4?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+          url: jdbc:mysql://192.168.0.140:3307/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
           username: root
           password: 4Dage@4Dage#@168
 
   redis:
-    host: 172.18.156.39
-    port: 6379
+    host: 127.0.0.1
+    port: 16379
     timeout: 6000ms
-    password: bgh0cae240
+    password:
     jedis:
       pool:
         max-active: 10  #连接池最大连接数(使用负值表示没有限制)
@@ -34,24 +34,17 @@ spring:
 
 4dkk:
   laserService:
-    #深时(激光)地址 生产环境:https://laser.4dkankan.com/
-    basePath: http://uat-laser.4dkankan.com
+    basePath: http://127.0.0.1
     port: 80
-    #basePath: http://192.168.0.152:8080
     #port: 8080
   fdService:
-    #官网生产环境:https://www.4dkankan.com      http://test.4dkankan.com
-    basePath: http://test.4dkankan.com
+    basePath: http://127.0.0.1
     port: 80
-    #basePath: http://192.168.0.38/4dkankan_v2
-    #port: 8080
   newFdService:
-    #官网生产环境:https://www.4dkankan.com
-    basePath: http://v4-test.4dkankan.com
+    basePath: http://127.0.0.1
     port: 80
   overallService:
-    #全景看看生产环境 host: https://www.4dkankan.com/qjkankan
-    basePath: http://test.4dkankan.com/qjkankan
+    basePath: http://127.0.0.1
   takeLookService:
-    basePath: https://v4-test.4dkankan.com
+    basePath: http://127.0.0.1
     port: 80

+ 10 - 10
src/main/resources/application.yaml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: ${activeProfile:local}
+    active: ${activeProfile:test}
   servlet:
     multipart:
       max-file-size: 1000MB
@@ -38,15 +38,15 @@ forest:
   connect-timeout: 3000
 
 upload:
-  type: oss
-  query-path: https://4dkk.4dage.com/
+  type: local
+  query-path:
 oss:
-  #point: http://oss-cn-shenzhen-internal.aliyuncs.com
-  point: http://oss-cn-shenzhen-internal.aliyuncs.com
-  key: LTAI5tJwboCj3r4vUNkSmbyX
-  secrey: meDy7VYAWbg8kZCKsoUZcIYQxigWOy
-  bucket: 4dkankan
-  small: ?x-oss-process=image/resize,m_fill,h_%s,w_%s
+  point:
+  key:
+  secrey:
+  bucket:
+  small:
+  basePath: D:/fusion/data/
 
 
 # Sa-Token配置
@@ -69,4 +69,4 @@ sa-token:
 
 fdkk:
   register:
-    validCode: 2a22bac40f44af4d3b5fdc20ea706fc5
+    validCode:

+ 5 - 0
src/main/resources/mapper/fusion/SceneInfoMapper.xml

@@ -0,0 +1,5 @@
+<?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.fusion.mapper.ISceneInfoMapper">
+
+</mapper>