Browse Source

财务-报告修改

wangqiang 2 years ago
parent
commit
8d637cea1f

+ 7 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportReviewMapper.java

@@ -15,7 +15,12 @@ public interface CwProjectReportReviewMapper extends BaseMapper<CwProjectReview>
 
     CwProjectReview selectByReportId(String id);
 
-    void updateReviewStatysByReportId(@Param("reviewStatus") String reviewStatus,@Param("id") String id);
+    void updateReviewStatysByReportId(@Param("reviewStatus") String reviewStatus,@Param("id") String id,
+                                      @Param("needUpdate2") String needUpdate2,
+                                      @Param("needUpdate3") String needUpdate3,
+                                      @Param("remark2") String remark2,
+                                      @Param("remark3") String remark3
+                                      );
 
     CwProjectReportData selectByPortId(String id);
 
@@ -25,4 +30,5 @@ public interface CwProjectReportReviewMapper extends BaseMapper<CwProjectReview>
      * @return
      */
     String getProjectIdByReportId(String id);
+
 }

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

@@ -2,7 +2,12 @@
 <!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.CwProjectReportReviewMapper">
     <update id="updateReviewStatysByReportId">
-        update cw_project_report_review set review_status = #{reviewStatus} where report_id = #{id}
+        update cw_project_report_review set review_status = #{reviewStatus},
+        need_update2 = #{needUpdate2},
+        need_update3 = #{needUpdate3},
+        remark2 = #{remark2},
+        remark3 = #{remark3}
+        where report_id = #{id}
     </update>
     <select id="selectByReportId" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectReview">
         select * from cw_project_report_review where report_id = #{id}
@@ -16,4 +21,5 @@
         on cw_p.id = cw_re.report_id and cw_re.del_flag = '0'
         WHERE cw_p.id = #{id}
     </select>
+
 </mapper>

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

@@ -45,6 +45,7 @@
 		select a.*,b.`name` AS type_name,b.sort from cw_proofread_detail a
 		left join cw_proofread_type b on a.type_id = b.id
 		where info_id = #{id}
+		ORDER BY a.create_date
 	</select>
 	<select id="getByTypeIdAndInfoId" resultType="com.jeeplus.test.cw.projectReport.domain.CwProofreadDetail">
 		select * from cw_proofread_detail where type_id = #{typeId} and info_id = #{infoId}

+ 29 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportReviewService.java

@@ -83,9 +83,11 @@ public class CwProjectReportReviewService extends ServiceImpl<CwProjectReportRev
     public String updateReviewStatysByReportId(CwProjectReportData data) {
         //获取当前登录人信息
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
-        mapper.updateReviewStatysByReportId(data.getReviewStatus(),data.getId());
+        mapper.updateReviewStatysByReportId(data.getReviewStatus(),data.getId(),data.getNeedUpdate2(),data.getRemark2(),
+        data.getNeedUpdate3(),data.getRemark3());
         //根据id找到报告id,然后根据报告id找到projectid,然后根据projectId修改状态
         String projectId = mapper.getProjectIdByReportId(data.getId());
+
         //将关联的项目信息的状态改为5
         CwProjectRecordsDTO recordsDTO = recordsMapper.queryById(projectId);
         CwProjectRecords records = new CwProjectRecords();
@@ -94,6 +96,32 @@ public class CwProjectReportReviewService extends ServiceImpl<CwProjectReportRev
         records.setUpdateBy(userDTO.getId());
         records.setUpdateDate(new Date());
         recordsMapper.updateById(records);
+        CwProjectReportData reviewData = mapper.selectByPortId(data.getId());
+        //对复核数据进行持久化操作
+        if (CollectionUtils.isNotEmpty(data.getDetails())) {
+            for (CwProofreadDetail detail1:data.getDetails()) {
+                CwProofreadDetail detail2 = detailMapper.getByTypeIdAndInfoId(detail1.getTypeId(),reviewData.getId());
+                if (null == detail2) {
+                    String detailId = UUID.randomUUID().toString().replace("-", "");
+                    detail1.setId(detailId);
+                    detail1.setInfoId(reviewData.getId());
+                    detail1.setCreateBy(userDTO.getId());
+                    detail1.setCreateDate(new Date());
+                    detail1.setUpdateBy(userDTO.getId());
+                    detail1.setUpdateDate(new Date());
+                    detailMapper.insert(detail1);
+                } else {
+                    detail1.setCreateDate(detail2.getCreateDate());
+                    detail1.setCreateBy(detail2.getCreateBy());
+                    detail1.setId(detail2.getId());
+                    detail1.setInfoId(reviewData.getId());
+                    detail1.setUpdateBy(userDTO.getId());
+                    detail1.setUpdateDate(new Date());
+                    detailMapper.updateById(detail1);
+                }
+            }
+        }
+
         return "操作成功";
     }
 

