Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

lizhenhao 2 yıl önce
ebeveyn
işleme
0dc033ce88
34 değiştirilmiş dosya ile 1457 ekleme ve 84 silme
  1. 4 0
      jeeplus-module/jeeplus-test/pom.xml
  2. 9 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractInfoController.java
  3. 2 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractFile.java
  4. 2 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractInfo.java
  5. 5 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractFileMapper.java
  6. 10 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractInfoMapper.java
  7. 3 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractFileMapper.xml
  8. 7 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractInfoMapper.xml
  9. 18 13
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFileService.java
  10. 14 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java
  11. 49 13
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportController.java
  12. 266 5
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java
  13. 5 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectInfoData.java
  14. 31 5
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportData.java
  15. 7 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectInfoMapper.java
  16. 13 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportMapper.java
  17. 7 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/ProjectReportWorkAttachmentMapper.java
  18. 3 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectInfoMapper.xml
  19. 53 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportMapper.xml
  20. 8 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/ProjectReportWorkAttachmentMapper.xml
  21. 13 3
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java
  22. 82 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/controller/CwProjectReportArchiveDetailController.java
  23. 128 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/domain/CwProjectReportArchiveDetail.java
  24. 22 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/CwProjectReportArchiveDetailMapper.java
  25. 47 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/mapper/xml/CwProjectReportArchiveDetailMapper.xml
  26. 139 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/CwProjectReportArchiveDetailService.java
  27. 292 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/dto/CwProjectReportArchiveDetailDTO.java
  28. 16 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportArchive/service/mapstruct/CwProjectReportArchiveDetailWrapper.java
  29. 59 32
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/service/ReportCancellApplyService.java
  30. 122 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OSSClientService.java
  31. 9 5
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java
  32. 5 0
      jeeplus-web/pom.xml
  33. 4 2
      jeeplus-web/src/main/resources/application-development.yml
  34. 3 1
      jeeplus-web/src/main/resources/application-production.yml

+ 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>
 

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractInfoController.java

@@ -88,4 +88,13 @@ public class ContractInfoController {
     public void updateStatusById(@RequestBody ContractInfo info) {
         service.updateStatusById(info);
     }
+
+    /**
+     * 根据id修改合同实际金额
+     */
+    @ApiOperation(value = "根据id修改合同实际金额")
+    @PostMapping(value = "updateInfo")
+    public void updateInfo(@RequestBody ContractInfo info) {
+        service.updateInfo(info);
+    }
 }

+ 2 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractFile.java

@@ -66,13 +66,13 @@ public class ContractFile extends BaseEntity {
     private String customerNo;
 
     /**
-     * 附件信息
+     * 合同正文附件信息
      */
     @TableField(exist = false)
     private List<WorkAttachmentDto> contractProperList;
 
     /**
-     * 附件信息
+     * 归档附件信息
      */
     @TableField(exist = false)
     private List<WorkAttachmentDto> contractInfoList;

+ 2 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractInfo.java

@@ -91,4 +91,6 @@ public class ContractInfo extends BaseEntity {
     @TableField(exist = false)
     private List<CwWorkClientBaseDTO> cwWorkClientContactDTOList;
 
+    @TableField(exist = false)
+    private String departmentName;
 }

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractFileMapper.java

@@ -28,4 +28,9 @@ public interface ContractFileMapper extends BaseMapper<ContractFile> {
     List<WorkAttachment> findList(@Param("id") String id);
 
     Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    /**
+     * 根据attachmentId删除上传文件信息
+     */
+    void deleteFileInfo(String attachmentId);
 }

+ 10 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractInfoMapper.java

@@ -39,4 +39,14 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
     List<WorkAttachment> findList(@Param("id") String id);
 
     Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    /**
+     * 修改合同实际金额
+     * @param id
+     * @param actualContractAmount
+     * @param contractApprovalType
+     */
+    void updateInfo(@Param("id") String id,
+                    @Param("actualContractAmount") Double actualContractAmount,
+                    @Param("contractApprovalType") String contractApprovalType);
 }

