lyhzzz 2 月之前
父節點
當前提交
5e8b563ebe

+ 6 - 0
doc/fd_fusion-local.sql

@@ -1021,3 +1021,9 @@ INSERT INTO `t_case_files_type` VALUES (60, '足迹', 1, 0, '2024-12-18 17:00:49
 INSERT INTO `t_case_files_type` VALUES (61, '血迹', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:40', 49, 0, 0);
 INSERT INTO `t_case_files_type` VALUES (62, '其他', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:40', 49, 0, 0);
 
+ALTER TABLE `laser`.`t_model2`
+    ADD COLUMN `convert_type` int NULL DEFAULT 0 AFTER `gcj02`;
+
+ALTER TABLE `laser`.`t_case`
+    ADD COLUMN `offline_status` int NULL DEFAULT 0 COMMENT '离线包打包状态-1打包失败,0未打包,1打包中,2打包完成' AFTER `thumb`,
+    ADD COLUMN `offline_path` varchar(255) NULL COMMENT '离线包路径' AFTER `offline_status`;

+ 0 - 3
doc/fusion_case_add.sql

@@ -1,3 +0,0 @@
-ALTER TABLE `laser`.`t_case`
-    ADD COLUMN `offline_status` int NULL DEFAULT 0 COMMENT '离线包打包状态-1打包失败,0未打包,1打包中,2打包完成' AFTER `thumb`,
-    ADD COLUMN `offline_path` varchar(255) NULL COMMENT '离线包路径' AFTER `offline_status`;

+ 0 - 80
doc/t_case_files_type.sql

@@ -1,86 +0,0 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server         : local-192.168.0.25
- Source Server Type    : MySQL
- Source Server Version : 80027
- Source Host           : 192.168.0.25:3306
- Source Schema         : fd_fusion
-
- Target Server Type    : MySQL
- Target Server Version : 80027
- File Encoding         : 65001
-
- Date: 03/03/2025 18:06:45
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
-DROP TABLE IF EXISTS `t_case_files_type`;
-CREATE TABLE `t_case_files_type`  (
-  `files_type_id` int NOT NULL AUTO_INCREMENT COMMENT '附件类型',
-  `files_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件类型名称',
-  `sort` int NULL DEFAULT 1,
-  `tb_status` int NULL DEFAULT 0,
-  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
-  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  `parent_id` int NULL DEFAULT NULL,
-  `modal_show` int NULL DEFAULT 0,
-  `flat_show` int NULL DEFAULT 0,
-  PRIMARY KEY (`files_type_id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
-
-INSERT INTO `t_case_files_type` VALUES (1, '原始照片', 1, 0, '2024-12-10 15:19:08', '2024-12-10 15:25:02', NULL, 1, 0);
-INSERT INTO `t_case_files_type` VALUES (2, '三录材料', 1, 0, '2024-12-10 15:19:53', '2024-12-10 15:19:55', NULL, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (3, '案件卷宗', 1, 0, '2024-12-10 15:20:01', '2024-12-10 15:20:04', NULL, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (4, '其他资料', 1, 0, '2024-12-10 15:20:09', '2024-12-10 15:20:12', NULL, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (11, '中心现场照片', 1, 0, '2024-12-10 09:40:19', '2024-12-10 15:20:53', 1, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (12, '关联现场照片', 2, 0, '2024-12-10 09:41:31', '2024-12-10 15:20:53', 1, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (13, '痕迹物证照片', 3, 0, '2024-12-10 09:41:43', '2024-12-10 15:20:53', 1, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (14, '其他', 4, 0, '2024-12-10 09:41:58', '2024-12-10 15:20:53', 1, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (23, '方位', 5, 0, '2024-12-10 09:44:05', '2024-12-10 15:18:35', 11, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (24, '概貌', 6, 0, '2024-12-10 09:44:15', '2024-12-10 15:18:35', 11, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (25, '重点部位', 7, 0, '2024-12-10 09:44:21', '2024-12-10 15:18:35', 11, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (26, '细目', 8, 0, '2024-12-10 09:44:22', '2024-12-10 15:18:35', 11, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (27, '其他', 9, 0, '2024-12-10 09:44:29', '2024-12-10 15:18:35', 11, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (28, '尸检照片', 10, 0, '2024-12-10 09:46:25', '2024-12-10 15:18:41', 12, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (29, '其他', 11, 0, '2024-12-10 09:46:29', '2024-12-10 15:18:41', 12, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (30, '尸体', 12, 0, '2024-12-10 09:49:02', '2024-12-10 15:18:51', 13, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (31, '手印', 13, 0, '2024-12-10 09:49:08', '2024-12-10 15:18:51', 13, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (32, '足迹', 14, 0, '2024-12-10 09:49:14', '2024-12-10 15:18:51', 13, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (33, '血迹', 15, 0, '2024-12-10 09:49:18', '2024-12-10 15:18:51', 13, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (34, '其他', 16, 0, '2024-12-10 09:49:23', '2024-12-10 15:18:51', 13, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (38, '现场图', 1, 0, '2024-12-10 15:22:08', '2024-12-10 15:25:12', 2, 0, 1);
-INSERT INTO `t_case_files_type` VALUES (39, '现场照片', 1, 0, '2024-12-10 15:22:24', '2024-12-10 15:25:21', 2, 1, 0);
-INSERT INTO `t_case_files_type` VALUES (40, '勘验笔录', 1, 0, '2024-12-10 15:22:28', '2024-12-10 15:22:38', 2, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (41, '平面图', 1, 0, '2024-12-10 15:23:09', '2024-12-10 15:23:16', 38, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (42, '方位图', 1, 0, '2024-12-10 15:23:12', '2025-01-02 10:58:53', 38, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (43, '侦查实验', 1, 0, '2024-12-10 15:23:58', '2024-12-10 15:24:05', 4, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (44, '其他材料', 1, 0, '2024-12-10 15:24:02', '2024-12-10 15:24:05', 4, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (45, '诉讼卷', 1, 0, '2024-12-10 15:24:31', '2024-12-10 15:24:45', 3, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (46, '证据卷', 1, 0, '2024-12-10 15:24:37', '2024-12-10 15:24:45', 3, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (47, '中心现场照片', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:00:58', 39, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (48, '关联现场照片', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:00:58', 39, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (49, '痕迹物证照片', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:00:58', 39, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (50, '其他', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:00:58', 39, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (51, '方位', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:08', 47, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (52, '概貌', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:08', 47, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (53, '重点部位', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:08', 47, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (54, '细目', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:08', 47, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (55, '其他', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:14', 47, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (56, '尸检照片', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:30', 48, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (57, '其他', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:30', 48, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (58, '尸体', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:40', 49, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (59, '手印', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:40', 49, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (60, '足迹', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:40', 49, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (61, '血迹', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:40', 49, 0, 0);
-INSERT INTO `t_case_files_type` VALUES (62, '其他', 1, 0, '2024-12-18 17:00:49', '2024-12-18 17:01:40', 49, 0, 0);
-
-SET FOREIGN_KEY_CHECKS = 1;

+ 0 - 57
doc/t_hot_icon.sql

@@ -1,63 +0,0 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server         : local-192.168.0.25
- Source Server Type    : MySQL
- Source Server Version : 80027
- Source Host           : 192.168.0.25:3306
- Source Schema         : fd_fusion
-
- Target Server Type    : MySQL
- Target Server Version : 80027
- File Encoding         : 65001
-
- Date: 03/03/2025 18:35:43
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
-DROP TABLE IF EXISTS `t_hot_icon`;
-CREATE TABLE `t_hot_icon`  (
-  `icon_id` int NOT NULL AUTO_INCREMENT,
-  `icon_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `icon_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `is_system` int NULL DEFAULT 0 COMMENT '是否系统默认,0否,1是',
-  `use_num` int NULL DEFAULT 0 COMMENT '使用次数',
-  `last_use` int NULL DEFAULT 0 COMMENT '1上次使用',
-  `is_new` int NULL DEFAULT 1 COMMENT '0否,1是',
-  `tb_status` int NULL DEFAULT 0,
-  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
-  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-  `case_id` int NULL DEFAULT NULL,
-  `sort` int NULL DEFAULT 1,
-  PRIMARY KEY (`icon_id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 273 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
-
-INSERT INTO `t_hot_icon` VALUES (1, '系统默认', 'profile/fusion/default/tag_icon_default.svg', NULL, 1, 0, 1, 1, 1, '2022-08-04 11:06:39', '2024-12-19 16:16:36', NULL, 1);
-INSERT INTO `t_hot_icon` VALUES (2, '2', 'profile/fusion/default/hand_l.png', NULL, 1, 2, 1, 1, 0, '2024-12-19 11:10:50', '2024-12-31 11:15:07', NULL, 2);
-INSERT INTO `t_hot_icon` VALUES (3, '2', 'profile/fusion/default/hand_r.png', NULL, 1, 1, 1, 1, 0, '2024-12-19 11:10:50', '2024-12-20 10:09:26', NULL, 3);
-INSERT INTO `t_hot_icon` VALUES (4, '2', 'profile/fusion/default/zhiwen.png', NULL, 1, 9, 1, 1, 0, '2024-12-19 11:10:50', '2025-02-27 11:00:33', NULL, 1);
-INSERT INTO `t_hot_icon` VALUES (5, '3', 'profile/fusion/default/xieyin.png', NULL, 1, 2, 1, 1, 0, '2024-12-19 11:10:50', '2025-02-16 20:47:56', NULL, 3);
-INSERT INTO `t_hot_icon` VALUES (6, '3', 'profile/fusion/default/youzuji.png', NULL, 1, 2, 1, 1, 0, '2024-12-19 11:10:50', '2025-02-13 17:46:00', NULL, 2);
-INSERT INTO `t_hot_icon` VALUES (7, '3', 'profile/fusion/default/zuozuji.png', NULL, 1, 5, 1, 1, 0, '2024-12-19 11:10:50', '2025-02-20 14:29:35', NULL, 1);
-INSERT INTO `t_hot_icon` VALUES (8, '4', 'profile/fusion/default/xueji.png', NULL, 1, 3, 1, 1, 0, '2024-12-19 11:10:50', '2025-02-27 14:43:06', NULL, 2);
-INSERT INTO `t_hot_icon` VALUES (9, '4', 'profile/fusion/default/xuepo.png', NULL, 1, 0, 1, 1, 0, '2024-12-19 11:10:50', '2024-12-19 16:10:24', NULL, 1);
-INSERT INTO `t_hot_icon` VALUES (10, '5', 'profile/fusion/default/shitiz.png', NULL, 1, 0, 1, 1, 0, '2024-12-19 11:10:50', '2024-12-19 16:10:24', NULL, 1);
-INSERT INTO `t_hot_icon` VALUES (11, '5', 'profile/fusion/default/shitib.png', NULL, 1, 1, 1, 1, 0, '2024-12-19 11:10:50', '2025-01-02 09:54:29', NULL, 2);
-INSERT INTO `t_hot_icon` VALUES (12, '5', 'profile/fusion/default/shitifuhao.png', NULL, 1, 0, 1, 1, 0, '2024-12-19 11:10:50', '2024-12-19 16:10:24', NULL, 3);
-INSERT INTO `t_hot_icon` VALUES (13, '6', 'profile/fusion/default/h_default.png', NULL, 1, 1, 1, 1, 0, '2024-12-19 11:10:50', '2024-12-19 17:27:49', NULL, 1);
-INSERT INTO `t_hot_icon` VALUES (14, '7', 'profile/fusion/default/h_default.png', NULL, 1, 2, 1, 1, 0, '2024-12-19 11:10:50', '2025-01-08 17:02:50', NULL, 1);
-INSERT INTO `t_hot_icon` VALUES (18, '8', 'profile/fusion/default/h_default.png', NULL, 1, 96, 1, 1, 0, '2024-12-19 11:10:50', '2025-02-27 14:34:10', NULL, 1);
-INSERT INTO `t_hot_icon` VALUES (20, '8', 'profile/fusion/default/indicate1.png', NULL, 1, 12, 1, 1, 0, '2024-12-19 11:10:50', '2025-02-16 20:30:29', NULL, 2);
-INSERT INTO `t_hot_icon` VALUES (21, '8', 'profile/fusion/default/indicate2.png', NULL, 1, 3, 1, 1, 0, '2024-12-19 11:10:50', '2025-01-02 15:02:40', NULL, 3);
-INSERT INTO `t_hot_icon` VALUES (22, '8', 'profile/fusion/default/indicate3.png', NULL, 1, 7, 1, 1, 0, '2024-12-19 11:10:50', '2025-02-16 20:46:33', NULL, 4);
-
-SET FOREIGN_KEY_CHECKS = 1;

+ 63 - 0
src/main/java/com/fdkankan/fusion/common/util/ProvinceUtils.java

@@ -0,0 +1,63 @@
+package com.fdkankan.fusion.common.util;
+
+import cn.hutool.http.HttpUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+
+import java.net.URL;
+
+@Slf4j
+public class ProvinceUtils {
+
+    public static String amapKey = "3609daa52e8ae4493393292213e2fb98";
+
+    public static String getMapByAddress ="https://restapi.amap.com/v3/geocode/geo?address=%s&output=JSON&key=%s";
+
+    private static String getProvince(String log, String lat ){
+        //lat 小  log  大
+        //参数解释: 纬度,经度 type 001 (100代表道路,010代表POI,001代表门址,111可以同时显示前三项)
+        String urlString = "http://gc.ditu.aliyun.com/regeocoding?l="+lat+","+log+"&type=010";
+        String res = "";
+        try {
+            URL url = new URL(urlString);
+            java.net.HttpURLConnection conn = (java.net.HttpURLConnection)url.openConnection();
+            conn.setDoOutput(true);
+            conn.setRequestMethod("POST");
+            java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(conn.getInputStream(),"UTF-8"));
+            String line;
+            while ((line = in.readLine()) != null) {
+                res += line+"\n";
+            }
+            in.close();
+        } catch (Exception e) {
+            System.out.println("error in wapaction,and e is " + e.getMessage());
+        }
+        System.out.println(res);
+        JSONObject jsonObject = JSONObject.parseObject(res);
+        JSONArray jsonArray = JSON.parseArray(jsonObject.getString("addrList"));
+        JSONObject jsonObject1 = jsonArray.getJSONObject(0);
+        String arr[] = jsonObject1.get("admName").toString().split(",");
+        System.out.println(arr[0]);
+        return arr[0];
+    }
+
+
+
+    public static String getRestMapByAddress(String address){
+        try {
+            String s = HttpUtil.get(String.format(getMapByAddress,address,amapKey),10000);
+            return s;
+        }catch (Exception e){
+            log.info("获取地图失败:{}",address,e);
+        }
+        return null;
+    }
+
+    public static void main(String[] args) {
+
+        System.out.println( getRestMapByAddress("港湾一号"));
+    }
+
+}

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

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

+ 10 - 7
src/main/java/com/fdkankan/fusion/controller/NoLoginController.java

@@ -13,8 +13,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.common.util.MD5Checksum;
+import com.fdkankan.fusion.common.util.ProvinceUtils;
 import com.fdkankan.fusion.common.util.RedisKeyUtil;
-import com.fdkankan.fusion.common.util.StringUtils;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.response.UserAddRequest;
 import com.fdkankan.fusion.service.ITmUserService;
@@ -22,6 +22,7 @@ import com.fdkankan.redis.util.RedisUtil;
 import jdk.nashorn.internal.runtime.regexp.joni.Config;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.compress.utils.OsgiUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpHeaders;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
@@ -34,6 +35,8 @@ import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.security.Security;
 import java.util.Properties;
+
+
 @RestController
 @RequestMapping("/notAuth")
 @Slf4j
@@ -75,11 +78,11 @@ public class NoLoginController {
         return ResultData.ok( tmUserService.getMsgAuthCode(phoneNum));
     }
 
-
-    public static void main(String[] args) {
-        String passwordHash = MD5.create().digestHex("6N^KJTG*GkWj3C");
-        System.out.println(passwordHash);
-        String passwordHash2 = MD5.create().digestHex(passwordHash);
-        System.out.println(passwordHash2);
+    @PostMapping("getMapByAddress")
+    public ResultData getMapByAddress(@RequestBody JSONObject jsonObject){
+        if(jsonObject.getString("address") == null || StringUtils.isBlank(jsonObject.getString("address"))){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        return ResultData.ok(ProvinceUtils.getRestMapByAddress(jsonObject.getString("address")));
     }
 }

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/Model.java

@@ -101,4 +101,7 @@ public class Model implements Serializable {
 
     @TableField("gcj02")
     private String gcj02;
+
+    @TableField("convert_type")
+    private Integer convertType =1;
 }

+ 2 - 2
src/main/java/com/fdkankan/fusion/mq/consumer/OsgbToB3dmConsumer.java

@@ -74,9 +74,9 @@ public class OsgbToB3dmConsumer {
             String url = CacheUtil.mapping + dir + File.separator +jsonFile.getName();
             HashMap<String,String> resultMap = ReadXmlUtil.getLatMap(file);
             if(resultMap != null && !resultMap.isEmpty()){
-                commonUploadService.updateByPath(uploadId,url,resultMap.get("wgs84"),resultMap.get("gcj02"));
+                commonUploadService.updateByPath(uploadId,url,resultMap.get("wgs84"),resultMap.get("gcj02"),sourcePath);
             }else {
-                commonUploadService.updateByPath(uploadId,url);
+                commonUploadService.updateByPath(uploadId,url,sourcePath);
             }
         }catch (Exception e){
             log.info("osgbToB3dm-status----消费失败",e);

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/ICommonUploadService.java

@@ -24,8 +24,8 @@ public interface ICommonUploadService extends IService<CommonUpload> {
 
     void updateStatus(Integer localPath, Integer i);
 
-    void updateByPath(Integer uploadId, String url, String wgs84, String gcj02);
-    void updateByPath(Integer uploadId, String url);
+    void updateByPath(Integer uploadId, String url, String wgs84, String gcj02,String unzipPath);
+    void updateByPath(Integer uploadId, String url,String unzipPath);
 
     List<CommonUpload> getDelData();
 

+ 7 - 0
src/main/java/com/fdkankan/fusion/service/IDictFileService.java

@@ -4,6 +4,9 @@ import com.fdkankan.fusion.entity.DictFile;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.fusion.request.DictFileParam;
 
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -21,4 +24,8 @@ public interface IDictFileService extends IService<DictFile> {
     void del(DictFile dictFile);
 
     void updateDictId(Integer dictId, Integer UpDictId);
+
+    List<DictFile> getByUploadId(Integer uploadId);
+
+    HashMap<Integer, List<DictFile>> getByUploadIds(List<Integer> ids);
 }

+ 1 - 0
src/main/java/com/fdkankan/fusion/service/IDictService.java

@@ -2,6 +2,7 @@ package com.fdkankan.fusion.service;
 
 import com.fdkankan.fusion.entity.Dict;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.fusion.entity.DictFile;
 import com.fdkankan.fusion.request.DictParam;
 
 import java.util.List;

+ 4 - 2
src/main/java/com/fdkankan/fusion/service/impl/CommonUploadServiceImpl.java

@@ -248,11 +248,12 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
     }
 
     @Override
-    public void updateByPath(Integer uploadId, String url) {
+    public void updateByPath(Integer uploadId, String url,String unzipPath) {
         LambdaUpdateWrapper<CommonUpload> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(CommonUpload::getId,uploadId);
         wrapper.set(CommonUpload::getStatus,1);
         wrapper.set(CommonUpload::getFileUrl,url);
+        wrapper.set(CommonUpload::getUnzipPath,unzipPath);
         this.update(wrapper);
     }
 
@@ -265,13 +266,14 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
     }
 
     @Override
-    public void updateByPath(Integer uploadId, String url,String wgs84 ,String gcj02) {
+    public void updateByPath(Integer uploadId, String url,String wgs84 ,String gcj02,String unzipPath) {
         LambdaUpdateWrapper<CommonUpload> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(CommonUpload::getId,uploadId);
         wrapper.set(CommonUpload::getStatus,1);
         wrapper.set(CommonUpload::getFileUrl,url);
         wrapper.set(CommonUpload::getWgs84,wgs84);
         wrapper.set(CommonUpload::getGcj02,gcj02);
+        wrapper.set(CommonUpload::getUnzipPath,unzipPath);
         this.update(wrapper);
     }
 

+ 31 - 0
src/main/java/com/fdkankan/fusion/service/impl/DictFileServiceImpl.java

@@ -1,10 +1,12 @@
 package com.fdkankan.fusion.service.impl;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.entity.Dict;
 import com.fdkankan.fusion.entity.DictFile;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.IDictFileMapper;
@@ -18,6 +20,10 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -68,4 +74,29 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
         wrapper.set(DictFile::getDictId,UpDictId);
         this.update(wrapper);
     }
+
+
+    @Override
+    public List<DictFile> getByUploadId(Integer uploadId) {
+        LambdaQueryWrapper<DictFile> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(DictFile::getUploadId,uploadId);
+        return this.list(wrapper);
+    }
+
+    @Override
+    public HashMap<Integer, List<DictFile>> getByUploadIds(List<Integer> ids) {
+        HashMap<Integer,List<DictFile>> map = new HashMap<>();
+        if(ids == null || ids.isEmpty()){
+            return map;
+        }
+        LambdaQueryWrapper<DictFile> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(DictFile::getUploadId,ids);
+        List<DictFile> list = this.list(wrapper);
+        for (DictFile dictFile : list) {
+            map.computeIfAbsent(dictFile.getUploadId(), k -> new ArrayList<>());
+            map.get(dictFile.getUploadId()).add(dictFile);
+        }
+
+        return map;
+    }
 }

+ 1 - 0
src/main/java/com/fdkankan/fusion/service/impl/DictServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.Dict;
+import com.fdkankan.fusion.entity.DictFile;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.IDictMapper;
 import com.fdkankan.fusion.request.DictParam;

+ 46 - 32
src/main/java/com/fdkankan/fusion/task/InitService.java

@@ -25,6 +25,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
@@ -89,7 +90,7 @@ public class InitService {
                 }
             }
         }catch (Exception e){
-
+            log.info("checkDefaultImag",e);
         }
 
     }
@@ -103,45 +104,58 @@ public class InitService {
     ICaseFilesService caseFilesService;
     @Autowired
     IFusionNumService fusionNumService;
+    @Autowired
+    IDictFileService dictFileService;
 
 
     public void delMediaLibrary() {
-        List<CommonUpload> commonUploadList = commonUploadService.getDelData();
-        if(commonUploadList.isEmpty()){
-            return;
-        }
-        List<CommonUpload> delUploadList = new ArrayList<>();
-        for (CommonUpload commonUpload : commonUploadList) {
-            if(StringUtils.isNotBlank(commonUpload.getFileUrl())){
-                LambdaQueryWrapper<Model> wrapper = new LambdaQueryWrapper<>();
-                JSONArray jsonArray = new JSONArray();
-                jsonArray.add(commonUpload.getFileUrl());
-                wrapper.like(Model::getModelGlbUrl,jsonArray.toJSONString());
-                List<Model> list = modelService.list(wrapper);
-
-                List<Integer> modelIds = list.stream().map(Model::getModelId).collect(Collectors.toList());
-                List<FusionNum> fusionNums = fusionNumService.getByModelId(modelIds);
-
-                LambdaQueryWrapper<CaseFiles> wrapper2 = new LambdaQueryWrapper<>();
-                wrapper2.like(CaseFiles::getFilesUrl,commonUpload.getFileUrl());
-                Long count2 = caseFilesService.count(wrapper2);
-                if(fusionNums.size() + count2 <=0){
+        try {
+            List<CommonUpload> commonUploadList = commonUploadService.list();
+            if(commonUploadList.isEmpty()){
+                return;
+            }
+            List<Integer> ids = commonUploadList.stream().map(CommonUpload::getId).collect(Collectors.toList());
+            HashMap<Integer,List<DictFile>> map = dictFileService.getByUploadIds(ids);
+
+            List<CommonUpload> delUploadList = new ArrayList<>();
+            for (CommonUpload commonUpload : commonUploadList) {
+                List<DictFile> dictFiles = map.get(commonUpload.getId());
+                if(dictFiles != null && !dictFiles.isEmpty()){
+                    continue;
+                }
+                if(StringUtils.isNotBlank(commonUpload.getFileUrl())){
+                    LambdaQueryWrapper<Model> wrapper = new LambdaQueryWrapper<>();
+                    JSONArray jsonArray = new JSONArray();
+                    jsonArray.add(commonUpload.getFileUrl());
+                    wrapper.like(Model::getModelGlbUrl,jsonArray.toJSONString());
+                    List<Model> list = modelService.list(wrapper);
+
+                    List<Integer> modelIds = list.stream().map(Model::getModelId).collect(Collectors.toList());
+                    List<FusionNum> fusionNums = fusionNumService.getByModelId(modelIds);
+
+                    LambdaQueryWrapper<CaseFiles> wrapper2 = new LambdaQueryWrapper<>();
+                    wrapper2.like(CaseFiles::getFilesUrl,commonUpload.getFileUrl());
+                    Long count2 = caseFilesService.count(wrapper2);
+                    if(fusionNums.size() + count2 <=0){
+                        delUploadList.add(commonUpload);
+                    }
+                }else {
                     delUploadList.add(commonUpload);
                 }
-            }else {
-                delUploadList.add(commonUpload);
             }
-        }
 
-        if(delUploadList.isEmpty()){
-            return;
-        }
-        for (CommonUpload commonUpload : delUploadList) {
-            FileUtil.del(commonUpload.getFileUrl());
-            FileUtil.del(commonUpload.getUnzipPath());
-            log.info("删除文件资源:{},{}",commonUpload.getFileUrl(),commonUpload.getUnzipPath());
+            if(delUploadList.isEmpty()){
+                return;
+            }
+            for (CommonUpload commonUpload : delUploadList) {
+                FileUtil.del(commonUpload.getUnzipPath());
+                log.info("删除文件资源:{},{}",commonUpload.getFileUrl(),commonUpload.getUnzipPath());
+            }
+            commonUploadService.removeByIds(delUploadList.stream().map(CommonUpload::getId).collect(Collectors.toList()));
+        }catch (Exception e){
+            log.info("删除文件失败:{}",e);
         }
-        commonUploadService.delByIds(delUploadList.stream().map(CommonUpload::getId).collect(Collectors.toList()));
+
 
     }