瀏覽代碼

三级校审

lizhenhao 2 年之前
父節點
當前提交
a9a6f38ce2
共有 12 個文件被更改,包括 807 次插入36 次删除
  1. 112 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OssService.java
  2. 34 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/controller/ProjectListController.java
  3. 164 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/domain/ProgramArchive.java
  4. 18 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/domain/ProgramProjectListInfo.java
  5. 19 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/mapper/ProgramArchiveMapper.java
  6. 119 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/mapper/xml/ProgramArchiveMapper.xml
  7. 8 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/mapper/xml/ProjectListMapper.xml
  8. 89 28
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/ProjectListService.java
  9. 210 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/dto/ProgramArchiveDto.java
  10. 17 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/mapstruct/ProgramArchiveWrapper.java
  11. 2 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workContract/mapper/WorkContractInfoMapper.java
  12. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workContract/mapper/xml/WorkContractInfoMapper.xml

+ 112 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OssService.java

@@ -19,12 +19,14 @@ import com.jeeplus.test.oss.service.dto.OssServiceDto;
 import com.jeeplus.test.projectRecords.domain.Project;
 import com.jeeplus.test.projectRecords.mapper.ProjectMapper;
 import com.jeeplus.test.user.service.dto.FileUrlDto;
+import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.flowable.editor.language.json.converter.util.CollectionUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
@@ -35,6 +37,7 @@ import java.io.IOException;
 import java.net.URL;
 import java.net.URLEncoder;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Slf4j
 @Service
@@ -301,4 +304,113 @@ public class OssService extends ServiceImpl<OssServiceMapper,WorkAttachment> {
         return dto;
     }
 
+    /**
+     * 保存/修改附件
+     * @param fileList 要保存的附件,传空值则删除attachmentId下的所有附件
+     * @param attachmentId 附件的attachmentId
+     * @param attachmentFlag 附件的attachmentFlag
+     */
+    public void saveOrUpdateFileList(List<WorkAttachmentDto> fileList,String attachmentId,String attachmentFlag){
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        if (CollectionUtil.isNotEmpty(fileList)) {
+            List<String> ids = fileList.stream().filter(item -> {
+                if (com.jeeplus.sys.utils.StringUtils.isNotBlank(item.getId())) {
+                    return true;
+                }
+                return false;
+            }).map(WorkAttachmentDto::getId).collect(Collectors.toList());
+            if(CollectionUtil.isNotEmpty(ids)){
+                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                        .eq(WorkAttachment::getAttachmentId, attachmentId)
+                        .notIn(WorkAttachment::getId,ids));
+            }else{
+                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                        .eq(WorkAttachment::getAttachmentId, attachmentId));
+            }
+
+            List<WorkAttachmentDto> dtoList = fileList.stream().filter(item -> {
+                if (com.jeeplus.sys.utils.StringUtils.isNotBlank(item.getId())) {
+                    return false;
+                }
+                return true;
+            }).collect(Collectors.toList());
+
+            this.saveFileList(dtoList, userDTO, attachmentId,attachmentFlag);
+        } else {
+            ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, attachmentId));
+        }
+    }
+
+    /**
+     * 保存/修改附件
+     * @param fileList 要保存的附件,传空值则删除attachmentId下attachmentFlag下的所有附件
+     * @param attachmentId 附件的attachmentId
+     * @param attachmentFlag 附件的attachmentFlag
+     */
+    public void saveOrUpdateFileListFlag(List<WorkAttachmentDto> fileList,String attachmentId,String attachmentFlag){
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        if (CollectionUtil.isNotEmpty(fileList)) {
+            List<String> ids = fileList.stream().filter(item -> {
+                if (com.jeeplus.sys.utils.StringUtils.isNotBlank(item.getId())) {
+                    return true;
+                }
+                return false;
+            }).map(WorkAttachmentDto::getId).collect(Collectors.toList());
+            if(CollectionUtil.isNotEmpty(ids)){
+                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                        .eq(WorkAttachment::getAttachmentId, attachmentId)
+                        .eq(WorkAttachment::getAttachmentFlag, attachmentFlag)
+                        .notIn(WorkAttachment::getId,ids));
+            }else{
+                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                        .eq(WorkAttachment::getAttachmentId, attachmentId)
+                        .eq(WorkAttachment::getAttachmentFlag, attachmentFlag));
+            }
+
+            List<WorkAttachmentDto> dtoList = fileList.stream().filter(item -> {
+                if (com.jeeplus.sys.utils.StringUtils.isNotBlank(item.getId())) {
+                    return false;
+                }
+                return true;
+            }).collect(Collectors.toList());
+
+            this.saveFileList(dtoList, userDTO, attachmentId,attachmentFlag);
+        } else {
+            ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, attachmentId).eq(WorkAttachment::getAttachmentFlag, attachmentFlag));
+        }
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    public void saveFileList(List<WorkAttachmentDto> list, UserDTO userDTO, String id,String attachmentFlag) {
+        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(attachmentFlag);
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            j++;
+        }
+    }
+
 }

