浏览代码

归档以及签章回调功能开发

user5 2 年之前
父节点
当前提交
f106a79870
共有 16 个文件被更改,包括 1216 次插入5 次删除
  1. 4 0
      jeeplus-module/jeeplus-test/pom.xml
  2. 266 5
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java
  3. 5 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportData.java
  4. 13 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportMapper.java
  5. 7 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/ProjectReportWorkAttachmentMapper.java
  6. 53 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportMapper.xml
  7. 8 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/ProjectReportWorkAttachmentMapper.xml
  8. 13 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java
  9. 82 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/controller/CwProjectReportArchiveDetailController.java
  10. 128 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/domain/CwProjectReportArchiveDetail.java
  11. 22 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/CwProjectReportArchiveDetailMapper.java
  12. 47 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/xml/CwProjectReportArchiveDetailMapper.xml
  13. 138 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/CwProjectReportArchiveDetailService.java
  14. 292 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/dto/CwProjectReportArchiveDetailDTO.java
  15. 16 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/mapstruct/CwProjectReportArchiveDetailWrapper.java
  16. 122 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OSSClientService.java

+ 4 - 0
jeeplus-module/jeeplus-test/pom.xml

@@ -40,6 +40,10 @@
             <artifactId>fastjson</artifactId>
             <version>1.2.28</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
 
     </dependencies>
 

+ 266 - 5
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
@@ -19,8 +20,12 @@ import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
 import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportSignatureMapper;
+import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
 import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
+import com.jeeplus.test.oss.domain.WorkAttachment;
+import com.jeeplus.test.oss.service.OSSClientService;
 import com.jeeplus.test.signature.domain.PresignCallBack;
+import com.jeeplus.test.signature.utils.SignaturePostUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.flowable.engine.TaskService;
 import org.flowable.task.api.Task;
@@ -30,7 +35,12 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.security.core.userdetails.User;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.mock.web.MockMultipartFile;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
 import java.lang.reflect.Type;
 import java.util.*;
 
