From deb977cfae04e5aca02d465cdea4cbc23f22af32 Mon Sep 17 00:00:00 2001
From: liyj <1003249715@qq.com>
Date: Sat, 31 Aug 2024 17:38:28 +0800
Subject: [PATCH] 1、附件管理模块修改2

---
 dyh-service/dyh-base/src/main/java/cn/huge/module/sys/constant/FileBaseConsts.java                    |    5 +----
 dyh-service/dyh-base/src/main/java/cn/huge/module/sys/dto/FileInfoBaseDTO.java                        |    2 +-
 dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/wechat/FileInfoWechatController.java |    9 +++++++--
 dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileInfo.java                         |    2 +-
 dyh-gateway/src/main/resources/config/application.yml                                                 |    2 +-
 dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java       |   16 ++++++++++------
 dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileRelate.java                       |    2 +-
 dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/dto/UploaderDTO.java                     |    2 +-
 8 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/dyh-gateway/src/main/resources/config/application.yml b/dyh-gateway/src/main/resources/config/application.yml
index df3781c..7e011a8 100644
--- a/dyh-gateway/src/main/resources/config/application.yml
+++ b/dyh-gateway/src/main/resources/config/application.yml
@@ -54,4 +54,4 @@
     #refreshToken过期时间:13小时,比token时间长一点
     expire-time: 46800000
   #不进行token拦截
-  auth-skip-urls: /dyh-cust/api/web/ctAccount/login,/dyh-sys/api/v1/sync/universalSync,/dyh-utils/api/web/caseUtils/getNewTimeId,/dyh-utils/api/web/caseUtils/getNewTimeCaseId
\ No newline at end of file
+  auth-skip-urls: /dyh-cust/api/web/ctAccount/login,/dyh-sys/api/v1/sync/universalSync,/dyh-utils/api/web/caseUtils/getNewTimeId,/dyh-utils/api/web/caseUtils/getNewTimeCaseId,/dyh-sys/api/web/fileInfo/show,/dyh-sys/api/web/fileInfo/down,/dyh-sys/api/wechat/fileInfo/show,/dyh-sys/api/wechat/fileInfo/down
\ No newline at end of file
diff --git a/dyh-service/dyh-base/src/main/java/cn/huge/module/sys/constant/FileBaseConsts.java b/dyh-service/dyh-base/src/main/java/cn/huge/module/sys/constant/FileBaseConsts.java
index 948e129..f877dd0 100644
--- a/dyh-service/dyh-base/src/main/java/cn/huge/module/sys/constant/FileBaseConsts.java
+++ b/dyh-service/dyh-base/src/main/java/cn/huge/module/sys/constant/FileBaseConsts.java
@@ -11,13 +11,10 @@
 public class FileBaseConsts {
 
     /**
-     * 上传人类型,1:工作人员,2:申请方当事人,3:申请方代理人,4:被申请方当事人,5:被申请方代理人
+     * 上传人类型,1:工作人员,2:当事人
      */
     public static final int UPLOADER_TYPE_1 = 1;
     public static final int UPLOADER_TYPE_2 = 2;
-    public static final int UPLOADER_TYPE_3 = 3;
-    public static final int UPLOADER_TYPE_4 = 4;
-    public static final int UPLOADER_TYPE_5 = 5;
 
 }
 /**
diff --git a/dyh-service/dyh-base/src/main/java/cn/huge/module/sys/dto/FileInfoBaseDTO.java b/dyh-service/dyh-base/src/main/java/cn/huge/module/sys/dto/FileInfoBaseDTO.java
index 33e0c73..18cdec3 100644
--- a/dyh-service/dyh-base/src/main/java/cn/huge/module/sys/dto/FileInfoBaseDTO.java
+++ b/dyh-service/dyh-base/src/main/java/cn/huge/module/sys/dto/FileInfoBaseDTO.java
@@ -151,7 +151,7 @@
     private String uploaderName;
 
     /**
-     * 上传人类型,1:工作人员,2:申请方当事人,3:申请方代理人,4:被申请方当事人,5:被申请方代理人
+     * 上传人类型,1:工作人员,2:当事人
      */
     private Integer uploaderType;
 
diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java
index 1d1ab60..3a2b7ce 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java
@@ -14,6 +14,7 @@
 import cn.huge.module.file.service.FileRelateService;
 import cn.huge.module.file.utils.FileUtils;
 import cn.huge.module.file.utils.FtpUtils;
+import cn.huge.module.sys.constant.FileBaseConsts;
 import cn.huge.module.sys.constant.FileOwnerTypeBaseEnum;
 import cn.huge.module.sys.dto.FileInfoBaseDTO;
 import com.google.common.collect.Maps;
@@ -66,22 +67,25 @@
 
     /**
      * 页面附件上传-文件流方式
-     * @url {ctx}/api/web/fileInfo/upload/{mainId}/{ownerId}/{ownerType}
+     * @url {ctx}/api/web/fileInfo/upload?mainId=&ownerId=&ownerType=
      * @param mainId 所属业务主体编号
      * @param ownerId 所属业务编号
      * @param ownerType 所属业务类型
      * @param request 请求头
      * @return Object
      */
