Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

lizhenhao 2 tahun lalu
induk
melakukan
cda56baa9b
30 mengubah file dengan 2045 tambahan dan 40 penghapusan
  1. 9 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractInfoController.java
  2. 28 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractInfo.java
  3. 11 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractFilePaperMapper.java
  4. 12 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractInfoMapper.java
  5. 16 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractFilePaperMapper.xml
  6. 13 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractInfoMapper.xml
  7. 107 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFilePaperService.java
  8. 59 14
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java
  9. 92 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/controller/AuditSheetTypeController.java
  10. 41 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/domain/CwProofreadType.java
  11. 19 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/mapper/CwProofreadTypeMapper.java
  12. 35 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/mapper/CwProofreadTypeMapper.xml
  13. 102 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/service/CwProofreadTypeForTreeDataService.java
  14. 136 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/service/CwProofreadTypeService.java
  15. 6 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/mapper/xml/ReportCancellApplyMapper.xml
  16. 17 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/service/dto/ReportInfoDto.java
  17. 93 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/controller/ReportCancellApplyArchivedController.java
  18. 115 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/domain/CwProjectReportApplyArchive.java
  19. 78 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/mapper/ReportCancellApplyArchivedMapper.java
  20. 230 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/mapper/xml/ReportCancellApplyArchivedMapper.xml
  21. 320 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/ReportCancellApplyArchivedService.java
  22. 216 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/dto/ApplyArchiveReportDTO.java
  23. 117 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/dto/ArchivedReportInfoDto.java
  24. 21 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/dto/CwWorkAttachmentArchiveDto.java
  25. 15 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/service/dto/BaseDTO.java
  26. 16 16
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java
  27. 2 2
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/FlowMapper.java
  28. 2 2
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/xml/FlowMapper.xml
  29. 18 2
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java
  30. 99 0
      jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/utils/FlowTaskUtil.java

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

@@ -107,6 +107,15 @@ public class ContractInfoController {
         service.updateInfo(info);
     }
 
+    /**
+     * 根据id修改纸质归档状态
+     */
+    @ApiOperation(value = "根据id修改纸质归档状态")
+    @PostMapping(value = "updatePaperInfo")
+    public void updatePaperInfo(@RequestBody ContractInfo info) {
+        service.updatePaperInfo(info);
+    }
+
     @ApiOperation(value = "根据客户id查询关联的项目")
     @GetMapping("/getByClientId")
     public ResponseEntity<List<ContractInfo>> getByClientId(String contractId, ContractInfo contractInfo) {

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

@@ -26,6 +26,19 @@ public class ContractInfo extends BaseEntity {
     //合同编号(字典值)
     public static final String BIZ_CODE = "10";
 
+    //合同 基字流水号
+    public static final String SERIAL_NUMBER1 = "17";
+    //合同 咨字流水号
+    public static final String SERIAL_NUMBER2 = "18";
+    //合同 框字流水号
+    public static final String SERIAL_NUMBER3 = "19";
+    //合同 审字流水号
+    public static final String SERIAL_NUMBER4 = "20";
+    //合同 验字流水号
+    public static final String SERIAL_NUMBER5 = "21";
+    //合同 特字流水号
+    public static final String SERIAL_NUMBER6 = "22";
+
     @Query(tableColumn = "a.contract_no")
     private String contractNo;              //合同编号
     @Query(tableColumn = "a.contract_name")
@@ -184,4 +197,19 @@ public class ContractInfo extends BaseEntity {
      * 创建时间
      */
     private Date createDate;
+
+    /**
+     * 付款描述
+     */
+    private String paymentDescribe;
+
+    /**
+     * 合同类型
+     */
+    private String contractType;
+
+    /**
+     * 合同流水号
+     */
+    private String contractSerialNumber;
 }

+ 11 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractFilePaperMapper.java

@@ -2,15 +2,18 @@ package com.jeeplus.test.cw.contractRegistration.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper;
+import com.jeeplus.test.oss.domain.WorkAttachment;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @author: 王强
  * @create: 2022-11-29 14:20
  **/
 public interface ContractFilePaperMapper extends BaseMapper<ContractFilePaper> {
     /**
-     * 估计id查询纸质归档信息
+     * 根据合同id查询纸质归档信息
      * @param id
      * @return
      */
@@ -20,5 +23,12 @@ public interface ContractFilePaperMapper extends BaseMapper<ContractFilePaper> {
 
     void updateStatusById(@Param("id") String id, @Param("filedType")String filedType);
 
+    List<WorkAttachment> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
 
+    /**
+     * 根据attachmentId删除上传文件信息
+     */
+    void deleteFileInfo(String attachmentId);
 }

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

@@ -54,7 +54,8 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
      */
     void updateInfo(@Param("id") String id,
                     @Param("actualContractAmount") Double actualContractAmount,
-                    @Param("contractApprovalType") String contractApprovalType);
+                    @Param("contractApprovalType") String contractApprovalType,
+                    @Param("filedType") String filedType);
 
     List<String> findChildIds(String department);
 
@@ -64,4 +65,14 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
     List<String> getClientListByClientNo(@Param("no") String no);
 
     void updateBorrowTypeById(@Param("id") String id, @Param("status")String status);
+
+    /**
+     * 修改纸质归档状态
+     * @param id
+     * @param filedPaperType
+     */
+    void updatePaperInfo(@Param("id") String id,
+                         @Param("actualContractAmount") Double actualContractAmount,
+                         @Param("contractApprovalType") String contractApprovalType,
+                         @Param("filedPaperType") String filedPaperType);
 }

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

@@ -5,6 +5,9 @@
         UPDATE cw_work_contract_file_paper SET filed_paper_type = #{filedType}, filed_data = NOW()
         WHERE del_flag = 0 AND contract_info_id = #{id}
     </update>
+    <delete id="deleteFileInfo">
+        delete from work_attachment where attachment_id = #{attachmentId}
+    </delete>
     <select id="selectFilePaperByContractInfoId"
             resultType="com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper">
         SELECT * FROM `cw_work_contract_file_paper` WHERE del_flag = 0 AND contract_info_id = #{id}
@@ -12,5 +15,18 @@
     <select id="getById" resultType="com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper">
         select * from cw_work_contract_file_paper where id = #{id}
     </select>
+    <select id="findList" resultType="com.jeeplus.test.oss.domain.WorkAttachment">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+    <select id="findIsExit" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+    </select>
 
 </mapper>

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

@@ -10,7 +10,7 @@
     </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}
+        ,contract_approval_type = #{contractApprovalType},filed_type = #{filedType} where del_flag = 0 AND id = #{id}
     </update>
     <update id="updatefiledPaperTypeById">
         UPDATE cw_work_contract_info SET `filed_paper_type` = #{status} WHERE del_flag = 0 AND id = #{id}
@@ -18,6 +18,12 @@
     <update id="updateBorrowTypeById">
         UPDATE cw_work_contract_info SET `borrow_type` = #{status} WHERE del_flag = 0 AND id = #{id}
     </update>
+    <update id="updatePaperInfo">
+        UPDATE cw_work_contract_info SET filed_paper_type = #{filedPaperType},
+        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
@@ -47,6 +53,9 @@
             a.contract_amount_type,
             a.contract_opposite,
             a.contract_fee,
+            a.payment_describe,
+            a.contract_type,
+            a.contract_serial_number,
             a.fees,
             a.status,
             b.filed_type as filedType,
@@ -96,6 +105,9 @@
             a.contract_amount_type,
             a.contract_opposite,
             a.contract_fee,
+            a.payment_describe,
+            a.contract_type,
+            a.contract_serial_number,
             a.fees,
             cw.id as customerId,
             cw.name as clientContacts,

+ 107 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFilePaperService.java

@@ -7,12 +7,18 @@ import com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractInfo;
 import com.jeeplus.test.cw.contractRegistration.mapper.ContractFilePaperMapper;
 import com.jeeplus.test.cw.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.test.oss.domain.WorkAttachment;
+import com.jeeplus.test.oss.mapper.OssServiceMapper;
+import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
+import org.flowable.editor.language.json.converter.util.CollectionUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.beans.BeanUtils;
 
 import javax.annotation.Resource;
+import java.util.Arrays;
 import java.util.Date;
