浏览代码

财务-bug修改,tab页添加

wangqiang 2 年之前
父节点
当前提交
be46d6ecb1

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

@@ -93,4 +93,10 @@ public class ContractInfo extends BaseEntity {
 
     @TableField(exist = false)
     private String departmentName;
+
+    /**
+     * 归档附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentDto> contractInfoList;
 }

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

@@ -33,4 +33,10 @@ public interface ContractFileMapper extends BaseMapper<ContractFile> {
      * 根据attachmentId删除上传文件信息
      */
     void deleteFileInfo(String attachmentId);
+
+    /**
+     * 根据合同登记主键值找到对应归档信息
+     * @param id
+     */
+    ContractFile getInfoByConId(String id);
 }

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

@@ -113,4 +113,7 @@
 			b.id = #{id}
 			AND b.del_flag = 0
     </select>
+    <select id="getInfoByConId" resultType="com.jeeplus.test.cw.contractRegistration.domain.ContractFile">
+        select * from cw_work_contract_file where contract_info_id = #{id}
+    </select>
 </mapper>

+ 16 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java

@@ -11,6 +11,7 @@ import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractFile;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractInfo;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractParticipant;
+import com.jeeplus.test.cw.contractRegistration.mapper.ContractFileMapper;
 import com.jeeplus.test.cw.contractRegistration.mapper.ContractInfoMapper;
 import com.jeeplus.test.cw.contractRegistration.mapper.ContractParticipantMapper;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
@@ -47,6 +48,9 @@ public class ContractInfoService {
     private OssServiceMapper ossServiceMapper;
 
     @Resource
+    private ContractFileMapper fileMapper;
+
+    @Resource
     private ContractParticipantMapper participantMapper;
 
     /**
@@ -210,12 +214,23 @@ public class ContractInfoService {
 //        info.setNo(serialNum);
         contractInfo.setUpdateBy(userDTO.getId());
         contractInfo.setUpdateDate(new Date());
-        if (!contractInfo.getStatus().equals("5")){
+
+        if (StringUtils.isNotEmpty(contractInfo.getStatus()) &&!contractInfo.getStatus().equals("5")){
             int num = Integer.parseInt(contractInfo.getChangeNum()) + 1;
             contractInfo.setChangeNum(num + "");
         }else {
             contractInfo.setChangeNum(contractInfo.getChangeNum());
         }
+        //对管理员上传归档文件进行相关操作
+        if (StringUtils.isNotEmpty(contractInfo.getFiledType()) && contractInfo.getFiledType().equals("5")){
+            //根据id找到归档表id
+            ContractFile contractFile = fileMapper.getInfoByConId(info.getId());
+            contractFile.setContractInfoList(info.getContractInfoList());
+            if (CollectionUtils.isNotEmpty(contractFile.getContractInfoList())){
+                updateFiles(contractFile.getContractInfoList(), userDTO, contractFile.getId());
+            }
+        }
+
 
 
         mapper.updateById(contractInfo);

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

@@ -117,6 +117,9 @@ public class CwProjectReportData extends BaseDTO {
     @TableField(exist = false)
     List<CwProjectInfoData> cwProjectInfoList;
 
+    //新建行历史数据
+    @TableField(exist = false)
+    List<CwProjectInfoData> cwWorkClientContactDTOList;
 
     @TableField(exist = false)
     private String[] contractDates;

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

@@ -49,4 +49,24 @@ public interface CwProjectInfoMapper extends BaseMapper<CwProjectInfoData> {
     void deleteByReportId(String id);
 
     List<String> getId(String reportId);
+
+    /**
+     * 根据新建行id查出该条信息
+     * @param reportNewLineId
+     */
+    CwProjectInfoData getNewLineInfoById(String reportNewLineId);
+
+    /**
+     * 根据报告管理id查看所有的新建行数据
+     * @param reportId
+     * @return
+     */
+    int getCountByReportId(String reportId);
+
+    /**
+     * 根据报告管理id查出所有的新增行数据
+     * @param id
+     * @return
+     */
+    List<CwProjectInfoData> getByReportId(String id);
 }

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

@@ -14,6 +14,8 @@ import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * 财务-报告管理
  * @author: 王强