+ 34 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/controller/ProjectListController.java

@@ -10,10 +10,7 @@ import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListInfo;
 import com.jeeplus.test.program.configuration.projectList.mapper.ProgramReportNoMapper;
 import com.jeeplus.test.program.configuration.projectList.service.ProjectListService;
-import com.jeeplus.test.program.configuration.projectList.service.dto.ContractDto;
-import com.jeeplus.test.program.configuration.projectList.service.dto.ExportFileDto;
-import com.jeeplus.test.program.configuration.projectList.service.dto.ProgramAuditDto;
-import com.jeeplus.test.program.configuration.projectList.service.dto.ProjectListDto;
+import com.jeeplus.test.program.configuration.projectList.service.dto.*;
 import com.jeeplus.test.projectRecords.domain.Project;
 import com.jeeplus.test.projectRecords.service.dto.FileUploadListDTO;
 import com.jeeplus.test.projectRecords.service.dto.ProjectDTO;
@@ -48,6 +45,16 @@ public class ProjectListController {
     }
 
     /**
+     * 新增/修改项目归档
+     */
+    @ApiOperation(value = "新增/修改项目归档")
+    @PostMapping(value = "/saveFormArchive")
+    public ResponseEntity saveFormArchive(@RequestBody ProgramArchiveDto programArchiveDto) throws Exception{
+        String id = projectListService.saveFormArchive(programArchiveDto);
+        return ResponseUtil.newInstance().add("businessTable", "program_archive").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
      * 新增/修改三级校审
      */
     @ApiOperation(value = "新增/修改三级校审")
@@ -92,6 +99,17 @@ public class ProjectListController {
     }
 
     /**
+     * 根据id查询项目归档
+     * @return
+     */
+    @ApiOperation(value = "根据id查询项目归档")
+    @GetMapping(value = "/findByIdArchive")
+    public ResponseEntity<ProgramArchiveDto> findByIdArchive(@RequestParam String id){
+        ProgramArchiveDto dto = projectListService.findByIdArchive(id);
+        return ResponseEntity.ok(dto);
+    }
+
+    /**
      * 根据id删除
      * @param id
      * @return
@@ -141,6 +159,18 @@ public class ProjectListController {
     }
 
     /**
+     * 根据id修改项目归档状态值status
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "根据id修改项目归档状态值status")
+    @PostMapping(value = "/updateStatusByArchiveId")
+    public ResponseEntity<String> updateStatusByArchiveId(@RequestBody ProjectListDto dto) {
+        String s = projectListService.updateStatusByArchiveId(dto);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
      * 合同登记列表
      * @param info
      * @param page

+ 164 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/domain/ProgramArchive.java

@@ -0,0 +1,164 @@
+package com.jeeplus.test.program.configuration.projectList.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 新项目管理-项目登记-项目归档
+ * @TableName program_archive
+ */
+@Data
+@TableName(value = "program_archive")
+public class ProgramArchive extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String programId;
+
+    /**
+     * 年份
+     */
+    private String year;
+
+    /**
+     * 项目类型
+     */
+    private String programType;
+
+    /**
+     * 评估报告日
+     */
+    private Date evaluationReportDate;
+
+    /**
+     * 协议号
+     */
+    private String protocolNum;
+
+    /**
+     * 废旧物资评估(万元)
+     */
+    private String waystEvaluation;
+
+    /**
+     * 固定资产评估(万元)
+     */
+    private String fixedAssetsEvaluation;
+
+    /**
+     * 净资产评估
+     */
+    private String netAssetsEvaluation;
+
+    /**
+     * 租金评估(万/年)
+     */
+    private String rentEvaluation;
+
+    /**
+     * 司法鉴定
+     */
+    private String forensics;
+
+    /**
+     * 报告收费(元)
+     */
+    private String reportCharges;
+
+    /**
+     * 当前处理人
+     */
+    private String currentDisposePerson;
+
+    /**
+     * 是否开票
+     */
+    private String isInvoice;
+
+    /**
+     * 开票日期
+     */
+    private Date invoiceDate;
+
+    /**
+     * 预估/实际收费(万元)
+     */
+    private String actualCharges;
+
+    /**
+     * 合同是否存档
+     */
+    private String isContractArchive;
+
+    /**
+     * 底稿是否完好
+     */
+    private String isPapersIntact;
+
+    /**
+     * 底稿是否归档
+     */
+    private String isPapersArchive;
+
+    /**
+     * 报销外勤天数
+     */
+    private String opsAmount;
+
+    /**
+     * 外勤是否已经报销
+     */
+    private String isOpsReimbursement;
+
+    /**
+     * 已报销金额
+     */
+    private String reimbursementAmount;
+
+    /**
+     * 未报销金额
+     */
+    private String unreimbursedAmount;
+
+    /**
+     * 报销单号
+     */
+    private String reimbursementNum;
+
+    /**
+     * 报销日期
+     */
+    private Date reimbursementDate;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 审核通过时间
+     */
+    private String auditDate;
+
+    private static final long serialVersionUID = 1L;
+}