+import java.util.List;
 import java.util.UUID;
 
 /**
@@ -23,6 +29,9 @@ import java.util.UUID;
 public class ContractFilePaperService {
 
     @Resource
+    private OssServiceMapper ossServiceMapper;
+
+    @Resource
     private ContractFilePaperMapper mapper;
 
     @Resource
@@ -74,6 +83,13 @@ public class ContractFilePaperService {
         file.setUpdateBy(userDTO.getId());
         file.setUpdateDate(new Date());
         mapper.updateById(file);
+        List<WorkAttachmentDto> list = filePaper.getContractInfoList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, file.getId());
+        }else {
+            //删除文件信息
+            mapper.deleteFileInfo(file.getId());
+        }
         return file.getId();
     }
 
@@ -93,7 +109,98 @@ public class ContractFilePaperService {
         file.setUpdateBy(userDTO.getId());
         file.setUpdateDate(new Date());
         mapper.insert(file);
+        List<WorkAttachmentDto> list = filePaper.getContractInfoList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            saveFiles(list, userDTO, id);
+        }
         return id;
     }
 
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentDto dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachment> infoList = mapper.findList(id);
+        if (CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachment i : infoList) {
+                if (!names.contains(i.getUrl())) {
+                    ossServiceMapper.deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentDto dto : list) {
+            //判断是否存在
+            Integer isExit = mapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachment i = new WorkAttachment();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateDate(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateDate(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("cwWorkContract");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentDto dto : list) {
+            WorkAttachment i = new WorkAttachment();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateDate(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateDate(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("cwWorkContract");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            j++;
+        }
+    }
+
 }

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

@@ -77,7 +77,14 @@ public class ContractInfoService {
      * 根据id修改合同实际金额
      */
     public void updateInfo(ContractInfo info) {
-        mapper.updateInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType());
+        mapper.updateInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType(),info.getFiledType());
+    }
+
+    /**
+     * 根据id修改合同实际金额
+     */
+    public void updatePaperInfo(ContractInfo info) {
+        mapper.updatePaperInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType(), info.getFiledPaperType());
     }
 
     public IPage<ContractInfo> list(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
@@ -198,10 +205,22 @@ public class ContractInfoService {
 
             }
             //根据合同id去归档表查归档附件信息
-            ContractFile file = fileMapper.getInfoByConId(dto.getId());
-            if (null != file){
+//            ContractFile file = fileMapper.getInfoByConId(dto.getId());
+//            if (null != file){
+//                //查归档附件信息
+//                List<WorkAttachmentDto> fileDtos = mapper.findDtos(file.getId());
+//                if (CollectionUtils.isNotEmpty(fileDtos)) {
+//                    for (WorkAttachmentDto i : fileDtos) {
+//                        i.setCreateBy(UserUtils.get(i.getBy()));
+//                    }
+//                    dto.setContractInfoList(fileDtos);
+//                }
+//            }
+            //根据合同id去纸质归档表查附件信息
+            ContractFilePaper filePaper = paperMapper.selectFilePaperByContractInfoId(id);
+            if (null != filePaper){
                 //查归档附件信息
-                List<WorkAttachmentDto> fileDtos = mapper.findDtos(file.getId());
+                List<WorkAttachmentDto> fileDtos = mapper.findDtos(filePaper.getId());
                 if (CollectionUtils.isNotEmpty(fileDtos)) {
                     for (WorkAttachmentDto i : fileDtos) {
                         i.setCreateBy(UserUtils.get(i.getBy()));
@@ -277,18 +296,26 @@ public class ContractInfoService {
                             });
 
                         }
-                        //估计合同登记id查出归档信息
-                        ContractFile contractFile = fileMapper.getInfoByConId(dto.getId());
-                        if (null != contractFile){
-                            //查归档附件信息
-                            List<WorkAttachmentDto> fileDtos = mapper.findDtos(contractFile.getId());
-                            if (CollectionUtils.isNotEmpty(fileDtos)) {
-                                for (WorkAttachmentDto i : fileDtos) {
-                                    i.setCreateBy(UserUtils.get(i.getBy()));
-                                }
-                                dto.setContractInfoList(fileDtos);
+                        //查归档附件信息
+                        List<WorkAttachmentDto> fileDtos = mapper.findDtos(filePaper.getId());
+                        if (CollectionUtils.isNotEmpty(fileDtos)) {
+                            for (WorkAttachmentDto i : fileDtos) {
+                                i.setCreateBy(UserUtils.get(i.getBy()));
                             }
+                            dto.setContractInfoList(fileDtos);
                         }
+//                        //估计合同登记id查出归档信息
+//                        ContractFile contractFile = fileMapper.getInfoByConId(dto.getId());
+//                        if (null != contractFile){
+//                            //查归档附件信息
+//                            List<WorkAttachmentDto> fileDtos = mapper.findDtos(contractFile.getId());
+//                            if (CollectionUtils.isNotEmpty(fileDtos)) {
+//                                for (WorkAttachmentDto i : fileDtos) {
+//                                    i.setCreateBy(UserUtils.get(i.getBy()));
+//                                }
+//                                dto.setContractInfoList(fileDtos);
+//                            }
+//                        }
 
                         dto.setCwWorkClientContactDTOList(list);
                         dto.setContractProperList(dtos);
@@ -448,6 +475,24 @@ public class ContractInfoService {
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
         //合同编号生成
         String serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.BIZ_CODE);
+        //合同流水号生成
+        String serialNumber = "";
+        if (StringUtils.isNotEmpty(contractInfo.getContractType())){
+            if (contractInfo.getContractType().equals("1")){
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER1);
+            } else if (contractInfo.getContractType().equals("2")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER2);
+            } else if (contractInfo.getContractType().equals("3")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER3);
+            } else if (contractInfo.getContractType().equals("4")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER4);
+            } else if (contractInfo.getContractType().equals("5")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER5);
+            } else if (contractInfo.getContractType().equals("6")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER6);
+            }
+            contractInfo.setContractSerialNumber(serialNumber);
+        }
         String id = UUID.randomUUID().toString().replace("-", "");
         ContractInfo info = new ContractInfo();
         BeanUtils.copyProperties(contractInfo, info);

+ 92 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/controller/AuditSheetTypeController.java