@@ -72,4 +74,11 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
      * @param cwProjectReportData
      */
     void updateReportSealType(CwProjectReportData cwProjectReportData);
+
+    /**
+     * 根据项目id查出所有的reportID
+     * @param projectId
+     * @return
+     */
+    List<CwProjectReportData> getByProjectId(String projectId);
 }

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

@@ -31,4 +31,16 @@
     <select id="getId" resultType="java.lang.String">
         select id from cw_project_report_new_line where report_id = #{id} and del_flag = '0'
     </select>
+    <select id="getNewLineInfoById" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectInfoData">
+        select * from cw_project_report_new_line where id = #{reportNewLineId}
+    </select>
+    <select id="getCountByReportId" resultType="java.lang.Integer">
+        select count(*) from cw_project_report_new_line where report_id = #{reportId} and del_flag = '0'
+    </select>
+    <select id="getByReportId" resultType="com.jeeplus.test.cw.projectReport.domain.CwProjectInfoData">
+        select a.*,cw.name as servedUnitName from cw_project_report_new_line a
+        left join cw_work_client_base cw
+        on a.served_unit_id = cw.id
+        where report_id = #{reportId} and a.del_flag = '0'
+    </select>
 </mapper>

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

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

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

@@ -566,9 +566,47 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
             info.setCwFileInfoList(dtoList);
             infoData.add(info);
         });
+        //根据项目id查出所有的新增行数据及对应的附件
+        String projectId = reportData.getProjectId();
+        //根据项目id找出所有的reportID
+        List<CwProjectReportData> byProjectId = reportMapper.getByProjectId(projectId);
+        //根据查出的report信息查新建行数据
+        List<CwProjectInfoData> dataList = new ArrayList<>();
+        byProjectId.forEach(by->{
+            List<CwProjectInfoData> byReportId = infoMapper.getByReportId(by.getId());
+            byReportId.forEach(byr->{
+                //保存到work_attachment表中的信息
+                List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(byr.getId());
+                List<ProjectReportWorkAttachmentDTO> dtoList = new ArrayList<>();
+                dtos.forEach(d->{
+                    //根据id查出cw_project_report_file文件表的其他信息
+                    CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId());
+                    d.setFileType(file.getFileType());
+                    d.setSealType(file.getSealType());
+                    d.setSealedFile(file.getSealedFile());
+                    d.setSealUser(file.getSealUser());
+                    d.setSealDate(file.getSealDate());
+                    d.setRemarks(file.getRemarks());
+                    UserDTO userDTO = new UserDTO();
+                    //根据创建人id查出创建人名称
+                    String name = reportMapper.getUserNameById(file.getCreateBy());
+                    userDTO.setId(file.getCreateBy());
+                    userDTO.setName(name);
+                    d.setCreateBy(userDTO);
+                    d.setCreateDate(file.getCreateDate());
+                    dtoList.add(d);
+                });
+                byr.setCwFileInfoList(dtoList);
+                dataList.add(byr);
+            });
+
+        });
         if (infoData != null & !infoData.isEmpty()){
             reportData.setCwProjectInfoList(infoData);
         }
+        if (dataList != null & !dataList.isEmpty()){
+            reportData.setCwWorkClientContactDTOList(dataList);
+        }
 
 
         return reportData;

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

@@ -149,6 +149,17 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
             //删除新建行下的文件信息
             //删除work_attachment_id信息
             attachmentMapper.deleteByAttachMnentId(report.getReportNewLineId());
+            //根据新建行id找到报告管理表id
+            CwProjectInfoData newLineInfo = infoMapper.getNewLineInfoById(report.getReportNewLineId());
+            if (StringUtils.isNotEmpty(newLineInfo.getReportId())){
+                //根据报告管理id去新建行表中查数据,当没有数据的时候,报告表该条数据逻辑删除
+                int count = infoMapper.getCountByReportId(newLineInfo.getReportId());
+                if (count == 0){
+                    //当没有数据的时候删除报告管理信息
+                    reportMapper.deleteById(newLineInfo.getReportId());
+                }
+            }
+
             //向存放报废报告号表中添加数据
             CwProjectReportCancel cancel = new CwProjectReportCancel();
             cancel.setId(UUID.randomUUID().toString().replace("-", ""));