+ 3 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractFileMapper.xml

@@ -9,6 +9,9 @@
 <!--        </if>-->
         WHERE del_flag = 0 AND contract_info_id = #{id}
     </update>
+    <delete id="deleteFileInfo">
+        delete from work_attachment where attachment_id = #{attachmentId}
+    </delete>
     <select id="selectFileByContractInfoId"
             resultType="com.jeeplus.test.cw.contractRegistration.domain.ContractFile">
         SELECT * FROM `cw_work_contract_file` WHERE del_flag = 0 AND contract_info_id = #{id}

+ 7 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractInfoMapper.xml

@@ -8,6 +8,10 @@
     <update id="updatefiledTypeById">
         UPDATE cw_work_contract_info SET `filed_type` = #{status} WHERE del_flag = 0 AND id = #{id}
     </update>
+    <update id="updateInfo">
+        UPDATE cw_work_contract_info SET actual_contract_amount = #{actualContractAmount}
+        ,contract_approval_type = #{contractApprovalType} where del_flag = 0 AND id = #{id}
+    </update>
 
     <select id="findPageList" resultType="com.jeeplus.test.cw.contractRegistration.domain.ContractInfo">
         SELECT
@@ -37,12 +41,14 @@
             a.status,
             b.filed_type as filedType,
             e.ID_ as taskFiledId,
-            b.proc_ins_id as taskFiledProcInsId
+            b.proc_ins_id as taskFiledProcInsId,
+            d.name as departmentName
 		FROM
 			cw_work_contract_info a
             LEFT JOIN cw_work_contract_file b on a.id = b.contract_info_id
             LEFT JOIN sys_user c ON a.create_by = c.id
             LEFT JOIN act_ru_task e ON b.proc_ins_id = e.PROC_INST_ID_
+            LEFT JOIN sys_office d on a.department = d.id
 		${ew.customSqlSegment}
 		ORDER BY a.update_date DESC
     </select>

+ 18 - 13
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFileService.java