@@ -0,0 +1,92 @@
+package com.jeeplus.test.cw.projectReportAuditSheet.controller;
+
+import com.jeeplus.test.cw.projectReportAuditSheet.domain.CwProofreadType;
+import com.jeeplus.test.cw.projectReportAuditSheet.mapper.CwProofreadTypeMapper;
+import com.jeeplus.test.cw.projectReportAuditSheet.service.CwProofreadTypeForTreeDataService;
+import com.jeeplus.test.cw.projectReportAuditSheet.service.CwProofreadTypeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-12-08 09:13
+ **/
+@RestController
+@Api(tags ="报告审核单")
+@RequestMapping(value = "/auditSheet/type")
+public class AuditSheetTypeController {
+
+    @Resource
+    private CwProofreadTypeService service;
+
+    @Resource
+    private CwProofreadTypeMapper mapper;
+
+    @Resource
+    private CwProofreadTypeForTreeDataService treeDataService;
+
+    /**
+     * 列表查询
+     * @param type
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    @GetMapping("/list")
+    public ResponseEntity<List<CwProofreadType>> list(CwProofreadType type) {
+        List<CwProofreadType> list = service.list(type);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 新增/修改
+     * @param info
+     * @return
+     */
+    @ApiOperation(value = "新增/修改")
+    @PostMapping("/save")
+    public ResponseEntity<String> save(@RequestBody CwProofreadType info) {
+        String s = service.saveType(info);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 根据id查询
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询")
+    @GetMapping("/findById")
+    public ResponseEntity<CwProofreadType> findById(String id) {
+        CwProofreadType info = mapper.selectById(id);
+        return ResponseEntity.ok(info);
+    }
+
+    /**
+     * 根据id删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id删除")
+    @GetMapping("/deleteById")
+    public ResponseEntity<String> deleteById(String id) {
+        mapper.deleteById(id);
+        return ResponseEntity.ok("操作完成");
+    }
+
+    /**
+     * 查询树形
+     * @param extId 排除的ID
+     * @return
+     */
+    @ApiOperation(value = "查询树形")
+    @GetMapping("/treeData")
+    public ResponseEntity<List<CwProofreadType>> treeData(@RequestParam(required = false) String extId, @RequestParam(required = false) String type) throws Exception{
+        List<CwProofreadType> infos = treeDataService.treeDataForType(extId, type);
+        return ResponseEntity.ok(infos);
+    }
+}

+ 41 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/domain/CwProofreadType.java

@@ -0,0 +1,41 @@
+package com.jeeplus.test.cw.projectReportAuditSheet.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.TreeEntity;
+import lombok.Data;
+
+@Data
+@TableName(value = "cw_proofread_type")
+public class CwProofreadType extends TreeEntity<CwProofreadType> {
+
+    /**
+     * 类型1自检2浏览审核记录
+     */
+    private String type;
+
+    /**
+     * 父节点id
+     */
+    private String parentId;
+
+    /**
+     * 父节点id集合
+     */
+    private String parentIds;
+
+    /**
+     * 层级
+     */
+    private String level;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+}

+ 19 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/mapper/CwProofreadTypeMapper.java

@@ -0,0 +1,19 @@
+package com.jeeplus.test.cw.projectReportAuditSheet.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.core.domain.TreeMapper;
+import com.jeeplus.test.cw.projectReportAuditSheet.domain.CwProofreadType;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author: 王强
+ * @create: 2022-12-08 09:19
+ **/
+public interface CwProofreadTypeMapper extends BaseMapper<CwProofreadType>, TreeMapper<CwProofreadType> {
+
+    Integer checkNameIsExist(@Param("parentId")String parentId, @Param("name") String name, @Param("type")String type);
+
+    Integer getNo(@Param("parentId") String parentId, @Param("type")String type);
+
+    Integer getLevel(@Param("parentId") String parentId, @Param("type")String type);
+}

+ 35 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/mapper/CwProofreadTypeMapper.xml

@@ -0,0 +1,35 @@
+<?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.projectReportAuditSheet.mapper.CwProofreadTypeMapper">
+    <select id="checkNameIsExist" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			cw_proofread_type
+		WHERE
+			del_flag = 0
+			AND parent_id = #{parentId}
+			AND `name` = #{name}
+			AND `type` = #{type}
+    </select>
+    <select id="getNo" resultType="java.lang.Integer">
+        SELECT
+			(MAX(`sort`) + 1) AS `sort`
+		FROM
+			cw_proofread_type
+		WHERE
+			del_flag = 0
+			AND parent_id = #{parentId}
+			AND `type` = #{type}
+    </select>
+    <select id="getLevel" resultType="java.lang.Integer">
+        SELECT
+			(MAX(level) + 1) AS `level`
+		FROM
+			cw_proofread_type
+		WHERE
+			del_flag = 0
+			AND id = #{parentId}
+			AND `type` = #{type}
+    </select>
+</mapper>

+ 102 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/service/CwProofreadTypeForTreeDataService.java

@@ -0,0 +1,102 @@
+package com.jeeplus.test.cw.projectReportAuditSheet.service;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.core.service.TreeService;
+import com.jeeplus.core.service.dto.TreeDTO;
+import com.jeeplus.test.cw.projectReportAuditSheet.domain.CwProofreadType;
+import com.jeeplus.test.cw.projectReportAuditSheet.mapper.CwProofreadTypeMapper;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class CwProofreadTypeForTreeDataService extends TreeService<CwProofreadTypeMapper, CwProofreadType> {
+
+    /**
+     * 获取JSON树形数据。
+     *
+     * @param extId 排除的ID
+     * @param type 禁选类型
+     * @return
+     */
+    public List<CwProofreadType> treeDataForType(String extId, String type) throws Exception{
+        List <CwProofreadType> allList = super.list (new LambdaQueryWrapper<>( (Class <CwProofreadType>) entityClass ).eq(CwProofreadType::getType, type).orderByAsc ( CwProofreadType::getSort ));
+        CwProofreadType root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <CwProofreadType> rootTree = this.formatListToTreeForType ( root, allList, extId );
+        return rootTree;
+    }
+
+    /**
+     * 以root为根节点, 将allList从线性列表转为树形列表
+     *
+     * @param root    根节点, 为空抛出空指针异常
+     * @param allList 所有需要参与构造为树的列表
+     * @param extId   需要排除在树之外的节点(子节点一并被排除)
+     * @return java.util.List<T>
+     * @Author 滕鑫源
+     * @Date 2020/10/23 17:04
+     **/
+    public List <CwProofreadType> formatListToTreeForType (CwProofreadType root, List <CwProofreadType> allList, String extId) {
+        String rootId = root.getId ( );
+        // 最终的树形态
+        List <CwProofreadType> trees = Lists.newArrayList ( );
+
+        // 把需要构造树的所有列表, 根据以父id作为key, 整理为列表
+        Map<String, List <CwProofreadType>> treeMap = Maps.newHashMap ( );
+        for (CwProofreadType entity : allList) {
+            List <CwProofreadType> entities = treeMap.get ( entity.getParentId ( ) );
+            if ( entities == null ) {
+                entities = Lists.newLinkedList ( );
+            }
+
+            // 剔除排除项, 构造treeMap, 转递归为线性操作
+            if ( StrUtil.isBlank ( extId ) || (!extId.equals ( entity.getId ( ) ) && entity.getParentIds ( ).indexOf ( "," + extId + "," ) == -1) ) {
+                entities.add ( entity );
+                treeMap.put ( entity.getParentId ( ), entities );
+            }
+
+        }
+
+        // 没有给定的子树, 返回空树
+        if ( treeMap.get ( rootId ) == null || treeMap.get ( rootId ).isEmpty ( ) ) {
+            return trees;
+        }
+
+        // 开始递归格式化
+        List <CwProofreadType> children = treeMap.get ( rootId );
+        for (CwProofreadType parent : children) {
+            formatFillChildren ( parent, treeMap );
+            trees.add ( parent );
+        }
+        if ( StrUtil.equals ( rootId, TreeDTO.getRootId () ) ) {
+            return children;
+        } else {
+            root.setChildren ( trees );
+            return Lists.newArrayList ( root );
+        }
+    }
+
+    /**
+     * 从treeMap中取出子节点填入parent, 并递归此操作
+     *
+     * @param parent
+     * @param treeMap
+     * @return void
+     * @Author 滕鑫源
+     * @Date 2020/9/30 16:33
+     **/
+    private void formatFillChildren(CwProofreadType parent, Map <String, List <CwProofreadType>> treeMap) {
+        List <CwProofreadType> children = treeMap.get ( parent.getId ( ) );
+        parent.setChildren ( children );
+        if ( children != null && !children.isEmpty ( ) ) {
+            for (CwProofreadType child : children) {
+                formatFillChildren ( child, treeMap );
+            }
+        }
+    }
+}

+ 136 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReportAuditSheet/service/CwProofreadTypeService.java

@@ -0,0 +1,136 @@
+package com.jeeplus.test.cw.projectReportAuditSheet.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.service.TreeService;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.projectReportAuditSheet.domain.CwProofreadType;
+import com.jeeplus.test.cw.projectReportAuditSheet.mapper.CwProofreadTypeMapper;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author: 王强
+ * @create: 2022-12-08 09:19
+ **/
+@Service
+public class CwProofreadTypeService  extends TreeService<CwProofreadTypeMapper, CwProofreadType> {
+
+    @Resource
+    private CwProofreadTypeMapper mapper;
+
+    public List<CwProofreadType> list(CwProofreadType type) {
+        LambdaQueryWrapper<CwProofreadType> wrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotEmpty(type.getName())) {
+            wrapper.like(CwProofreadType::getName, type.getName());
+        }
+        wrapper.eq(BaseEntity::getDelFlag, 0);
+        wrapper.eq(CwProofreadType::getType, type.getType());
+        wrapper.orderByAsc(CwProofreadType::getSort);
+        return mapper.selectList(wrapper);
+    }
+
+    public String saveType(CwProofreadType type) {
+        // parentId未传值,则表示一级菜单
+        if(StringUtils.isEmpty(type.getParentId())) {
+            type.setParentId("0");
+        }
+        // 判断名称是否已存在
+        Integer isExist = mapper.checkNameIsExist(type.getParentId(), type.getName(), type.getType());
+        if (isExist > 0) {
+            return "该名称已存在";
+        }
+        // 保存数据
+        if (StringUtils.isNotEmpty(type.getId())) {
+            return update(type);
+        }
+        return add(type);
+    }
+
+    /**
+     * 新增
+     * @param type
+     * @return
+     */
+    public String add(CwProofreadType type) {
+        // 获取当前登录人信息
+        UserDTO userDto = UserUtils.getCurrentUserDTO();
+        // 生成id值
+        String id = UUID.randomUUID().toString().replace("-", "");
+        type.setId(id);
+        type.setCreateBy(userDto.getId());
+        type.setCreateDate(new Date());
+        type.setUpdateBy(userDto.getId());
+        type.setUpdateDate(new Date());
+        type.setDelFlag(0);
+        // 生成序号/层级
+        getNo(type);
+        mapper.insert(type);
+        return "操作完成";
+    }
+
+    /**
+     * 修改
+     * @param info
+     * @return
+     */
+    public String update(CwProofreadType info) {
+        // 获取当前登录人信息
+        UserDTO userDto = UserUtils.getCurrentUserDTO();
+        info.setUpdateBy(userDto.getId());
+        info.setUpdateDate(new Date());
+        mapper.updateById(info);
+        return "操作完成";
+    }
+
+    /**
+     * 生成序号/层级
+     * @param type
+     * @return
+     */
+    public CwProofreadType getNo(CwProofreadType type) {
+        CwProofreadType parentInfo = null;
+        if (!"0".equals(type.getParentId())) {
+            //根据parentId查询父节点信息
+            LambdaQueryWrapper<CwProofreadType> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(BaseEntity::getDelFlag, 0);
+            wrapper.eq(BaseEntity::getId, type.getParentId());
+            parentInfo = mapper.selectOne(wrapper);
+        }
+        //查询序号
+        Integer no = mapper.getNo(type.getParentId(), type.getType());
+        // 该层级下有数据,正常返回序号值
+        if (no != null) {
+            type.setSort(no);
+        } else {
+            // 父节点存在,根据父节点序号生成;不存在,则表示无上级层级,从1开始
+            if (parentInfo != null) {
+                String s = parentInfo.getSort() + "01";
+                type.setSort(Integer.parseInt(s));
+            } else {
+                type.setSort(1);
+            }
+        }
+        // 生成层级
+        //查询层级
+        Integer level = mapper.getLevel(type.getParentId(), type.getType());
+        if (level != null) {
+            type.setLevel(level.toString());
+        } else {
+            // 父节点存在,根据父节点level生成,不存在,则表示无上级层级,从1开始
+            if (parentInfo != null) {
+                Integer i = Integer.parseInt(parentInfo.getLevel())+1;
+                type.setLevel(i.toString());
+            } else {
+                type.setLevel("1");
+            }
+        }
+        return type;
+    }
+}