+ 7 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java

@@ -463,6 +463,12 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                 queryWrapper.le("a.audit_fees", contractAmounts[1]);
             }
         }
+        if (StringUtils.isNotEmpty(projectReportData.getReviewStatus())) {
+            queryWrapper.eq("cw_rev.review_status", projectReportData.getReviewStatus());
+        }
+        if (StringUtils.isNotEmpty(projectReportData.getStatus1())) {
+            queryWrapper.eq("cw_prs1.status", projectReportData.getStatus1());
+        }
         String isBmzr = "0";
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
         if (FindUtils.haveRoleCwBmzr()) {
@@ -690,7 +696,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
                         reportData.setSignatureFileList(signatureList);
                     }
                     // 查询附件信息
-                    List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(id);
+                    List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(reportData.getId());
                     if (CollectionUtils.isNotEmpty(dtos)) {
                         for (WorkAttachmentDto i : fileInfo2) {
                             i.setCreateBy(UserUtils.get(i.getBy()));

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/service/ReportCancellApplyService.java

@@ -111,6 +111,7 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
 
     public ReportInfoDto queryById(String id) {
         ReportInfoDto reportData = applyMapper.queryById(id);
+
         return reportData;
     }
 

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

@@ -38,6 +38,8 @@ public interface ReportCancellApplyArchivedMapper extends BaseMapper<CwProjectRe
 
     ApplyArchiveReportDTO queryById(@Param("id") String id);
 
+    ApplyArchiveReportDTO queryById2(@Param("id") String id);
+
     CwProjectReportApplyArchive selectByApplyId(String id);
 
     /**

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

@@ -27,6 +27,7 @@
     </sql>
 	<sql id="prnl_column">
         cw_pr.id as report_id,
+        cw_pr.project_id as project_id,
         cw_prnl.report_no,
         cw_prnl.report_date,
         cw_pr.signature_annotator1,
@@ -113,11 +114,10 @@
 		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 cw_project_report cw_pr on cw_pr.id = cw_prnl.report_id
 		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>
@@ -227,4 +227,70 @@
         ) b on b.report_id = cw_pa.report_id
         where cw_pa.del_flag = '0' and cw_pa.id = #{id}
     </select>
+    <select id="queryById2"
+            resultType="com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO">
+        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,
+        a.audit_fees,
+        e.name as projectMasterName,
+        a.real_create,
+        a.business_type,
+        a.audit_business_type,
+        a.register_address,
+        a.business_location,
+        a.security_business,
+        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,
+        cw_prs3.proc_ins_id as proc_ins_ids3,
+        cw_prs3.process_definition_id as process_definition_id3,
+        cw_prs3.status as status3,
+        cw_prs3.id as sid3,
+        new_line.served_unit_id as servedUnitId,
+        new_line.report_date as reportDate,
+        new_line.report_type as reportType,
+        new_line.report_number as reportNumber,
+        new_line.report_no as reportNo,
+        new_line.opinion_type as opinionType,
+        new_line.seal_type as sealType,
+        cw_re.proc_ins_id as procInsId3
+        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'
+        LEFT JOIN cw_project_report_signature cw_prs3 on cw_prs3.report_id = a.id and cw_prs3.type = '3' and cw_prs3.del_flag = '0'
+        left join cw_project_report_new_line new_line on a.id = new_line.report_id
+        left join cw_project_report_review cw_re on a.id = cw_re.report_id and cw_re.del_flag = '0'
+        where a.id = #{id}
+    </select>
 </mapper>

+ 147 - 50
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/ReportCancellApplyArchivedService.java

@@ -1,6 +1,7 @@
 package com.jeeplus.test.cw.reportCancellApplyArchived.service;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.druid.sql.visitor.functions.If;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -10,8 +11,13 @@ 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.projectReport.domain.CwProjectInfoData;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.projectReport.mapper.CwProjectInfoMapper;
+import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportMapper;
 import com.jeeplus.test.cw.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
 import com.jeeplus.test.cw.reportCancellApply.domain.ReportCancellApply;
+import com.jeeplus.test.cw.reportCancellApply.mapper.ReportCancellApplyMapper;
 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;
@@ -49,19 +55,29 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
     private OssServiceMapper ossServiceMapper;
 
     @Resource
+    private ReportCancellApplyMapper cancellApplyMapper;
+
+    @Resource
+    private CwProjectInfoMapper infoMapper;
+
+    @Resource
+    private CwProjectReportMapper reportMapper;
+
+    @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");
+    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())) {
@@ -88,65 +104,141 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
 
     /**
      * 根据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);
+        //传过来的是报告作废流程表的id
+        ReportCancellApply archive = cancellApplyMapper.selectById(id);
+        ApplyArchiveReportDTO reportDTO = new ApplyArchiveReportDTO();
+        if (null != archive) {
+            CwProjectInfoData infoData = infoMapper.getById(archive.getReportNewLineId());
+            if (null != infoData) {
+                reportDTO = applyMapper.queryById2(infoData.getReportId());
+                //查询报告作废归档表的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);
+                            //设置报告册数、底稿册数、档案年度、归档类型、备注
+                            reportDTO.setReportNum(applyArchive.getReportNum());
+                            reportDTO.setPapersNum(applyArchive.getPapersNum());
+                            reportDTO.setYear(applyArchive.getYear());
+                            reportDTO.setNumber(applyArchive.getNumber());
+                            reportDTO.setIsNumber(applyArchive.getIsNumber());
+                            reportDTO.setAuditDate(applyArchive.getAuditDate());
+                            reportDTO.setFileNumber(applyArchive.getFileNumber());
+                            reportDTO.setReportRemarks(applyArchive.getReportRemarks());
+                            reportDTO.setCarchivedType(applyArchive.getCarchivedType());
+                        }
+
+                        //项目信息
+                        //先查出新建行id,根据新建行id查出reportid,根据reportid查出projectId
+//                CwProjectRecordsDTO recordsDTO = applyMapper.selectProjectInfo(reportDTO.getProjectId());
+//                if (null != recordsDTO) {
+//                    reportDTO.setCwProjectRecordsDTO(recordsDTO);
+//                }
+                    }
+                    //项目信息
+                    //先查出新建行id,根据新建行id查出reportid,根据reportid查出projectId
+                    CwProjectRecordsDTO recordsDTO = applyMapper.selectProjectInfo(reportDTO.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);
+            //传过来的是报废归档表id
+            CwProjectReportApplyArchive applyArchive1 = applyMapper.selectById(id);
+            if ( null != applyArchive1) {
+                archive = cancellApplyMapper.selectById(applyArchive1.getArchiveId());
+                if ( null != archive) {
+                    CwProjectInfoData infoData = infoMapper.getById(archive.getReportNewLineId());
+                    if (null != infoData) {
+                        reportDTO = applyMapper.queryById2(infoData.getReportId());
+                        //查询报告作废归档表的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);
+                                    //设置报告册数、底稿册数、档案年度、归档类型、备注
+                                    reportDTO.setReportNum(applyArchive.getReportNum());
+                                    reportDTO.setPapersNum(applyArchive.getPapersNum());
+                                    reportDTO.setYear(applyArchive.getYear());
+                                    reportDTO.setNumber(applyArchive.getNumber());
+                                    reportDTO.setIsNumber(applyArchive.getIsNumber());
+                                    reportDTO.setAuditDate(applyArchive.getAuditDate());
+                                    reportDTO.setFileNumber(applyArchive.getFileNumber());
+                                    reportDTO.setReportRemarks(applyArchive.getReportRemarks());
+                                    reportDTO.setCarchivedType(applyArchive.getCarchivedType());
+                                }
+                                //项目信息
+                                //先查出新建行id,根据新建行id查出reportid,根据reportid查出projectId
+//                CwProjectRecordsDTO recordsDTO = applyMapper.selectProjectInfo(reportDTO.getProjectId());
+//                if (null != recordsDTO) {
+//                    reportDTO.setCwProjectRecordsDTO(recordsDTO);
+//                }
+                            }
+                            //项目信息
+                            //先查出新建行id,根据新建行id查出reportid,根据reportid查出projectId
+                            CwProjectRecordsDTO recordsDTO = applyMapper.selectProjectInfo(reportDTO.getProjectId());
+                            if (null != recordsDTO) {
+                                reportDTO.setCwProjectRecordsDTO(recordsDTO);
+                            }
+                        }
+                    }
                 }
             }
+            //传过来的是归档的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(reportDTO.getProjectId());
+//                if (null != recordsDTO) {
+//                    reportDTO.setCwProjectRecordsDTO(recordsDTO);
+//                }
+//            }
         }
-
         return reportDTO;
     }
 
     /**
      * 保存项目归档信息以及其他相关信息
+     *
      * @param cwProjectReportArchiveDTO
      * @return
      * @throws Exception
      */
-    public String saveForm(ApplyArchiveReportDTO cwProjectReportArchiveDTO) throws Exception{
+    public String saveForm(ApplyArchiveReportDTO cwProjectReportArchiveDTO) throws Exception {
 
-        if (StringUtils.isNotEmpty(cwProjectReportArchiveDTO.getId())){
+        if (StringUtils.isNotEmpty(cwProjectReportArchiveDTO.getId())) {
             CwProjectReportApplyArchive report = applyMapper.selectByApplyId(cwProjectReportArchiveDTO.getId());
             if (null != report) {
                 //修改报告作废表的归档状态
-                applyMapper.updateArchiveStyle(cwProjectReportArchiveDTO.getId(),cwProjectReportArchiveDTO.getStatus());
+                applyMapper.updateArchiveStyle(cwProjectReportArchiveDTO.getId(), cwProjectReportArchiveDTO.getStatus());
                 report.setCreateBy(cwProjectReportArchiveDTO.getCreateBy().getId());
                 return update(cwProjectReportArchiveDTO, report.getId());
             } else {
@@ -154,7 +246,7 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
                 report = applyMapper.selectById(cwProjectReportArchiveDTO.getId());
                 if (null != report) {
                     //修改报告作废表的归档状态
-                    applyMapper.updateArchiveStyle(report.getArchiveId(),cwProjectReportArchiveDTO.getStatus());
+                    applyMapper.updateArchiveStyle(report.getArchiveId(), cwProjectReportArchiveDTO.getStatus());
                     report.setCreateBy(cwProjectReportArchiveDTO.getCreateBy().getId());
                     return update(cwProjectReportArchiveDTO, report.getId());
                 }
@@ -168,7 +260,7 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
      * 合同登记新增
      */
     @Transactional(rollbackFor = Exception.class)
-    public String add(ApplyArchiveReportDTO reportDTO) throws Exception{
+    public String add(ApplyArchiveReportDTO reportDTO) throws Exception {
         //获取当前登录人信息
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
         String id = UUID.randomUUID().toString().replace("-", "");
@@ -181,6 +273,8 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
         applyArchive.setUpdateDate(new Date());
         applyArchive.setArchiveId(reportDTO.getId());
         applyMapper.insert(applyArchive);
+        //修改报告作废表的归档状态
+        applyMapper.updateArchiveStyle(reportDTO.getId(), applyArchive.getStatus());
         List<CwWorkAttachmentArchiveDto> list = reportDTO.getWorkAttachmentDtoList();
         if (CollectionUtils.isNotEmpty(list)) {
             saveFiles(list, userDTO, id);
@@ -192,7 +286,7 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
      * 修改
      */
     @Transactional(rollbackFor = Exception.class)
-    public String update(ApplyArchiveReportDTO reportData,String id) throws Exception{
+    public String update(ApplyArchiveReportDTO reportData, String id) throws Exception {
         //获取当前登录人信息
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
 
@@ -216,9 +310,10 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
 
     /**
      * 修改附件信息
-     * @param list 待修改的附件列表
+     *
+     * @param list    待修改的附件列表
      * @param userDTO 当前登录用户
-     * @param id 关联id
+     * @param id      关联id
      */
     @Transactional(rollbackFor = Exception.class)
     public void updateFiles(List<CwWorkAttachmentArchiveDto> list, UserDTO userDTO, String id) {
@@ -226,7 +321,7 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
         String names = new String();
         //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
         for (CwWorkAttachmentArchiveDto dto : list) {
-            names = names + "," +dto.getUrl();
+            names = names + "," + dto.getUrl();
         }
         //查询保存的附件信息
         List<WorkAttachment> infoList = applyMapper.findList(id);
@@ -269,9 +364,10 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
 
     /**
      * 保存附件信息
-     * @param list 待保存的附件列表
+     *
+     * @param list    待保存的附件列表
      * @param userDTO 当前登录用户
-     * @param id 关联id
+     * @param id      关联id
      */
     @Transactional(rollbackFor = Exception.class)
     public void saveFiles(List<CwWorkAttachmentArchiveDto> list, UserDTO userDTO, String id) {
@@ -303,14 +399,15 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
 
     /**
      * 修改状态
+     *
      * @param cwProjectReportArchiveDTO
      * @return
      */
     public String updateStatusById(ApplyArchiveReportDTO cwProjectReportArchiveDTO) {
         CwProjectReportApplyArchive cwProjectReportArchive = new CwProjectReportApplyArchive();
         //修改报告作废表归档状态
-        applyMapper.updateCancellArchiveType(cwProjectReportArchiveDTO.getStatus(),cwProjectReportArchiveDTO.getId());
-        applyMapper.updateStatusByArchiveId(cwProjectReportArchive.getStatus(),cwProjectReportArchive.getArchiveId());
+        applyMapper.updateCancellArchiveType(cwProjectReportArchiveDTO.getStatus(), cwProjectReportArchiveDTO.getId());
+        applyMapper.updateStatusByArchiveId(cwProjectReportArchive.getStatus(), cwProjectReportArchive.getArchiveId());
         return "操作成功";
     }