@@ -48,16 +48,18 @@ public class ContractFileService {
     }
 
     public String saveInfo(ContractFile contractFile) throws Exception {
-        if (StringUtils.isNotEmpty(contractFile.getId())) {
-            ContractFile info = mapper.selectFileByContractInfoId(contractFile.getId());
-            if (info != null) {
-                contractFile.setFileCreateName(contractFile.getCreateBy());
-                contractFile.setCreateBy(contractFile.getCreateId());
-                infoMapper.updatefiledTypeById(contractFile.getContractInfoId(),contractFile.getFiledType());
-                return update(contractFile, info.getId());
-            }
+//        if (StringUtils.isNotEmpty(contractFile.getId())) {
+//
+//        }
+        ContractFile info = mapper.selectFileByContractInfoId(contractFile.getId());
+        if (null != info) {
+            contractFile.setFileCreateName(contractFile.getCreateBy());
+            contractFile.setCreateBy(contractFile.getCreateId());
+            infoMapper.updatefiledTypeById(contractFile.getContractInfoId(),contractFile.getFiledType());
+            return update(contractFile, info.getId());
+        }else {
+            return add(contractFile);
         }
-        return add(contractFile);
     }
 
     /**
@@ -98,7 +100,10 @@ public class ContractFileService {
         mapper.updateById(file);
         List<WorkAttachmentDto> list = contractFile.getContractInfoList();
         if (CollectionUtils.isNotEmpty(list)) {
-            updateFiles(list, userDTO, contractFile.getId());
+            updateFiles(list, userDTO, file.getId());
+        }else {
+            //删除文件信息
+            mapper.deleteFileInfo(file.getId());
         }
         return file.getId();
     }
@@ -109,7 +114,7 @@ public class ContractFileService {
             dto = mapper.findByInfoId(id);
         }
         if (dto != null){
-            // 查询附件信息
+            // 查询归档附件信息
             List<WorkAttachmentDto> dtos = mapper.findDtos(dto.getFileId());
             List<WorkAttachmentDto> contractInfoList = mapper.findDtos(dto.getContractInfoId());
 
@@ -117,13 +122,13 @@ public class ContractFileService {
                 for (WorkAttachmentDto i : dtos) {
                     i.setCreateBy(UserUtils.get(i.getBy()));
                 }
-                dto.setContractProperList(dtos);
+                dto.setContractInfoList(dtos);
             }
             if (CollectionUtils.isNotEmpty(contractInfoList)){
                 for (WorkAttachmentDto i : contractInfoList){
                     i.setCreateBy(UserUtils.get(i.getBy()));
                 }
-                dto.setContractInfoList(contractInfoList);
+                dto.setContractProperList(contractInfoList);
             }
 
         }

+ 14 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java

@@ -55,6 +55,12 @@ public class ContractInfoService {
     public void updateStatusById(ContractInfo info) {
         mapper.updateStatusById(info.getId(), info.getStatus());
     }
+    /**
+     * 根据id修改合同实际金额
+     */
+    public void updateInfo(ContractInfo info) {
+        mapper.updateInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType());
+    }
 
     public IPage<ContractInfo> list(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
 //        LambdaQueryWrapper<ContractInfo> wrapper = new LambdaQueryWrapper<>();
@@ -204,8 +210,14 @@ public class ContractInfoService {
 //        info.setNo(serialNum);
         contractInfo.setUpdateBy(userDTO.getId());
         contractInfo.setUpdateDate(new Date());
-        int num = Integer.parseInt(contractInfo.getChangeNum()) + 1;
-        contractInfo.setChangeNum(num + "");
+        if (!contractInfo.getStatus().equals("5")){
+            int num = Integer.parseInt(contractInfo.getChangeNum()) + 1;
+            contractInfo.setChangeNum(num + "");
+        }else {
+            contractInfo.setChangeNum(contractInfo.getChangeNum());
+        }
+
+
         mapper.updateById(contractInfo);
         ContractParticipant participant = new ContractParticipant();
         //对参与签约方进行操作

+ 49 - 13
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportController.java

@@ -1,30 +1,22 @@
 package com.jeeplus.test.cw.projectReport.controller;
 
 import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.ObjectUtil;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.TypeReference;
-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.google.common.collect.Maps;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.redis.RedisUtils;
 import com.jeeplus.common.utils.ResponseUtil;
-import com.jeeplus.flowable.model.Flow;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.utils.DictUtils;
 import com.jeeplus.sys.utils.UserUtils;
-import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
-import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
-import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
-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.cw.projectReport.service.dto.CwProjectReportDTO;
 import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import com.jeeplus.test.oss.domain.WorkAttachment;
@@ -33,17 +25,18 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.flowable.engine.TaskService;
-import org.flowable.task.api.Task;
 import org.springframework.beans.factory.annotation.Autowired;
 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.Map;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 /**
  * @author: 王强
@@ -249,4 +242,47 @@ public class CwProjectReportController {
         String s = "projectReportService.updateSignatureStatusById(data);";
         return ResponseEntity.ok(s);
     }
+
+
+
+    /**
+     * 导出分所报销数据
+     * @param cwProjectReportData
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出报告数据信息")
+    @GetMapping("export")
+    @ApiOperation(value = "导出报告数据信息excel")
+    public void exportFile(CwProjectReportData cwProjectReportData, Page <CwProjectReportData> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename ( );
+
+        List<CwProjectReportData> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = projectReportService.findList ( page, cwProjectReportData ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = projectReportService.findList ( page, cwProjectReportData ).getRecords().stream ( ).filter ( info ->
+                    options.getSelectIds ( ).contains ( info.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = projectReportService.findList ( page, cwProjectReportData ).getRecords();
+        }
+        if(result.size()>0){
+            for (CwProjectReportData info : result) {
+                if(StringUtils.isNotBlank(info.getStatus())){
+                    info.setStatus(DictUtils.getDictLabel(info.getStatus(), "cw_status", ""));
+                }
+                if(StringUtils.isNotBlank(info.getStatus1())){
+                    info.setStatus1(DictUtils.getDictLabel(info.getStatus1(), "cw_status", ""));
+                }
+                if(StringUtils.isNotBlank(info.getStatus2())){
+                    info.setStatus1(DictUtils.getDictLabel(info.getStatus2(), "cw_project_report_sign_status", ""));
+                }
+            }
+        }
+        EasyPoiUtil.exportExcel ( result, "报告信息",  options.getSheetName ( ), CwProjectReportData.class, fileName, response );
+    }
 }

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

@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
 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;
@@ -20,8 +21,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;
@@ -31,7 +36,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.*;
 
@@ -45,8 +55,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");
 
@@ -68,7 +84,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());
         // 将取回的数据转换为审核通过所需要的参数
@@ -156,10 +172,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/CwProjectInfoData.java

@@ -20,6 +20,11 @@ import java.util.List;
 @TableName("cw_project_report_new_line")
 public class CwProjectInfoData extends BaseEntity {
 
+    /**
+     * 报告作废标记
+     */
+    private String deleteSign;
+
     //报告文号(字典值)
     public static final String BIZ_CODE = "14";
 

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

@@ -1,11 +1,13 @@
 package com.jeeplus.test.cw.projectReport.domain;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.jeeplus.core.query.Query;
 import com.jeeplus.core.service.dto.BaseDTO;
 import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
 import lombok.Data;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -33,16 +35,19 @@ public class CwProjectReportData extends BaseDTO {
     /**
      * 单据编号
      */
+    @Excel(name = "单据编号",width = 20)
     private String documentNo;
     /**
      * 项目名称
      */
     @Query(tableColumn = "b.project_name")
+    @Excel(name = "项目名称",width = 40)
     private String projectName;
     /**
      * 项目编号
      */
     @Query(tableColumn = "b.project_number")
+    @Excel(name = "项目编号",width = 20)
     private String projectNumber;
     /**
      * 项目id
@@ -52,10 +57,16 @@ public class CwProjectReportData extends BaseDTO {
      * 报告所属部门
      */
     private String officeId;
+
+
+    @TableField(exist = false)
+    @Excel(name = "报告所属部门",width = 20)
+    private String departmentName; //部门名称
     /**
      * 项目经理
      */
     @Query(tableColumn = "e.name")
+    @Excel(name = "项目经理",width = 12)
     private String projectMasterName;
     /**
      * 签字注师1
@@ -78,19 +89,28 @@ public class CwProjectReportData extends BaseDTO {
     private String processDefinitionId;
 
     /**
+     * 创建人
+     */
+    @TableField(exist = false)
+    @Excel(name = "创建人",width = 12)
+    private String userName; //用户名
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", exportFormat="yyyy-MM-dd",width = 16)
+    private Date createDate;
+
+    /**
      * 状态
      */
+    @Excel(name = "状态",width = 12)
     private String status;
 
     //新建行数据
     @TableField(exist = false)
     List<CwProjectInfoData> cwProjectInfoList;
 
-    @TableField(exist = false)
-    private String departmentName; //部门名称
-
-    @TableField(exist = false)
-    private String userName; //用户名
 
     @TableField(exist = false)
     private String[] contractDates;
@@ -123,6 +143,7 @@ public class CwProjectReportData extends BaseDTO {
     /**
      * 公章流程status
      */
+    @Excel(name = "签章状态",width = 12)
     private String status1;
 
     /**
@@ -149,4 +170,9 @@ public class CwProjectReportData extends BaseDTO {
      * 公章+执业章流程表id
      */
     private String sid2;
+
+    /**
+     * 电子签章文件地址
+     */
+    private String signatureUrl;
 }

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

@@ -3,6 +3,7 @@ package com.jeeplus.test.cw.projectReport.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectInfoData;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -14,6 +15,12 @@ import java.util.List;
 @Mapper
 public interface CwProjectInfoMapper extends BaseMapper<CwProjectInfoData> {
 
+    /**
+     * 根据id修改作废标记
+     * @param id
+     */
+    void updateSignById(@Param("id") String id, @Param("sign")String sign);
+
     List<CwProjectInfoData> selectIdByReportId(String id);
 
     List<CwProjectInfoData> selectByReportId(String id);

+ 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);
 }

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

@@ -1,6 +1,9 @@
 <?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.projectReport.mapper.CwProjectInfoMapper">
+    <update id="updateSignById">
+        update cw_project_report_new_line set delete_sign = #{sign} where id = #{id}
+    </update>
     <delete id="deleteByReportId">
         update cw_project_report_new_line set del_flag = '1' where report_id = #{id}
     </delete>

+ 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 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java

@@ -101,7 +101,6 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
 
     @Autowired
     private UserService userService;
-
     @Autowired
     private OSSClientService ossClientService;
 
@@ -198,8 +197,6 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                     }
                     infoMapper.deleteById(data.getId());
                 });