+ 18 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/domain/ProgramProjectListInfo.java

@@ -273,4 +273,22 @@ public class ProgramProjectListInfo {
     @TableField(exist = false)
     private String procInsId3;
 
+    /**
+     * 项目归档流程id
+     */
+    @TableField(exist = false)
+    private String procInsIdArchive;
+
+    /**
+     * 项目归档id
+     */
+    @TableField(exist = false)
+    private String archiveId;
+
+    /**
+     * 项目归档状态
+     */
+    @TableField(exist = false)
+    private String archiveStatus;
+
 }

+ 19 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/mapper/ProgramArchiveMapper.java

@@ -0,0 +1,19 @@
+package com.jeeplus.test.program.configuration.projectList.mapper;
+
+import com.jeeplus.test.program.configuration.projectList.domain.ProgramArchive;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.test.program.configuration.projectList.service.dto.ProgramArchiveDto;
+import com.jeeplus.test.program.configuration.projectList.service.dto.ProgramAuditDto;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Entity com.jeeplus.test.program.configuration.projectList.domain.ProgramArchive
+ */
+@Mapper
+public interface ProgramArchiveMapper extends BaseMapper<ProgramArchive> {
+    ProgramArchiveDto findByIdArchive(String id);
+}
+
+
+
+

+ 119 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/mapper/xml/ProgramArchiveMapper.xml