@@ -44,8 +54,14 @@ import java.util.*;
 public class CwProjectReportSignatureCallBackController {
 
 
+    private static final String DIRECTORY = "/attachment-file";
+
+    private static final String ALIYUNURL = "http://oss.gangwaninfo.com";
+
     private CwProjectReportService cwProjectReportService = SpringContextHolder.getBean(CwProjectReportService.class);
+    private OSSClientService ossClientService = SpringContextHolder.getBean(OSSClientService.class);
     private CwProjectReportSignatureMapper cwProjectReportSignatureMapper = SpringContextHolder.getBean(CwProjectReportSignatureMapper.class);
+    private ProjectReportWorkAttachmentMapper attachmentMapper = SpringContextHolder.getBean(ProjectReportWorkAttachmentMapper.class);
 
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
 
@@ -67,7 +83,7 @@ public class CwProjectReportSignatureCallBackController {
      * @return
      */
     @RequestMapping(value = "/getApprovalCallBackCoordinates", method= RequestMethod.POST)
-    public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack) throws Exception {
+    public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack, HttpServletResponse response) throws Exception {
         // 在redis中取回流程审核所需的参数
         CommitParamDTO<CwProjectReportData> commitParamDTO = (CommitParamDTO<CwProjectReportData>)redisUtils.get("cw_report_signature_" + presignCallBack.getContractId());
         // 将取回的数据转换为审核通过所需要的参数
@@ -143,10 +159,255 @@ public class CwProjectReportSignatureCallBackController {
 
         return null;
     }
-    @PostMapping(value = "/aaa")
-    public ResponseEntity<String> updateSignatureStatusById() {
-        String s = "projectReportService.updateSignatureStatusById(data);";
-        return ResponseEntity.ok(s);
+
+
+    @RequestMapping(value = "/getApprovalCallBackAccomplish", method= RequestMethod.POST)
+    public String getApprovalCallBackAccomplish(PresignCallBack presignCallBack, HttpServletResponse response) {
+//        //根据contractId查询对应的报告信息
+        CwProjectReportData projectReportData = cwProjectReportService.queryByContractId(presignCallBack.getContractId());
+        //对文件回调路径进行处理并保存
+        String signatureUrl = null;
+        if(StringUtils.isNotBlank(presignCallBack.getStoragePath())){
+            signatureUrl = presignCallBack.getStoragePath().replace("oss:/","");
+            signatureUrl = signatureUrl.replace("/xg-qz","");
+            projectReportData.setSignatureUrl(signatureUrl);
+        }
+
+        //将签章完成地址保存到数据库对应报告信息中
+        cwProjectReportService.updateSignatureUrl(projectReportData);
+
+
+        //将文件下载并对原有文件地址进行替换
+        String deleteFile = null;
+        String unzipFileStr = null;
+        try{
+            String path = null;
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                path = "D:/attachment-file/";
+            }else{
+                path = "/attachment-file/";
+            }
+            String aliyunUrl = Global.getAliyunUrl();
+            String aliDownloadUrl = Global.getAliDownloadUrl();
+
+
+            String file = aliyunUrl + signatureUrl;
+            file = file.replace("amp;","");
+            String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
+            String cons = "";
+            if (file.contains(aliyunUrl)){
+                cons = aliyunUrl;
+            }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+                cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+            }else {
+                cons = aliDownloadUrl;
+            }
+            String ossKey = file.split(cons+"/")[1];
+            ossClientService.downQzByStreamSaveLocal(ossKey,fileName,path+fileName);
+            //将下载下来的文件转换为file文件
+            File srcFile = new File(path+fileName);
+            deleteFile = path+fileName;
+
+            //截取文件名称
+            String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+
+            //解压后文件地址
+            unzipFileStr = path + srcFileName;
+
+            //将下载后的文件进行解压
+            SignaturePostUtil.unZipFile(srcFile,unzipFileStr);
+
+            //遍历解压后文件夹中的所有文件信息
+            File unZipFile = new File(unzipFileStr);
+
+            File[] unZipFileList = unZipFile.listFiles();
+
+            for (File f : unZipFileList) {
+                String filepath = "";
+                //取得上传文件
+                //将文件上传到oss云盘中
+                MultipartFile cMultiFile = new MockMultipartFile("file", f.getName(), null, new FileInputStream(f));
+                if (cMultiFile != null && !cMultiFile.isEmpty()) {
+                    // 文件保存路径
+                    String realPath =DIRECTORY.replace("/","")+"/cw_project_report_file"+ossClientService.datePath()+"/"+ System.currentTimeMillis();
+                    //文件原名称
+                    String newName = cMultiFile.getOriginalFilename();
+                    newName = newName.substring(13, newName.length());
+                    ossClientService.uploadFile2OSS(cMultiFile.getInputStream(),realPath,newName);
+                    filepath = "/" + realPath + newName;
+                }
+
+                System.out.println(f.getName());
+                //截取文件后缀名
+                String substring = f.getName().substring(f.getName().lastIndexOf(".")+1, f.getName().length());
+                //遍历该contractId对应的报告信息,将报告信息中的附件地址进行替换
+
+                //查询报告文件信息(电子章)
+                List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(projectReportData.getId());
+                if(fileList.size()>0){
+                    for (WorkAttachment workattachment : fileList) {
+                        //根据url截取文件名成
+                        String workattachmentName = workattachment.getUrl().substring(workattachment.getUrl().lastIndexOf("/")+1, workattachment.getUrl().length());
+
+                        if(f.getName().contains(workattachmentName)){
+                            workattachment.setUrl(filepath);
+                            workattachment.setType(substring);
+                            workattachment.setAttachmentName(f.getName());
+                            attachmentMapper.updateByIdOnSignature(workattachment);
+                        }
+                    }
+                }
+            }
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+            File file = new File(unzipFileStr);
+            deleteFile(file);
+        }
+
+        return null;
+    }
+
+
+    @RequestMapping(value = "/download", method= RequestMethod.POST)
+    public String download(String signatureUrl) {
+//        //根据contractId查询对应的报告信息
+        CwProjectReportData projectReportData = cwProjectReportService.queryByContractId("3032604994397941821");
+
+        //将文件下载并对原有文件地址进行替换
+        String deleteFile = null;
+        String unzipFileStr = null;
+        try{
+            String path = null;
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                path = "D:/attachment-file/";
+            }else{
+                path = "/attachment-file/";
+            }
+            String aliyunUrl = Global.getAliyunUrl();
+            String aliDownloadUrl = Global.getAliDownloadUrl();
+
+
+            String file = aliyunUrl + signatureUrl;
+            file = file.replace("amp;","");
+            String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
+            String cons = "";
+            if (file.contains(aliyunUrl)){
+                cons = aliyunUrl;
+            }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+                cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+            }else {
+                cons = aliDownloadUrl;
+            }
+            String ossKey = file.split(cons+"/")[1];
+            ossClientService.downQzByStreamSaveLocal(ossKey,fileName,path+fileName);
+            //将下载下来的文件转换为file文件
+            File srcFile = new File(path+fileName);
+            deleteFile = path+fileName;
+
+            //截取文件名称
+            String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+
+            //解压后文件地址
+            unzipFileStr = path + srcFileName;
+
+            //将下载后的文件进行解压
+            SignaturePostUtil.unZipFile(srcFile,unzipFileStr);
+
+            //遍历解压后文件夹中的所有文件信息
+            File unZipFile = new File(unzipFileStr);
+
+            File[] unZipFileList = unZipFile.listFiles();
+
+            for (File f : unZipFileList) {
+                String filepath = "";
+                //取得上传文件
+                //将文件上传到oss云盘中
+                MultipartFile cMultiFile = new MockMultipartFile("file", f.getName(), null, new FileInputStream(f));
+                if (cMultiFile != null && !cMultiFile.isEmpty()) {
+                    // 文件保存路径
+                    String realPath =DIRECTORY.replace("/","")+"/cw_project_report_file"+ossClientService.datePath()+"/"+ System.currentTimeMillis();
+                    //文件原名称
+                    String newName = cMultiFile.getOriginalFilename();
+                    newName = newName.substring(13, newName.length());
+                    ossClientService.uploadFile2OSS(cMultiFile.getInputStream(),realPath,newName);
+                    filepath = "/" + realPath + newName;
+                }
+
+                System.out.println(f.getName());
+                //截取文件后缀名
+                String substring = f.getName().substring(f.getName().lastIndexOf(".")+1, f.getName().length());
+                //遍历该contractId对应的报告信息,将报告信息中的附件地址进行替换
+
+                //查询报告文件信息(电子章)
+                List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(projectReportData.getId());
+                if(fileList.size()>0){
+                    for (WorkAttachment workattachment : fileList) {
+                        //根据url截取文件名成
+                        String workattachmentName = workattachment.getUrl().substring(workattachment.getUrl().lastIndexOf("/")+1, workattachment.getUrl().length());
+
+                        if(f.getName().contains(workattachmentName)){
+                            workattachment.setUrl(filepath);
+                            workattachment.setType(substring);
+                            workattachment.setAttachmentName(f.getName());
+                            attachmentMapper.updateByIdOnSignature(workattachment);
+                        }
+                    }
+                }
+            }
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            if(StringUtils.isNotBlank(deleteFile)){
+                //根据路径创建文件对象
+                File file = new File(deleteFile);
+                //路径是个文件且不为空时删除文件
+                if(file.isFile()&&file.exists()){
+                    file.delete();
+                }
+            }
+            File file = new File(unzipFileStr);
+            deleteFile(file);
+        }
+
+        return null;
+    }
+
+    public static Boolean deleteFile(File file) {
+        //判断文件不为null或文件目录存在
+        if (file == null || !file.exists()) {
+            System.out.println("文件删除失败,请检查文件是否存在以及文件路径是否正确");
+            return false;
+        }
+        //获取目录下子文件
+        File[] files = file.listFiles();
+        //遍历该目录下的文件对象
+        for (File f : files) {
+            //判断子目录是否存在子目录,如果是文件则删除
+            if (f.isDirectory()) {
+                //递归删除目录下的文件
+                deleteFile(f);
+            } else {
+                //文件删除
+                f.delete();
+                //打印文件名
+                System.out.println("文件名:" + f.getName());
+            }
+        }
+        //文件夹删除
+        file.delete();
+        System.out.println("目录名:" + file.getName());
+        return true;
     }
 
 }

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportData.java