+ 6 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/mapper/xml/ReportCancellApplyMapper.xml

@@ -51,6 +51,7 @@
         a.del_flag,
         a.remarks,
         a.status,
+        a.apply_file_type,
 				a.proc_ins_id,
         a.process_definition_id,
 				c.document_no,
@@ -62,7 +63,9 @@
 				f.name as userName,
 				g.name as projectMasterName,
 				h.name as reportSponsor,
-				d.project_master_id as projectMasterId
+				d.project_master_id as projectMasterId,
+				cw_ar.proc_ins_id as cwProcInsId,
+				cw_ar.process_definition_id as cwProDefId
 
 				FROM cw_project_report_cancell_apply a
 				LEFT JOIN cw_project_report_new_line b
@@ -79,6 +82,8 @@
         on d.project_master_id = g.id
         LEFT JOIN sys_user h
         on c.create_by = h.id
+        left join cw_project_report_cancell_apply_archived cw_ar
+        on a.id = cw_ar.archive_id
         ${ew.customSqlSegment}
     </select>
 </mapper>

+ 17 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/service/dto/ReportInfoDto.java

@@ -94,4 +94,21 @@ public class ReportInfoDto extends BaseDTO {
      */
     @TableField(exist = false)
     private String[] contractDates;
+
+    /**
+     * 报告作废归档状态
+     */
+    private String applyFileType;
+
+    /**
+     * 报告作废归档流程id
+     */
+    @TableField(exist = false)
+    private String cwProcInsId;
+
+    /**
+     *
+     */
+    @TableField(exist = false)
+    private String cwProDefId;
 }

+ 93 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/controller/ReportCancellApplyArchivedController.java