-
-                System.out.println("ids01" + ids);
                 finalInfoList.forEach(in->{
                     in.setUpdateBy(UserUtils.getCurrentUserDTO().getId());
                     in.setUpdateDate(new Date());
@@ -342,6 +339,14 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
     }
 
     /**
+     * 保存签章文件地址
+     * @param projectReportData
+     */
+    public void updateSignatureUrl(CwProjectReportData projectReportData){
+        reportMapper.updateSignatureUrl(projectReportData);
+    }
+
+    /**
      * 新增
      */
     @Transactional(rollbackFor = Exception.class)
@@ -1061,4 +1066,9 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
             }
         }
     }
+
+    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>

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

@@ -0,0 +1,139 @@
+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");
+        queryWrapper.eq("pr.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);
+
+}

+ 59 - 32
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/service/ReportCancellApplyService.java

@@ -20,6 +20,7 @@ import com.jeeplus.test.cw.projectReport.domain.*;
 import com.jeeplus.test.cw.projectReport.mapper.CwProjectInfoMapper;
 import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportCancelMapper;
 import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportMapper;
+import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
 import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportDTO;
 import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
 import com.jeeplus.test.cw.projectReport.service.mapstruct.CwProjectReportFileWrapper;
@@ -57,6 +58,9 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
     private CwProjectInfoMapper infoMapper;
 
     @Resource