@@ -149,4 +149,9 @@ public class CwProjectReportData extends BaseDTO {
      * 公章+执业章流程表id
      */
     private String sid2;
+
+    /**
+     * 电子签章文件地址
+     */
+    private String signatureUrl;
 }

+ 13 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportMapper.java

@@ -49,8 +49,21 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
     void updateSignatureInfo(CwProjectReportData cwProjectReportData);
 
     /**
+     * 更改报告号签章id信息
+     * @param cwProjectReportData
+     */
+    void updateSignatureUrl(CwProjectReportData cwProjectReportData);
+
+    /**
      * 根据id修改del_flag状态
      * @param id
      */
     void updateDelFlag(@Param("flag")int flag,@Param("id") String id);
+
+    /**
+     * 根据签章id查询报告信息
+     * @param contractId
+     * @return
+     */
+    CwProjectReportData queryByContractId(@Param("contractId") String contractId);
 }

+ 7 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/ProjectReportWorkAttachmentMapper.java

@@ -33,4 +33,11 @@ public interface ProjectReportWorkAttachmentMapper extends BaseMapper<CwProjectR
      * @return
      */
     List<WorkAttachment> selectWorkAttachmentByReportId(String id);
+
+    /**
+     * 根据id修改文件信息(cw签章文件替换)
+     * @param workattachment
+     * @return
+     */
+    Integer updateByIdOnSignature(WorkAttachment workattachment);
 }

+ 53 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportMapper.xml

@@ -143,7 +143,60 @@
         signature_contract_id = #{signatureContractId}
         where id = #{id}
     </update>
+
+    <update id="updateSignatureUrl">
+        update cw_project_report set
+        signature_url = #{signatureUrl}
+        where id = #{id}
+    </update>
     <update id="updateDelFlag">
         UPDATE cw_project_report SET del_flag = #{flag} where id = #{id}
     </update>
+
+
+
+
+    <select id="queryByContractId" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectReportData">
+        SELECT
+        a.id,
+        a.create_by as createById,
+        a.create_date,
+        a.update_by,
+        a.update_date,
+        a.del_flag,
+        a.remarks,
+        a.status,
+        a.document_no,
+        a.project_report_number,
+        a.project_id,
+        a.office_id,
+        a.signature_type,
+        a.signature_annotator1,
+        a.signature_annotator2,
+        a.signature_contract_id,
+        a.proc_ins_id,
+        a.process_definition_id,
+        b.project_number as projectNumber,
+        b.project_name as projectName,
+        c.name as departmentName,
+        d.name as userName,
+        a.create_date,
+        e.name as projectMasterName,
+        cw_prs1.proc_ins_id as proc_ins_id1,
+        cw_prs1.process_definition_id as process_definition_id1,
+        cw_prs1.status as status1,
+        cw_prs1.id as sid1,
+        cw_prs2.proc_ins_id as proc_ins_id2,
+        cw_prs2.process_definition_id as process_definition_id2,
+        cw_prs2.status as status2,
+        cw_prs2.id as sid2
+        FROM cw_project_report a
+        left join cw_project_records b on a.project_id = b.id
+        LEFT JOIN sys_office c on a.office_id = c.id
+        LEFT JOIN sys_user d on a.create_by = d.id
+        LEFT JOIN sys_user e on b.project_master_id = e.id
+        LEFT JOIN cw_project_report_signature cw_prs1 on cw_prs1.report_id = a.id and cw_prs1.type = '1' and cw_prs1.del_flag = '0'
+        LEFT JOIN cw_project_report_signature cw_prs2 on cw_prs2.report_id = a.id and cw_prs2.type = '2' and cw_prs2.del_flag = '0'
+        where a.signature_contract_id = #{contractId}
+    </select>
 </mapper>