@@ -0,0 +1,93 @@
+package com.jeeplus.test.cw.reportCancellApplyArchived.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.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.ReportCancellApplyArchivedService;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ArchivedReportInfoDto;
+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.validation.Valid;
+
+/**
+ * @author: 王强
+ * @create: 2022-12-09 13:52
+ **/
+@RestController
+@Api("财务报告文号报废归档")
+@RequestMapping(value = "/cwProjectReportArchivedCancell")
+public class ReportCancellApplyArchivedController {
+
+    @Resource
+    private ReportCancellApplyArchivedService applyService;
+
+    /**
+     * 查询报告作废归档信息列表
+     * @param projectReportData
+     * @param page
+     * @return
+     */
+    @ApiLog("查询报告作废归档信息列表")
+    @PreAuthorize("hasAuthority('cwProjectReportCancell:findList')")
+    @GetMapping("findList")
+    public ResponseEntity<IPage<ArchivedReportInfoDto>> findList(ArchivedReportInfoDto projectReportData, Page<ArchivedReportInfoDto> page) throws Exception {
+        IPage<ArchivedReportInfoDto> result = new Page<ArchivedReportInfoDto>();
+        result = applyService.getList (page,projectReportData);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 查询财务项目报告归档详情
+     * @param id
+     * @return
+     */
+    @ApiLog("查询财务项目报告归档详情")
+    @PreAuthorize ("hasAnyAuthority('cwProjectReportCancell:view','cwProjectReportCancell:add','cwProjectReportCancell:edit')")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam("id") String id) {
+        ApplyArchiveReportDTO cwProjectReportArchiveDTO = applyService.queryById ( id );
+        return ResponseEntity.ok (cwProjectReportArchiveDTO);
+    }
+
+    /**
+     * 保存财务项目报告作废归档信息-流程
+     * @param cwProjectReportArchiveDTO
+     * @return
+     */
+    @ApiLog(value = "保存财务项目报告作废归档信息-流程", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cwProjectReportCancell:add','cwProjectReportCancell:edit')")
+    @PostMapping("saveForm")
+    public ResponseEntity saveForm(@Valid @RequestBody ApplyArchiveReportDTO cwProjectReportArchiveDTO) throws Exception {
+        String id = applyService.saveForm(cwProjectReportArchiveDTO);
+        return ResponseUtil.newInstance().add("businessTable", "cw_project_report_cancell_apply_archived").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改状态值status
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "根据id修改状态值status")
+    @PostMapping(value = "/updateStatusById")
+    public ResponseEntity<String> updateStatusById(@RequestBody ApplyArchiveReportDTO dto) {
+        String s = applyService.updateStatusById(dto);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 根据contractInfoId查询
+     */
+    @ApiOperation(value = "根据contractInfoId查询")
+    @GetMapping(value = "findByContractInfoId")
+    public ApplyArchiveReportDTO findByContractInfoId(@RequestParam String id) {
+        return applyService.findByContractInfoId(id);
+    }
+}

+ 115 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/domain/CwProjectReportApplyArchive.java

@@ -0,0 +1,115 @@
+package com.jeeplus.test.cw.reportCancellApplyArchived.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 lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 财务-项目报告归档-项目归档
+ * @TableName cw_project_report_archive
+ */
+@Data
+@TableName("cw_project_report_cancell_apply_archived")
+public class CwProjectReportApplyArchive extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 档案名称
+     */
+//    @Query(tableColumn = "cw_pa.name",type = QueryType.LIKE)
+//    private String name;
+
+    /**
+     * 被审计单位
+     */
+//    private String auditedUnits;
+
+    /**
+     * 报告册数
+     */
+    private String reportNum;
+
+    /**
+     * 底稿册数
+     */
+    private String papersNum;
+
+    /**
+     * 档案年度
+     */
+    @Query(tableColumn = "cw_pa.year",type = QueryType.EQ)
+    private String year;
+
+    /**
+     * 案卷号
+     */
+    @Query(tableColumn = "cw_pa.number",type = QueryType.LIKE)
+    private String number;
+
+    /**
+     * 确认案卷号
+     */
+    private String isNumber;
+
+    /**
+     * 归档时间
+     */
+    private Date auditDate;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    @Query(tableColumn = "cw_pa.status",type = QueryType.EQ)
+    private String status;
+
+    /**
+     * 档案号
+     */
+    @Query(tableColumn = "cw_pa.file_number",type = QueryType.LIKE)
+    private String fileNumber;
+
+    /**
+     * 报告id
+     */
+    private String reportId;
+
+    /**
+     * 审计意见
+     */
+    private String reportRemarks;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 归档类型
+     */
+    private String carchivedType;
+
+    /*
+    报告作废id
+     */
+    private String archiveId;
+}

+ 78 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/mapper/ReportCancellApplyArchivedMapper.java

@@ -0,0 +1,78 @@
+package com.jeeplus.test.cw.reportCancellApplyArchived.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.sys.service.dto.UserDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
+import com.jeeplus.test.cw.reportCancellApply.domain.ReportCancellApply;
+import com.jeeplus.test.cw.reportCancellApply.service.dto.ReportInfoDto;
+import com.jeeplus.test.cw.reportCancellApplyArchived.domain.CwProjectReportApplyArchive;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ArchivedReportInfoDto;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.CwWorkAttachmentArchiveDto;
+import com.jeeplus.test.oss.domain.WorkAttachment;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 报告文号报废mapper
+ * @author: 王强
+ * @create: 2022-11-18 17:35
+ **/
+@Mapper
+public interface ReportCancellApplyArchivedMapper extends BaseMapper<CwProjectReportApplyArchive> {
+
+    /**
+     * 查询报告数据集合
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    IPage<ArchivedReportInfoDto> getList(Page<ArchivedReportInfoDto> page, @Param(Constants.WRAPPER) QueryWrapper<ArchivedReportInfoDto> queryWrapper);
+
+    ApplyArchiveReportDTO queryById(@Param("id") String id);
+
+    CwProjectReportApplyArchive selectByApplyId(String id);
+
+    /**
+     * 根据attachmentId删除上传文件信息
+     */
+    void deleteFileInfo(String attachmentId);
+
+    List<WorkAttachment> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    void updateArchiveStyle(@Param("id") String id, @Param("status")String status);
+
+    List<CwWorkAttachmentArchiveDto> selectFileInfoByAttid(String id);
+
+    CwProjectReportApplyArchive selectByArchiveId(String id);
+
+    /**
+     * 查询项目信息
+     * @return
+     */
+    CwProjectRecordsDTO selectProjectInfo(String id);
+
+    UserDTO getUserInfo(String userId);
+
+    void updateCancellArchiveType(@Param("status")String status,@Param("id")String id);
+
+    /**
+     * 根据合同id查询纸质归档信息
+     * @param id
+     * @return
+     */
+    ApplyArchiveReportDTO selectFilePaperByContractInfoId(String id);
+
+    ApplyArchiveReportDTO queryByArchivedId(String id);
+
+    void updateStatusByArchiveId(@Param("status")String status, @Param("id")String archiveId);
+}

+ 230 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/mapper/xml/ReportCancellApplyArchivedMapper.xml

@@ -0,0 +1,230 @@
+<?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.reportCancellApplyArchived.mapper.ReportCancellApplyArchivedMapper">
+
+	<sql id="Base_Column_List">
+        cw_pa.create_by,
+        cw_pa.create_date,
+        cw_pa.update_by,
+        cw_pa.update_date,
+        cw_pa.del_flag,
+        cw_pa.remarks,
+        cw_pa.project_id,
+        cw_pa.report_num,
+        cw_pa.papers_num,
+        cw_pa.year,
+        cw_pa.number,
+        cw_pa.is_number,
+        cw_pa.audit_date,
+        cw_pa.proc_ins_id,
+        cw_pa.process_definition_id,
+        cw_pa.status,
+        cw_pa.file_number,
+        cw_pa.report_id,
+        cw_pa.report_remarks,
+        cw_pa.carchived_type,
+        cw_a.apply_file_type
+    </sql>
+	<sql id="prnl_column">
+        cw_pr.id as report_id,
+        cw_prnl.report_no,
+        cw_prnl.report_date,
+        cw_pr.signature_annotator1,
+        cw_pr.signature_annotator2,
+        cw_prnl.create_by,
+        su.name as report_create_name,
+        su1.name as signature_annotator1_name,
+        su2.name as signature_annotator2_name
+    </sql>
+    <update id="updateArchiveStyle">
+        update cw_project_report_cancell_apply set apply_file_type = #{status} where id = #{id}
+    </update>
+    <update id="updateCancellArchiveType">
+        update cw_project_report_cancell_apply set apply_file_type = #{status} where id = #{id}
+    </update>
+    <update id="updateStatusByArchiveId">
+        update cw_project_report_cancell_apply_archived set status = #{status} where archive_id = #{id}
+    </update>
+    <delete id="deleteFileInfo">
+        delete from work_attachment where attachment_id = #{attachmentId}
+    </delete>
+
+    <select id="getList" resultType="com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ArchivedReportInfoDto">
+        SELECT
+        cw_ar.create_by as createId,
+        a.id,
+        a.create_by as createById,
+        a.create_date,
+        a.update_by,
+        a.update_date,
+        a.del_flag,
+        a.remarks,
+        a.status,
+        a.apply_file_type,
+				a.proc_ins_id,
+        a.process_definition_id,
+				c.document_no,
+				c.office_id,
+				d.project_number as projectNumber,
+				d.project_name,
+				d.project_master_id,
+				e.name as departmentName,
+				f.name as userName,
+				g.name as projectMasterName,
+				h.name as reportSponsor,
+				d.project_master_id as projectMasterId,
+				cw_ar.proc_ins_id as cwProcInsId,
+				cw_ar.process_definition_id as cwProDefId
+
+				FROM cw_project_report_cancell_apply a
+				LEFT JOIN cw_project_report_new_line b
+				on a.report_new_line_id = b.id
+				LEFT JOIN cw_project_report c
+				on b.report_id = c.id
+				LEFT JOIN cw_project_records d
+				on c.project_id = d.id
+				LEFT JOIN sys_office e
+        on c.office_id = e.id
+				LEFT JOIN sys_user f
+        on a.create_by = f.id
+				LEFT JOIN sys_user g
+        on d.project_master_id = g.id
+        LEFT JOIN sys_user h
+        on c.create_by = h.id
+        left join cw_project_report_cancell_apply_archived cw_ar
+        on a.id = cw_ar.archive_id
+        ${ew.customSqlSegment}
+    </select>
+    <select id="queryById"
+            resultType="com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO">
+		select
+		<include refid="Base_Column_List"></include>,
+        cw_a.id as id,
+		su.name as user_name,
+		b.report_date,
+		b.report_create_name,
+		b.signature_annotator1_name,
+		b.signature_annotator2_name,
+		b.report_no
+		from cw_project_report_cancell_apply cw_a
+		left join cw_project_report_cancell_apply_archived cw_pa on cw_a.id = cw_pa.archive_id
+		left join sys_user su on su.id = cw_pa.create_by and su.del_flag = '0'
+		left join(
+		select
+		<include refid="prnl_column"></include>
+		from cw_project_report_new_line cw_prnl
+		left join cw_project_report cw_pr on cw_pr.id = cw_prnl.report_id and cw_pr.del_flag = '0'
+		left join sys_user su on su.id = cw_prnl.create_by and su.del_flag = '0'
+		left join sys_user su1 on su1.id = cw_pr.signature_annotator1 and su1.del_flag = '0'
+		left join sys_user su2 on su2.id = cw_pr.signature_annotator2 and su2.del_flag = '0'
+		where cw_prnl.del_flag = '0'
+		) b on b.report_id = cw_pa.report_id
+		where cw_a.del_flag = '0' and cw_a.id = #{id}
+	</select>
+    <select id="selectByApplyId"
+            resultType="com.jeeplus.test.cw.reportCancellApplyArchived.domain.CwProjectReportApplyArchive">
+        select * from cw_project_report_cancell_apply_archived where archive_id = #{id}
+    </select>
+    <select id="findList"
+            resultType="com.jeeplus.test.oss.domain.WorkAttachment">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+    <select id="findIsExit" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+    </select>
+    <select id="selectFileInfoByAttid"
+            resultType="com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.CwWorkAttachmentArchiveDto">
+        select attachment_name as name,url,create_by as userId,create_date,remarks,type as fileType,file_size as size from work_attachment where attachment_id = #{id}
+    </select>
+    <select id="selectByArchiveId"
+            resultType="com.jeeplus.test.cw.reportCancellApplyArchived.domain.CwProjectReportApplyArchive">
+        select * from cw_project_report_cancell_apply_archived where archive_id = #{id}
+    </select>
+    <select id="selectProjectInfo"
+            resultType="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO">
+        select * from cw_project_records where id = #{id}
+    </select>
+    <select id="getUserInfo" resultType="com.jeeplus.sys.service.dto.UserDTO">
+        select * from sys_user where id = #{userId}
+    </select>
+    <select id="selectFilePaperByContractInfoId"
+            resultType="com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO">
+        SELECT
+        cw_ar.create_by as createId,
+        a.id,
+        a.create_by as createById,
+        a.create_date,
+        a.update_by,
+        a.update_date,
+        a.del_flag,
+        a.remarks,
+        a.status,
+        a.apply_file_type,
+				a.proc_ins_id,
+        a.process_definition_id,
+				c.document_no,
+				c.office_id,
+				d.project_number as projectNumber,
+				d.project_name,
+				d.project_master_id,
+				e.name as departmentName,
+				f.name as userName,
+				g.name as projectMasterName,
+				h.name as reportSponsor,
+				d.project_master_id as projectMasterId,
+				cw_ar.proc_ins_id as cwProcInsId,
+				cw_ar.process_definition_id as cwProDefId
+
+				FROM cw_project_report_cancell_apply a
+				LEFT JOIN cw_project_report_new_line b
+				on a.report_new_line_id = b.id
+				LEFT JOIN cw_project_report c
+				on b.report_id = c.id
+				LEFT JOIN cw_project_records d
+				on c.project_id = d.id
+				LEFT JOIN sys_office e
+        on c.office_id = e.id
+				LEFT JOIN sys_user f
+        on a.create_by = f.id
+				LEFT JOIN sys_user g
+        on d.project_master_id = g.id
+        LEFT JOIN sys_user h
+        on c.create_by = h.id
+        left join cw_project_report_cancell_apply_archived cw_ar
+        on a.id = cw_ar.archive_id and cw_ar.del_flag = 0
+        WHERE a.del_flag = 0 AND a.id = #{id}
+    </select>
+    <select id="queryByArchivedId"
+            resultType="com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO">
+        select
+        <include refid="Base_Column_List"></include>,
+        cw_a.id as id,
+        su.name as user_name,
+        b.report_date,
+        b.report_create_name,
+        b.signature_annotator1_name,
+        b.signature_annotator2_name,
+        b.report_no
+        from cw_project_report_cancell_apply cw_a
+        left join cw_project_report_cancell_apply_archived cw_pa on cw_a.id = cw_pa.archive_id
+        left join sys_user su on su.id = cw_pa.create_by and su.del_flag = '0'
+        left join(
+        select
+        <include refid="prnl_column"></include>
+        from cw_project_report_new_line cw_prnl
+        left join cw_project_report cw_pr on cw_pr.id = cw_prnl.report_id and cw_pr.del_flag = '0'
+        left join sys_user su on su.id = cw_prnl.create_by and su.del_flag = '0'
+        left join sys_user su1 on su1.id = cw_pr.signature_annotator1 and su1.del_flag = '0'
+        left join sys_user su2 on su2.id = cw_pr.signature_annotator2 and su2.del_flag = '0'
+        where cw_prnl.del_flag = '0'
+        ) b on b.report_id = cw_pa.report_id
+        where cw_pa.del_flag = '0' and cw_pa.id = #{id}
+    </select>
+</mapper>

+ 320 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/ReportCancellApplyArchivedService.java

@@ -0,0 +1,320 @@
+package com.jeeplus.test.cw.reportCancellApplyArchived.service;
+
+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.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
+import com.jeeplus.test.cw.reportCancellApply.domain.ReportCancellApply;
+import com.jeeplus.test.cw.reportCancellApplyArchived.domain.CwProjectReportApplyArchive;
+import com.jeeplus.test.cw.reportCancellApplyArchived.mapper.ReportCancellApplyArchivedMapper;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ArchivedReportInfoDto;
+import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.CwWorkAttachmentArchiveDto;
+import com.jeeplus.test.mould.service.SerialnumTplService;
+import com.jeeplus.test.oss.domain.WorkAttachment;
+import com.jeeplus.test.oss.mapper.OssServiceMapper;
+import com.jeeplus.test.oss.service.OssService;
+import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
+import org.flowable.editor.language.json.converter.util.CollectionUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-18 17:36
+ **/
+@Service
+@Transactional
+public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancellApplyArchivedMapper, CwProjectReportApplyArchive> {
+
+    @Resource
+    private ReportCancellApplyArchivedMapper applyMapper;
+
+    @Resource
+    private SerialnumTplService serialnumTplService;
+
+    @Resource
+    private OssServiceMapper ossServiceMapper;
+
+    @Resource
+    private OssService ossService;
+
+    /**
+     * 差选项目列表信息
+     * @param page
+     * @param projectReportData
+     * @return
+     * @throws Exception
+     */
+    public IPage<ArchivedReportInfoDto> getList(Page<ArchivedReportInfoDto> page, ArchivedReportInfoDto projectReportData) throws Exception{
+        QueryWrapper<ArchivedReportInfoDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,ArchivedReportInfoDto.class);
+        queryWrapper.eq("a.del_flag","0");
+        queryWrapper.eq("a.status","5");
+        queryWrapper.orderByDesc("a.create_date");
+        //条件
+        if (StringUtils.isNotEmpty(projectReportData.getProjectNumber())) {
+            queryWrapper.like("d.project_number", projectReportData.getProjectNumber());
+        }
+        if (StringUtils.isNotEmpty(projectReportData.getProjectName())) {
+            queryWrapper.like("d.project_name", projectReportData.getProjectName());
+        }
+        if (StringUtils.isNotEmpty(projectReportData.getProjectMasterId())) {
+            queryWrapper.eq("d.project_master_id", projectReportData.getProjectMasterId());
+        }
+        if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
+            queryWrapper.like("a.create_by", projectReportData.getCreateBy().getId());
+        }
+        //创建时间
+        String[] contractDates = projectReportData.getContractDates();
+        if (contractDates != null) {
+
+            queryWrapper.between("a.create_date", contractDates[0], contractDates[1]);
+        }
+        IPage<ArchivedReportInfoDto> list = applyMapper.getList(page, queryWrapper);
+        return list;
+    }
+
+    /**
+     * 根据id查询项目详情
+     * @param id
+     * @return
+     */
+    public ApplyArchiveReportDTO queryById(String id) {
+        //查附件信息
+        ApplyArchiveReportDTO reportDTO = applyMapper.queryById(id);
+        //查询报告作废归档表的id
+        if (null != reportDTO) {
+            CwProjectReportApplyArchive applyArchive = applyMapper.selectByArchiveId(id);
+            if (null != applyArchive) {
+                List<CwWorkAttachmentArchiveDto> files = applyMapper.selectFileInfoByAttid(applyArchive.getId());
+                if (null != files) {
+                    files.forEach(fi->{
+                        UserDTO userDTO = applyMapper.getUserInfo(fi.getUserId());
+                        fi.setCreateBy(userDTO);
+                    });
+                    reportDTO.setWorkAttachmentDtoList(files);
+                }
+                CwProjectRecordsDTO recordsDTO = applyMapper.selectProjectInfo(applyArchive.getProjectId());
+                if (null != recordsDTO) {
+                    reportDTO.setCwProjectRecordsDTO(recordsDTO);
+                }
+            }
+        } else {
+            //传过来的是归档的id
+            reportDTO = applyMapper.queryByArchivedId(id);
+            CwProjectReportApplyArchive applyArchive = applyMapper.selectByArchiveId(reportDTO.getId());
+            if (null != applyArchive) {
+                List<CwWorkAttachmentArchiveDto> files = applyMapper.selectFileInfoByAttid(applyArchive.getId());
+                if (null != files) {
+                    files.forEach(fi->{
+                        UserDTO userDTO = applyMapper.getUserInfo(fi.getUserId());
+                        fi.setCreateBy(userDTO);
+                    });
+                    reportDTO.setWorkAttachmentDtoList(files);
+                }
+                CwProjectRecordsDTO recordsDTO = applyMapper.selectProjectInfo(applyArchive.getProjectId());
+                if (null != recordsDTO) {
+                    reportDTO.setCwProjectRecordsDTO(recordsDTO);
+                }
+            }
+        }
+
+        return reportDTO;
+    }
+
+    /**
+     * 保存项目归档信息以及其他相关信息
+     * @param cwProjectReportArchiveDTO
+     * @return
+     * @throws Exception
+     */
+    public String saveForm(ApplyArchiveReportDTO cwProjectReportArchiveDTO) throws Exception{
+
+        if (StringUtils.isNotEmpty(cwProjectReportArchiveDTO.getId())){
+            CwProjectReportApplyArchive report = applyMapper.selectByApplyId(cwProjectReportArchiveDTO.getId());
+            if (null != report) {
+                //修改报告作废表的归档状态
+                applyMapper.updateArchiveStyle(cwProjectReportArchiveDTO.getId(),cwProjectReportArchiveDTO.getStatus());
+                report.setCreateBy(cwProjectReportArchiveDTO.getCreateBy().getId());
+                return update(cwProjectReportArchiveDTO, report.getId());
+            } else {
+                //传过来的是归档id
+                report = applyMapper.selectById(cwProjectReportArchiveDTO.getId());
+                if (null != report) {
+                    //修改报告作废表的归档状态
+                    applyMapper.updateArchiveStyle(report.getArchiveId(),cwProjectReportArchiveDTO.getStatus());
+                    report.setCreateBy(cwProjectReportArchiveDTO.getCreateBy().getId());
+                    return update(cwProjectReportArchiveDTO, report.getId());
+                }
+            }
+
+        }
+        return add(cwProjectReportArchiveDTO);
+    }
+
+    /**
+     * 合同登记新增
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String add(ApplyArchiveReportDTO reportDTO) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        String id = UUID.randomUUID().toString().replace("-", "");
+        CwProjectReportApplyArchive applyArchive = new CwProjectReportApplyArchive();
+        BeanUtils.copyProperties(reportDTO, applyArchive);
+        applyArchive.setId(id);
+        applyArchive.setCreateBy(userDTO.getId());
+        applyArchive.setCreateDate(new Date());
+        applyArchive.setUpdateBy(userDTO.getId());
+        applyArchive.setUpdateDate(new Date());
+        applyArchive.setArchiveId(reportDTO.getId());
+        applyMapper.insert(applyArchive);
+        List<CwWorkAttachmentArchiveDto> list = reportDTO.getWorkAttachmentDtoList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            saveFiles(list, userDTO, id);
+        }
+        return id;
+    }
+
+    /**
+     * 修改
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String update(ApplyArchiveReportDTO reportData,String id) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+
+        CwProjectReportApplyArchive cwProjectReportArchive = new CwProjectReportApplyArchive();
+        BeanUtils.copyProperties(reportData, cwProjectReportArchive);
+        cwProjectReportArchive.setUpdateBy(userDTO.getId());
+        cwProjectReportArchive.setUpdateDate(new Date());
+        cwProjectReportArchive.setId(id);
+        cwProjectReportArchive.setArchiveId(reportData.getId());
+        applyMapper.updateById(cwProjectReportArchive);
+        //对上传的文件数据进行持久化操作
+        List<CwWorkAttachmentArchiveDto> list = reportData.getWorkAttachmentDtoList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, cwProjectReportArchive.getId());
+        } else {
+            applyMapper.deleteFileInfo(cwProjectReportArchive.getId());
+        }
+
+        return cwProjectReportArchive.getId();
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<CwWorkAttachmentArchiveDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (CwWorkAttachmentArchiveDto dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachment> infoList = applyMapper.findList(id);
+        if (CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachment i : infoList) {
+                if (!names.contains(i.getUrl())) {
+                    ossServiceMapper.deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (CwWorkAttachmentArchiveDto dto : list) {
+            //判断是否存在
+            Integer isExit = applyMapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachment i = new WorkAttachment();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateDate(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateDate(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("cwWorkContract");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<CwWorkAttachmentArchiveDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (CwWorkAttachmentArchiveDto dto : list) {
+            WorkAttachment i = new WorkAttachment();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateDate(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateDate(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("cwWorkContract");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            j++;
+        }
+    }
+
+    /**
+     * 修改状态
+     * @param cwProjectReportArchiveDTO
+     * @return
+     */
+    public String updateStatusById(ApplyArchiveReportDTO cwProjectReportArchiveDTO) {
+        CwProjectReportApplyArchive cwProjectReportArchive = new CwProjectReportApplyArchive();
+        //修改报告作废表归档状态
+        applyMapper.updateCancellArchiveType(cwProjectReportArchiveDTO.getStatus(),cwProjectReportArchiveDTO.getId());
+        applyMapper.updateStatusByArchiveId(cwProjectReportArchive.getStatus(),cwProjectReportArchive.getArchiveId());
+        return "操作成功";
+    }
+
+    public ApplyArchiveReportDTO findByContractInfoId(String id) {
+        return applyMapper.selectFilePaperByContractInfoId(id);
+    }
+}