-    @PostMapping("/upload/{ownerId}/{ownerType}")
-    public Object upload(@PathVariable(value = "mainId") String mainId,
-                         @PathVariable(value = "ownerId") String ownerId,
-                         @PathVariable(value = "ownerType") String ownerType,
+    @PostMapping("/upload")
+    public Object upload(@RequestParam(value = "mainId") String mainId,
+                         @RequestParam(value = "ownerId") String ownerId,
+                         @RequestParam(value = "ownerType") String ownerType,
                          @CurrentUser String userId, MultipartHttpServletRequest request) {
         try{
             CtUserDTO loginUser = custClient.clientGetUser(userId);
             UploaderDTO uploaderDTO = new UploaderDTO();
-            BeanUtils.copyProperties(loginUser, uploaderDTO);
+            uploaderDTO.setUploaderId(loginUser.getId());
+            uploaderDTO.setUploaderName(loginUser.getTrueName());
+            uploaderDTO.setUploaderType(FileBaseConsts.UPLOADER_TYPE_1);
+            uploaderDTO.setCustId(loginUser.getCustId());
             List<FileInfoBaseDTO> files = new ArrayList<>();
             Iterator<String> itr = request.getFileNames();
             int fileCount = fileRelateService.countByOwnerIdAndType(ownerId, ownerType)+1;
diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/wechat/FileInfoWechatController.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/wechat/FileInfoWechatController.java
index f077943..963a377 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/wechat/FileInfoWechatController.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/wechat/FileInfoWechatController.java
@@ -8,12 +8,14 @@
 import cn.huge.module.client.api.impl.CustClientImpl;
 import cn.huge.module.constant.BaseConsts;
 import cn.huge.module.cust.dto.CtUserDTO;
+import cn.huge.module.cust.dto.PaUserDTO;
 import cn.huge.module.file.domain.dto.UploaderDTO;
 import cn.huge.module.file.domain.po.FileInfo;
 import cn.huge.module.file.service.FileInfoService;
 import cn.huge.module.file.service.FileRelateService;
 import cn.huge.module.file.utils.FileUtils;
 import cn.huge.module.file.utils.FtpUtils;
+import cn.huge.module.sys.constant.FileBaseConsts;
 import cn.huge.module.sys.constant.FileOwnerTypeBaseEnum;
 import cn.huge.module.sys.dto.FileInfoBaseDTO;
 import lombok.extern.slf4j.Slf4j;
@@ -72,9 +74,12 @@
                          @PathVariable(value = "ownerType") String ownerType,
                          @CurrentUser String userId, MultipartHttpServletRequest request) {
         try{
-            CtUserDTO loginUser = custClient.clientGetUser(userId);
+            PaUserDTO loginUser = custClient.paclientGetUser(userId);
             UploaderDTO uploaderDTO = new UploaderDTO();
-            BeanUtils.copyProperties(loginUser, uploaderDTO);
+            uploaderDTO.setUploaderId(loginUser.getId());
+            uploaderDTO.setUploaderName(loginUser.getTrueName());
+            uploaderDTO.setUploaderType(FileBaseConsts.UPLOADER_TYPE_1);
+            uploaderDTO.setCustId(loginUser.getCustId());
             List<FileInfoBaseDTO> files = new ArrayList<>();
             Iterator<String> itr = request.getFileNames();
             int fileCount = fileRelateService.countByOwnerIdAndType(ownerId, ownerType)+1;
diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/dto/UploaderDTO.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/dto/UploaderDTO.java
index 8be3d8e..9d8a1b2 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/dto/UploaderDTO.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/dto/UploaderDTO.java
@@ -25,7 +25,7 @@
     private String uploaderName;
 
     /**
-     * 上传人类型,1:工作人员,2:申请方当事人,3:申请方代理人,4:被申请方当事人,5:被申请方代理人
+     * 上传人类型,1:工作人员,2:当事人
      */
     private Integer uploaderType;
 
diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileInfo.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileInfo.java
index 1526533..be72cfa 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileInfo.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileInfo.java
@@ -184,7 +184,7 @@
     private String uploaderName;
 
     /**
-     * 上传人类型,1:工作人员,2:申请方当事人,3:申请方代理人,4:被申请方当事人,5:被申请方代理人
+     * 上传人类型,1:工作人员,2:当事人
      */
     @TableField(exist = false)
     private Integer uploaderType;
diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileRelate.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileRelate.java
index 36a5362..9168201 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileRelate.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileRelate.java
@@ -69,7 +69,7 @@
     private String uploaderName;
 
     /**
-    * 上传人类型,1:工作人员,2:申请方当事人,3:申请方代理人,4:被申请方当事人,5:被申请方代理人
+    * 上传人类型,1:工作人员,2:当事人
     */
     @TableField(value = "uploader_type")
     private Integer uploaderType;

--
Gitblit v1.8.0