dengsixing пре 5 дана
родитељ
комит
c85e82e8ee
34 измењених фајлова са 1894 додато и 214 уклоњено
  1. 1 0
      src/main/java/com/fdkankan/modeldemo/Application.java
  2. 25 0
      src/main/java/com/fdkankan/modeldemo/bean/EntityInfo.java
  3. 16 0
      src/main/java/com/fdkankan/modeldemo/bean/StationInfo.java
  4. 2 0
      src/main/java/com/fdkankan/modeldemo/constant/Constant.java
  5. 69 3
      src/main/java/com/fdkankan/modeldemo/controller/SceneController.java
  6. 64 0
      src/main/java/com/fdkankan/modeldemo/entity/Manufacturer.java
  7. 90 0
      src/main/java/com/fdkankan/modeldemo/entity/SceneOrigUpload.java
  8. 86 0
      src/main/java/com/fdkankan/modeldemo/generator/AutoGenerate.java
  9. 0 188
      src/main/java/com/fdkankan/modeldemo/generator/MappingGeneratorOracle.java
  10. 14 0
      src/main/java/com/fdkankan/modeldemo/httpclient/CustomHttpClient.java
  11. 18 0
      src/main/java/com/fdkankan/modeldemo/mapper/ManufacturerMapper.java
  12. 18 0
      src/main/java/com/fdkankan/modeldemo/mapper/SceneOrigUploadMapper.java
  13. 2 4
      src/main/java/com/fdkankan/modeldemo/mq/ConvertListener.java
  14. 2 0
      src/main/java/com/fdkankan/modeldemo/service/FYunFileService.java
  15. 9 0
      src/main/java/com/fdkankan/modeldemo/service/HttpInterfaceService.java
  16. 3 0
      src/main/java/com/fdkankan/modeldemo/service/IConvertService.java
  17. 20 0
      src/main/java/com/fdkankan/modeldemo/service/ManufacturerService.java
  18. 21 0
      src/main/java/com/fdkankan/modeldemo/service/SceneOrigUploadService.java
  19. 64 0
      src/main/java/com/fdkankan/modeldemo/service/impl/ConvertServiceImpl.java
  20. 37 3
      src/main/java/com/fdkankan/modeldemo/service/impl/FYunFileServiceImpl.java
  21. 145 0
      src/main/java/com/fdkankan/modeldemo/service/impl/HttpInterfaceServiceImpl.java
  22. 40 0
      src/main/java/com/fdkankan/modeldemo/service/impl/ManufacturerServiceImpl.java
  23. 217 0
      src/main/java/com/fdkankan/modeldemo/service/impl/SceneOrigUploadServiceImpl.java
  24. 27 0
      src/main/java/com/fdkankan/modeldemo/task/TaskJob.java
  25. 1 1
      src/main/java/com/fdkankan/modeldemo/utils/ConvertUtil.java
  26. 126 0
      src/main/java/com/fdkankan/modeldemo/utils/FileUtil.java
  27. 460 0
      src/main/java/com/fdkankan/modeldemo/utils/HttpClientUtil.java
  28. 14 14
      src/main/java/com/fdkankan/modeldemo/utils/MinioUtil.java
  29. 186 0
      src/main/java/com/fdkankan/modeldemo/utils/RsaCryptTools.java
  30. 16 0
      src/main/resources/application-dev.yml
  31. 81 0
      src/main/resources/application-local.yml
  32. 10 1
      src/main/resources/application.yml
  33. 5 0
      src/main/resources/mapper/ManufacturerMapper.xml
  34. 5 0
      src/main/resources/mapper/SceneOrigUploadMapper.xml

+ 1 - 0
src/main/java/com/fdkankan/modeldemo/Application.java

@@ -22,4 +22,5 @@ public class Application {
         // 启动 Spring Boot 应用程序
         SpringApplication.run(Application.class, args);
     }
+
 }

+ 25 - 0
src/main/java/com/fdkankan/modeldemo/bean/EntityInfo.java

@@ -0,0 +1,25 @@
+package com.fdkankan.modeldemo.bean;
+
+import lombok.Data;
+
+/**
+ * 实体信息
+ * @author syhz
+ *
+ */
+@Data
+public class EntityInfo {
+    /**
+     * 实体ID
+     */
+    private String ENTITY_ID;
+    /**
+     * 实体名称
+     */
+    private String ENTITY_NAME;
+    /**
+     * 站址编码
+     */
+    private String STATION_CODE;
+
+}

+ 16 - 0
src/main/java/com/fdkankan/modeldemo/bean/StationInfo.java

@@ -0,0 +1,16 @@
+package com.fdkankan.modeldemo.bean;
+
+import lombok.Data;
+
+/**
+ * 站址信息 vo 对象
+ */
+@Data
+public class StationInfo {
+    private String STATION_ID;
+    private String STATION_CODE; //
+    private String DISTRICT_COUNTY_ID; //县区级行政区域编码
+    private String DISTRICT_REGION_ID; //地市级行政区域编码
+    private String DISTRICT_PROVINCE_ID;  //省级行政区域编码
+    private String LAN_ID;     //分区ID(省份)
+}

+ 2 - 0
src/main/java/com/fdkankan/modeldemo/constant/Constant.java

@@ -21,4 +21,6 @@ public class Constant {
     // Redis 场景转换中
     public static final String REDIS_SCENE_CONVERT_ING = "scene:converting:%s";
 
+    public final static String WORK_DIR = "/mnt/scene/convert/";
+
 }

+ 69 - 3
src/main/java/com/fdkankan/modeldemo/controller/SceneController.java

@@ -1,11 +1,33 @@
 package com.fdkankan.modeldemo.controller;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.CharsetUtil;
+import cn.hutool.core.util.ZipUtil;
+import com.fdkankan.modeldemo.bean.EntityInfo;
 import com.fdkankan.modeldemo.bean.ResultData;
+import com.fdkankan.modeldemo.bean.StationInfo;
+import com.fdkankan.modeldemo.constant.Constant;
+import com.fdkankan.modeldemo.entity.Manufacturer;
+import com.fdkankan.modeldemo.service.HttpInterfaceService;
+import com.fdkankan.modeldemo.service.ManufacturerService;
 import com.fdkankan.modeldemo.service.SceneConvertLogService;
+import com.fdkankan.modeldemo.service.SceneOrigUploadService;
+import com.fdkankan.modeldemo.utils.FileUtil;
+import com.fdkankan.modeldemo.utils.RsaCryptTools;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
 
 /**
  * <p>
@@ -15,12 +37,16 @@ import org.springframework.web.bind.annotation.RestController;
  * @author dsx
  * @since 2024-06-25
  */
+@Slf4j
 @RestController
 @RequestMapping("/convert")
 public class SceneController {
 
     @Autowired
     private SceneConvertLogService sceneConvertLogService;
+    @Autowired
+    private ManufacturerService manufacturerService;
+
 
     /**
      * 健康检查接口
@@ -39,4 +65,44 @@ public class SceneController {
     public ResultData test(){
         return ResultData.ok(sceneConvertLogService.list());
     }
+
+    @Autowired
+    private SceneOrigUploadService sceneOrigUploadService;
+
+    /**
+     * 站址编码+机房ID+数据包文件MD5值
+     *
+     * @param stationCode  站址编码
+     * @param roomEntityID 机房实体ID
+     * @param file         上传文件压缩包
+     * @param manufact     厂商标识
+     * @param encrypt      加密密文
+     * @param upUserAcct   上传用户
+     *
+     * @return  上传操作接口提示信息
+     */
+    @PostMapping("/uploadRsaFileZipView")
+    public ResultData upLoadRsaZipFile(
+            @RequestParam("stationCode") String stationCode,
+            @RequestParam("roomEntityID") String roomEntityID,
+            @RequestPart("file") MultipartFile file,
+            @RequestParam("manufact")  String manufact,
+            @RequestParam("encrypt")  String encrypt
+//            @RequestParam("upUserAcct")  String upUserAcct
+    ){
+        return sceneOrigUploadService.uploadRsaFileZipView(stationCode, roomEntityID, file, manufact, encrypt);
+    }
+
+    /**
+     * 根据 厂商标识新增或重新生成对应的 私钥 公钥信息
+     */
+    @PostMapping("/reBuildManuRsaInfo")
+    public ResultData reBuildManuRsaInfo(
+            @RequestParam("manuId") String manuId,
+            @RequestParam("manuName") String manuName,
+            @RequestParam("manuDesc") String manuDesc) throws NoSuchAlgorithmException {
+        return manufacturerService.getResultData(manuId, manuName, manuDesc);
+    }
+
+
 }

+ 64 - 0
src/main/java/com/fdkankan/modeldemo/entity/Manufacturer.java

@@ -0,0 +1,64 @@
+package com.fdkankan.modeldemo.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2026-02-26
+ */
+@Getter
+@Setter
+@TableName("t_manufacturer")
+public class Manufacturer implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 厂商id
+     */
+    @TableId("manu_id")
+    private String manuId;
+
+    /**
+     * 厂商名称
+     */
+    @TableField("manu_name")
+    private String manuName;
+
+    /**
+     * 私钥
+     */
+    @TableField("manu_prikey")
+    private String manuPrikey;
+
+    /**
+     * 公钥
+     */
+    @TableField("manu_pubkey")
+    private String manuPubkey;
+
+    /**
+     * 厂商描述
+     */
+    @TableField("manu_desc")
+    private String manuDesc;
+
+    /**
+     * 是否可用:A-可用,I不可用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A", delval = "I")
+    private String recStatus;
+
+
+}

+ 90 - 0
src/main/java/com/fdkankan/modeldemo/entity/SceneOrigUpload.java

@@ -0,0 +1,90 @@
+package com.fdkankan.modeldemo.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 场景采集数据压缩包上传记录
+ * </p>
+ *
+ * @author 
+ * @since 2026-02-27
+ */
+@Getter
+@Setter
+@TableName("t_scene_orig_upload")
+public class SceneOrigUpload implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 自增主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 厂商id
+     */
+    @TableField("manu_id")
+    private String manuId;
+
+    /**
+     * 站址编码
+     */
+    @TableField("station_code")
+    private String stationCode;
+
+    /**
+     * 机房id
+     */
+    @TableField("room_entity_id")
+    private String roomEntityId;
+
+    /**
+     * 桶名
+     */
+    @TableField(value = "bucket_name")
+    private String bucketName;
+
+    /**
+     * 对象名称
+     */
+    @TableField("object_name")
+    private String objectName;
+
+    /**
+     * 上传时间
+     */
+    @TableField("upload_time")
+    private Date uploadTime;
+
+    /**
+     * 是否有效
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    /**
+     * 转换状态(-1-失败,0-等待,1-成功,2-转换中)
+     */
+    @TableField("convert_status")
+    private Integer convertStatus;
+
+    /**
+     * 备注
+     */
+    @TableField("remark")
+    private String remark;
+
+
+}