@@ -0,0 +1,119 @@
+<?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.program.configuration.projectList.mapper.ProgramArchiveMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.test.program.configuration.projectList.service.dto.ProgramArchiveDto">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="programId" column="program_id" jdbcType="VARCHAR"/>
+            <result property="year" column="year" jdbcType="VARCHAR"/>
+            <result property="programType" column="program_type" jdbcType="VARCHAR"/>
+            <result property="evaluationReportDate" column="evaluation_report_date" jdbcType="TIMESTAMP"/>
+            <result property="protocolNum" column="protocol_num" jdbcType="VARCHAR"/>
+            <result property="waystEvaluation" column="wayst_evaluation" jdbcType="VARCHAR"/>
+            <result property="fixedAssetsEvaluation" column="fixed_assets_evaluation" jdbcType="VARCHAR"/>
+            <result property="netAssetsEvaluation" column="net_assets_evaluation" jdbcType="VARCHAR"/>
+            <result property="rentEvaluation" column="rent_evaluation" jdbcType="VARCHAR"/>
+            <result property="forensics" column="forensics" jdbcType="VARCHAR"/>
+            <result property="reportCharges" column="report_charges" jdbcType="VARCHAR"/>
+            <result property="currentDisposePerson" column="current_dispose_person" jdbcType="VARCHAR"/>
+            <result property="isInvoice" column="is_invoice" jdbcType="VARCHAR"/>
+            <result property="invoiceDate" column="invoice_date" jdbcType="TIMESTAMP"/>
+            <result property="actualCharges" column="actual_charges" jdbcType="VARCHAR"/>
+            <result property="isContractArchive" column="is_contract_archive" jdbcType="VARCHAR"/>
+            <result property="isPapersIntact" column="is_papers_intact" jdbcType="VARCHAR"/>
+            <result property="isPapersArchive" column="is_papers_archive" jdbcType="VARCHAR"/>
+            <result property="opsAmount" column="ops_amount" jdbcType="VARCHAR"/>
+            <result property="isOpsReimbursement" column="is_ops_reimbursement" jdbcType="VARCHAR"/>
+            <result property="reimbursementAmount" column="reimbursement_amount" jdbcType="VARCHAR"/>
+            <result property="unreimbursedAmount" column="unreimbursed_amount" jdbcType="VARCHAR"/>
+            <result property="reimbursementNum" column="reimbursement_num" jdbcType="VARCHAR"/>
+            <result property="reimbursementDate" column="reimbursement_date" jdbcType="TIMESTAMP"/>
+            <result property="auditDate" column="audit_date" jdbcType="TIMESTAMP"/>
+            <result property="procInsId" column="proc_ins_id" jdbcType="VARCHAR"/>
+            <result property="processDefinitionId" column="process_definition_id" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="VARCHAR"/>
+            <result property="reportNo" column="report_no" jdbcType="VARCHAR"/>
+            <association property="programProjectListInfo" select="getProgram" javaType="com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListInfo" column="program_id"></association>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        pa.id,
+        pa.create_by,
+        pa.create_date,
+        pa.update_by,
+        pa.update_date,
+        pa.del_flag,
+        pa.remarks,
+        pa.program_id,
+        pa.year,
+        pa.program_type,
+        pa.evaluation_report_date,
+        pa.protocol_num,
+        pa.wayst_evaluation,
+        pa.fixed_assets_evaluation,
+        pa.net_assets_evaluation,
+        pa.rent_evaluation,
+        pa.forensics,
+        pa.report_charges,
+        pa.current_dispose_person,
+        pa.is_invoice,
+        pa.invoice_date,
+        pa.actual_charges,
+        pa.is_contract_archive,
+        pa.is_papers_intact,
+        pa.is_papers_archive,
+        pa.ops_amount,
+        pa.is_ops_reimbursement,
+        pa.reimbursement_amount,
+        pa.unreimbursed_amount,
+        pa.reimbursement_num,
+        pa.reimbursement_date,
+        pa.proc_ins_id,
+        pa.process_definition_id,
+        pa.status,
+        pa.audit_date
+    </sql>
+    <sql id="Program_Column_List">
+        id,create_by,create_date,
+        update_by,update_date,del_flag,
+        contract_id,contract_name,client,
+        client_name,amount,contract_type,
+        name,no,project_type,
+        approval_no,company,project_mould,
+        property_holder,property_holder_name,location,
+        is_first,year_num,check_year,
+        project_manager,project_manager_name,report_type,
+        industry,enterprise_type,risk_level,
+        project_source,estimate,plan_end_time,
+        use_num,appointment,work_hours,
+        remarks,assessment_enterprise,assessment_enterprise_name,
+        link_num,relationship,assessment_way,
+        assessment_objective,assessment_date,num,
+        project_development,delegate_project_type,assessment_object,
+        work_begin_date,work_end_date,reporting_date,
+        is_have,is_influence,mode,
+        status,proc_ins_id,process_definition_id
+    </sql>
+    <select id="getProgram" resultType="com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListInfo">
+        select
+        <include refid="Program_Column_List"></include>
+        from program_project_list_info ppli
+        where ppli.del_flag = '0' and id = #{program_id}
+    </select>
+    <select id="findByIdArchive" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>,
+        prn.report_no as report_no
+        from program_archive pa
+        left join program_report_no prn on prn.program_id = pa.program_id and prn.del_flag = '0'
+        where pa.del_flag = '0' and pa.id = #{id}
+    </select>
+</mapper>