+ 216 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/dto/ApplyArchiveReportDTO.java

@@ -0,0 +1,216 @@
+package com.jeeplus.test.cw.reportCancellApplyArchived.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveReportDTO;
+import com.jeeplus.test.cw.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 财务-报告作废归档-报告作废归档
+ */
+@Data
+public class ApplyArchiveReportDTO extends BaseDTO {
+
+    public static final String BIZ_CODE = "15";
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 档案名称
+     */
+    @Excel(name = "档案名称",width = 25,orderNum = "0")
+    private String name;
+
+    /**
+     * 被审计单位
+     */
+//    private String auditedUnits;
+
+    /**
+     * 报告册数
+     */
+    @Excel(name = "报告册数",width = 25,orderNum = "5")
+    private String reportNum;
+
+    /**
+     * 底稿册数
+     */
+    @Excel(name = "底稿册数",width = 25,orderNum = "6")
+    private String papersNum;
+
+    /**
+     * 档案年度
+     */
+    @Excel(name = "档案年度",width = 25,orderNum = "7")
+    private String year;
+
+    /**
+     * 案卷号
+     */
+    @Excel(name = "案卷号",width = 25,orderNum = "8")
+    private String number;
+
+    /**
+     * 确认案卷号
+     */
+    private String isNumber;
+
+    /**
+     * 归档时间
+     */
+    @Excel(name = "归档时间",exportFormat = "yyyy-MM-dd HH:mm:ss",width = 25,orderNum = "10")
+    private Date auditDate;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 项目信息
+     */
+    private CwProjectRecordsDTO cwProjectRecordsDTO;
+
+    /**
+     * 其他附件
+     */
+    private List<CwWorkAttachmentArchiveDto> workAttachmentDtoList;
+
+    /**
+     * 审计报告
+     */
+    private List<CwProjectReportArchiveReportDTO> cwProjectReportArchiveReportDTOList;
+
+    /**
+     * 被审计单位名称
+     */
+//    @Excel(name = "被审计单位",width = 25,orderNum = "4")
+//    private String auditedUnitsName;
+
+    /**
+     * 归档时间区间
+     */
+    private String[] auditDates;
+
+    /**
+     * 创建时间区间
+     */
+    private String[] createDates;
+
+    /**
+     * 报告文号
+     */
+    @Excel(name = "报告文号",width = 25,orderNum = "9")
+    private String reportNo;
+
+    /**
+     * 档案号
+     */
+    @Excel(name = "档案号",width = 25,orderNum = "1")
+    private String fileNumber;
+
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称",width = 25,orderNum = "2")
+    private String projectName;
+
+    /**
+     * 项目经理
+     */
+    @Excel(name = "项目经理",width = 25,orderNum = "3")
+    private String projectMasterName;
+
+    /**
+     * 创建人姓名
+     */
+    @Excel(name = "创建人",width = 25,orderNum = "11")
+    private String createName;
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间",exportFormat = "yyyy-MM-dd HH:mm:ss",width = 25,orderNum = "12")
+    private String createDateT;
+
+    /**
+     * 报告id
+     */
+    private String reportId;
+
+    /**
+     * 审计意见
+     */
+    private String reportRemarks;
+
+    /**
+     * 报告日期
+     */
+    private Date reportDate;
+
+    /**
+     * 报告主办人
+     */
+    private String reportCreateName;
+
+    /**
+     * 签字注师1
+     */
+    private String signatureAnnotator1Name;
+
+    /**
+     * 签字注师2
+     */
+    private String signatureAnnotator2Name;
+
+    /*
+    报告作废id
+     */
+    private String archiveId;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 归档类型
+     */
+    private String carchivedType;
+
+    /**
+     * 报告作废归档流程id
+     */
+    private String cwProcInsId;
+
+    /**
+     *
+     */
+    private String cwProDefId;
+
+    /**
+     * 报告作废归档状态
+     */
+    private String applyFileType;
+}