+ 86 - 0
src/main/java/com/fdkankan/modeldemo/generator/AutoGenerate.java

@@ -0,0 +1,86 @@
+package com.fdkankan.modeldemo.generator;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.generator.FastAutoGenerator;
+import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
+import com.baomidou.mybatisplus.generator.config.OutputFile;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public class AutoGenerate {
+
+
+    public static void main(String[] args) {
+
+        String path =System.getProperty("user.dir");
+
+        generate(path,"modeldemo.generator", getTables(new String[]{
+                "t_scene_orig_upload"
+        }));
+    }
+
+    public static List<String> getTables(String [] tableNames){
+        return new ArrayList<>(Arrays.asList(tableNames));
+    }
+
+
+    public static void  generate(String path,String moduleName,  List<String> tables){
+        DataSourceConfig.Builder datasourceConfig = new DataSourceConfig.Builder("jdbc:postgresql://10.180.145.98:5432/chinatower_vr",
+                "res_vr", "qawsed@123.");
+        datasourceConfig.schema("res_vr");
+        FastAutoGenerator.create(datasourceConfig)
+                .globalConfig(builder -> {
+                    builder.author("")               //作者
+                            .outputDir(path+"\\src\\main\\java")    //输出路径(写到java目录)
+                            //.enableSwagger()           //开启swagger
+                            .commentDate("yyyy-MM-dd")
+                            .dateType(DateType.ONLY_DATE)
+                            .fileOverride();            //开启覆盖之前生成的文件
+
+                })
+                .packageConfig(builder -> {
+                    builder.parent("com.fdkankan")
+                            .moduleName(moduleName)
+                            .entity("entity")
+                            .service("service")
+                            .serviceImpl("service.impl")
+                            .controller("controller")
+                            .mapper("mapper")
+//                            .xml("mapper")
+                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml,path+"\\src\\main\\resources\\mapper"));
+                })
+                .strategyConfig(builder -> {
+                    builder.addInclude(tables)
+                            .addTablePrefix("t_")
+
+                            .serviceBuilder()
+                            .formatServiceFileName("%sService")
+                            .formatServiceImplFileName("%sServiceImpl")
+
+                            .entityBuilder()
+                            .enableLombok()
+                            .logicDeleteColumnName("rec_status")
+                            .enableTableFieldAnnotation()
+                            .idType(IdType.AUTO)
+//                            .superClass(BaseEntity.class)
+
+                            .controllerBuilder()
+                            .formatFileName("%sController")
+                            .enableRestStyle()
+
+                            .mapperBuilder()
+                            .superClass(BaseMapper.class)
+                            .formatMapperFileName("%sMapper")
+                            .enableMapperAnnotation()
+                            .formatXmlFileName("%sMapper");
+                })
+                 .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
+                .execute();
+    }
+}

+ 0 - 188
src/main/java/com/fdkankan/modeldemo/generator/MappingGeneratorOracle.java

@@ -1,188 +0,0 @@
-//package com.fdkankan.modeldemo.generator;
-//
-//import com.baomidou.mybatisplus.annotation.DbType;
-//import com.baomidou.mybatisplus.annotation.IdType;
-//import com.baomidou.mybatisplus.generator.AutoGenerator;
-//import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
-//import com.baomidou.mybatisplus.generator.config.GlobalConfig;
-//import com.baomidou.mybatisplus.generator.config.PackageConfig;
-//import com.baomidou.mybatisplus.generator.config.StrategyConfig;
-//import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
-//import com.baomidou.mybatisplus.generator.config.rules.DateType;
-//import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-//import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
-//
-///**
-// * 代码生成器
-// *
-// * <p>
-// * 根据数据库中的表生成:数据库表映射对象、Mapper 接口、Mapper XML 文件(含基础的 ResultMap 和字段代码片段)、 Service
-// * 接口、Service 接口实现累、基础的 Controller 类。
-// * </p>
-// * <p>
-// * 如果数据库设计符合规范,并且代码没有特殊要求。设置好表名前缀(无则忽略)、表字段前缀(无则忽略)后, 直接修改输出的路径、JDBC
-// * Url、数据库的账户和密码即可直接生成代码。
-// * </p>
-// * <p>
-// * 生成后将 Mapper 中的 xml 包中的 XML 文件移动到 resource 下即可,XML 存放文件夹名为 Mapper
-// * 接口包名(全包名)的同名文件夹<br/>
-// * 如 Mapper 接口包名为:com.example.mapper,那么在 resource 下新建同名文件夹:com.example.mapper,将
-// * xml 文件移动到该文件夹下即可。
-// * </p>
-// *
-// * @author wayne
-// * @since 2020-01-08 23:00
-// */
-//public class MappingGeneratorOracle {
-//
-//	/**
-//	 * 生成代码输出路径,<strong>路径必须是绝对路径,不需要包含包名</strong>
-//	 */
-//	private static final String OUTPUT_DIR = ".\\src\\main\\java\\com\\fdkankan\\modeldemo\\generator";
-//	/**
-//	 * 生成代码输出的包名
-//	 * <p>
-//	 * 总包名,后续生成的 Mapper,Service 等将在该包下生成子包
-//	 * </p>
-//	 */
-//	private static final String PACKAGE = "com.fdkankan.modeldemo";
-//	/**
-//	 * JDBC URL 说明: url地址前需要加上@,否则会报错
-//	 */
-//
-//	private static final String JDBC_URL = "jdbc:oracle:thin:@//10.180.41.39:1521/resdb";
-//	/**
-//	 * 数据库账户
-//	 */
-//	private static final String DB_USERNAME = "RES_VR";
-//	/**
-//	 * 数据库账户密码
-//	 */
-//	private static final String DB_PASSWORD = "IDCqawsed@123.";
-//
-//	/**
-//	 * 执行即可生成代码 需要添加 freemarker 依赖 <dependency> <groupId>org.freemarker</groupId>
-//	 * <artifactId>freemarker</artifactId> <version>2.3.29</version> </dependency>
-//	 */
-//	// 不要在src/main/java里面使用main方法,否则springboot项目某人为main方法的类就是启动类
-////	public static void main(String[] args) {
-////		autoGenerator().execute();
-////	}
-//
-//	public static AutoGenerator autoGenerator() {
-//		AutoGenerator autoGenerator = new AutoGenerator();
-//		autoGenerator.setGlobalConfig(globalConfig());
-//		autoGenerator.setDataSource(oracleDataSourceConfig());
-//		autoGenerator.setStrategy(strategyConfig());
-//		autoGenerator.setPackageInfo(packageConfig());
-//		autoGenerator.setTemplateEngine(new FreemarkerTemplateEngine());
-//		return autoGenerator;
-//	}
-//
-//	public static void main(String[] args) {
-//		autoGenerator().execute();
-//	}
-//
-//	/**
-//	 * 全局配置
-//	 *
-//	 * @return {@link GlobalConfig}
-//	 */
-//	private static GlobalConfig globalConfig() {
-//		GlobalConfig globalConfig = new GlobalConfig();
-//		globalConfig.setAuthor("dsx");
-//		// 设置代码输出位置,需要绝对路径
-//		globalConfig.setOutputDir(OUTPUT_DIR);
-//		// 覆盖已有的代码
-//		globalConfig.setFileOverride(false);
-//		// 基本表的 ResultMap
-//		globalConfig.setBaseResultMap(true);
-//		// 基本表字段片段
-//		globalConfig.setBaseColumnList(true);
-//		// 开启基于 Model 操作数据库
-//		globalConfig.setActiveRecord(true);
-//		// 设置 ID 类型
-//		globalConfig.setIdType(IdType.AUTO);
-//		globalConfig.setDateType(DateType.ONLY_DATE);
-////		// 生成基本 Swagger2 文档
-////		globalConfig.setSwagger2(true);
-//		// 开启二级缓存
-////		globalConfig.setEnableCache(true);
-//		// 设置生成的对象名称规则,%s 表示当前的 Entity
-//		// 数据库表映射对象名称规则
-//		globalConfig.setEntityName("%s");
-//		// 也可以使用下面这种就是末尾会以DO结尾
-////		globalConfig.setEntityName("%sDO");
-//		// Mapper 接口名称规则
-//		globalConfig.setMapperName("%sMapper");
-//		// Mapper XML 文件名称规则
-//		globalConfig.setXmlName("%sMapper");
-//		// Controller 生成规则
-//		globalConfig.setControllerName("%sController");
-//		// Service 接口生成名称规则
-//		globalConfig.setServiceName("%sService");
-//		// Service 实现类生成名称规则
-//		globalConfig.setServiceImplName("%sServiceImpl");
-//		return globalConfig;
-//	}
-//
-//	/**
-//	 * 生成策略配置
-//	 *
-//	 * @return StrategyConfig
-//	 */
-//	private static StrategyConfig strategyConfig() {
-//		StrategyConfig strategyConfig = new StrategyConfig();
-//		strategyConfig.setCapitalMode(false);
-//		strategyConfig.setEntityLombokModel(true);
-//		strategyConfig.setRestControllerStyle(true);
-//		strategyConfig.setNaming(NamingStrategy.underline_to_camel);
-//		strategyConfig.setColumnNaming(NamingStrategy.underline_to_camel);
-//		// TODO 填写表前缀、表字段前缀,生成代码时去除字段前缀
-//		strategyConfig.setTablePrefix("t_");
-//		strategyConfig.setFieldPrefix("a_", "c_", "e_", "f_", "p_", "r_", "t_", "tf_");
-//		strategyConfig.setInclude("T_FULLPHOTO_FILEINDEX");
-//		return strategyConfig;
-//	}
-//
-//	/**
-//	 * MySQL 数据源配置
-//	 *
-//	 * @return DataSourceConfig
-//	 */
-//	private static DataSourceConfig oracleDataSourceConfig() {
-//		DataSourceConfig dataSourceConfig = new DataSourceConfig();
-//		dataSourceConfig.setDbType(DbType.ORACLE);
-//		dataSourceConfig.setTypeConvert(new MySqlTypeConvert());
-//		dataSourceConfig.setDriverName("oracle.jdbc.driver.OracleDriver");
-//		dataSourceConfig.setUrl(JDBC_URL);
-//		dataSourceConfig.setUsername(DB_USERNAME);
-//		dataSourceConfig.setPassword(DB_PASSWORD);
-//		return dataSourceConfig;
-//	}
-//
-//	/**
-//	 * 包相关配置信息
-//	 * <p>
-//	 * 配置生成代码的包信息,如生成的 Mapper 包,Service 包等
-//	 * </p>
-//	 */
-//	private static PackageConfig packageConfig() {
-//		PackageConfig packageConfig = new PackageConfig();
-//		// 设置父包
-//		packageConfig.setParent(PACKAGE);
-//		// TODO 设置生成代码的包
-//		// Controller 包
-//		packageConfig.setController("controller");
-//		// 数据库表映射对象包
-//		packageConfig.setEntity("entity");
-//		// Mapper 接口包,含 XML 文件
-//		packageConfig.setMapper("mapper");
-//		// Service 接口包
-//		packageConfig.setService("service");
-//		// Service 接口实现类包
-//		packageConfig.setServiceImpl("service.impl");
-//		return packageConfig;
-//	}
-//}
-//