+    private ProjectReportWorkAttachmentMapper attachmentMapper;
+
+    @Resource
     private CwProjectReportMapper reportMapper;
 
     /**
@@ -136,23 +140,36 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
         BeanUtils.copyProperties(reportData, report);
         report.setUpdateBy(userDTO.getId());
         report.setUpdateDate(new Date());
-        //向存放报废报告号表中添加数据
-        CwProjectReportCancel cancel = new CwProjectReportCancel();
-        cancel.setId(UUID.randomUUID().toString().replace("-", ""));
-        cancel.setReportNo(reportData.getReportNo());
-        cancelMapper.insert(cancel);
+
         applyMapper.updateById(report);
         //修改报告管理的del_flag
-        CwProjectInfoData newLine = infoMapper.getById(report.getReportNewLineId());
-        //根据newLine的reportid找到报告表
-        CwProjectReport projectReport = reportMapper.selectById(newLine.getReportId());
-        if (report.getStatus().equals("2")){
-            projectReport.setDelFlag(1);
-            reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
-        }else if (report.getStatus().equals("1") || report.getStatus().equals("4") || report.getStatus().equals("3")){
-            projectReport.setDelFlag(0);
-            reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
+        if (report.getStatus().equals("5")){
+            //当审核通过的时候,删除新建行的newLine信息
+            infoMapper.deleteById(report.getReportNewLineId());
+            //删除新建行下的文件信息
+            //删除work_attachment_id信息
+            attachmentMapper.deleteByAttachMnentId(report.getReportNewLineId());
+            //向存放报废报告号表中添加数据
+            CwProjectReportCancel cancel = new CwProjectReportCancel();
+            cancel.setId(UUID.randomUUID().toString().replace("-", ""));
+            cancel.setReportNo(reportData.getReportNo());
+            cancelMapper.insert(cancel);
         }
+        //驳回撤回操作
+//        if (report.getStatus().equals("3") || report.getStatus().equals("4")){
+//            //根据新建行id修改newLine的作废删除标记
+//            infoMapper.updateSignById(report.getReportNewLineId(),"1");
+//        }
+//        CwProjectInfoData newLine = infoMapper.getById(report.getReportNewLineId());
+//        //根据newLine的reportid找到报告表
+//        CwProjectReport projectReport = reportMapper.selectById(newLine.getReportId());
+//        if (report.getStatus().equals("2")){
+//            projectReport.setDelFlag(1);
+//            reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
+//        }else if (report.getStatus().equals("1") || report.getStatus().equals("4") || report.getStatus().equals("3")){
+//            projectReport.setDelFlag(0);
+//            reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
+//        }
 
         return report.getId();
     }
@@ -174,25 +191,28 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
                 report.setId(id);
             }
         }
-        //向存放报废报告号表中添加数据
-        CwProjectReportCancel cancel = new CwProjectReportCancel();
-        cancel.setId(UUID.randomUUID().toString().replace("-", ""));
-        cancel.setReportNo(reportData.getReportNo());
-        cancelMapper.insert(cancel);
-        this.applyMapper.insert(report);
-        applyMapper.updateById(report);
+        //根据新建行id修改newLine的作废删除标记
+        infoMapper.updateSignById(report.getReportNewLineId(),"1");
 
-        //修改报告管理的del_flag
-        CwProjectInfoData newLine = infoMapper.getById(report.getReportNewLineId());
-        //根据newLine的reportid找到报告表
-        CwProjectReport projectReport = reportMapper.selectById(newLine.getReportId());
-        if (report.getStatus().equals("2")){
-            projectReport.setDelFlag(1);
-            reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
-        }else if (report.getStatus().equals("1") || report.getStatus().equals("4") || report.getStatus().equals("3")){
-            projectReport.setDelFlag(0);
-            reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
-        }
+        this.applyMapper.insert(report);
+//        //向存放报废报告号表中添加数据
+//        CwProjectReportCancel cancel = new CwProjectReportCancel();
+//        cancel.setId(UUID.randomUUID().toString().replace("-", ""));
+//        cancel.setReportNo(reportData.getReportNo());
+//        cancelMapper.insert(cancel);
+//        applyMapper.updateById(report);
+//
+//        //修改报告管理的del_flag
+//        CwProjectInfoData newLine = infoMapper.getById(report.getReportNewLineId());
+//        //根据newLine的reportid找到报告表
+//        CwProjectReport projectReport = reportMapper.selectById(newLine.getReportId());
+//        if (report.getStatus().equals("2")){
+//            projectReport.setDelFlag(1);
+//            reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
+//        }else if (report.getStatus().equals("1") || report.getStatus().equals("4") || report.getStatus().equals("3")){
+//            projectReport.setDelFlag(0);
+//            reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
+//        }
 
         return report.getId();
     }
@@ -209,6 +229,7 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
 
         queryWrapper.eq("a.del_flag","0");
         queryWrapper.eq("a.status","5");
+        queryWrapper.eq("b.delete_sign","0");
         queryWrapper.orderByDesc("a.create_date");
         if (StringUtils.isNotEmpty(reportInfoDto.getProjectName())) {
             queryWrapper.like("c.project_name", reportInfoDto.getProjectName());
@@ -223,6 +244,12 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
         //删除前先将报告文号给复原
         ArrayList<String> strings = Lists.newArrayList(idArray);
         for (int i=0;i<strings.size();i++){
+            //修改新建行的del_flag为0,delete_sign为0
+            ReportCancellApply cancellApply = applyMapper.selectById(strings.get(i));
+            CwProjectInfoData infoData = infoMapper.getById(cancellApply.getReportNewLineId());
+            infoData.setDelFlag(0);
+            infoData.setDeleteSign("0");
+            infoMapper.updateById(infoData);
             ReportInfoDto reportInfoDto = applyMapper.queryById(strings.get(i));
             cancelMapper.deleteByReportNo(reportInfoDto.getReportNo());
         }

+ 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));

+ 9 - 5
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -201,7 +201,7 @@ public class UserController {
         if ( StrUtil.isNotBlank ( userDTO.getNewPassword ( ) ) ) {
             userDTO.setPassword ( SecurityUtils.encryptPassword ( userDTO.getNewPassword ( ) ) );
         }
-        if ( isCheckLoginName ( userDTO.getOldLoginName ( ), userDTO.getLoginName ( ) ) ) {
+        if ( isCheckLoginName ( userDTO.getOldLoginName ( ),userDTO.getId(), userDTO.getLoginName ( ) ) ) {
             return ResponseEntity.badRequest ( ).body ( "保存用户'" + userDTO.getLoginName ( ) + "'失败,登录名已存在!" );
         }
         // 保存用户信息
@@ -409,17 +409,21 @@ public class UserController {
     }
 
 
-    private boolean isCheckLoginName(String oldLoginName, String loginName) {
+    private boolean isCheckLoginName(String oldLoginName,String oldLoginId, String loginName) {
         if (StringUtils.isNotBlank(loginName)) {
             List<User> userList = userService.list(new QueryWrapper<User>().lambda().eq(User::getLoginName,loginName));
             if (CollectionUtil.isNotEmpty(userList)) {
-                return true;
+                for (User info: userList) {
+                    if(!info.getId().equals(oldLoginId)){
+                        return true;
+                    }
+                }
             }
-            if (StringUtils.isNotBlank(oldLoginName)){
+            /*if (StringUtils.isNotBlank(oldLoginName)){
                 if ( loginName.equals ( oldLoginName ) ) {
                     return true;
                 }
-            }
+            }*/
         }
         return false;
     }