+ 117 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/dto/ArchivedReportInfoDto.java

@@ -0,0 +1,117 @@
+package com.jeeplus.test.cw.reportCancellApplyArchived.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 报告申请信息
+ * @author: 王强
+ * @create: 2022-11-20 11:34
+ **/
+@Data
+public class ArchivedReportInfoDto extends BaseDTO {
+    private static final long serialVersionUID = 1L;
+
+    @TableField(exist = false)
+    private String createById;
+
+    @TableField(exist = false)
+    private String createId;
+
+    /**
+     * 项目编号
+     */
+    private String projectNumber;
+
+    /**
+     * 创建人
+     */
+    private String userName;
+
+    /**
+     * 报告所属部门
+     */
+    private String departmentName;
+
+    /**
+     * 报告文号
+     */
+    private String reportNo;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 报告主办人
+     */
+    private String reportSponsor;
+
+    /**
+     * 报告作废原因
+     */
+    private String cancellateReason;
+
+    /**
+     * 报告申请单号
+     */
+    private String documentNo;
+
+    /**
+     * 单据状态(报告流程status为5的)
+     */
+    private String documentStatus;
+
+    /**
+     * 项目经理姓名
+     */
+    private String projectMasterName;
+
+    /**
+     * 项目经理id
+     */
+    @TableField(exist = false)
+    private String projectMasterId;
+
+    /**
+     * 新建行id
+     */
+    private String reportNewLineId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    /**
+     * 创建时间区间
+     */
+    @TableField(exist = false)
+    private String[] contractDates;
+
+    /**
+     * 报告作废归档状态
+     */
+    private String applyFileType;
+
+    /**
+     * 报告作废归档流程id
+     */
+    @TableField(exist = false)
+    private String cwProcInsId;
+
+    /**
+     *
+     */
+    @TableField(exist = false)
+    private String cwProDefId;
+}

+ 21 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/dto/CwWorkAttachmentArchiveDto.java

@@ -0,0 +1,21 @@
+package com.jeeplus.test.cw.reportCancellApplyArchived.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+@Data
+public class CwWorkAttachmentArchiveDto extends BaseDTO {
+
+    private String name; // 文件名称
+
+    private String size; // 文件大小
+
+    private String url; // 文件路径
+
+    private String remarks; // 备注
+
+    private String fileType; // 文件类型
+
+    private String userId;
+
+}

+ 15 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/service/dto/BaseDTO.java