+ 14 - 0
src/main/java/com/fdkankan/modeldemo/httpclient/CustomHttpClient.java

@@ -6,6 +6,7 @@ import com.dtflys.forest.annotation.*;
 import com.dtflys.forest.extensions.DownloadFile;
 
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.Map;
 
 public interface CustomHttpClient {
@@ -26,4 +27,17 @@ public interface CustomHttpClient {
     @DownloadFile(dir = "{dir}", filename = "{fileName}")
     void downloadFile(@Var("url") String url, @Var("dir") String dir, @Var("fileName") String fileName);
 
+    @GetRequest(url = "{url}", connectTimeout = 6000, readTimeout = 3600000, maxRetryInterval = 5)
+    @DownloadFile(dir = "{dir}", filename = "{fileName}")
+    void downloadBigFile(@Var("url") String url, @Var("dir") String dir, @Var("fileName") String fileName);
+
+    @GetRequest(url = "{url}")
+    @Headers({
+            "Range: bytes={start}-",
+            "Accept-Encoding: identity"
+    })
+    void download(@Var("url") String url,
+                  @Var("start") long start,
+                  OutputStream os);
+
 }

+ 18 - 0
src/main/java/com/fdkankan/modeldemo/mapper/ManufacturerMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeldemo.mapper;
+
+import com.fdkankan.modeldemo.entity.Manufacturer;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2026-02-26
+ */
+@Mapper
+public interface ManufacturerMapper extends BaseMapper<Manufacturer> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeldemo/mapper/SceneOrigUploadMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeldemo.mapper;
+
+import com.fdkankan.modeldemo.entity.SceneOrigUpload;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 场景采集数据压缩包上传记录 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2026-02-27
+ */
+@Mapper
+public interface SceneOrigUploadMapper extends BaseMapper<SceneOrigUpload> {
+
+}

+ 2 - 4
src/main/java/com/fdkankan/modeldemo/mq/ConvertListener.java

@@ -51,8 +51,6 @@ import java.util.*;
 @Component
 public class ConvertListener{
 
-    public final static String baseZipPath = "/mnt/scene/convert/";
-
     public final static String file_type_key = "fileType";
 
     @Autowired
@@ -175,7 +173,7 @@ public class ConvertListener{
                     return "3".equals(obj.getString(file_type_key));
                 });
 
-                dataSource = baseZipPath + stationCode + "_" + entityId + "_" + DateUtil.format(upTime, DatePattern.PURE_DATETIME_PATTERN) + "/";
+                dataSource = Constant.WORK_DIR + stationCode + "_" + entityId + "_" + DateUtil.format(upTime, DatePattern.PURE_DATETIME_PATTERN) + "/";
                 String imagePath = dataSource + "images/";
                 String dataPath = dataSource + "data/";
                 String meshPath = dataPath + "mesh/";
@@ -223,7 +221,7 @@ public class ConvertListener{
                 });
 
                 // 转换并上传文件
-                convertUtil.convert(dataSource, entityId, stationCode, upTime, convertType, upTimeKey);
+                convertUtil.convert(dataSource, entityId, stationCode, upTime, upTimeKey);
             }
 
             sceneConvertLog.setStatus("1");

+ 2 - 0
src/main/java/com/fdkankan/modeldemo/service/FYunFileService.java

@@ -17,4 +17,6 @@ public interface FYunFileService {
 
     String downloadFile(String num, Integer subgroup, String upTime, String key, String dir, String fileName);
 
+    String downloadBigFile(String bucketName, String objectName, String dir, String fileName);
+
 }

+ 9 - 0
src/main/java/com/fdkankan/modeldemo/service/HttpInterfaceService.java

@@ -0,0 +1,9 @@
+package com.fdkankan.modeldemo.service;
+
+import com.fdkankan.modeldemo.bean.EntityInfo;
+import com.fdkankan.modeldemo.bean.StationInfo;
+
+public interface HttpInterfaceService {
+    public EntityInfo getRoomEntityByStatCodeAndID(String stationCode, String entityID);
+    public StationInfo getStationInfoByCode(String stationCode);
+}

+ 3 - 0
src/main/java/com/fdkankan/modeldemo/service/IConvertService.java

@@ -1,6 +1,7 @@
 package com.fdkankan.modeldemo.service;
 
 import com.fdkankan.modeldemo.dto.SendConvertDTO;
+import com.fdkankan.modeldemo.entity.SceneOrigUpload;
 
 /**
  * 转换接口类
@@ -10,5 +11,7 @@ public interface IConvertService {
 
     void sendConvert(SendConvertDTO dto);
 
+    void convertHandler(SceneOrigUpload sceneOrigUpload);
+
 
 }

+ 20 - 0
src/main/java/com/fdkankan/modeldemo/service/ManufacturerService.java

@@ -0,0 +1,20 @@
+package com.fdkankan.modeldemo.service;
+
+import com.fdkankan.modeldemo.bean.ResultData;
+import com.fdkankan.modeldemo.entity.Manufacturer;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2026-02-26
+ */
+public interface ManufacturerService extends IService<Manufacturer> {
+
+    ResultData getResultData(String manuId, String manuName, String manuDesc) throws NoSuchAlgorithmException;
+}

+ 21 - 0
src/main/java/com/fdkankan/modeldemo/service/SceneOrigUploadService.java

@@ -0,0 +1,21 @@
+package com.fdkankan.modeldemo.service;
+
+import com.fdkankan.modeldemo.bean.ResultData;
+import com.fdkankan.modeldemo.entity.SceneOrigUpload;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ * 场景采集数据压缩包上传记录 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2026-02-27
+ */
+public interface SceneOrigUploadService extends IService<SceneOrigUpload> {
+
+    ResultData uploadRsaFileZipView(String stationCode, String roomEntityID, MultipartFile file, String manufact, String encrypt);
+
+    SceneOrigUpload popOneWaitingTask();
+}

+ 64 - 0
src/main/java/com/fdkankan/modeldemo/service/impl/ConvertServiceImpl.java

@@ -1,17 +1,45 @@
 package com.fdkankan.modeldemo.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.exceptions.ExceptionUtil;
+import cn.hutool.core.img.ImgUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.CharsetUtil;
+import cn.hutool.core.util.ZipUtil;
+import com.alibaba.fastjson.JSON;
 import com.fdkankan.modeldemo.constant.Constant;
 import com.fdkankan.modeldemo.dto.SendConvertDTO;
+import com.fdkankan.modeldemo.entity.SceneOrigUpload;
+import com.fdkankan.modeldemo.service.FYunFileService;
 import com.fdkankan.modeldemo.service.IConvertService;