+ 8 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/mapper/xml/ProjectListMapper.xml

@@ -125,15 +125,19 @@
            pa2.proc_ins_id as procInsId2,
            pa3.status as status3,
            pa3.id as auditId3,
-           pa3.proc_ins_id as procInsId3
+           pa3.proc_ins_id as procInsId3,
+           pa.status as archive_status,
+           pa.id as archive_id,
+           pa.proc_ins_id as procInsIdArchive
         FROM
             program_project_list_info a
             LEFT JOIN sys_user b ON a.create_by = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN program_report_no prn ON prn.program_id = a.id
-            LEFT JOIN program_audit pa1 ON pa1.program_id = a.id and pa1.audit_level = '1'
-            LEFT JOIN program_audit pa2 ON pa2.program_id = a.id and pa2.audit_level = '2'
-            LEFT JOIN program_audit pa3 ON pa3.program_id = a.id and pa3.audit_level = '3'
+            LEFT JOIN program_audit pa1 ON pa1.program_id = a.id and pa1.audit_level = '1' and pa1.del_flag = '0'
+            LEFT JOIN program_audit pa2 ON pa2.program_id = a.id and pa2.audit_level = '2' and pa2.del_flag = '0'
+            LEFT JOIN program_audit pa3 ON pa3.program_id = a.id and pa3.audit_level = '3' and pa3.del_flag = '0'
+            LEFT JOIN program_archive pa ON pa.program_id = a.id and pa.del_flag = '0'
             ${ew.customSqlSegment}
             ORDER BY a.update_date DESC
     </select>

+ 89 - 28
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/ProjectListService.java

@@ -15,9 +15,11 @@ import com.jeeplus.sys.utils.UserUtils;
 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.program.configuration.projectList.domain.*;
 import com.jeeplus.test.program.configuration.projectList.mapper.*;
 import com.jeeplus.test.program.configuration.projectList.service.dto.*;
+import com.jeeplus.test.program.configuration.projectList.service.mapstruct.ProgramArchiveWrapper;
 import com.jeeplus.test.program.configuration.projectList.service.mapstruct.ProgramAuditAssessPeopleWrapper;
 import com.jeeplus.test.program.configuration.projectList.service.mapstruct.ProgramAuditWrapper;
 import com.jeeplus.test.workContract.domain.WorkContractInfo;