@@ -49,6 +49,21 @@ public abstract class BaseDTO <T> implements Serializable {
     protected Integer delFlag;
 
     /**
+     * taskId
+     */
+    protected String taskId;
+
+    /**
+     * 流程id
+     */
+    protected String procInsId;
+
+    /**
+     * 流程信息
+     */
+    protected String processDefinitionId;
+
+    /**
      * 构造函数
      */
     public BaseDTO () {

+ 16 - 16
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java

@@ -127,15 +127,15 @@ public class FlowableTaskController {
      */
     @GetMapping("getTaskDef")
     public ResponseEntity getTaskDef(Flow flow) {
-        /*if(StringUtils.isBlank(flow.getTaskId()) && StringUtils.isNotBlank(flow.getProcDefId())){
-            ActRuTaskInfo taskInfoByProcDefId = flowTaskService.getTaskInfoByProcDefId(flow.getProcDefId());
-            if(null != taskInfoByProcDefId){
-                flow.setTaskId(taskInfoByProcDefId.getId());
-                flow.setProcInsId(taskInfoByProcDefId.getProcInstId());
-                flow.setTaskName(taskInfoByProcDefId.getName());
-                flow.setTaskDefKey(taskInfoByProcDefId.getTaskDefKey());
+        if(StringUtils.isNotBlank(flow.getTaskId()) && StringUtils.isBlank(flow.getTaskName()) && StringUtils.isBlank(flow.getTaskDefKey())){
+            ActRuTaskInfo taskInfoByTaskId = flowTaskService.getTaskInfoByTaskId(flow.getTaskId());
+            if(null != taskInfoByTaskId){
+                flow.setTaskId(taskInfoByTaskId.getId());
+                flow.setProcInsId(taskInfoByTaskId.getProcInstId());
+                flow.setTaskName(taskInfoByTaskId.getName());
+                flow.setTaskDefKey(taskInfoByTaskId.getTaskDefKey());
             }
-        }*/
+        }
         // 获取流程XML上的表单KEY
         String formKey = flowTaskService.getFormKey(flow.getProcDefId(), flow.getTaskDefKey());
 
@@ -258,15 +258,15 @@ public class FlowableTaskController {
     @PostMapping("audit")
     public ResponseEntity auditTask(HttpServletRequest request, Flow flow) {
 
-        /*if(StringUtils.isBlank(flow.getTaskId()) && StringUtils.isNotBlank(flow.getProcDefId())){
-            ActRuTaskInfo taskInfoByProcDefId = flowTaskService.getTaskInfoByProcDefId(flow.getProcDefId());
-            if(null != taskInfoByProcDefId){
-                flow.setTaskId(taskInfoByProcDefId.getId());
-                flow.setProcInsId(taskInfoByProcDefId.getProcInstId());
-                flow.setTaskName(taskInfoByProcDefId.getName());
-                flow.setTaskDefKey(taskInfoByProcDefId.getTaskDefKey());
+        if(StringUtils.isNotBlank(flow.getTaskId()) && StringUtils.isBlank(flow.getTaskName()) && StringUtils.isBlank(flow.getTaskDefKey())){
+            ActRuTaskInfo taskInfoByTaskId = flowTaskService.getTaskInfoByTaskId(flow.getTaskId());
+            if(null != taskInfoByTaskId){
+                flow.setTaskId(taskInfoByTaskId.getId());
+                flow.setProcInsId(taskInfoByTaskId.getProcInstId());
+                flow.setTaskName(taskInfoByTaskId.getName());
+                flow.setTaskDefKey(taskInfoByTaskId.getTaskDefKey());
             }
-        }*/
+        }
         Map<String, Object> vars = Maps.newHashMap();
         Map<String, String[]> map = request.getParameterMap();
         for (Map.Entry<String, String[]> entry : map.entrySet()) {

+ 2 - 2
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/FlowMapper.java

@@ -29,8 +29,8 @@ public interface FlowMapper extends BaseMapper <Flow> {
 
     /**
      * 根据流程id查询流程信息
-     * @param procDefId
+     * @param taskId
      * @return
      */
-    ActRuTaskInfo getTaskInfoByProcDefId(String procDefId);
+    ActRuTaskInfo getTaskInfoByTaskId(String taskId);
 }

+ 2 - 2
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/mapper/xml/FlowMapper.xml

@@ -29,7 +29,7 @@
 		where PROC_INST_ID_= #{processInstanceId}
 	</select>
 
-	<select id="getTaskInfoByProcDefId" resultType="com.jeeplus.flowable.model.ActRuTaskInfo">
+	<select id="getTaskInfoByTaskId" resultType="com.jeeplus.flowable.model.ActRuTaskInfo">
 		select
 		  ID_ as "id",
 		  REV_ as "rev",
@@ -62,7 +62,7 @@
 		  SUB_TASK_COUNT_  as "subTaskCount"
 		from
 		  act_ru_task
-		where PROC_DEF_ID_= #{procDefId}
+		where ID_= #{taskId}
 		order by CREATE_TIME_ desc
 		limit 1
 	</select>

+ 18 - 2
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java

@@ -151,6 +151,17 @@ public class FlowTaskService {
         return page;
     }
 
+
+    public List <Task> getRecords() {
+        String userId = UserUtils.getCurrentUserDTO ().getId ();
+        // =============== 已经签收或者等待签收的任务  ===============
+        TaskQuery todoTaskQuery = taskService.createTaskQuery ().taskCandidateOrAssigned (userId).active ()
+                .includeProcessVariables ().orderByTaskCreateTime ().desc ();
+
+        List <Task> todoList = todoTaskQuery.list ( );
+        return todoList;
+    }
+
     /**
      * 获取已办任务列表
      *
@@ -970,8 +981,13 @@ public class FlowTaskService {
         return task;
     }
 
-    public ActRuTaskInfo getTaskInfoByProcDefId(String procDefId){
-        return flowMapper.getTaskInfoByProcDefId(procDefId);
+    /**
+     * 根据taskId查询流程信息
+     * @param taskId
+     * @return
+     */
+    public ActRuTaskInfo getTaskInfoByTaskId(String taskId){
+        return flowMapper.getTaskInfoByTaskId(taskId);
     }
 
 }

+ 99 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/utils/FlowTaskUtil.java

@@ -0,0 +1,99 @@
+package com.jeeplus.flowable.utils;
+
+import com.jeeplus.flowable.service.FlowTaskService;
+import com.jeeplus.sys.utils.SpringContextHolder;
+import org.flowable.task.api.Task;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author: 徐滕
+ * @version: 2022-12-08 15:34
+ */
+public class FlowTaskUtil {
+
+    private FlowTaskService flowTaskService = SpringContextHolder.getBean(FlowTaskService.class);
+
+
+    public <T> List<T> taskDispose(List<T> list) {
+
+        List<Task> taskList = flowTaskService.getRecords();
+        Method procInsIdMethod = null;
+        Method processDefinitionIdMethod = null;
+        Method statusMethod = null;
+        for (T info : list ) {
+            Class<? extends Object> tClass = info.getClass();
+            //得到所有属性
+            Field[] fields = tClass.getDeclaredFields();
+            Class<? extends Object> superClass = tClass.getSuperclass();
+            //得到所有属性
+            Field[] superField = superClass.getDeclaredFields();
+            Field[] field = concat(fields,superField);
+
+            for (Task taskInfo : taskList) {
+                Integer taskIdInteger = null;
+                try {
+                    for (Integer i=0; i<field.length; i++ ){
+                        //获取属性的名字
+                        String name = field[i].getName();
+                        //将属性名字的首字母大写
+                        name = name.replaceFirst(name.substring(0, 1), name.substring(0, 1).toUpperCase());
+
+                        if("ProcInsId".equals(name)){
+                            field[i].setAccessible(true);
+                            //整合出 getId() 属性这个方法
+                            procInsIdMethod = tClass.getMethod("get"+name);
+
+                        }else if("ProcessDefinitionId".equals(name)){
+                            field[i].setAccessible(true);
+                            //整合出 getId() 属性这个方法
+                            processDefinitionIdMethod = tClass.getMethod("get"+name);
+
+                        }else if("Status".equals(name)){
+                            field[i].setAccessible(true);
+                            //整合出 getId() 属性这个方法
+                            statusMethod = tClass.getMethod("get"+name);
+
+                        }else if("TaskId".equals(name)){
+                            field[i].setAccessible(true);
+                            //整合出 getId() 属性这个方法
+                            taskIdInteger = i;
+
+                        }
+                    }
+
+                    //调用这个整合出来的get方法,强转成自己需要的类型
+                    String procInsId = (String)procInsIdMethod.invoke(info);
+                    String processDefinitionId = (String)processDefinitionIdMethod.invoke(info);
+                    String status = (String)statusMethod.invoke(info);
+
+                    if(procInsId.equals(taskInfo.getProcessInstanceId()) && processDefinitionId.equals(taskInfo.getProcessDefinitionId()) && "4".equals(status)){
+                        field[taskIdInteger].set(info,taskInfo.getId());
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return list;
+
+    }
+
+    /**
+     * 数据整合方法
+     * @param a
+     * @param b
+     * @return
+     */
+    static Field[] concat(Field[] a, Field[] b) {
+
+        Field[] c= new Field[a.length+b.length];
+        System.arraycopy(a, 0, c, 0, a.length);
+        System.arraycopy(b, 0, c, a.length, b.length);
+        return c;
+    }
+
+}