+import com.fdkankan.modeldemo.service.SceneOrigUploadService;
+import com.fdkankan.modeldemo.utils.ConvertUtil;
+import com.fdkankan.modeldemo.utils.MinioUtil;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.List;
+
+@Slf4j
 @Service
 public class ConvertServiceImpl implements IConvertService {
 
     @Autowired
     private RabbitMqProducer mqProducer;
+    @Resource
+    private MinioUtil minioUtil;
+    @Autowired
+    private FYunFileService fYunFileService;
+    @Autowired
+    private SceneOrigUploadService sceneOrigUploadService;
+    @Autowired
+    private ConvertUtil convertUtil;
 
     /**
      * 发送转换请求
@@ -21,4 +49,40 @@ public class ConvertServiceImpl implements IConvertService {
     public void sendConvert(SendConvertDTO dto) {
         mqProducer.sendByWorkQueue(Constant.QUEUE_SCENE_CONVERT, dto);
     }
+
+    @Override
+    public void convertHandler(SceneOrigUpload sceneOrigUpload) {
+        try {
+            //创建工作目录
+            String workDir = Constant.WORK_DIR + DateUtil.format(sceneOrigUpload.getUploadTime(), DatePattern.PURE_DATETIME_PATTERN) + "/";
+            String dataSource = workDir + sceneOrigUpload.getStationCode() + "_" + sceneOrigUpload.getRoomEntityId() + "/";
+            FileUtil.mkdir(workDir);
+            //下载压缩包
+            String zipFilePath = fYunFileService.downloadBigFile(sceneOrigUpload.getBucketName(), sceneOrigUpload.getObjectName(), workDir, sceneOrigUpload.getObjectName());
+            //解压
+            ZipUtil.unzip(zipFilePath, workDir, CharsetUtil.CHARSET_GBK);
+            String imagePath = dataSource + "images/";
+            String image512Path = imagePath + "512/";
+            String image4kPath = imagePath + "4k/";
+            boolean exists512 = CollUtil.isNotEmpty(FileUtil.listFileNames(image512Path)) ? true : false;
+            //如果4k图不存在,则需要从8k中切出来
+            //如果512图不存在,就需要从4k图中切
+            if(!exists512){
+                FileUtil.mkdir(image512Path);
+                List<File> fileList = FileUtil.loopFiles(image4kPath);
+                for (File file : fileList) {
+                    ImgUtil.scale(file, new File(image512Path + file.getName()), 0.125f);
+                }
+            }
+            //开始调用算法进行处理
+            String upTimeKey = DateUtil.format(sceneOrigUpload.getUploadTime(), DatePattern.PURE_DATETIME_PATTERN);
+            convertUtil.convert(dataSource, sceneOrigUpload.getRoomEntityId(), sceneOrigUpload.getStationCode(), sceneOrigUpload.getUploadTime(), upTimeKey);
+            sceneOrigUpload.setConvertStatus(1);
+        }catch (Exception e){
+            log.error("场景转换失败:{}", JSON.toJSONString(sceneOrigUpload), e);
+            sceneOrigUpload.setConvertStatus(-1);
+            sceneOrigUpload.setRemark(ExceptionUtil.stacktraceToString(e, 4000));
+        }
+        sceneOrigUploadService.updateById(sceneOrigUpload);
+    }
 }

+ 37 - 3
src/main/java/com/fdkankan/modeldemo/service/impl/FYunFileServiceImpl.java

@@ -19,9 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.Objects;
@@ -142,6 +140,42 @@ public class FYunFileServiceImpl implements FYunFileService {
         return dir + fileName;
     }
 
+    @Override
+    public String downloadBigFile(String bucketName, String objectName, String dir, String fileName) {
+        String url = minioProperties.getAddress().concat(minioProperties.getApi().getDownload().replace(UploadFilePath.BUCKET_NAME, bucketName).replace(UploadFilePath.OBJECT_NAME, objectName));
+        customHttpClient.downloadBigFile(url, dir, fileName);
+        if(dir.endsWith("/")){
+            dir += "/";
+        }
+        return dir + fileName;
+    }
+
+    public void downloadWithResume(String url, File file) throws Exception {
+
+        long start = 0;
+
+        if (file.exists()) {
+            start = file.length(); // 已下载大小
+        }
+
+        try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
+
+            raf.seek(start);
+
+            customHttpClient.download(url, start, new OutputStream() {
+                @Override
+                public void write(byte[] b, int off, int len) throws IOException {
+                    raf.write(b, off, len);
+                }
+
+                @Override
+                public void write(int b) throws IOException {
+                    raf.write(b);
+                }
+            });
+        }
+    }
+
 //    @Override
 //    public void uploadMulFiles(String num, Integer subgroup, String upTime, Map<String, String> map) {
 //        if(CollUtil.isEmpty(map)){

+ 145 - 0
src/main/java/com/fdkankan/modeldemo/service/impl/HttpInterfaceServiceImpl.java

@@ -0,0 +1,145 @@
+package com.fdkankan.modeldemo.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.modeldemo.bean.EntityInfo;
+import com.fdkankan.modeldemo.bean.StationInfo;
+import com.fdkankan.modeldemo.service.HttpInterfaceService;
+import com.fdkankan.modeldemo.utils.HttpClientUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * 有关外部 HTTP REST 相关协议调用服务类
+ */
+@Service
+@Slf4j
+public class HttpInterfaceServiceImpl implements HttpInterfaceService {
+
+    private static final String ENTITY_NAME =" 机房实物名称:";
+    private static final String ENTITY_ID ="ENTITY_ID";
+    private static final String ENTITY_ID2 =" 机房实物ID:";
+    private static final String STATION_CODE =" 站址编码:";
+    private static final String STATION_CODE2 ="STATION_CODE";
+    private static final String ERROR_MSG ="接口服务获取异常:";
+    private static final String ENTITY_NAME2 ="ENTITY_NAME";
+    private static final String ERROR_MSG2 ="站址编码、机房实物名称 获取结果有多个记录,匹配异常.";
+    private static final String ERROR_MSG3 ="站址编码、机房实物名称 获取结果为空!";
+    private static final String ERROR_MSG4 =" 接口获取数据异常:";
+    private static final String ERROR_MSG5 =" 接口获取数据失败,结果为空! 站址编码:";
+    private static final String ERROR_MSG6 ="参数信息:";
+    private static final String ERROR_MSG7 ="输入参数异常. 站址编码:";
+    private static final String RESULT_MSG ="resultMsg";
+    private static final String RESULT_CODE ="resultCode";
+    private static final String KEYWORD_TYPE ="keywordType";
+    private static final String VALUE ="value";
+    private static final String OPERATOR ="operator";
+    private static final String INPUT ="input";
+    private static final String KEYWORD ="keyword";
+
+    @Value("${stationInfoUrl}")
+    private String stationInfoUrl;
+    @Value("${searchEntityUrl}")
+    private String searchEntityUrl;
+
+    /**
+     *   根据传入站址编码、机房实物名称,获取机房实物ID
+     * @param stationCode  站址编码
+     * @param entityID   机房实物ID
+     * @return  机房实物ID
+     */
+    public EntityInfo getRoomEntityByStatCodeAndID(String stationCode, String entityID) {
+
+        //组织接口参数信息
+        JSONObject params = new JSONObject();
+        JSONArray paramArr = new JSONArray();
+        JSONObject stationCodes = new JSONObject();
+        stationCodes.put(KEYWORD,STATION_CODE2);
+        stationCodes.put(KEYWORD_TYPE,INPUT);
+        stationCodes.put(OPERATOR,"=");
+        stationCodes.put(VALUE,new String[]{stationCode});
+        paramArr.add(stationCodes);
+
+        JSONObject entityNames = new JSONObject();
+        entityNames.put(KEYWORD,ENTITY_ID);
+        entityNames.put(KEYWORD_TYPE,INPUT);
+        entityNames.put(OPERATOR,"=");
+        entityNames.put(VALUE,new String[]{entityID});
+        paramArr.add(entityNames);
+        params.put("params",paramArr.toString());
+        try {
+            String result = HttpClientUtil.doPostJson(searchEntityUrl, params.toString());
+
+            if(StrUtil.isEmpty(result) || !JSONUtil.isJson(result)){
+                log.error(searchEntityUrl + ERROR_MSG5 + stationCode + ENTITY_ID2 + entityID + ERROR_MSG6 + params);
+                throw new RuntimeException(searchEntityUrl+ERROR_MSG5+stationCode+ENTITY_ID2+entityID);
+            }
+
+            Map<String, Object> parse = JSON.parseObject(result);
+            if(parse==null && parse.get(RESULT_CODE) != "0"){
+                log.error(searchEntityUrl + ERROR_MSG4 + parse == null ? "" : (String) parse.get(RESULT_MSG));
+                throw new RuntimeException(searchEntityUrl+ERROR_MSG4+(parse==null?"":parse.get(RESULT_MSG)));
+            }
+            JSONArray retnDate = JSON.parseArray(parse.get("data").toString());
+            if(retnDate.size()==0){
+                log.error(ERROR_MSG3);
+                return null;
+            }else if(retnDate.size()>1){
+                log.error(ERROR_MSG2);
+                return null;
+            }
+            //都正常 生成  vo 对象
+            JSONObject currObj = (JSONObject)retnDate.get(0);
+            if(currObj.get(ENTITY_ID)==null){
+                return null;
+            }
+            EntityInfo outRslt = new EntityInfo();
+            outRslt.setENTITY_ID(currObj.get(ENTITY_ID)==null?"":currObj.get(ENTITY_ID).toString());
+            outRslt.setENTITY_NAME(currObj.get(ENTITY_NAME2)==null?"":currObj.get(ENTITY_NAME2).toString());
+            return outRslt;
+        } catch (IOException e) {
+            log.error(ERROR_MSG+e.getMessage()+STATION_CODE+stationCode+ENTITY_ID2+entityID+ERROR_MSG6+params);
+            throw new RuntimeException(ERROR_MSG+e.getMessage()+STATION_CODE+stationCode+ENTITY_ID2+entityID);
+        }
+    }
+
+
+    /**
+     * 根据传入站址编码获取省分、地市编码
+     * @param stationCode  站址编码
+     */
+    public StationInfo getStationInfoByCode(String stationCode){
+
+        String requestUrl = stationInfoUrl +stationCode;
+        String getData = HttpClientUtil.doGet(requestUrl,null);
+
+        if(StrUtil.isEmpty(getData)){
+            log.error(requestUrl+" 接口获取数据失败,结果为空!");
+            throw new RuntimeException(requestUrl+" 接口获取数据失败,结果为空!");
+        }
+
+        Map<String, Object> parse = JSON.parseObject(getData);
+        if(parse==null && parse.get(RESULT_CODE) != "0"){
+            log.error(requestUrl+ERROR_MSG4+parse==null?"": (String) parse.get(RESULT_MSG));
+            throw new RuntimeException(requestUrl+ERROR_MSG4+(parse==null?"":parse.get(RESULT_MSG)));
+        }
+        //都正常 生成  vo 对象
+        Map<String,Object>  dataInfo = (Map<String, Object>) parse.get("data");
+        StationInfo outRslt = new StationInfo();
+        outRslt.setSTATION_CODE(dataInfo.get(STATION_CODE2)==null?"":dataInfo.get(STATION_CODE2).toString());
+        outRslt.setSTATION_ID(dataInfo.get("STATION_ID")==null?"":dataInfo.get("STATION_ID").toString());
+        outRslt.setDISTRICT_COUNTY_ID(dataInfo.get("DISTRICT_COUNTY_ID")==null?"":dataInfo.get("DISTRICT_COUNTY_ID").toString());
+        outRslt.setDISTRICT_REGION_ID(dataInfo.get("DISTRICT_REGION_ID")==null?"":dataInfo.get("DISTRICT_REGION_ID").toString());
+        outRslt.setDISTRICT_PROVINCE_ID(dataInfo.get("DISTRICT_PROVINCE_ID")==null?"":dataInfo.get("DISTRICT_PROVINCE_ID").toString());
+        outRslt.setLAN_ID(dataInfo.get("LAN_ID")==null?"":dataInfo.get("LAN_ID").toString());
+        return outRslt;
+    }
+
+}

+ 40 - 0
src/main/java/com/fdkankan/modeldemo/service/impl/ManufacturerServiceImpl.java

@@ -0,0 +1,40 @@
+package com.fdkankan.modeldemo.service.impl;
+
+import com.fdkankan.modeldemo.bean.ResultData;
+import com.fdkankan.modeldemo.entity.Manufacturer;
+import com.fdkankan.modeldemo.mapper.ManufacturerMapper;
+import com.fdkankan.modeldemo.service.ManufacturerService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.modeldemo.utils.RsaCryptTools;
+import org.springframework.stereotype.Service;
+
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2026-02-26
+ */
+@Service
+public class ManufacturerServiceImpl extends ServiceImpl<ManufacturerMapper, Manufacturer> implements ManufacturerService {
+
+    private static final String MANU_PRI_KEY = "********";
+
+    @Override
+    public ResultData getResultData(String manuId, String manuName, String manuDesc) throws NoSuchAlgorithmException {
+        Manufacturer reBdManu = new Manufacturer();
+        reBdManu.setManuId(manuId);
+        reBdManu.setManuName(manuName);
+        reBdManu.setManuDesc(manuDesc);
+        //测试发现  站址编码+机房实体id+文件Md5  需要长度 1024 才满足其要求
+        RsaCryptTools.SecretKey secretKey= RsaCryptTools.generateSecretKey(1024);
+        reBdManu.setManuPrikey(secretKey.getPrivateKey());
+        reBdManu.setManuPubkey(secretKey.getPublicKey());
+        this.saveOrUpdate(reBdManu);
+        reBdManu.setManuPrikey(MANU_PRI_KEY);
+        return ResultData.ok(reBdManu);
+    }
+}

+ 217 - 0
src/main/java/com/fdkankan/modeldemo/service/impl/SceneOrigUploadServiceImpl.java

@@ -0,0 +1,217 @@
+package com.fdkankan.modeldemo.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.CharsetUtil;
+import cn.hutool.core.util.ZipUtil;
+import com.fdkankan.modeldemo.bean.EntityInfo;
+import com.fdkankan.modeldemo.bean.ResultData;
+import com.fdkankan.modeldemo.bean.StationInfo;
+import com.fdkankan.modeldemo.constant.UploadFilePath;
+import com.fdkankan.modeldemo.entity.Manufacturer;
+import com.fdkankan.modeldemo.entity.SceneOrigUpload;
+import com.fdkankan.modeldemo.mapper.SceneOrigUploadMapper;
+import com.fdkankan.modeldemo.service.FYunFileService;
+import com.fdkankan.modeldemo.service.HttpInterfaceService;
+import com.fdkankan.modeldemo.service.ManufacturerService;
+import com.fdkankan.modeldemo.service.SceneOrigUploadService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.modeldemo.utils.FileUtil;
+import com.fdkankan.modeldemo.utils.MinioUtil;
+import com.fdkankan.modeldemo.utils.RsaCryptTools;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.Date;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * <p>
+ * 场景采集数据压缩包上传记录 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2026-02-27
+ */
+@Slf4j
+@Service
+public class SceneOrigUploadServiceImpl extends ServiceImpl<SceneOrigUploadMapper, SceneOrigUpload> implements SceneOrigUploadService {
+
+    private static String zipFileSeparator = "_";
+    private static final String LOG_MSG = "本次收到的360VR视图,数据包文件处理出错.站址编码[%s],机房实物ID[%s].错误:[%s]";
+
+    @Value("${zipfilePath}")
+    private String zipfilePath;
+    @Value("${imagesVision}")
+    private String imagesVision;
+    @Value("${dataFloorplan}")
+    private String dataFloorplan;
+    @Value("${dataScene}")
+    private String dataScene;
+    @Value("${image4k}")
+    private String image4k;
+    @Value("${dataMesh}")
+    private String dataMesh;
+    @Autowired
+    private HttpInterfaceService httpInterfaceService;
+    @Autowired
+    private ManufacturerService manufacturerService;
+    @Resource
+    private MinioUtil minioUtil;
+
+    @Override
+    public ResultData uploadRsaFileZipView(String stationCode, String roomEntityID, MultipartFile file, String manufact, String encrypt) {
+        try {
+            String inFileMd5 = FileUtil.getMulFileMD5(file);
+
+            //获取厂商 密钥等信息
+            Manufacturer queryRslt = manufacturerService.getById(manufact);
+            if(queryRslt == null){
+                return ResultData.error(-1, String.format("本次收到的360VR视图,厂商标识[%s]在资源系统中无实际数据.", manufact));
+            }
+
+            //密文解密
+            String decryRslt = "";
+            try {
+                decryRslt = RsaCryptTools.decryptData(encrypt, queryRslt.getManuPrikey());
+            }catch (Exception ex){ //公钥解密异常
+                return ResultData.error(-1, String.format("本次收到的360VR视图上传请求未通过[%s]厂商的密文[%s]解密失败.", manufact, encrypt));
+            }
+
+            //站址编码+机房ID+数据包文件MD5值
+            String currFileKey = String.format("%s+%s+%s", stationCode, roomEntityID,inFileMd5);
+
+            //验证密钥结果信息
+            if(!decryRslt.equals(currFileKey)){
+                //解密后的字符 不匹配
+                return ResultData.error(-1, String.format("本次收到的360VR视图上传请求未通过[%s]厂商的密文[%s]解密后[%s]与接口参数[%s]比对不一致.", manufact, encrypt, decryRslt, currFileKey));
+            }
+
+            //根据传入站址编码、机房实物名称,获取机房实物ID
+            EntityInfo roomEntityInfo = httpInterfaceService.getRoomEntityByStatCodeAndID(stationCode, roomEntityID);
+            if(roomEntityInfo == null){
+                return ResultData.error(-1, String.format("本次收到的360VR视图,机房实物ID[%s]在资源系统中无实际数据.所属站址[%s]", roomEntityID, stationCode));
+            }
+
+            //获取 省市编码
+            StationInfo stationInfo= httpInterfaceService.getStationInfoByCode(stationCode);
+            if(stationInfo == null){
+                return ResultData.error(-1, String.format("本次收到的360VR视图,站址编码[%s]在资源系统中无实际数据.", stationCode));
+            }
+
+            //开始压缩包处理
+            //1、校验必要文件是否存在
+            //2、上传压缩包到minio
+            return handZipFile(stationInfo, roomEntityInfo, file, manufact);
+        }catch (Exception ex){
+            log.error(String.format(LOG_MSG, stationCode, roomEntityID,ex.getMessage()));
+            return ResultData.error(-1, String.format(LOG_MSG, stationCode, roomEntityID, ex.getMessage()));
+        }
+    }
+
+    private ResultData handZipFile(StationInfo stationInfo,EntityInfo roomEntityInfo,MultipartFile file,String manufact){
+        String zipFileFullName = "";
+        String zipSaveDir = null;
+        try{
+            //2023-03-22 修改 机房目录名:“站址编码-机房实物ID”
+            String currRoomDirName = stationInfo.getSTATION_CODE()+zipFileSeparator+roomEntityInfo.getENTITY_ID();
+
+            //创建zip压缩原始文件保存目录   zip文件解压目录。(临时目录)
+            zipSaveDir = zipfilePath + stationInfo.getDISTRICT_PROVINCE_ID() + File.separator + stationInfo.getDISTRICT_REGION_ID() + File.separator + currRoomDirName + File.separator;
+
+            //清空 zip保存路径,并重建
+            FileUtil.del(zipSaveDir);
+            FileUtil.mkdir(zipSaveDir);
+
+            //判断文件是否为空,不为空时,保存文件
+            zipFileFullName = zipSaveDir+file.getOriginalFilename();
+            file.transferTo(new File(zipFileFullName));
+            //删除原机房实物文件目录 并重新创建
+            String checkDelPath = zipSaveDir+currRoomDirName;
+            //原始解压文件目录清空 并重建
+            FileUtil.del(checkDelPath);
+            FileUtil.mkdir(checkDelPath);
+
+            //解压
+            ZipUtil.unzip(zipFileFullName, zipSaveDir, CharsetUtil.CHARSET_GBK);
+            //获取解压后的文件信息 并入库保存(主键ID)
+            String newUpUUID = UUID.randomUUID().toString();
+            //点位数据文件
+            String fvisonPathFile = checkDelPath + imagesVision;
+            //小地图json 文件
+            String fdataFloorplan = checkDelPath + dataFloorplan;
+
+            //2023-07-04 增加 点位文件  和 位图文件的 大小监测(-1 或者 0)  那么就提示异常
+            long sizeFvisonFile = FileUtil.size(new File(fvisonPathFile));
+            long sizeFDataFloor = FileUtil.size(new File(fdataFloorplan));
+
+            //校验vision.txt文件是否正常
+            if(sizeFvisonFile<=0){
+                return ResultData.error(-1, String.format("本次收到的360VR视图数据包文件处理出错,点位文件[%s] 不存在或大小为0.站址编码[%s],机房实物ID[%s]",sizeFvisonFile, stationInfo.getSTATION_CODE(), roomEntityInfo.getENTITY_ID()));
+            }
+
+            if( sizeFDataFloor<=0){
+                return ResultData.error(-1, String.format("本次收到的360VR视图数据包文件处理出错,小地图文件[%s] 不存在或大小为0.站址编码[%s],机房实物ID[%s]",String.valueOf(fdataFloorplan), stationInfo.getSTATION_CODE(), roomEntityInfo.getENTITY_ID()));
+            }
+
+            //其他 data
+            String fdataScene = checkDelPath + dataScene;
+            String fmage4k = checkDelPath+image4k;
+
+            long sizeFdataSceneFile = FileUtil.size(new File(fdataScene));
+            if(CollUtil.isEmpty(FileUtil.listFileNames(fmage4k))){
+                return ResultData.error(-1, String.format("本次收到的360VR视图数据包文件处理出错,4k图片目录不存在[%s] .站址编码[%s],机房实物ID[%s]",fmage4k,stationInfo.getSTATION_CODE(), roomEntityInfo.getENTITY_ID()));
+            }
+            //文件不存在 或 大小为 0
+            if(sizeFdataSceneFile<=0 ){
+                return ResultData.ok(String.format("本次收到的360VR视图数据包文件处理出错,场景文件[%s] 不存在或大小为0.站址编码[%s],机房实物ID[%s]",fdataScene,stationInfo.getSTATION_CODE(), roomEntityInfo.getENTITY_ID()));
+            }
+
+            String fdataMesh =  checkDelPath + dataMesh;
+            long sizefDataMeshSize = FileUtil.size(new File(fdataMesh));
+            //文件不存在 或 大小为 0
+            if(sizefDataMeshSize<=0){
+                return ResultData.error(-1, String.format("本次收到的360VR视图数据包文件处理出错,3D模型文件[%s] 不存在或大小为0.站址编码[%s],机房实物ID[%s]",fdataMesh,stationInfo.getSTATION_CODE(), roomEntityInfo.getENTITY_ID()));
+            }
+
+            //上传压缩包
+            String objectName = UUID.randomUUID() + ".zip";
+            Map<String, String> upload = minioUtil.upload(zipFileFullName, objectName);
+            String bucketName = upload.get(UploadFilePath.BUCKET_NAME);
+            SceneOrigUpload sceneOrigUpload = new SceneOrigUpload();
+            sceneOrigUpload.setObjectName(objectName);
+            sceneOrigUpload.setBucketName(bucketName);
+            sceneOrigUpload.setUploadTime(new Date());
+            sceneOrigUpload.setManuId(manufact);
+            sceneOrigUpload.setRoomEntityId(roomEntityInfo.getENTITY_ID());
+            sceneOrigUpload.setStationCode(stationInfo.getSTATION_CODE());
+            this.save(sceneOrigUpload);
+
+            return ResultData.ok(String.format("本次收到的360VR视图数据包文件处理结束.站址编码[%s],机房实物ID[%s],上传记录id[%s]", stationInfo.getSTATION_CODE(), roomEntityInfo.getENTITY_ID(),newUpUUID));
+        }catch(Exception ex){
+            log.error(String.format(LOG_MSG, stationInfo.getSTATION_CODE(), roomEntityInfo.getENTITY_ID(),ex.getMessage()), ex);
+            return ResultData.error(-1, String.format(LOG_MSG, stationInfo.getSTATION_CODE(), roomEntityInfo.getENTITY_ID(),ex.getMessage()));
+        }
+        finally {
+
+        }
+    }
+
+    @Transactional
+    @Override
+    public SceneOrigUpload popOneWaitingTask() {
+        SceneOrigUpload one = lambdaQuery().eq(SceneOrigUpload::getConvertStatus, 0).orderByAsc(SceneOrigUpload::getId).last("limit 1 FOR UPDATE SKIP LOCKED").one();
+        if(one == null){
+            return null;
+        }
+        one.setConvertStatus(2);
+        this.updateById(one);
+        return one;
+    }
+}

+ 27 - 0
src/main/java/com/fdkankan/modeldemo/task/TaskJob.java

@@ -0,0 +1,27 @@
+package com.fdkankan.modeldemo.task;
+
+import com.fdkankan.modeldemo.entity.SceneOrigUpload;
+import com.fdkankan.modeldemo.service.IConvertService;
+import com.fdkankan.modeldemo.service.SceneOrigUploadService;
+import com.fdkankan.modeldemo.service.impl.ConvertServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+@Component
+public class TaskJob {
+
+    @Autowired
+    private SceneOrigUploadService sceneOrigUploadService;
+    @Autowired
+    private IConvertService convertService;
+
+    @Scheduled(fixedDelay = 5000)
+    public void execute() {
+        SceneOrigUpload sceneOrigUpload = sceneOrigUploadService.popOneWaitingTask();
+        if(sceneOrigUpload == null){
+            return;
+        }
+        convertService.convertHandler(sceneOrigUpload);
+    }
+}

+ 1 - 1
src/main/java/com/fdkankan/modeldemo/utils/ConvertUtil.java

@@ -109,7 +109,7 @@ public class ConvertUtil {
         }
     }
 