@@ -46,7 +48,8 @@ public class ProjectListService {
     private WorkContractInfoMapper workContractInfoMapper;
     @Resource
     private OssServiceMapper ossServiceMapper;
-
+    @Resource
+    private OssService ossService;
     @Resource
     private SerialnumTplService serialnumTplService;
     @Resource
@@ -57,6 +60,8 @@ public class ProjectListService {
     private ProgramReportNoMapper programReportNoMapper;
     @Resource
     private ProgramAuditAssessPeopleMapper programAuditAssessPeopleMapper;
+    @Resource
+    private ProgramArchiveMapper programArchiveMapper;
 
     public String save(ProjectListDto dto) throws Exception{
         if (StringUtils.isNotEmpty(dto.getId())) {
@@ -131,9 +136,31 @@ public class ProjectListService {
         programAudit3.setProgramId(info.getId());
         programAudit3.setStatus("0");
         programAuditMapper.insert(programAudit3);
+        // 项目归档添加
+        ProgramArchive programArchive = new ProgramArchive();
+        programArchive.setProgramId(info.getId());
+        programArchive.setStatus("0");
+        programArchiveMapper.insert(programArchive);
         return id;
     }
 
+    public String saveFormArchive(ProgramArchiveDto programArchiveDto) {
+        ProgramArchive programArchive = ProgramArchiveWrapper.INSTANCE.toEntity(programArchiveDto);
+        if (StringUtils.isNotBlank(programArchive.getId())){
+            programArchiveMapper.updateById(programArchive);
+        }else{
+            programArchiveMapper.insert(programArchive);
+        }
+        if (ObjectUtil.isNotEmpty(programArchiveDto)) {
+            ossService.saveOrUpdateFileListFlag(programArchiveDto.getReportFileList(),programArchive.getId(),"report");
+            ossService.saveOrUpdateFileListFlag(programArchiveDto.getDetailFileList(),programArchive.getId(),"detail");
+            ossService.saveOrUpdateFileListFlag(programArchiveDto.getExplainFileList(),programArchive.getId(),"explain");
+            ossService.saveOrUpdateFileListFlag(programArchiveDto.getPapersFileList(),programArchive.getId(),"papers");
+            ossService.saveOrUpdateFileListFlag(programArchiveDto.getOtherFileList(),programArchive.getId(),"other");
+        }
+        return programArchive.getId();
+    }
+
     public String saveFormThree(ProgramAuditDto programAuditDto) {
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
         ProgramAudit programAudit = ProgramAuditWrapper.INSTANCE.toEntity(programAuditDto);
@@ -144,33 +171,7 @@ public class ProjectListService {
         }
         if (ObjectUtil.isNotEmpty(programAuditDto)) {
             //附件
-            if (CollectionUtil.isNotEmpty(programAuditDto.getWorkAttachmentDtoList())) {
-                List<String> ids = programAuditDto.getWorkAttachmentDtoList().stream().filter(item -> {
-                    if (StringUtils.isNotBlank(item.getId())) {
-                        return true;
-                    }
-                    return false;
-                }).map(WorkAttachmentDto::getId).collect(Collectors.toList());
-                if(CollectionUtil.isNotEmpty(ids)){
-                    ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
-                            .eq(WorkAttachment::getAttachmentId, programAudit.getId())
-                            .notIn(WorkAttachment::getId,ids));
-                }else{
-                    ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
-                            .eq(WorkAttachment::getAttachmentId, programAudit.getId()));
-                }
-
-                List<WorkAttachmentDto> dtoList = programAuditDto.getWorkAttachmentDtoList().stream().filter(item -> {
-                    if (StringUtils.isNotBlank(item.getId())) {
-                        return false;
-                    }
-                    return true;
-                }).collect(Collectors.toList());
-
-                workContractService.saveFilesNew(dtoList, userDTO, programAudit.getId(),"program");
-            } else {
-                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, programAudit.getId()));
-            }
+            ossService.saveOrUpdateFileList(programAuditDto.getWorkAttachmentDtoList(),programAudit.getId(),"program");
             //专业评估人员
             if (CollectionUtil.isNotEmpty(programAuditDto.getProgramAuditAssessPeopleDtoList())) {
                 programAuditAssessPeopleMapper.delete(new QueryWrapper<ProgramAuditAssessPeople>().lambda().eq(ProgramAuditAssessPeople::getAuditId,programAudit.getId()));
@@ -275,6 +276,58 @@ public class ProjectListService {
         return byIdAudit;
     }
 
+    public ProgramArchiveDto findByIdArchive(String id){
+        ProgramArchiveDto programArchiveDto = programArchiveMapper.findByIdArchive(id);
+
+        // 查询附件信息 - 评估报告
+        List<WorkAttachmentDto> reportFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "report");
+        if (CollectionUtils.isNotEmpty(reportFileList)) {
+            for (WorkAttachmentDto i : reportFileList) {
+                i.setCreateBy(UserUtils.get(i.getBy()));
+            }
+            programArchiveDto.setReportFileList(reportFileList);
+        }
+
+        // 查询附件信息 - 评估说明
+        List<WorkAttachmentDto> explainFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "explain");
+        if (CollectionUtils.isNotEmpty(explainFileList)) {
+            for (WorkAttachmentDto i : explainFileList) {
+                i.setCreateBy(UserUtils.get(i.getBy()));
+            }
+            programArchiveDto.setExplainFileList(explainFileList);
+        }
+
+        // 查询附件信息 - 评估明细表
+        List<WorkAttachmentDto> detailFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "detail");
+        if (CollectionUtils.isNotEmpty(detailFileList)) {
+            for (WorkAttachmentDto i : detailFileList) {
+                i.setCreateBy(UserUtils.get(i.getBy()));
+            }
+            programArchiveDto.setDetailFileList(detailFileList);
+        }
+
+        // 查询附件信息 - 评估操作计算底稿
+        List<WorkAttachmentDto> papersFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "papers");
+        if (CollectionUtils.isNotEmpty(papersFileList)) {
+            for (WorkAttachmentDto i : papersFileList) {
+                i.setCreateBy(UserUtils.get(i.getBy()));
+            }
+            programArchiveDto.setPapersFileList(papersFileList);
+        }
+
+        // 查询附件信息 - 其他
+        List<WorkAttachmentDto> otherFileList = workContractInfoMapper.findByAttachmentIdAndFlag(id, "other");
+        if (CollectionUtils.isNotEmpty(otherFileList)) {
+            for (WorkAttachmentDto i : otherFileList) {
+                i.setCreateBy(UserUtils.get(i.getBy()));
+            }
+            programArchiveDto.setOtherFileList(otherFileList);
+        }
+
+
+        return programArchiveDto;
+    }
+
     public String deleteById(String id) {
         projectListMapper.deleteById(id);
         projectLinkMapper.deleteByInfoId(id);
@@ -303,6 +356,14 @@ public class ProjectListService {
         return "操作成功";
     }
 
+    public String updateStatusByArchiveId(ProjectListDto dto) {
+        ProgramArchive programArchive = new ProgramArchive();
+        programArchive.setId(dto.getId());
+        programArchive.setStatus(dto.getStatus());
+        programArchiveMapper.update(programArchive,new QueryWrapper<ProgramArchive>().lambda().eq(ProgramArchive::getId,programArchive.getId()));
+        return "操作成功";
+    }
+
     public IPage<ProgramProjectListInfo> list(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info) throws Exception{
         QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
         wrapper.eq("a.del_flag", "0");

+ 210 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/dto/ProgramArchiveDto.java

@@ -0,0 +1,210 @@
+package com.jeeplus.test.program.configuration.projectList.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.test.oss.domain.WorkAttachment;
+import com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListInfo;
+import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 新项目管理-项目登记-项目归档
+ * @TableName program_archive
+ */
+@Data
+public class ProgramArchiveDto extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String programId;
+
+    /**
+     * 年份
+     */
+    private String year;
+
+    /**
+     * 项目类型
+     */
+    private String programType;
+
+    /**
+     * 评估报告日
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date evaluationReportDate;
+
+    /**
+     * 协议号
+     */
+    private String protocolNum;
+
+    /**
+     * 废旧物资评估(万元)
+     */
+    private String waystEvaluation;
+
+    /**
+     * 固定资产评估(万元)
+     */
+    private String fixedAssetsEvaluation;
+
+    /**
+     * 净资产评估
+     */
+    private String netAssetsEvaluation;
+
+    /**
+     * 租金评估(万/年)
+     */
+    private String rentEvaluation;
+
+    /**
+     * 司法鉴定
+     */
+    private String forensics;
+
+    /**
+     * 报告收费(元)
+     */
+    private String reportCharges;
+
+    /**
+     * 当前处理人
+     */
+    private String currentDisposePerson;
+
+    /**
+     * 是否开票
+     */
+    private String isInvoice;
+
+    /**
+     * 开票日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date invoiceDate;
+
+    /**
+     * 预估/实际收费(万元)
+     */
+    private String actualCharges;
+
+    /**
+     * 合同是否存档
+     */
+    private String isContractArchive;
+
+    /**
+     * 底稿是否完好
+     */
+    private String isPapersIntact;
+
+    /**
+     * 底稿是否归档
+     */
+    private String isPapersArchive;
+
+    /**
+     * 报销外勤天数
+     */
+    private String opsAmount;
+
+    /**
+     * 外勤是否已经报销
+     */
+    private String isOpsReimbursement;
+
+    /**
+     * 已报销金额
+     */
+    private String reimbursementAmount;
+
+    /**
+     * 未报销金额
+     */
+    private String unreimbursedAmount;
+
+    /**
+     * 报销单号
+     */
+    private String reimbursementNum;
+
+    /**
+     * 报销日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date reimbursementDate;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 审核通过时间
+     */
+    private String auditDate;
+
+    /**
+     * 项目信息
+     */
+    private ProgramProjectListInfo programProjectListInfo;
+
+    /**
+     * 附件 - 评估报告
+     */
+    private List<WorkAttachmentDto> reportFileList;
+
+    /**
+     * 附件 - 评估说明
+     */
+    private List<WorkAttachmentDto> explainFileList;
+
+    /**
+     * 附件 - 评估明细表
+     */
+    private List<WorkAttachmentDto> detailFileList;
+
+    /**
+     * 附件 - 评估操作计算底稿
+     */
+    private List<WorkAttachmentDto> papersFileList;
+
+    /**
+     * 附件 - 其他
+     */
+    private List<WorkAttachmentDto> otherFileList;
+
+    /**
+     * 项目报告号
+     */
+    private String reportNo;
+
+    private static final long serialVersionUID = 1L;
+}

+ 17 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/mapstruct/ProgramArchiveWrapper.java

@@ -0,0 +1,17 @@
+package com.jeeplus.test.program.configuration.projectList.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.test.program.configuration.projectList.domain.ProgramArchive;
+import com.jeeplus.test.program.configuration.projectList.domain.ProgramAuditAssessPeople;
+import com.jeeplus.test.program.configuration.projectList.service.dto.ProgramArchiveDto;
+import com.jeeplus.test.program.configuration.projectList.service.dto.ProgramAuditAssessPeopleDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface ProgramArchiveWrapper extends EntityWrapper<ProgramArchiveDto, ProgramArchive>{
+
+        ProgramArchiveWrapper INSTANCE = Mappers.getMapper(ProgramArchiveWrapper.class);
+
+}

+ 2 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workContract/mapper/WorkContractInfoMapper.java

@@ -25,6 +25,8 @@ public interface WorkContractInfoMapper extends BaseMapper<WorkContractInfo> {
 
     List<WorkAttachmentDto> findDtos(@Param("id") String id);
 
+    List<WorkAttachmentDto> findByAttachmentIdAndFlag(@Param("attachmentId") String id,@Param("attachmentFlag") String attachmentFlag);
+
     void updateStatusById(@Param("id") String id, @Param("status")String status);
 
     IPage<ProgramProjectListInfo> relationProjectList(@Param("id") String id, Page<ProgramProjectListInfo> page);

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workContract/mapper/xml/WorkContractInfoMapper.xml

@@ -122,6 +122,21 @@
 			AND attachment_id = #{id}
 	</select>
 
+	<select id="findByAttachmentIdAndFlag" resultType="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by AS `by`,
+			create_date
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{attachmentId}
+			And attachment_flag = #{attachmentFlag}
+	</select>
+
 	<update id="updateStatusById">
 		UPDATE work_contract_info SET `status` = #{status} WHERE del_flag = 0 AND id = #{id}
 	</update>