forked from gzzfw/backEnd/gz-dyh

liyj
2024-08-31 deb977cfae04e5aca02d465cdea4cbc23f22af32
1、附件管理模块修改2
8 files modified
40 ■■■■■ changed files
dyh-gateway/src/main/resources/config/application.yml 2 ●●● patch | view | raw | blame | history
dyh-service/dyh-base/src/main/java/cn/huge/module/sys/constant/FileBaseConsts.java 5 ●●●● patch | view | raw | blame | history
dyh-service/dyh-base/src/main/java/cn/huge/module/sys/dto/FileInfoBaseDTO.java 2 ●●● patch | view | raw | blame | history
dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/web/FileInfoWebController.java 16 ●●●●● patch | view | raw | blame | history
dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/wechat/FileInfoWechatController.java 9 ●●●● patch | view | raw | blame | history
dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/dto/UploaderDTO.java 2 ●●● patch | view | raw | blame | history
dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileInfo.java 2 ●●● patch | view | raw | blame | history
dyh-service/dyh-sys/src/main/java/cn/huge/module/file/domain/po/FileRelate.java 2 ●●● patch | view | raw | blame | history
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
  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
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;
}
/**
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;
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;
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;
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;
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;
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;