+ 5 - 0
jeeplus-web/pom.xml

@@ -116,6 +116,11 @@
             <artifactId>jeeplus-test</artifactId>
             <version>${project.parent.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 4 - 2
jeeplus-web/src/main/resources/application-development.yml

@@ -48,7 +48,7 @@ spring:
         master:
           username: root
           password: root
-          url: jdbc:mysql://192.168.2.4:3306/assess_process_master?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://127.0.0.1:3306/assess_process_master?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
           driver-class-name: com.mysql.cj.jdbc.Driver
 
           #oracle database settings
@@ -211,6 +211,8 @@ yy_shcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpris
 publicPassword: jsxgpassword
 #阿里云文件夹路径
 aliyun_directory: attachment-file/assess
+#签章阿里云文件bucketName
+qzBucketName: xg-qz
 
 #apptoken: Mt4een4BN8
 #appsecret: qhA4aV2GKE8Oq8k4G3twLiUn4U60cN
@@ -257,7 +259,7 @@ company_round_seal_id_vertical: 2898043523878957918
 #公司方章
 company_parties_seal_id: 2894163220106129636
 #审定单用印流程id
-approval_category_id: 2895582833566102435
+approval_category_id: 3032139783803457567
 #报告用印流程id
 report_category_id: 2895618951099527314
 ##审定内用印流程id

+ 3 - 1
jeeplus-web/src/main/resources/application-production.yml

@@ -213,6 +213,8 @@ publicPassword: jsxgpassword
 
 #阿里云文件夹路径
 aliyun_directory: attachment-file/assess
+  #签章阿里云文件bucketName
+  qzBucketName: xg-qz
 
 #apptoken: Mt4een4BN8
 #appsecret: qhA4aV2GKE8Oq8k4G3twLiUn4U60cN
@@ -259,7 +261,7 @@ company_round_seal_id_vertical: 2898043523878957918
 #公司方章
 company_parties_seal_id: 2894163220106129636
 #审定单用印流程id
-approval_category_id: 2895582833566102435
+approval_category_id: 3032265972836684447
 #报告用印流程id
 report_category_id: 2895618951099527314
 ##审定内用印流程id