lyhzzz 8 月之前
父节点
当前提交
16b1d3c6fb

+ 13 - 0
pom.xml

@@ -99,6 +99,19 @@
     </dependency>
 
     <dependency>
+      <groupId>com.baomidou</groupId>
+      <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+      <version>3.5.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.alibaba</groupId>
+      <artifactId>druid-spring-boot-starter</artifactId>
+      <version>1.1.22</version>
+    </dependency>
+
+
+    <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
     </dependency>

+ 1 - 1
src/main/java/com/fdkankan/manage/common/OssPath.java

@@ -11,7 +11,7 @@ public class OssPath {
 
     public final static String default_head ="manage/user/newHead.png";
 
-    public final static String MANAGE_MODEL_FILE_PATH = "manage/model/%s/%s";
+    public final static String MANAGE_MODEL_FILE_PATH = "manage/media-library/%s/%s";
 
 
 

+ 1 - 1
src/main/java/com/fdkankan/manage/common/ResultCode.java

@@ -98,7 +98,7 @@ public enum ResultCode  {
     FILE_TYPE_ERROR2(60025, "文件类型不符合规则"),
     UNZIP_ERROR(60026, "解压失败"),
 
-    UPLOAD_FILE_OBJ_ERROR(60027,"文件内容错误,缺少obj,或者mtl文件"),
+    UPLOAD_FILE_OBJ_ERROR(60027,"文件内容错误,缺少文件"),
     UPLOAD_FILE_MSG_ERROR(60028,"文件内容错误"),
     ;
 

+ 7 - 69
src/main/java/com/fdkankan/manage/controller/CaseController.java

@@ -1,23 +1,15 @@
 package com.fdkankan.manage.controller;
 
 
-import cn.dev33.satoken.stp.StpUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.manage.common.ResultCode;
-import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.common.ResultData;
-import com.fdkankan.manage.entity.Case;
 import com.fdkankan.manage.service.ICaseService;
-import com.fdkankan.manage.util.Dateutils;
-import com.fdkankan.manage.vo.request.CaseAddParam;
 import com.fdkankan.manage.vo.request.CaseParam;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
 
-import java.util.Date;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * <p>
@@ -25,72 +17,18 @@ import java.util.Date;
  * </p>
  *
  * @author 
- * @since 2022-10-25
+ * @since 2024-12-04
  */
 @RestController
 @RequestMapping("/service/manage/case")
 public class CaseController {
 
     @Autowired
-    ICaseService  caseService;
+    ICaseService caseService;
 
     @PostMapping("/list")
-    public ResultData list(@RequestBody CaseParam param){
+    public ResultData pageList(@RequestBody CaseParam param){
         return ResultData.ok(caseService.pageList(param));
     }
-
-
-    @PostMapping("/addOrUpdate")
-    public ResultData addOrUpdate(@RequestBody CaseAddParam param){
-        Case caseEntity = new Case();
-        BeanUtils.copyProperties(param,caseEntity);
-        if(param.getIconIdList() != null && param.getIconIdList().size() >0){
-            caseEntity.setIconIds(JSONObject.toJSONString(param.getIconIdList()));
-        }
-        caseEntity.setCreateTime(null);
-        caseEntity.setUpdateTime(null);
-        caseEntity.setSysUserId(Integer.valueOf((String)StpUtil.getLoginId()));
-        caseService.saveOrUpdate(caseEntity);
-        return ResultData.ok();
-    }
-
-
-    @PostMapping("/del")
-    public ResultData del(@RequestBody CaseAddParam param){
-        if(param.getId() == null){
-            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        caseService.removeById(param.getId());
-        return ResultData.ok();
-    }
-    @GetMapping("/release")
-    public ResultData release(@RequestParam(required = false) Integer id,
-                              @RequestParam(required = false) Integer isPublic){
-        if(id == null || isPublic == null){
-            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        LambdaUpdateWrapper<Case> wrapper = new LambdaUpdateWrapper<>();
-        wrapper.eq(Case::getId,id);
-        wrapper.set(Case::getIsPublic,isPublic);
-        if(isPublic == 1){
-            wrapper.set(Case::getPublicTime, Dateutils.getDate(new Date()));
-        }else {
-            wrapper.set(Case::getPublicTime,null);
-        }
-        caseService.update(wrapper);
-        return ResultData.ok();
-    }
-    @GetMapping("/isShow")
-    public ResultData isShow(@RequestParam(required = false) Integer id,
-                              @RequestParam(required = false) Integer isShow){
-        if(id == null || isShow == null){
-            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        LambdaUpdateWrapper<Case> wrapper = new LambdaUpdateWrapper<>();
-        wrapper.eq(Case::getId,id);
-        wrapper.set(Case::getIsShow,isShow);
-        caseService.update(wrapper);
-        return ResultData.ok();
-    }
 }
 

+ 21 - 0
src/main/java/com/fdkankan/manage/controller/CaseNumController.java

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

+ 75 - 45
src/main/java/com/fdkankan/manage/entity/Case.java

@@ -1,10 +1,7 @@
 package com.fdkankan.manage.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 com.baomidou.mybatisplus.annotation.*;
+
 import java.io.Serializable;
 import java.util.Date;
 import lombok.Getter;
@@ -16,7 +13,7 @@ import lombok.Setter;
  * </p>
  *
  * @author 
- * @since 2022-10-25
+ * @since 2024-12-04
  */
 @Getter
 @Setter
@@ -25,66 +22,99 @@ public class Case implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
+    /**
+     * 案件表
+     */
+    @TableId(value = "case_id", type = IdType.AUTO)
+    private Integer caseId;
 
     /**
-     * 案例标题
+     * 案标题
      */
-    @TableField("title")
-    private String title;
+    @TableField("case_title")
+    private String caseTitle;
 
     /**
-     * 案例文案
+     * 四维用户名
      */
-    @TableField("sub_title")
-    private String subTitle;
+    @TableField("user_name")
+    private String userName;
+
+    @TableField("sys_user_id")
+    private Integer sysUserId;
 
-    @TableField("type_id")
-    private String typeId;
+    @TableField("tb_status")
+    @TableLogic
+    private Integer tbStatus;
+
+    @TableField("create_time")
+    private Date createTime;
 
-    @TableField("icon_ids")
-    private String iconIds;
+    @TableField("update_time")
+    private Date updateTime;
 
     /**
-     * 排序字段
+     * 0刑侦案件,1火调案件
      */
-    @TableField("sort")
-    private Integer sort;
-
-    @TableField("logo")
-    private String logo;
+    @TableField("type")
+    private Integer type;
 
-    @TableField("detail_content")
-    private String detailContent;
+    /**
+     * 火调项目id
+     */
+    @TableField("tm_project_id")
+    private String tmProjectId;
 
-    @TableField("cover_image_url")
-    private String coverImageUrl;
+    /**
+     * 部门ID
+     */
+    @TableField("dept_id")
+    private String deptId;
 
+    /**
+     * 地图链接
+     */
+    @TableField("map_url")
+    private String mapUrl;
 
-    @TableField("rec_status")
-    @TableLogic(value = "A",delval = "I")
-    private String recStatus;
+    @TableField("lat_and_long")
+    private String latAndLong;
 
-    @TableField("create_time")
-    private String createTime;
+    /**
+     * 案件编号
+     */
+    @TableField("case_num")
+    private String caseNum;
 
-    @TableField("update_time")
-    private String updateTime;
+    /**
+     * 案件类别
+     */
+    @TableField("case_category")
+    private String caseCategory;
 
-    @TableField("is_public")
-    private Integer isPublic;
+    /**
+     * 案发区域
+     */
+    @TableField("case_region")
+    private String caseRegion;
 
-    @TableField("public_time")
-    private String publicTime;
+    /**
+     * 案发地址
+     */
+    @TableField("case_address")
+    private String caseAddress;
 
-    @TableField("is_show")
-    private Integer isShow;
+    /**
+     * 是否命案,0否,1是
+     */
+    @TableField("homicide_case")
+    private Integer homicideCase;
 
-    @TableField("language")
-    private String language;
+    /**
+     * 是否刑案,0否,1是
+     */
+    @TableField("criminal_case")
+    private Integer criminalCase;
 
-    @TableField("sys_user_id")
-    private Integer sysUserId;
 
 }

+ 51 - 0
src/main/java/com/fdkankan/manage/entity/CaseNum.java

@@ -0,0 +1,51 @@
+package com.fdkankan.manage.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-12-04
+ */
+@Getter
+@Setter
+@TableName("t_case_num")
+public class CaseNum implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("case_id")
+    private Integer caseId;
+
+    @TableField("num")
+    private String num;
+
+    /**
+     * 0 四维看看,1看见场景,2 深时场景,3 三维模型,4深时obj
+     */
+    @TableField("num_type")
+    private Integer numType;
+
+    @TableField("tb_status")
+    @TableLogic
+    private Integer tbStatus;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+
+}

+ 2 - 2
src/main/java/com/fdkankan/manage/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir");
 
         generate(path,"manage", getTables(new String[]{
-                "t_common_upload"
+                "t_case","t_case_num"
         }));
 
 //        generate(path,"goods", getTables(new String[]{
@@ -46,7 +46,7 @@ public class AutoGenerate {
 
 
     public static void  generate(String path,String moduleName,  List<String> tables){
-        FastAutoGenerator.create("jdbc:mysql://192.168.0.25:3306/4dkankan_v4",
+        FastAutoGenerator.create("jdbc:mysql://192.168.0.25:3306/fd_fusion",
                 "root","4dkk2023cuikuan%")
                 .globalConfig(builder -> {
                     builder.author("")               //作者

+ 1 - 1
src/main/java/com/fdkankan/manage/mapper/ICaseMapper.java

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
  * </p>
  *
  * @author 
- * @since 2022-10-25
+ * @since 2024-12-04
  */
 @Mapper
 public interface ICaseMapper extends BaseMapper<Case> {

+ 18 - 0
src/main/java/com/fdkankan/manage/mapper/ICaseNumMapper.java

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

+ 16 - 0
src/main/java/com/fdkankan/manage/service/ICaseNumService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.manage.service;
+
+import com.fdkankan.manage.entity.CaseNum;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-12-04
+ */
+public interface ICaseNumService extends IService<CaseNum> {
+
+}

+ 3 - 1
src/main/java/com/fdkankan/manage/service/ICaseService.java

@@ -1,5 +1,6 @@
 package com.fdkankan.manage.service;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.fdkankan.manage.entity.Case;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.manage.vo.request.CaseParam;
@@ -10,8 +11,9 @@ import com.fdkankan.manage.vo.request.CaseParam;
  * </p>
  *
  * @author 
- * @since 2022-10-25
+ * @since 2024-12-04
  */
+
 public interface ICaseService extends IService<Case> {
 
     Object pageList(CaseParam param);

+ 20 - 0
src/main/java/com/fdkankan/manage/service/impl/CaseNumServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.manage.service.impl;
+
+import com.fdkankan.manage.entity.CaseNum;
+import com.fdkankan.manage.mapper.ICaseNumMapper;
+import com.fdkankan.manage.service.ICaseNumService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-12-04
+ */
+@Service
+public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNum> implements ICaseNumService {
+
+}

+ 9 - 49
src/main/java/com/fdkankan/manage/service/impl/CaseServiceImpl.java

@@ -1,79 +1,39 @@
 package com.fdkankan.manage.service.impl;
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
+import cn.dev33.satoken.stp.StpUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.manage.common.PageInfo;
 import com.fdkankan.manage.entity.Case;
-import com.fdkankan.manage.entity.SysUser;
 import com.fdkankan.manage.mapper.ICaseMapper;
 import com.fdkankan.manage.service.ICaseService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.manage.service.ISysUserService;
 import com.fdkankan.manage.vo.request.CaseParam;
-import com.fdkankan.manage.vo.response.CaseVo;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-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>
  *  服务实现类
  * </p>
  *
  * @author 
- * @since 2022-10-25
+ * @since 2024-12-04
  */
 @Service
+@DS("db2")
 public class CaseServiceImpl extends ServiceImpl<ICaseMapper, Case> implements ICaseService {
 
-
-    @Autowired
-    ISysUserService sysUserService;
-
     @Override
     public Object pageList(CaseParam param) {
         LambdaQueryWrapper<Case> wrapper = new LambdaQueryWrapper<>();
-        if(param.getTypeId() != null){
-            wrapper.eq(Case::getTypeId,param.getTypeId());
-        }
-        if(StringUtils.isNotBlank(param.getTitle())){
-            wrapper.like(Case::getTitle,param.getTitle());
-        }
-        if(StringUtils.isNotBlank(param.getStartTime())){
-            wrapper.gt(Case::getPublicTime,param.getStartTime());
-        }
-        if(StringUtils.isNotBlank(param.getEndTime())){
-            wrapper.lt(Case::getPublicTime,param.getEndTime());
-        }
-        wrapper.eq(Case::getLanguage,param.getLanguage());
-        wrapper.orderByDesc(Case::getSort);
-        wrapper.orderByDesc(Case::getIsPublic);
-        wrapper.orderByDesc(Case::getPublicTime);
-        wrapper.orderByDesc(Case::getCreateTime);
-        Page<Case> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
+        wrapper.eq(Case::getSysUserId,StpUtil.getLoginId());
 
-        List<CaseVo> voList = new ArrayList<>();
-        for (Case record : page.getRecords()) {
-            CaseVo vo = new CaseVo();
-            BeanUtils.copyProperties(record,vo);
-            SysUser sysuser = sysUserService.getById(record.getSysUserId());
-            if(sysuser != null){
-                vo.setSysUserName(sysuser.getNickName());
-            }
-            voList.add(vo);
+        if(StringUtils.isNotBlank(param.getCaseTitle())){
+            wrapper.like(Case::getCaseTitle,param.getCaseTitle());
         }
-
-        Page<CaseVo> pageVo = new Page<>(param.getPageNum(), param.getPageSize());
-        pageVo.setRecords(voList);
-        pageVo.setTotal(page.getTotal());
-
-        return PageInfo.PageInfo(pageVo);
+        Page<Case> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
+        return PageInfo.PageInfo(page);
     }
 }

+ 24 - 6
src/main/java/com/fdkankan/manage/service/impl/CommonServiceImpl.java

@@ -87,6 +87,9 @@ public class CommonServiceImpl implements ICommonService {
                     .getTime(), DateExtUtil.dateStyle6), uuid + extName);
 
             tempFile = new File(OssPath.localPath + ossPath);
+            if(!tempFile.getParentFile().exists()){
+                tempFile.getParentFile().mkdirs();
+            }
             file.transferTo(tempFile);
             if(extName.equals(".zip")){
                 return uploadModelZip(tempFile);
@@ -130,17 +133,17 @@ public class CommonServiceImpl implements ICommonService {
             throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
         }
         String modelFileFormat = modelFile.getName().split("\\.")[1].toLowerCase();
+        String url = null;
         switch (modelFileFormat){
             case "obj" :  OBJToGLBUtil.checkObj(modelFile.getPath());
             case "laz" :
-            case "b3dm" :
-            case "shp" :  uploadOss(unzipPath,modelFile); break;
+            case "shp" :   url = uploadOss(unzipPath,modelFile); break;
+            case "b3dm" :  url = uploadB3dm(unzipPath,modelFile); break;
             case "las" :
-            case "ply" :  uploadLasOrPly(modelFile);break;
+            case "ply" :  url = uploadLasOrPly(modelFile);break;
             case "osgb":  uploadOsgb(unzipPath,modelFile) ;break;
             default: break;
         }
-        String url = "";
         String extName= ".zip";
         FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(modelFileFormat);
         if(fileTypeEnum == null){
@@ -152,25 +155,40 @@ public class CommonServiceImpl implements ICommonService {
         return ResultData.ok(commonUpload);
     }
 
+    private String uploadB3dm(String unzipPath, File modelFile) {
+       String b3dmJsonPath = FileWriterUtil.checkB3dmTileset(modelFile);
+        if(b3dmJsonPath == null){
+            throw new BusinessException(ResultCode.UPLOAD_FILE_OBJ_ERROR);
+        }
+        String ossPath = b3dmJsonPath.replace(OssPath.localPath, "");
+        uploadOss(unzipPath,modelFile);
+        if(!fYunFileServiceInterface.fileExist(ossPath)){
+            throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
+        }
+        return ossUrlPrefix +  ossPath;
+    }
+
     private void uploadOsgb(String unzipPath, File modelFile) {
     }
 
 
-    private void uploadOss(String unzipPath,File modelFile) {
+    private String uploadOss(String unzipPath,File modelFile) {
         String ossPath = unzipPath.replace(OssPath.localPath,"");
         String modelOssPath = modelFile.getPath().replace(OssPath.localPath, "");
         ShellUtil.yunUpload(unzipPath,ossPath);
         if(!fYunFileServiceInterface.fileExist(modelOssPath)){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
+        return ossUrlPrefix +  modelOssPath;
     }
 
-    private void uploadLasOrPly(File modelFile) {
+    private String uploadLasOrPly(File modelFile) {
         File mntFile = OBJToGLBUtil.lasOrPlyToBin(modelFile);
         String ossPath = mntFile.getPath().replace(OssPath.localPath,"");
         ShellUtil.yunUpload(mntFile.getPath(),ossPath);
         if(!fYunFileServiceInterface.fileExist(ossPath+"/webcloud/cloud.js")){
             throw new BusinessException(-1,"缺少cloud.js文件");
         }
+        return ossUrlPrefix +  ossPath + "/webcloud";
     }
 }

+ 0 - 12
src/main/java/com/fdkankan/manage/vo/request/CaseAddParam.java

@@ -1,12 +0,0 @@
-package com.fdkankan.manage.vo.request;
-
-import com.fdkankan.manage.vo.request.RequestBase;
-import com.fdkankan.manage.entity.Case;
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class CaseAddParam extends Case {
-    private List<Integer> iconIdList;
-}

+ 2 - 27
src/main/java/com/fdkankan/manage/vo/request/CaseParam.java

@@ -1,33 +1,8 @@
 package com.fdkankan.manage.vo.request;
 
-import com.fdkankan.manage.vo.request.RequestBase;
-import com.fdkankan.manage.util.Dateutils;
 import lombok.Data;
 
-import java.util.List;
-
 @Data
-public class CaseParam extends RequestBase {
-    private String typeId;
-    private String title;
-    private List<String> publicTime;
-    private String startTime;
-    private String endTime;
-
-    private String language = "cn";
-
-
-    public String getStartTime() {
-        if(publicTime != null && publicTime.size() >1){
-            return Dateutils.getStartTime(publicTime.get(0));
-        }
-        return Dateutils.getStartTime(startTime);
-    }
-
-    public String getEndTime() {
-        if(publicTime != null && publicTime.size() >1){
-            return Dateutils.getEndTime(publicTime.get(1));
-        }
-        return Dateutils.getEndTime(endTime);
-    }
+public class CaseParam extends RequestBase{
+    private String caseTitle;
 }

+ 5 - 0
src/main/resources/mapper/manage/CaseNumMapper.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.manage.mapper.ICaseNumMapper">
+
+</mapper>