-    public Map<String, String> convert(String sourcePath, String num, String stationCode, Date upTime, String convertType, String upTimeKey) throws Exception {
+    public Map<String, String> convert(String sourcePath, String num, String stationCode, Date upTime, String upTimeKey) throws Exception {
 
         Map<String, String> map = new HashMap<>();
         String dataViewPath = String.format(Constant.DATA_VIEW_PATH, num);

+ 126 - 0
src/main/java/com/fdkankan/modeldemo/utils/FileUtil.java

@@ -0,0 +1,126 @@
+package com.fdkankan.modeldemo.utils;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.io.*;
+import java.security.MessageDigest;
+
+@Slf4j
+public class FileUtil extends cn.hutool.core.io.FileUtil {
+ 
+    /**
+     * 本地文件转为MultipartFile
+     *
+     * @param picPath
+     * @return
+     */
+    public static MultipartFile pathToMultipartFile(String picPath) throws Exception{
+        FileItem fileItem = createFileItem(picPath);
+        MultipartFile mfile = new CommonsMultipartFile(fileItem);
+        return mfile;
+    }
+ 
+    /**
+     * 将file转换成fileItem
+     *
+     * @param filePath
+     * @return
+     */
+    public static FileItem createFileItem(String filePath) throws Exception{
+        FileItemFactory factory = new DiskFileItemFactory(16, null);
+        String textFieldName = "textField";
+ 
+        FileItem item = factory.createItem(textFieldName, "text/plain", true, "MyFileName");
+        File newfile = new File(filePath);
+        int bytesRead = 0;
+        byte[] buffer = new byte[8192];
+        FileInputStream fis = null;
+        OutputStream os = null;
+        try {
+            fis = new FileInputStream(newfile);
+            os = item.getOutputStream();
+            while ((bytesRead = fis.read(buffer, 0, 8192)) != -1) {
+                os.write(buffer, 0, bytesRead);
+            }
+        } catch (IOException e) {
+            log.error("createFileItem:文件转换异常!",e);
+            throw e;
+        } finally {
+            try {
+                if (null != os){
+                    os.close();
+                }
+                if (null != fis){
+                    fis.close();
+                }
+            } catch (IOException e) {
+                log.error("createFileItem:关流异常!",e);
+            }
+        }
+        return item;
+    }
+
+    /**
+     * 获取一个文件的md5值(可处理大文件)
+     * @return md5 value
+     */
+    public static String getMulFileMD5(InputStream fileInputStream) {
+        try {
+            MessageDigest MD5 = MessageDigest.getInstance("SHA-256");
+            byte[] buffer = new byte[8192];
+            int length;
+            while ((length = fileInputStream.read(buffer)) != -1) {
+                MD5.update(buffer, 0, length);
+            }
+            return new String(Hex.encodeHex(MD5.digest())).substring(0,32);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        } finally {
+            try {
+                if (fileInputStream != null){
+                    fileInputStream.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    /**
+     * 获取一个文件的md5值(可处理大文件)
+     * @return md5 value
+     */
+    public static String getMulFileMD5(MultipartFile file) {
+        InputStream fileInputStream = null;
+        try {
+//            MessageDigest MD5 = MessageDigest.getInstance("MD5");
+            MessageDigest MD5 = MessageDigest.getInstance("SHA-256");
+            fileInputStream = file.getInputStream();
+            byte[] buffer = new byte[8192];
+            int length;
+            while ((length = fileInputStream.read(buffer)) != -1) {
+                MD5.update(buffer, 0, length);
+            }
+            return new String(Hex.encodeHex(MD5.digest())).substring(0,32);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        } finally {
+            try {
+                if (fileInputStream != null){
+                    fileInputStream.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 460 - 0
src/main/java/com/fdkankan/modeldemo/utils/HttpClientUtil.java

@@ -0,0 +1,460 @@
+package com.fdkankan.modeldemo.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.CookieStore;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.cookie.BasicClientCookie;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ *
+ * Http工具类
+ *
+ * <pre>
+ * 非证书请求
+ * </pre>
+ *
+ * @author: 张志宏
+ * @email: it_javasun@yeah.net
+ * @date:2015年7月3日 下午4:20:48
+ * @since 1.0.0
+ */
+@Slf4j
+@SuppressWarnings("all")
+public class HttpClientUtil {
+    private final static transient Log logger = LogFactory.getLog(HttpClientUtil.class);
+
+    public static final String CHARSET = "UTF-8";
+    public static final int CONNECT_TIMEOUT = 10 * 10000;
+
+    private static CloseableHttpClient httpClient;
+
+    static {
+        RequestConfig config = RequestConfig.custom()
+                .setConnectionRequestTimeout(CONNECT_TIMEOUT)
+                .setConnectTimeout(CONNECT_TIMEOUT)
+                .setSocketTimeout(CONNECT_TIMEOUT).build();
+        httpClient = HttpClientBuilder.create().setDefaultRequestConfig(config).build();
+    }
+
+    /**
+     * <p>
+     * 外部调用的GET方法
+     * </p>
+     *
+     * @param url
+     *            请求地址
+     * @param params
+     *            请求参数
+     * @return String 返回请求串
+     * @author: 张志宏
+     * @date:2015年7月3日 下午12:01:13
+     * @since 1.0.0
+     */
+    public static String doGet(String url, Map<String, String> params) {
+        return doGet(url, params, CHARSET);
+    }
+
+    /**
+     *
+     * <p>
+     * 外部调用的POST方法
+     * </p>
+     *
+     * @param url
+     *            请求地址
+     * @param params
+     *            请求参数
+     * @return String 返回请求串
+     * @author: 张志宏
+     * @date:2015年7月3日 下午12:02:03
+     * @since 1.0.0
+     */
+    public static String doPost(String url, Map<String, String> params) {
+        return doPost(url, params, CHARSET);
+    }
+
+    /**
+     * HTTP Get 获取内容
+     *
+     * @param url
+     *            请求的url地址 ?之前的地址
+     * @param params
+     *            请求的参数
+     * @param charset
+     *            编码格式
+     * @return 页面内容
+     */
+    public static String doGet(String url, Map<String, String> params,
+                               String charset) {
+        if (StringUtils.isBlank(url)) {
+            return null;
+        }
+        try {
+            if (params != null && !params.isEmpty()) {
+                List<NameValuePair> pairs = new ArrayList<NameValuePair>(
+                        params.size());
+                for (Map.Entry<String, String> entry : params.entrySet()) {
+                    String value = entry.getValue();
+                    if (value != null) {
+                        pairs.add(new BasicNameValuePair(entry.getKey(), value));
+                    }
+                }
+                url += "?"
+                        + EntityUtils.toString(new UrlEncodedFormEntity(pairs,
+                        charset));
+            }
+            HttpGet httpGet = new HttpGet(url);
+            CloseableHttpResponse response = httpClient.execute(httpGet);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode != 200) {
+                httpGet.abort();
+                throw new RuntimeException("HttpClient,error status code :"
+                        + statusCode);
+            }
+            HttpEntity entity = response.getEntity();
+            String result = null;
+            if (entity != null) {
+                result = EntityUtils.toString(entity, "utf-8");
+            }
+            EntityUtils.consume(entity);
+            response.close();
+            return result;
+        } catch (Exception e) {
+            logger.error(e.getMessage(),e);
+        }
+        return null;
+    }
+
+    /**
+     * HTTP Post 获取内容
+     *
+     * @param url
+     *            请求的url地址 ?之前的地址
+     * @param params
+     *            请求的参数
+     * @param charset
+     *            编码格式
+     * @return 页面内容
+     */
+    public static String doPost(String url, Map<String, String> params,
+                                String charset) {
+        if (StringUtils.isBlank(url)) {
+            return null;
+        }
+        try {
+            List<NameValuePair> pairs = null;
+            if (params != null && !params.isEmpty()) {
+                pairs = new ArrayList<NameValuePair>(params.size());
+                for (Map.Entry<String, String> entry : params.entrySet()) {
+                    String value = entry.getValue();
+                    if (value != null) {
+                        pairs.add(new BasicNameValuePair(entry.getKey(), value));
+                    }
+                }
+            }
+            HttpPost httpPost = new HttpPost(url);
+
+            if (pairs != null && pairs.size() > 0) {
+                httpPost.setEntity(new UrlEncodedFormEntity(pairs, CHARSET));
+            }
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            String jsessionId = getJsessionId(response);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode != 200) {
+                if(statusCode==302){
+                    return "{\"JSESSIONID\":\""+jsessionId+"\"}";
+                }
+                httpPost.abort();
+                throw new RuntimeException("HttpClient,error status code :"
+                        + statusCode);
+            }
+            HttpEntity entity = response.getEntity();
+            String result = null;
+            if (entity != null) {
+                result = EntityUtils.toString(entity, "utf-8");
+            }
+            EntityUtils.consume(entity);
+            response.close();
+            return result;
+        } catch (Exception e) {
+            logger.error("HttpClientUtil.doPost error, url:" + url + ", errorMsg:" + e.getMessage());
+        }
+        return null;
+    }
+
+    /**
+     * 发送 POST 请求
+     *
+     * @param path
+     *            请求路径
+     * @param map
+     *            参数
+     * @return 如果为空设置 GET 请求
+     * @throws Exception
+     */
+    public static InputStream sendPostRequest(String path,
+                                              Map<String, Object> map) throws Exception {
+
+        StringBuilder sb = new StringBuilder();
+        for (Map.Entry<String, Object> entry : map.entrySet()) {
+
+            if (entry.getValue() instanceof String) {
+                sb.append(entry.getKey())
+                        .append("=")
+                        .append(URLEncoder.encode(entry.getValue().toString(),
+                                "UTF-8"));
+            } else {
+                sb.append(entry.getKey()).append("=").append(entry.getValue());
+            }
+
+            // sb.append(entry.getKey()).append("=").append(entry.getValue());
+            sb.append('&');
+        }
+        sb.deleteCharAt(sb.length() - 1);
+        if (path.indexOf("?") != -1) {
+            logger.info("path:" + path + "&" + sb);
+        } else {
+            logger.info("path:" + path + "?" + sb);
+        }
+        byte[] data = sb.toString().getBytes();
+        URL url = new URL(path);
+        HttpURLConnection con = (HttpURLConnection) url.openConnection();
+        con.setRequestMethod("POST");
+        con.setConnectTimeout(6 * 1000);
+        con.setDoOutput(true);// 发送 POST 请求必须设置允许输出
+        con.setUseCaches(false);// 不设置 cache
+        con.setRequestProperty("Connection", "Keep-Alive");// 维持长链接
+        con.setRequestProperty("Charset", "UTF-8");
+        con.setRequestProperty("Content-Length", String.valueOf(data.length));
+        con.setRequestProperty("Content-Type",
+                "application/x-www-form-urlencoded");
+        DataOutputStream dataOutputStream = new DataOutputStream(
+                con.getOutputStream());
+        dataOutputStream.write(data);
+        dataOutputStream.flush();
+        dataOutputStream.close();
+        if (con.getResponseCode() == 200) {
+            return con.getInputStream();
+        }
+
+        return null;
+    }
+
+    public static String doPostThrowException(String url, Map<String, String> params) throws Exception {
+        return doPostThrowException(url, params, CHARSET);
+    }
+    public static String doPostThrowException(String url, Map<String, String> params,
+                                              String charset) throws Exception {
+        List<NameValuePair> pairs = null;
+        if (params != null && !params.isEmpty()) {
+            pairs = new ArrayList<NameValuePair>(params.size());
+            for (Map.Entry<String, String> entry : params.entrySet()) {
+                String value = entry.getValue();
+                if (value != null) {
+                    pairs.add(new BasicNameValuePair(entry.getKey(), value));
+                }
+            }
+        }
+        HttpPost httpPost = new HttpPost(url);
+        if (pairs != null && pairs.size() > 0) {
+            httpPost.setEntity(new UrlEncodedFormEntity(pairs, CHARSET));
+        }
+        CloseableHttpResponse response = httpClient.execute(httpPost);
+        int statusCode = response.getStatusLine().getStatusCode();
+        if (statusCode != 200) {
+            httpPost.abort();
+            throw new RuntimeException("HttpClient,error status code :"
+                    + statusCode);
+        }
+        HttpEntity entity = response.getEntity();
+        String result = null;
+        if (entity != null) {
+            result = EntityUtils.toString(entity, "utf-8");
+        }
+        EntityUtils.consume(entity);
+        response.close();
+        return result;
+    }
+
+    /**
+     * @param
+     * @return
+     * @author wangtaida
+     * @Date: 11:06 2018/12/17
+     * @Description: 取出cookie的JSESSIONID
+     */
+    public static String getJsessionId(HttpResponse httpResponse){
+        log.info("JsessionId的值:{}",httpResponse.toString());
+        String JSESSIONID="";
+        if(null!=httpResponse.getFirstHeader("Set-Cookie")){
+            String setCookie = httpResponse.getFirstHeader("Set-Cookie").getValue();
+            JSESSIONID = setCookie.substring("JSESSIONID=".length(),setCookie.indexOf(";"));
+            return JSESSIONID;
+        }
+        return JSESSIONID;
+    }
+
+    /**
+     * @param
+     * @return
+     * @author wangtaida
+     * @Date: 16:41 2018/12/17
+     * @Description: 在请求头里追加cookie
+     */
+    public static  CookieStore addCookieStore(String JSESSIONID){
+        CookieStore cookieStore = new BasicCookieStore();
+        BasicClientCookie cookie = new BasicClientCookie("JSESSIONID",JSESSIONID);
+        cookie.setVersion(0);
+        cookie.setDomain(".123.126.34.6");
+        cookie.setPath("/");
+        cookieStore.addCookie(cookie);
+        return cookieStore;
+    }
+    /**
+     * @param
+     * @return
+     * @author wangtaida
+     * @Date: 16:52 2018/12/17
+     * @Description: 发送post请求 入参是请求地址和json字符串
+     */
+    public static String doPostJson(String url, String json) throws ClientProtocolException, IOException {
+        // 创建HttpClientBuilder
+        // HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
+        //JSONObject jsonObject = JSONObject.parseObject(json, JSONObject.class);
+        // String JSESSIONID = jsonObject.getString("JSESSIONID");
+        //CookieStore cookieStore = addCookieStore(JSESSIONID);
+        //httpClient = httpClientBuilder.setDefaultCookieStore(cookieStore).build();
+        // 创建http POST请求
+        HttpPost httpPost = new HttpPost(url);
+        if (json != null) {
+            // 构造一个form表单式的实体
+            StringEntity stringEntity = new StringEntity(json, ContentType.APPLICATION_JSON);
+            // 将请求实体设置到httpPost对象中
+            httpPost.setEntity(stringEntity);
+        }
+        CloseableHttpResponse response = null;
+        try {
+            // 执行请求
+            response = httpClient.execute(httpPost);
+            log.info("POST 访问url:" + url + " 状态为: " + response.getStatusLine().getStatusCode());
+            String re = EntityUtils.toString(response.getEntity(), "UTF-8");
+            log.info("返回结果为: "+re);
+            return re;
+        } finally {
+            if (response != null) {
+                response.close();
+            }
+        }
+    }
+
+    /**
+     * 测试直接获取 目标文件
+     */
+    public static void testGet(){
+    String result = doGet("http://10.180.22.41:8761/group2/M05/37/43/CrQWK2SFuzOELc4KAAAAABI4ceU987.txt",null);
+    System.out.println(result);
+}
+
+    public static void testGetStatPageInfo(){
+
+
+        //        String URL = "http://10.180.41.35:10017/app/station/info/45060201000102";
+        String URL = "http://10.180.41.35:10019/app/station/lower/resource/page";
+//        Map<String, List<Map<String, String>>> mapParames = new HashMap<String, List<Map<String, String>>>();
+//        List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
+//        Map<String, String> map = new HashMap<String, String>();
+//        map.put("keyword", "20096095");
+//        map.put("keywordType", "salesZO");
+//        map.put("operator", "SZOASE");
+//        map.put("value", "SZOASE");
+//        Map<String, String> mapTwo = new HashMap<String, String>();
+//        map.put("beEvaluatorId", "20096095");
+//        map.put("beEvaluatorType", "salesZO");
+//        map.put("questionType", "SZOASE");
+//
+//
+//        String getData = doGet(URL, map);
+//        System.out.println(getData);
+        //System.out.println("----------------------分割线-----------------------");
+        //String postData = doPost(URL, map);
+        // System.out.println(postData);
+        JSONObject params = new JSONObject();
+        JSONArray paramArr = new JSONArray();
+        JSONObject stationCodes = new JSONObject();
+        stationCodes.put("keyword","STATION_CODE");
+        stationCodes.put("keywordType","input");
+        stationCodes.put("operator","=");
+        stationCodes.put("value",new String[]{"45060201000102"});
+        paramArr.add(stationCodes);
+
+        JSONObject entityNames = new JSONObject();
+        entityNames.put("keyword","ENTITY_NAME");
+        entityNames.put("keywordType","input");
+        entityNames.put("operator","=");
+        entityNames.put("value",new String[]{"防城港港口区金海湾小区C1-9栋联通LTE/-003"});
+//        entityNames.put("value",new String[]{"防城港港口联通LTE/-003"});
+        paramArr.add(entityNames);
+//        String[] testPram = new String[]{stationCodes.toJSONString(),entityNames.toJSONString()};
+        params.put("params",paramArr.toString());
+        System.out.println(params);
+
+//        String jsonP = "{\"params\":\"[{\\\"keywordType\\\":\\\"input\\\",\\\"keyword\\\":\\\"STATION_CODE\\\",\\\"value\\\":[\\\"45060201000102\\\"],\\\"operator\\\":\\\"=\\\"},{\\\"keywordType\\\":\\\"input\\\",\\\"keyword\\\":\\\"ENTITY_NAME\\\",\\\"value\\\":[\\\"防城港港口区金海湾小区C1-9栋联通LTE/-003\\\"],\\\"operator\\\":\\\"=\\\"}]\"}";
+//        System.out.println(jsonP);
+        try {
+            //System.out.println(jsonP);
+            String result = doPostJson(URL,params.toString());
+            System.out.println("the Result="+result);
+            Map<String, Object> parse = JSON.parseObject(result);
+            JSONArray retnDate = JSON.parseArray(parse.get("data").toString());
+            if(retnDate.size()==0){
+                logger.error("站址编码、机房实物名称 获取结果为空!");
+            }else if(retnDate.size()>1){
+                logger.error("站址编码、机房实物名称 获取结果有多个记录,匹配异常.");
+            }
+
+            JSONObject currObj = (JSONObject)retnDate.get(0);
+            System.out.println(currObj.get("ENTITY_ID"));
+
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+    //测试入口
+    public static void main(String[] args) {
+        testGet();
+    }
+}

+ 14 - 14
src/main/java/com/fdkankan/modeldemo/utils/MinioUtil.java

@@ -80,20 +80,20 @@ public class MinioUtil {
         }
     }
 
-    public void download(String bucketName, String objectName){
-        HttpRequest httpRequest = HttpRequest.delete(minioProperties.getAddress().concat(minioProperties.getApi().getRemoveObject()))
-                .form(UploadFilePath.BUCKET_NAME, bucketName).form(UploadFilePath.OBJECT_NAME, objectName);
-        try (HttpResponse res = httpRequest.execute()){
-            String resBody = res.body();
-            TietaMinioResBean<String> tietaResBean = JSON.parseObject(resBody, TietaMinioResBean.class);
-            String code = tietaResBean.getStatus();
-            if(!success_status.equals(code)){
-                throw new RuntimeException("minio删除文件接口失败, code:" + code);
-            }
-        }catch (Exception e){
-            log.error("删除minio文件失败,bucketName:{}, objectName:{}", bucketName, objectName, e);
-        }
-    }
+//    public void download(String bucketName, String objectName){
+//        HttpRequest httpRequest = HttpRequest.delete(minioProperties.getAddress().concat(minioProperties.getApi().getRemoveObject()))
+//                .form(UploadFilePath.BUCKET_NAME, bucketName).form(UploadFilePath.OBJECT_NAME, objectName);
+//        try (HttpResponse res = httpRequest.execute()){
+//            String resBody = res.body();
+//            TietaMinioResBean<String> tietaResBean = JSON.parseObject(resBody, TietaMinioResBean.class);
+//            String code = tietaResBean.getStatus();
+//            if(!success_status.equals(code)){
+//                throw new RuntimeException("minio删除文件接口失败, code:" + code);
+//            }
+//        }catch (Exception e){
+//            log.error("删除minio文件失败,bucketName:{}, objectName:{}", bucketName, objectName, e);
+//        }
+//    }
 
 
 

Разлика између датотеке није приказан због своје велике величине
+ 186 - 0
src/main/java/com/fdkankan/modeldemo/utils/RsaCryptTools.java


+ 16 - 0
src/main/resources/application-dev.yml

@@ -58,6 +58,22 @@ minio:
     removeObject: /nodb/ChinatowerFile/removeObject
     download: /nodb/ChinatowerFile/download/bucketName/objectName
 
+#原始 zip 文件上传目录
+zipfilePath: /app/res-filemanager/zipFile/
+#上传存储文件主目录 在此目录下 按照 省编码  地市编码规律建立目录
+roomfilePath: /app/res-filemanager/image/
+#点位文件相对全路径及文件名称
+imagesVision: /images/vision.txt
+imagesVisionToDam: /images/vision.dam
+imagesVisionToModelData: /images/vision.modeldata
+#小地图数据文件
+dataFloorplan: /data/floorplan.json
+#场景信息数据文件
+dataScene: /data/scene.json
+#原始4096*2048全景图路径
+image4k: /images/4k/
+#原始模型对象obj文件
+dataMesh: /data/mesh/mesh.obj
 
 
 

+ 81 - 0
src/main/resources/application-local.yml

@@ -0,0 +1,81 @@
+spring:
+  application:
+    name: 4dkankan-center-convert
+  rabbitmq:
+    host: 10.180.22.152
+    port: 5672
+    username: User_CHNTZCGL_ZCSZHGL_003
+    password: zcszhgl03_vr
+    virtual-host: Vhost_CHNTZCGL_ZCSZHGL_003
+    connection-timeout: 0
+    listener:
+      simple:
+        prefetch: 1
+        max-concurrency: 1
+        acknowledge-mode: manual #开启消费者手动确认
+    #开启消息投递确认机制
+    publisher-confirm-type: correlated
+  datasource:
+    url: jdbc:postgresql://10.180.145.98:5432/chinatower_vr
+    username: res_vr
+    password: qawsed@123.
+    driver-class-name: org.postgresql.Driver
+    hikari:
+      maximum-pool-size: 20 #连接池最大连接数
+      minimum-idle: 5 #连接池最小连接数
+      connection-timeout: 30000
+      idle-timeout: 600000
+      max-lifetime: 1800000
+      login-timeout: 60000
+      pool-name: MyHikariCP
+      connection-test-query: SELECT 1 FROM DUAL
+
+mybatis-plus:
+  mapper-locations: classpath:mapper/*Mapper.xml
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+tieta:
+  sysCode: CT00017
+  serverName: vrconvert
+
+fdfs:
+  sysCode: CT00017
+  address: http://10.180.22.41:8761
+  api:
+    getSignature: /ChinatowerFileService/getSignature
+    uploadFile: /ChinatowerFileService/uploadFile/
+
+redis:
+  host: http://10.180.22.137:8081
+
+minio:
+  bucket: chntzcgl-zcszhgl-003-1
+  address: http://10.180.22.147:8511
+  api:
+    upload: /nodb/ChinatowerFile/upload
+    preview: /nodb/ChinatowerFile/preview/bucketName/objectName
+    removeObject: /nodb/ChinatowerFile/removeObject
+    download: /nodb/ChinatowerFile/download/bucketName/objectName
+
+#获取站址信息接口URL
+stationInfoUrl: http://10.180.41.35:10017/app/station/info/
+#获取 实物信息列表接口URL
+searchEntityUrl: http://10.180.41.35:10019/app/station/lower/resource/page
+#原始 zip 文件上传目录
+zipfilePath: D:\Downloads\tieta/res-filemanager/zipFile/
+#点位文件相对全路径及文件名称
+imagesVision: /images/vision.txt
+#小地图数据文件
+dataFloorplan: /data/floorplan.json
+#场景信息数据文件
+dataScene: /data/scene.json
+#原始4096*2048全景图路径
+image4k: /images/4k/
+#原始模型对象obj文件
+dataMesh: /data/mesh/mesh.obj
+
+
+
+
+

+ 10 - 1
src/main/resources/application.yml

@@ -2,4 +2,13 @@ server:
   port: 10083
 spring:
   profiles:
-    active: dev
+    active: local
+  servlet:
+    multipart:
+      max-file-size: 10240MB
+      max-request-size: 10240MB
+forest:
+  backend: okhttp3
+  connect-timeout: 30000
+  read-timeout: 3600000   # 1小时
+  max-retry-count: 0

+ 5 - 0
src/main/resources/mapper/ManufacturerMapper.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.modeldemo.mapper.ManufacturerMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/SceneOrigUploadMapper.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.modeldemo.mapper.SceneOrigUploadMapper">
+
+</mapper>