+ 8 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/ProjectReportWorkAttachmentMapper.xml

@@ -27,4 +27,12 @@
         where a.attachment_id in (select id from cw_project_report_new_line where report_id = #{id}) and cf.seal_type = 1
     </select>
 
+    <update id="updateByIdOnSignature">
+        update work_attachment
+        set url = #{url},
+        type = #{type},
+        attachment_name= #{attachmentName}
+        where id = #{id}
+    </update>
+
 </mapper>

+ 13 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java

@@ -327,6 +327,14 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
     }
 
     /**
+     * 保存签章文件地址
+     * @param projectReportData
+     */
+    public void updateSignatureUrl(CwProjectReportData projectReportData){
+        reportMapper.updateSignatureUrl(projectReportData);
+    }
+
+    /**
      * 新增
      */
     @Transactional(rollbackFor = Exception.class)
@@ -988,4 +996,9 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
         cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
         return cwProjectReportSignature.getId();
     }
+
+    public CwProjectReportData queryByContractId(String contractId){
+        CwProjectReportData reportData = reportMapper.queryByContractId(contractId);
+        return reportData;
+    }
 }

+ 82 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/controller/CwProjectReportArchiveDetailController.java

@@ -0,0 +1,82 @@
+package com.jeeplus.test.cw.projectReportArchive.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
+import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.test.cw.projectReportArchive.service.CwProjectReportArchiveDetailService;
+import com.jeeplus.test.cw.projectReportArchive.service.CwProjectReportArchiveService;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.ReportDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 财务项目报告归档
+ */
+@RestController
+@Api("财务项目报告归档")
+@RequestMapping(value = "/cwProjectReportArchiveDetail")
+public class CwProjectReportArchiveDetailController {
+
+    @Resource
+    private CwProjectReportArchiveDetailService cwProjectReportArchiveDetailService;
+
+    /**
+     * 查询财务项目报告归档信息列表
+     * @param cwProjectReportArchiveDetailDTO
+     * @param page
+     * @return
+     */
+    @ApiLog("查询报告归档状态信息")
+    @PreAuthorize("hasAuthority('cwProjectReportArchiveDetail:list')")
+    @GetMapping("list")
+    public ResponseEntity<IPage<CwProjectReportArchiveDetailDTO>> data(CwProjectReportArchiveDetailDTO cwProjectReportArchiveDetailDTO, Page<CwProjectReportArchiveDetailDTO> page) throws Exception {
+        IPage<CwProjectReportArchiveDetailDTO> result = new Page<CwProjectReportArchiveDetailDTO>();
+        result = cwProjectReportArchiveDetailService.findList (page, cwProjectReportArchiveDetailDTO);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 导出分所报销数据
+     * @param cwProjectReportArchiveDetailDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出分所报销数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出分所报销数据excel")
+    public void exportFile(CwProjectReportArchiveDetailDTO cwProjectReportArchiveDetailDTO, Page <CwProjectReportArchiveDetailDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename ( );
+
+        List<CwProjectReportArchiveDetailDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = cwProjectReportArchiveDetailService.findList ( page, cwProjectReportArchiveDetailDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = cwProjectReportArchiveDetailService.findList ( page, cwProjectReportArchiveDetailDTO ).getRecords().stream ( ).filter ( info ->
+                    options.getSelectIds ( ).contains ( info.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = cwProjectReportArchiveDetailService.findList ( page, cwProjectReportArchiveDetailDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "归档信息",  options.getSheetName ( ), CwProjectReportArchiveDetailDTO.class, fileName, response );
+    }
+
+}

+ 128 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/domain/CwProjectReportArchiveDetail.java

@@ -0,0 +1,128 @@
+package com.jeeplus.test.cw.projectReportArchive.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.core.query.QueryType;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 财务-项目报告归档-项目归档
+ * @TableName cw_project_report_archive
+ */
+@Data
+@TableName("cw_project_report_archive")
+public class CwProjectReportArchiveDetail extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告文号
+     */
+    private String reportNo;
+
+    /**
+     * 报告日期
+     */
+    private Date reportDate;
+
+    /**
+     * 归档时间
+     */
+    private Date auditDate;
+
+    /**
+     * 归档状态
+     */
+    private String status;
+
+    /**
+     * 超期天数
+     */
+    private String overDueDay;
+
+    /**
+     * 罚款金额
+     */
+    private String fineMoney;
+
+    /**
+     * 项目负责人
+     */
+    private String projectMasterName;
+
+    /**
+     * 合同id
+     */
+    private String contractId;
+
+    /**
+     * 合同编号
+     */
+    private String contractNumber;
+
+    /**
+     * 案卷号
+     */
+    private String number;
+
+    /**
+     * 报告到归档时间差(天数)
+     */
+    private Integer archiveDay;
+
+    /**
+     * 逾期天数(天数)
+     */
+    private String overdueDay;
+
+    /**
+     * 签字注师1
+     */
+    private String signatureAnnotatorName1;
+
+    /**
+     * 签字注师2
+     */
+    private String signatureAnnotatorName2;
+
+    /**
+     * 项目信息
+     */
+    private CwProjectRecordsDTO cwProjectRecordsDTO;
+
+    /**
+     * 归档时间区间
+     */
+    private String[] auditDates;
+
+    /**
+     * 报告时间区间
+     */
+    private String[] reportDates;
+
+    /**
+     * 档案号
+     */
+    @Query(tableColumn = "cw_pa.file_number",type = QueryType.LIKE)
+    private String fileNumber;
+
+    private static final long serialVersionUID = 1L;
+}

+ 22 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/CwProjectReportArchiveDetailMapper.java

@@ -0,0 +1,22 @@
+package com.jeeplus.test.cw.projectReportArchive.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchiveDetail;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface CwProjectReportArchiveDetailMapper extends BaseMapper<CwProjectReportArchiveDetail> {
+
+    IPage<CwProjectReportArchiveDetailDTO> findList(Page<CwProjectReportArchiveDetailDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectReportArchiveDetail> queryWrapper,@Param("cwProjectReportArchiveDetailDTO") CwProjectReportArchiveDetailDTO cwProjectReportArchiveDetailDTO);
+
+}
+
+
+
+

+ 47 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/xml/CwProjectReportArchiveDetailMapper.xml

@@ -0,0 +1,47 @@
+<?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.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveDetailMapper">
+
+    <select id="findList" resultType="com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO">
+        select a.id as 'id',
+        a.report_no as 'reportNo',
+        date_format(a.report_date,'%Y-%m-%d') as 'reportDate',
+        date_format(pra.audit_date,'%Y-%m-%d') as 'auditDate',
+        p.id as 'projectId',
+        p.id as 'cwProjectRecordsDTO.id',
+        pm.name as 'projectMasterName',
+        pm.name as 'cwProjectRecordsDTO.projectMasterName',
+        p.project_name as 'projectName',
+        p.project_name as 'cwProjectRecordsDTO.projectName',
+        su1.name as 'signatureAnnotatorName1',
+        su2.name as 'signatureAnnotatorName2',
+        pra.number as 'number',
+        (case when pra.audit_date is null then timestampdiff(day,a.report_date,now()) when pra.audit_date is not null then timestampdiff(day,a.report_date,pra.audit_date) end) as archiveDay
+        from cw_project_report_new_line a
+        left join cw_project_report pr on pr.id = a.report_id
+        left join sys_user su1 on su1.id = pr.signature_annotator1
+        left join sys_user su2 on su2.id = pr.signature_annotator2
+        left join cw_project_records p on p.id = pr.project_id
+        left join sys_user pm on pm.id = p.project_master_id
+        left join cw_project_report_archive_report prar on a.id = prar.report_id
+        left join cw_project_report_archive pra on prar.archive_id = pra.id
+        ${ew.customSqlSegment}
+        and a.report_number is not null and a.report_date is not null
+        <if test="cwProjectReportArchiveDetailDTO.status == '超期未归档'">
+            and pra.audit_date is null and timestampdiff(day,a.report_date,now())>60
+        </if>
+        <if test="cwProjectReportArchiveDetailDTO.status == '暂时未归档'">
+            and pra.audit_date is null and timestampdiff(day,a.report_date,now()) &lt;= 60
+        </if>
+        <if test="cwProjectReportArchiveDetailDTO.status == '已超期归档'">
+            and pra.audit_date is not null and timestampdiff(day,a.report_date,pra.audit_date)>60
+        </if>
+        <if test="cwProjectReportArchiveDetailDTO.status == '已按时归档'">
+            and pra.audit_date is not null and timestampdiff(day,a.report_date,pra.audit_date) &lt;= 60
+        </if>
+
+        order by a.report_date asc
+    </select>
+</mapper>

+ 138 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/CwProjectReportArchiveDetailService.java

@@ -0,0 +1,138 @@
+package com.jeeplus.test.cw.projectReportArchive.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.mapper.UserMapper;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.mapper.CwProjectRecordsMapper;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectInfoData;
+import com.jeeplus.test.cw.projectReport.mapper.CwProjectInfoMapper;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchive;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchiveDetail;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchiveReport;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveDetailMapper;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveFileMapper;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveMapper;
+import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveReportMapper;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.mapstruct.CwProjectReportArchiveDetailWrapper;
+import com.jeeplus.test.cw.projectReportArchive.service.mapstruct.CwProjectReportArchiveWrapper;
+import com.jeeplus.test.mould.service.SerialnumTplService;
+import com.jeeplus.test.oss.mapper.OssServiceMapper;
+import com.jeeplus.test.oss.service.OssService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+@Transactional
+public class CwProjectReportArchiveDetailService extends ServiceImpl<CwProjectReportArchiveDetailMapper, CwProjectReportArchiveDetail> {
+
+    @Resource
+    private CwProjectReportArchiveDetailMapper cwProjectReportArchiveDetailMapper;
+    @Resource
+    private CwProjectReportArchiveReportMapper cwProjectReportArchiveReportMapper;
+    @Resource
+    private CwProjectRecordsMapper cwProjectRecordsMapper;
+    @Resource
+    private UserMapper userMapper;
+    @Resource
+    private CwProjectInfoMapper cwProjectInfoMapper;
+
+    /**
+     * 项目归档列表信息
+     * @param page
+     * @param cwProjectReportArchiveDetailDTO
+     * @return
+     * @throws Exception
+     */
+    public IPage<CwProjectReportArchiveDetailDTO> findList(Page<CwProjectReportArchiveDetailDTO> page, CwProjectReportArchiveDetailDTO cwProjectReportArchiveDetailDTO) throws Exception{
+        QueryWrapper<CwProjectReportArchiveDetail> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwProjectReportArchiveDetailWrapper.INSTANCE.toEntity(cwProjectReportArchiveDetailDTO), CwProjectReportArchiveDetail.class );
+        queryWrapper.eq("a.del_flag","0");
+        if (ObjectUtil.isNotEmpty(cwProjectReportArchiveDetailDTO)) {
+            if (ObjectUtil.isNotEmpty(cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO())){
+                // 项目名称
+                if (StringUtils.isNotBlank(cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO().getProjectName())){
+                    List<CwProjectRecords> cwProjectRecords = cwProjectRecordsMapper.selectList(new QueryWrapper<CwProjectRecords>().lambda().like(CwProjectRecords::getProjectName, cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO().getProjectName()));
+                    List<String> ids = cwProjectRecords.stream().distinct().map(CwProjectRecords::getId).collect(Collectors.toList());
+                    if(CollectionUtil.isNotEmpty(ids)) {
+                        queryWrapper.in("p.id",ids);
+                    }else{
+                        return new Page<>();
+                    }
+                }
+                // 项目经理
+                if (StringUtils.isNotBlank(cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO().getProjectMasterId())){
+                    queryWrapper.eq("p.project_master_id",cwProjectReportArchiveDetailDTO.getCwProjectRecordsDTO().getProjectMasterId());
+                }
+                // 创建时间
+                if (ArrayUtil.isNotEmpty(cwProjectReportArchiveDetailDTO.getReportDates())){
+                    queryWrapper.between("a.report_date", cwProjectReportArchiveDetailDTO.getReportDates()[0], cwProjectReportArchiveDetailDTO.getReportDates()[1]);
+                }
+                // 归档时间
+                if (ArrayUtil.isNotEmpty(cwProjectReportArchiveDetailDTO.getAuditDates())){
+                    queryWrapper.between("pra.audit_date", cwProjectReportArchiveDetailDTO.getAuditDates()[0], cwProjectReportArchiveDetailDTO.getAuditDates()[1]);
+                }
+                // 报告文号
+                if (StringUtils.isNotBlank(cwProjectReportArchiveDetailDTO.getReportNo())){
+                    queryWrapper.like("a.report_no",cwProjectReportArchiveDetailDTO.getReportNo());
+                }
+                // 案卷号
+                if (StringUtils.isNotBlank(cwProjectReportArchiveDetailDTO.getNumber())){
+                    queryWrapper.like("pra.number",cwProjectReportArchiveDetailDTO.getNumber());
+                }
+            }
+        }
+        IPage<CwProjectReportArchiveDetailDTO> list = cwProjectReportArchiveDetailMapper.findList(page, queryWrapper,cwProjectReportArchiveDetailDTO);
+        List<CwProjectReportArchiveDetailDTO> records = list.getRecords();
+        if (null != records && records.size()>0){
+            //循环查询出来的数据
+            for (CwProjectReportArchiveDetailDTO info : records) {
+                //如果归档日期为空,则表示该报告还未归档
+                if(null == info.getAuditDate()){
+                    //如果归档日期差大于60天,表示超期未归档
+                    if(info.getArchiveDay()>60){
+                        info.setStatus("超期未归档");
+                        long n = (info.getArchiveDay()) / 60;
+                        String money = Long.toString(n * 200);
+                        info.setOverdueDay(String.valueOf(info.getArchiveDay() - 60));
+                        info.setFineMoney(money);
+                    }else{
+                        //如果归档日期差小于等于60天,表示暂时未归档
+                        info.setStatus("暂时未归档");
+                        info.setOverdueDay(String.valueOf(info.getArchiveDay() - 60));
+                        info.setFineMoney("0");
+                    }
+                } else {
+                    //如果归档日期不为空,则表示该报告已归档
+
+                    //如果归档日期差大于60天,表示已超期归档
+                    if(info.getArchiveDay()>60){
+                        info.setStatus("已超期归档");
+                        long n = (info.getArchiveDay()) / 60;
+                        String money = Long.toString(n * 200);
+                        info.setOverdueDay(String.valueOf(info.getArchiveDay() - 60));
+                        info.setFineMoney(money);
+                    }else{
+                        //如果归档日期差小于等于60天,表示已按时归档
+                        info.setStatus("已按时归档");
+                        info.setOverdueDay(String.valueOf(info.getArchiveDay() - 60));
+                        info.setFineMoney("0");
+                    }
+                }
+            }
+        }
+        return list;
+    }
+}

+ 292 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/dto/CwProjectReportArchiveDetailDTO.java

@@ -0,0 +1,292 @@
+package com.jeeplus.test.cw.projectReportArchive.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 财务-项目报告归档-项目归档
+ */
+public class CwProjectReportArchiveDetailDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称",width = 40)
+    private String projectName;
+
+    /**
+     * 项目负责人
+     */
+    @Excel(name = "项目负责人",width = 12)
+    private String projectMasterName;
+
+    /**
+     * 报告文号
+     */
+    @Excel(name = "报告文号",width = 26)
+    private String reportNo;
+
+    /**
+     * 报告日期
+     */
+    @Excel(name = "报告日期", exportFormat="yyyy-MM-dd",width = 16)
+    private Date reportDate;
+
+    /**
+     * 归档时间
+     */
+    @Excel(name = "归档日期", exportFormat="yyyy-MM-dd",width = 16)
+    private Date auditDate;
+
+    /**
+     * 签字注师1
+     */
+    @Excel(name = "签字注师1",width = 12)
+    private String signatureAnnotatorName1;
+
+    /**
+     * 签字注师2
+     */
+    @Excel(name = "签字注师2",width = 12)
+    private String signatureAnnotatorName2;
+
+    /**
+     * 逾期天数(天数)
+     */
+    @Excel(name = "逾期天数",type = 10,width = 10)
+    private String overdueDay;
+
+    /**
+     * 归档状态
+     */
+    @Excel(name = "归档状态",width = 12)
+    private String status;
+
+    /**
+     * 罚款金额
+     */
+    @Excel(name = "罚款金额",type = 10,width = 10)
+    private String fineMoney;
+
+    /**
+     * 超期天数
+     */
+    private String overDueDay;
+
+    /**
+     * 合同id
+     */
+    private String contractId;
+
+    /**
+     * 合同编号
+     */
+    private String contractNumber;
+
+    /**
+     * 案卷号
+     */
+    private String number;
+
+    /**
+     * 报告到归档时间差(天数)
+     */
+    private Integer archiveDay;
+
+    /**
+     * 项目信息
+     */
+    private CwProjectRecordsDTO cwProjectRecordsDTO;
+
+    /**
+     * 归档时间区间
+     */
+    private String[] auditDates;
+
+    /**
+     * 报告时间区间
+     */
+    private String[] reportDates;
+
+    private static final long serialVersionUID = 1L;
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getReportNo() {
+        return reportNo;
+    }
+
+    public void setReportNo(String reportNo) {
+        this.reportNo = reportNo;
+    }
+
+    public Date getReportDate() {
+        return reportDate;
+    }
+
+    public void setReportDate(Date reportDate) {
+        this.reportDate = reportDate;
+    }
+
+    public Date getAuditDate() {
+        return auditDate;
+    }
+
+    public void setAuditDate(Date auditDate) {
+        this.auditDate = auditDate;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getOverDueDay() {
+        return overDueDay;
+    }
+
+    public void setOverDueDay(String overDueDay) {
+        this.overDueDay = overDueDay;
+    }
+
+    public String getFineMoney() {
+        return fineMoney;
+    }
+
+    public void setFineMoney(String fineMoney) {
+        this.fineMoney = fineMoney;
+    }
+
+    public String getProjectMasterName() {
+        return projectMasterName;
+    }
+
+    public void setProjectMasterName(String projectMasterName) {
+        this.projectMasterName = projectMasterName;
+    }
+
+    public String getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(String contractId) {
+        this.contractId = contractId;
+    }
+
+    public String getContractNumber() {
+        return contractNumber;
+    }
+
+    public void setContractNumber(String contractNumber) {
+        this.contractNumber = contractNumber;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    public Integer getArchiveDay() {
+        return archiveDay;
+    }
+
+    public void setArchiveDay(Integer archiveDay) {
+        this.archiveDay = archiveDay;
+    }
+
+    public String getOverdueDay() {
+        return overdueDay;
+    }
+
+    public void setOverdueDay(String overdueDay) {
+        this.overdueDay = overdueDay;
+    }
+
+    public String getSignatureAnnotatorName1() {
+        return signatureAnnotatorName1;
+    }
+
+    public void setSignatureAnnotatorName1(String signatureAnnotatorName1) {
+        this.signatureAnnotatorName1 = signatureAnnotatorName1;
+    }
+
+    public String getSignatureAnnotatorName2() {
+        return signatureAnnotatorName2;
+    }
+
+    public void setSignatureAnnotatorName2(String signatureAnnotatorName2) {
+        this.signatureAnnotatorName2 = signatureAnnotatorName2;
+    }
+
+    public CwProjectRecordsDTO getCwProjectRecordsDTO() {
+        return cwProjectRecordsDTO;
+    }
+
+    public void setCwProjectRecordsDTO(CwProjectRecordsDTO cwProjectRecordsDTO) {
+        this.cwProjectRecordsDTO = cwProjectRecordsDTO;
+    }
+
+    public String[] getAuditDates() {
+        return auditDates;
+    }
+
+    public void setAuditDates(String[] auditDates) {
+        this.auditDates = auditDates;
+    }
+
+    public String[] getReportDates() {
+        return reportDates;
+    }
+
+    public void setReportDates(String[] reportDates) {
+        this.reportDates = reportDates;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+}

+ 16 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/mapstruct/CwProjectReportArchiveDetailWrapper.java

@@ -0,0 +1,16 @@
+package com.jeeplus.test.cw.projectReportArchive.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchiveDetail;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDetailDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwProjectReportArchiveDetailWrapper extends EntityWrapper<CwProjectReportArchiveDetailDTO, CwProjectReportArchiveDetail> {
+
+    CwProjectReportArchiveDetailWrapper INSTANCE = Mappers.getMapper(CwProjectReportArchiveDetailWrapper.class);
+
+}

+ 122 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OSSClientService.java

@@ -6,6 +6,7 @@ import com.aliyun.oss.OSSClientBuilder;
 import com.aliyun.oss.model.OSSObject;
 import com.aliyun.oss.model.PutObjectResult;
 import com.aliyun.oss.model.SimplifiedObjectMeta;
+import com.jeeplus.sys.utils.Global;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -28,6 +29,9 @@ public class OSSClientService {
     @Value("${config.accessory.aliyun.bucketName}")
     private String bucketName;
 
+    @Value("${qzBucketName}")
+    private String qzBucketName;
+
     @Value("${config.accessory.aliyun.endpoint}")
     private String endpoint;
 
@@ -200,6 +204,124 @@ public class OSSClientService {
         }
     }
 
+
+    /**
+     * 文件下载(签章系统)
+     * @param key
+     * @param fileName
+     */
+    public byte[] downQzBytesByStream(String key, String fileName){
+        OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
+        byte[] bytes = null;
+        BufferedInputStream in = null;
+        ByteArrayOutputStream outputStream = null;
+        log.info("开始从云服务器加载文件,文件名:{}",fileName);
+        try {
+            // 创建OSSClient实例
+            long start = System.currentTimeMillis();
+            OSSObject ossObject = ossClient.getObject(qzBucketName, key);
+            in = new BufferedInputStream(ossObject.getObjectContent());
+            outputStream = new ByteArrayOutputStream();
+            byte[] car=new byte[1024];
+            int L=0;
+            while((L=in.read(car))!=-1){
+                outputStream.write(car, 0,L);
+            }
+            bytes = outputStream.toByteArray();
+            long end = System.currentTimeMillis();
+            log.info("从云服务器加载文件成功,文件名:{},耗时:{}ms",fileName,end-start);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }finally {
+            if (in!=null){
+                try {
+                    in.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (outputStream!=null){
+                try {
+                    outputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return  bytes;
+    }
+
+
+    /**
+     * 附件下载到本地指定文件夹(签章系统)
+     * @param key
+     * @param fileName
+     */
+    public void downQzByStreamSaveLocal(String key, String fileName,String downFileStr){
+        try {
+            // 创建OSSClient实例
+            OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
+            OSSObject ossObject = ossClient.getObject(qzBucketName, key);
+            BufferedInputStream in = new BufferedInputStream(ossObject.getObjectContent());
+
+
+            //写入到文件(注意文件保存路径的后面一定要加上文件的名称)
+            FileOutputStream fileOut = new FileOutputStream(downFileStr);
+            BufferedOutputStream bos = new BufferedOutputStream(fileOut);
+            byte[] buf = new byte[4096];
+            int length = in.read(buf);
+            //保存文件
+            while(length != -1)
+            {
+                bos.write(buf, 0, length);
+                length = in.read(buf);
+            }
+            if(bos!=null){
+                bos.flush();
+                bos.close();
+            }
+            if(in!=null){
+                in.close();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 阿里云获取临时文件查看url
+     * 签章文件查看
+     * @param file
+     */
+    public String getQzFileTemporaryLookUrl(String file){
+        URL url = null;
+        try {
+            OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
+
+            file = file.replace("amp;","");
+            String aliyunUrl = Global.getAliyunUrl();
+            String aliDownloadUrl = Global.getAliDownloadUrl();
+            String cons = "";
+            if (file.contains(aliyunUrl)){
+                cons = aliyunUrl;
+            }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+                cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+            }else {
+                cons = aliDownloadUrl;
+            }
+            String key = file.split(cons+"/")[1];
+            // 指定过期时间为24小时。
+            Date expiration = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 );
+            url = ossClient.generatePresignedUrl(qzBucketName, key, expiration);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+        return url.toString();
+    }
+
+
     public String datePath(){
         Calendar date = Calendar.getInstance();
         String year = String.valueOf(date.get(Calendar.YEAR));