Ver código fonte

报销功能修改

lizhenhao 2 anos atrás
pai
commit
c9e3d7813b

+ 84 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalInfo/domain/CwReimbursementDetailInfoProcured.java

@@ -0,0 +1,84 @@
+package com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName(value = "cw_reimbursement_detail_info_procured")
+public class CwReimbursementDetailInfoProcured extends BaseEntity {
+
+    /**
+     * 关联id
+     */
+    private String infoId;
+
+    /**
+     * 报销人
+     */
+    private String userId;
+
+    /**
+     * 报销人名称
+     */
+    @TableField(exist = false)
+    private String userName;
+
+    /**
+     * 报销部门
+     */
+    private String deptId;
+
+    /**
+     * 报销部门名称
+     */
+    @TableField(exist = false)
+    private String deptName;
+
+    /**
+     * 报销类型
+     */
+    private String typeId;
+
+    /**
+     * 报销类型名称
+     */
+    @TableField(exist = false)
+    private String typeName;
+
+    /**
+     * 报告号
+     */
+    private String reportNumber;
+
+    /**
+     * 费用(元)
+     */
+    private String number;
+
+    /**
+     * 收据张数
+     */
+    private Integer receiptNumber;
+
+    /**
+     * 出差天数
+     */
+    private Integer days;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 报销项目
+     */
+    private String projectId;
+
+    /**
+     * 报销项目名称
+     */
+    private String projectName;
+}

+ 2 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalInfo/domain/CwReimbursementInfo.java

@@ -69,4 +69,6 @@ public class CwReimbursementInfo extends BaseEntity {
      */
     private String sourceType;
 
+    private String purchaseId;
+
 }

+ 8 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalInfo/mapper/CwReimbursementDetailInfoProcuredMapper.java

@@ -0,0 +1,8 @@
+package com.jeeplus.test.cw.reimbursementApproval.approvalInfo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.CwReimbursementDetailInfoOther;
+import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.CwReimbursementDetailInfoProcured;
+
+public interface CwReimbursementDetailInfoProcuredMapper extends BaseMapper<CwReimbursementDetailInfoProcured> {
+}

+ 2 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalInfo/mapper/CwReimbursementInfoMapper.java

@@ -47,5 +47,7 @@ public interface CwReimbursementInfoMapper extends BaseMapper<CwReimbursementInf
 
     List<CwReimbursementDetailInfoOther> getOtherDetailList(@Param("id") String id);
 
+    List<CwReimbursementDetailInfoProcured> getProcuredDetailList(@Param("id") String id);
+
     List<CwReimbursementDetailInfo> getDetailList(@Param("id") String id);
 }

+ 134 - 18
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalInfo/mapper/xml/CwReimbursementInfoMapper.xml

@@ -16,42 +16,50 @@
 			WHEN a.source_type = 1 THEN b.type_id
 			WHEN a.source_type = 2 THEN b2.type_id
 			WHEN a.source_type = 3 THEN b3.type_id
-									ELSE b4.type_id END) AS type_id,
+			WHEN a.source_type = 4 THEN b4.type_id
+									ELSE b5.type_id END) AS type_id,
 			(CASE
 			WHEN a.source_type = 1 THEN t.name
 			WHEN a.source_type = 2 THEN t2.name
 			WHEN a.source_type = 3 THEN t3.name
-									ELSE t4.name END) AS type_name,
+			WHEN a.source_type = 4 THEN t4.name
+									ELSE t5.name END) AS type_name,
 			(CASE
 			WHEN a.source_type = 1 THEN b.project_id
 			WHEN a.source_type = 2 THEN b2.contract_id
 			WHEN a.source_type = 3 THEN b3.project_id
-									ELSE b4.project_id END) AS project_id,
+			WHEN a.source_type = 4 THEN b4.project_id
+									ELSE b5.project_id END) AS project_id,
 			(CASE
 			WHEN a.source_type = 1 THEN p.project_name
 			WHEN a.source_type = 2 THEN contr2.contract_name
 			WHEN a.source_type = 3 THEN p3.project_name
-									ELSE p4.project_name END) AS project_name,
+			WHEN a.source_type = 4 THEN b4.project_name
+									ELSE b5.project_name END) AS project_name,
 			(CASE
 			WHEN a.source_type = 1 THEN b.report_number
 			WHEN a.source_type = 2 THEN b2.report_number
 			WHEN a.source_type = 3 THEN b3.report_number
-									ELSE b4.report_number END) AS report_number,
+			WHEN a.source_type = 4 THEN b4.report_number
+									ELSE b5.report_number END) AS report_number,
 			(CASE
 			WHEN a.source_type = 1 THEN so.name
 			WHEN a.source_type = 2 THEN so2.name
 			WHEN a.source_type = 3 THEN so3.name
-									ELSE so4.name END) AS dept_name,
+			WHEN a.source_type = 4 THEN so4.name
+									ELSE so5.name END) AS dept_name,
 			(CASE
 			WHEN a.source_type = 1 THEN us.name
 			WHEN a.source_type = 2 THEN us2.name
 			WHEN a.source_type = 3 THEN us3.name
-									ELSE us4.name END) AS name,
+			WHEN a.source_type = 4 THEN us4.name
+									ELSE us5.name END) AS name,
 			(CASE
 			WHEN a.source_type = 1 THEN b.`number`
 			WHEN a.source_type = 2 THEN b2.`number`
 			WHEN a.source_type = 3 THEN b3.`number`
-									ELSE b4.`number` END) AS `number`,
+			WHEN a.source_type = 4 THEN b4.`number`
+									ELSE b5.`number` END) AS `number`,
 			a.user_name,
 			a.reim_date,
 			a.type,
@@ -59,7 +67,9 @@
 			a.process_definition_id,
 			d.ID_ AS task_id,
 			a.create_by as create_id,
-			a.source_type
+			a.source_type,
+			a.purchase_id,
+			pru.purchase_no
 		FROM
 			cw_reimbursement_info a
 			LEFT JOIN cw_reimbursement_detail_info b ON a.id = b.info_id AND b.del_flag = 0
@@ -86,8 +96,15 @@
 			left join sys_office so4 on so4.id = b4.dept_id and so4.del_flag = 0
 			left join sys_user us4 on us4.id = b4.user_id and us4.del_flag = 0
 
+			LEFT JOIN cw_reimbursement_detail_info_procured b5 ON a.id = b5.info_id AND b5.del_flag = 0
+			left join cw_reimbursement_type_info t5 on b5.type_id = t5.id and t5.del_flag = 0
+			left join cw_project_records p5 on p5.id = b5.project_id and p5.del_flag = 0
+			left join sys_office so5 on so5.id = b5.dept_id and so5.del_flag = 0
+			left join sys_user us5 on us5.id = b5.user_id and us5.del_flag = 0
+
 			LEFT JOIN sys_user c ON a.create_by =  c.id
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+			left join material_management_pruchase_request_basics pru on pru.id = a.purchase_id and pru.del_flag = '0'
 			${ew.customSqlSegment}
 		ORDER BY a.update_date DESC
     </select>
@@ -130,23 +147,93 @@
 		SELECT
 			a.id,
 			a.`no`,
-			b.type_id,
-			b.type_name,
-			b.project_id,
-			b.project_name,
-			b.report_number,
+			(CASE
+			WHEN a.source_type = 1 THEN b.type_id
+			WHEN a.source_type = 2 THEN b2.type_id
+			WHEN a.source_type = 3 THEN b3.type_id
+			WHEN a.source_type = 4 THEN b4.type_id
+									ELSE b5.type_id END) AS type_id,
+			(CASE
+			WHEN a.source_type = 1 THEN t.name
+			WHEN a.source_type = 2 THEN t2.name
+			WHEN a.source_type = 3 THEN t3.name
+			WHEN a.source_type = 4 THEN t4.name
+									ELSE t5.name END) AS type_name,
+			(CASE
+			WHEN a.source_type = 1 THEN b.project_id
+			WHEN a.source_type = 2 THEN b2.contract_id
+			WHEN a.source_type = 3 THEN b3.project_id
+			WHEN a.source_type = 4 THEN b4.project_id
+									ELSE b5.project_id END) AS project_id,
+			(CASE
+			WHEN a.source_type = 1 THEN p.project_name
+			WHEN a.source_type = 2 THEN contr2.contract_name
+			WHEN a.source_type = 3 THEN p3.project_name
+			WHEN a.source_type = 4 THEN b4.project_name
+									ELSE b5.project_name END) AS project_name,
+			(CASE
+			WHEN a.source_type = 1 THEN b.report_number
+			WHEN a.source_type = 2 THEN b2.report_number
+			WHEN a.source_type = 3 THEN b3.report_number
+			WHEN a.source_type = 4 THEN b4.report_number
+									ELSE b5.report_number END) AS report_number,
+			(CASE
+			WHEN a.source_type = 1 THEN so.name
+			WHEN a.source_type = 2 THEN so2.name
+			WHEN a.source_type = 3 THEN so3.name
+			WHEN a.source_type = 4 THEN so4.name
+									ELSE so5.name END) AS dept_name,
+			(CASE
+			WHEN a.source_type = 1 THEN us.name
+			WHEN a.source_type = 2 THEN us2.name
+			WHEN a.source_type = 3 THEN us3.name
+			WHEN a.source_type = 4 THEN us4.name
+									ELSE us5.name END) AS name,
+			(CASE
+			WHEN a.source_type = 1 THEN b.`number`
+			WHEN a.source_type = 2 THEN b2.`number`
+			WHEN a.source_type = 3 THEN b3.`number`
+			WHEN a.source_type = 4 THEN b4.`number`
+									ELSE b5.`number` END) AS `number`,
 			a.user_name,
-			b.user_name AS `name`,
-			b.dept_name,
 			a.reim_date,
-			b.`number`,
 			a.type,
 			a.proc_ins_id,
 			a.process_definition_id,
-			d.ID_ AS task_id
+			d.ID_ AS task_id,
+			a.source_type
 		FROM
 			cw_reimbursement_info a
 			LEFT JOIN cw_reimbursement_detail_info b ON a.id = b.info_id AND b.del_flag = 0
+			left join cw_reimbursement_type_info t on b.type_id = t.id and t.del_flag = 0
+			left join cw_project_records p on p.id = b.project_id and p.del_flag = 0
+			left join sys_office so on so.id = b.dept_id and so.del_flag = 0
+			left join sys_user us on us.id = b.user_id and us.del_flag = 0
+
+			LEFT JOIN cw_reimbursement_detail_info_contract b2 ON a.id = b2.info_id AND b2.del_flag = 0
+			left join cw_reimbursement_type_info t2 on b2.type_id = t2.id and t2.del_flag = 0
+			left join cw_work_contract_info contr2 on contr2.id = b2.contract_id and contr2.del_flag = 0
+			left join sys_office so2 on so2.id = b2.dept_id and so2.del_flag = 0
+			left join sys_user us2 on us2.id = b2.user_id and us2.del_flag = 0
+
+			LEFT JOIN cw_reimbursement_detail_info_report b3 ON a.id = b3.info_id AND b3.del_flag = 0
+			left join cw_reimbursement_type_info t3 on b3.type_id = t3.id and t3.del_flag = 0
+			left join cw_project_records p3 on p3.id = b3.project_id and p3.del_flag = 0
+			left join sys_office so3 on so3.id = b3.dept_id and so3.del_flag = 0
+			left join sys_user us3 on us3.id = b3.user_id and us3.del_flag = 0
+
+			LEFT JOIN cw_reimbursement_detail_info_other b4 ON a.id = b4.info_id AND b4.del_flag = 0
+			left join cw_reimbursement_type_info t4 on b4.type_id = t4.id and t4.del_flag = 0
+			left join cw_project_records p4 on p4.id = b4.project_id and p4.del_flag = 0
+			left join sys_office so4 on so4.id = b4.dept_id and so4.del_flag = 0
+			left join sys_user us4 on us4.id = b4.user_id and us4.del_flag = 0
+
+			LEFT JOIN cw_reimbursement_detail_info_procured b5 ON a.id = b5.info_id AND b5.del_flag = 0
+			left join cw_reimbursement_type_info t5 on b5.type_id = t5.id and t5.del_flag = 0
+			left join cw_project_records p5 on p5.id = b5.project_id and p5.del_flag = 0
+			left join sys_office so5 on so5.id = b5.dept_id and so5.del_flag = 0
+			left join sys_user us5 on us5.id = b5.user_id and us5.del_flag = 0
+
 			LEFT JOIN sys_user c ON a.create_by =  c.id
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
 			${ew.customSqlSegment}
@@ -427,4 +514,33 @@
 		where a.del_flag = '0' and a.info_id = #{id}
 		order by a.number asc
 	</select>
+
+	<select id="getProcuredDetailList" resultType="com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.CwReimbursementDetailInfoProcured">
+		select
+		a.id,
+		a.create_by,
+		a.create_date,
+		a.del_flag,
+		a.info_id,
+		a.user_id,
+		a.dept_id,
+		a.type_id,
+		a.project_id,
+		a.report_number,
+		a.number,
+		a.receipt_number,
+		a.days,
+		a.content,
+		su.name as user_name,
+		so.name as dept_name,
+		cw_type.name as type_name,
+		a.project_name as project_name
+		from cw_reimbursement_detail_info_procured a
+		left join sys_user su on a.user_id = su.id and su.del_flag = '0'
+		left join sys_office so on a.dept_id = so.id and so.del_flag = '0'
+		left join cw_reimbursement_type_info cw_type on cw_type.id = a.type_id and cw_type.del_flag = '0'
+		left join cw_project_records cw_project on cw_project.id = a.project_id and cw_project.del_flag = '0'
+		where a.del_flag = '0' and a.info_id = #{id}
+		order by a.number asc
+	</select>
 </mapper>

+ 130 - 12
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalInfo/service/CwReimbursementInfoService.java

@@ -1,5 +1,6 @@
 package com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -7,12 +8,14 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 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.DictUtils;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.cw.contractRegistration.service.ContractInfoService;
 import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.*;
 import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.mapper.*;
 import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service.dto.*;
+import com.jeeplus.test.materialManagement.purchase.mapper.MaterialBasicMapper;
 import com.jeeplus.test.mould.service.SerialnumTplService;
 import com.jeeplus.test.oss.domain.WorkAttachment;
 import com.jeeplus.test.oss.mapper.OssServiceMapper;
@@ -47,6 +50,9 @@ public class CwReimbursementInfoService {
     private CwReimbursementDetailInfoOtherMapper cwReimbursementDetailInfoOtherMapper;
 
     @Resource
+    private CwReimbursementDetailInfoProcuredMapper cwReimbursementDetailInfoProcuredMapper;
+
+    @Resource
     private CwReimbursementDetailInfoMapper detailInfoMapper;
 
     @Resource
@@ -61,6 +67,9 @@ public class CwReimbursementInfoService {
     @Resource
     private ContractInfoService infoService;
 
+    @Resource
+    private MaterialBasicMapper materialBasicMapper;
+
     /**
      * 报告号查询
      */
@@ -89,7 +98,11 @@ public class CwReimbursementInfoService {
         queryWrapper.eq("a.del_flag", 0);
         // 报销项目
         if (StringUtils.isNotEmpty(dto.getProject())) {
-            queryWrapper.apply("(b.project_id = {0} OR b.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+            queryWrapper.apply("(b.project_id = {0} OR p.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+            queryWrapper.or().apply("(b3.project_id = {0} OR p3.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+            queryWrapper.or().apply("(b4.project_id = {0} OR b4.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+            queryWrapper.or().apply("(b5.project_id = {0} OR b5.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+
         }
         // 报销时间
         if (dto.getDates() != null) {
@@ -101,7 +114,12 @@ public class CwReimbursementInfoService {
         }
         // 报销人
         if (StringUtils.isNotEmpty(dto.getReimBy())) {
-            queryWrapper.apply("( b.user_id = {0} OR b.user_name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.apply("( b.user_id = {0} OR us.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b2.user_id = {0} OR us2.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b3.user_id = {0} OR us3.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b4.user_id = {0} OR us4.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b5.user_id = {0} OR us5.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+
         }
         // 报销状态
         if (StringUtils.isNotEmpty(dto.getType())) {
@@ -109,25 +127,52 @@ public class CwReimbursementInfoService {
         }
         // 报销部门
         if (StringUtils.isNotEmpty(dto.getDepartment())) {
-            queryWrapper.apply("( b.dept_id = {0} OR b.dept_name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.apply("( b.dept_id = {0} OR so.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b2.dept_id = {0} OR so2.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b3.dept_id = {0} OR so3.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b4.dept_id = {0} OR so4.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b5.dept_id = {0} OR so5.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+
         }
         // 报销类别
         if (StringUtils.isNotEmpty(dto.getRemiType())) {
-            queryWrapper.apply(" (b.type_id = {0} OR b.type_name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.apply(" (b.type_id = {0} OR t.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b2.type_id = {0} OR t2.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b3.type_id = {0} OR t3.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b4.type_id = {0} OR t4.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b5.type_id = {0} OR t5.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+
         }
         // 报销金额
         if (dto.getAmounts() != null) {
             if (StringUtils.isNotEmpty(dto.getAmounts()[0])) {
-                queryWrapper.ge("b.number", Double.parseDouble(dto.getAmounts()[0]));
+                queryWrapper.and(w ->
+                    w.ge("b.number", Double.parseDouble(dto.getAmounts()[0]))
+                        .or().ge("b2.number", Double.parseDouble(dto.getAmounts()[0]))
+                        .or().ge("b3.number", Double.parseDouble(dto.getAmounts()[0]))
+                        .or().ge("b4.number", Double.parseDouble(dto.getAmounts()[0]))
+                        .or().ge("b5.number", Double.parseDouble(dto.getAmounts()[0]))
+                );
             }
             if (StringUtils.isNotEmpty(dto.getAmounts()[1])) {
-                queryWrapper.le("b.number", Double.parseDouble(dto.getAmounts()[1]));
+                queryWrapper.and(w ->
+                    w.le("b.number", Double.parseDouble(dto.getAmounts()[1]))
+                        .or().le("b2.number", Double.parseDouble(dto.getAmounts()[1]))
+                        .or().le("b3.number", Double.parseDouble(dto.getAmounts()[1]))
+                        .or().le("b4.number", Double.parseDouble(dto.getAmounts()[1]))
+                        .or().le("b5.number", Double.parseDouble(dto.getAmounts()[1]))
+                );
             }
         }
         // 报告号
         if (StringUtils.isNotEmpty(dto.getReportNumber())) {
             queryWrapper.like("b.report_number", dto.getReportNumber());
+            queryWrapper.or().like("b2.report_number", dto.getReportNumber());
+            queryWrapper.or().like("b3.report_number", dto.getReportNumber());
+            queryWrapper.or().like("b4.report_number", dto.getReportNumber());
+            queryWrapper.or().like("b5.report_number", dto.getReportNumber());
         }
+        // 报销类型
         if (StringUtils.isNotBlank(dto.getSourceType())) {
             queryWrapper.eq("a.source_type", dto.getSourceType());
         }
@@ -212,6 +257,14 @@ public class CwReimbursementInfoService {
                 cwReimbursementDetailInfoOtherMapper.insert(detailInfo);
             }
         }
+        // 保存采购报销详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getDetailInfoProcured())) {
+            for (CwReimbursementDetailInfoProcured detailInfo : dto.getDetailInfoProcured()) {
+                // 保存基础表信息主键值
+                detailInfo.setInfoId(id);
+                cwReimbursementDetailInfoProcuredMapper.insert(detailInfo);
+            }
+        }
         // 保存专用发票列表信息
         if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
             for (CwReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
@@ -259,6 +312,10 @@ public class CwReimbursementInfoService {
         LambdaQueryWrapper<CwReimbursementDetailInfoOther> detailWrapperOthers = new LambdaQueryWrapper<>();
         detailWrapperOthers.eq(CwReimbursementDetailInfoOther::getInfoId, dto.getId());
         cwReimbursementDetailInfoOtherMapper.delete(detailWrapperOthers);
+        // 删除采购报销表
+        LambdaQueryWrapper<CwReimbursementDetailInfoProcured> detailWrapperProcured = new LambdaQueryWrapper<>();
+        detailWrapperProcured.eq(CwReimbursementDetailInfoProcured::getInfoId, dto.getId());
+        cwReimbursementDetailInfoProcuredMapper.delete(detailWrapperProcured);
 
         // 保存项目详情列表信息
         if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
@@ -296,6 +353,15 @@ public class CwReimbursementInfoService {
                 cwReimbursementDetailInfoOtherMapper.insert(detailInfo);
             }
         }
+        // 保存采购报销详情列表信息
+        if (CollectionUtils.isNotEmpty(dto.getDetailInfoProcured())) {
+            for (CwReimbursementDetailInfoProcured detailInfo : dto.getDetailInfoProcured()) {
+                // 保存基础表信息主键值
+                detailInfo.setInfoId(dto.getId());
+                detailInfo.setId("");
+                cwReimbursementDetailInfoProcuredMapper.insert(detailInfo);
+            }
+        }
         // 修改专用发票信息列表
         // 删除原有数据
         LambdaQueryWrapper<CwReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
@@ -342,6 +408,10 @@ public class CwReimbursementInfoService {
         LambdaQueryWrapper<CwReimbursementDetailInfoOther> detailWrapperOther = new LambdaQueryWrapper<>();
         detailWrapperOther.eq(CwReimbursementDetailInfoOther::getInfoId, id);
         cwReimbursementDetailInfoOtherMapper.delete(detailWrapperOther);
+        // 删除采购报销列表
+        LambdaQueryWrapper<CwReimbursementDetailInfoProcured> detailWrapperProcured = new LambdaQueryWrapper<>();
+        detailWrapperProcured.eq(CwReimbursementDetailInfoProcured::getInfoId, id);
+        cwReimbursementDetailInfoProcuredMapper.delete(detailWrapperProcured);
         // 删除专用发票信息列表
         LambdaQueryWrapper<CwReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
         amountInfoLambdaQueryWrapper.eq(CwReimbursementAmountInfo::getInfoId, id);
@@ -371,6 +441,8 @@ public class CwReimbursementInfoService {
         dto.setDetailInfoReports(infoMapper.getReportDetailList(id));
         // 其他报销
         dto.setDetailInfoOthers(infoMapper.getOtherDetailList(id));
+        // 采购报销
+        dto.setDetailInfoProcured(infoMapper.getProcuredDetailList(id));
         // 查询专用发票信息列表
         LambdaQueryWrapper<CwReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
         amountInfoLambdaQueryWrapper.eq(CwReimbursementAmountInfo::getInfoId, id);
@@ -430,7 +502,11 @@ public class CwReimbursementInfoService {
         queryWrapper.eq("a.del_flag", 0);
         // 报销项目
         if (StringUtils.isNotEmpty(dto.getProject())) {
-            queryWrapper.apply("(b.project_id = {0} OR b.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+            queryWrapper.apply("(b.project_id = {0} OR p.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+            queryWrapper.or().apply("(b3.project_id = {0} OR p3.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+            queryWrapper.or().apply("(b4.project_id = {0} OR b4.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+            queryWrapper.or().apply("(b5.project_id = {0} OR b5.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+
         }
         // 报销时间
         if (dto.getDates() != null) {
@@ -442,7 +518,12 @@ public class CwReimbursementInfoService {
         }
         // 报销人
         if (StringUtils.isNotEmpty(dto.getReimBy())) {
-            queryWrapper.apply("( b.user_id = {0} OR b.user_name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.apply("( b.user_id = {0} OR us.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b2.user_id = {0} OR us2.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b3.user_id = {0} OR us3.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b4.user_id = {0} OR us4.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+            queryWrapper.or().apply("( b5.user_id = {0} OR us5.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+
         }
         // 报销状态
         if (StringUtils.isNotEmpty(dto.getType())) {
@@ -450,24 +531,54 @@ public class CwReimbursementInfoService {
         }
         // 报销部门
         if (StringUtils.isNotEmpty(dto.getDepartment())) {
-            queryWrapper.apply("( b.dept_id = {0} OR b.dept_name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.apply("( b.dept_id = {0} OR so.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b2.dept_id = {0} OR so2.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b3.dept_id = {0} OR so3.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b4.dept_id = {0} OR so4.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+            queryWrapper.or().apply("( b5.dept_id = {0} OR so5.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+
         }
         // 报销类别
         if (StringUtils.isNotEmpty(dto.getRemiType())) {
-            queryWrapper.apply(" (b.type_id = {0} OR b.type_name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.apply(" (b.type_id = {0} OR t.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b2.type_id = {0} OR t2.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b3.type_id = {0} OR t3.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b4.type_id = {0} OR t4.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+            queryWrapper.or().apply(" (b5.type_id = {0} OR t5.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+
         }
         // 报销金额
         if (dto.getAmounts() != null) {
             if (StringUtils.isNotEmpty(dto.getAmounts()[0])) {
-                queryWrapper.ge("b.number", dto.getAmounts()[0]);
+                queryWrapper.and(w ->
+                        w.ge("b.number", Double.parseDouble(dto.getAmounts()[0]))
+                                .or().ge("b2.number", Double.parseDouble(dto.getAmounts()[0]))
+                                .or().ge("b3.number", Double.parseDouble(dto.getAmounts()[0]))
+                                .or().ge("b4.number", Double.parseDouble(dto.getAmounts()[0]))
+                                .or().ge("b5.number", Double.parseDouble(dto.getAmounts()[0]))
+                );
             }
             if (StringUtils.isNotEmpty(dto.getAmounts()[1])) {
-                queryWrapper.le("b.number", dto.getAmounts()[1]);
+                queryWrapper.and(w ->
+                        w.le("b.number", Double.parseDouble(dto.getAmounts()[1]))
+                                .or().le("b2.number", Double.parseDouble(dto.getAmounts()[1]))
+                                .or().le("b3.number", Double.parseDouble(dto.getAmounts()[1]))
+                                .or().le("b4.number", Double.parseDouble(dto.getAmounts()[1]))
+                                .or().le("b5.number", Double.parseDouble(dto.getAmounts()[1]))
+                );
             }
         }
         // 报告号
         if (StringUtils.isNotEmpty(dto.getReportNumber())) {
             queryWrapper.like("b.report_number", dto.getReportNumber());
+            queryWrapper.or().like("b2.report_number", dto.getReportNumber());
+            queryWrapper.or().like("b3.report_number", dto.getReportNumber());
+            queryWrapper.or().like("b4.report_number", dto.getReportNumber());
+            queryWrapper.or().like("b5.report_number", dto.getReportNumber());
+        }
+        // 报销类型
+        if (StringUtils.isNotBlank(dto.getSourceType())) {
+            queryWrapper.eq("a.source_type", dto.getSourceType());
         }
         List<RetureListDto> exportList = infoMapper.findExportList(queryWrapper);
         if (CollectionUtils.isNotEmpty(exportList)) {
@@ -487,6 +598,13 @@ public class CwReimbursementInfoService {
                 if ("5".equals(retureListDto.getType())) {
                     retureListDto.setType("已完成");
                 }
+                if (StringUtils.isNotBlank(retureListDto.getSourceType())) {
+                    if ("2".equals(retureListDto.getSourceType())) {
+                        retureListDto.setContractName(retureListDto.getProjectName());
+                        retureListDto.setProjectName("");
+                    }
+                    retureListDto.setSourceType(DictUtils.getDictLabel(retureListDto.getSourceType(),"cw_reimbursement_source_type",""));
+                }
             }
         }
         return exportList;

+ 20 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalInfo/service/dto/RetureListDto.java

@@ -29,7 +29,7 @@ public class RetureListDto {
     /**
      * 报销类别
      */
-    @Excel(name = "报销类别", width = 30, orderNum = "2")
+    @Excel(name = "报销类别", width = 30, orderNum = "3")
     private String typeName;
 
     /**
@@ -40,50 +40,56 @@ public class RetureListDto {
     /**
      * 报销项目
      */
-    @Excel(name = "报销项目", width = 30, orderNum = "3")
+    @Excel(name = "报销项目", width = 30, orderNum = "4")
     private String projectName;
 
     /**
+     * 报销合同
+     */
+    @Excel(name = "报销合同", width = 30, orderNum = "5")
+    private String contractName;
+
+    /**
      * 报告号
      */
-    @Excel(name = "报告号", width = 30, orderNum = "4")
+    @Excel(name = "报告号", width = 30, orderNum = "6")
     private String reportNumber;
 
     /**
      * 经办人
      */
-    @Excel(name = "经办人", width = 30, orderNum = "5")
+    @Excel(name = "经办人", width = 30, orderNum = "7")
     private String userName;
 
     /**
      * 报销人
      */
-    @Excel(name = "报销人", width = 30, orderNum = "6")
+    @Excel(name = "报销人", width = 30, orderNum = "8")
     private String name;
 
     /**
      * 报销部门
      */
-    @Excel(name = "报销部门", width = 30, orderNum = "7")
+    @Excel(name = "报销部门", width = 30, orderNum = "9")
     private String deptName;
 
     /**
      * 报销日期
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "报销日期", width = 30, orderNum = "8")
+    @Excel(name = "报销日期", width = 30, orderNum = "10")
     private Date reimDate;
 
     /**
      * 报销金额
      */
-    @Excel(name = "报销金额", width = 30, orderNum = "9")
+    @Excel(name = "报销金额", width = 30, orderNum = "11")
     private BigDecimal number;
 
     /**
      * 报销状态
      */
-    @Excel(name = "报销状态", width = 30, orderNum = "10")
+    @Excel(name = "报销状态", width = 30, orderNum = "12")
     private String type;
 
     /**
@@ -103,5 +109,10 @@ public class RetureListDto {
      */
     private String createId;
 
+    @Excel(name = "报销类型", width = 30, orderNum = "2")
     private String sourceType;
+
+    private String purchaseNo;
+
+    private String purchaseId;
 }

+ 8 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalInfo/service/dto/SaveInfoDto.java

@@ -69,6 +69,7 @@ public class SaveInfoDto extends BaseEntity {
     private List<CwReimbursementDetailInfoContract> detailInfoContracts;
     private List<CwReimbursementDetailInfoReport> detailInfoReports;
     private List<CwReimbursementDetailInfoOther> detailInfoOthers;
+    private List<CwReimbursementDetailInfoProcured> detailInfoProcured;
 
     private List<CwReimbursementAmountInfo> amountInfos;
 
@@ -79,4 +80,11 @@ public class SaveInfoDto extends BaseEntity {
      */
     private String sourceType;
 
+    /**
+     * 采购编号
+     */
+    private String purchaseNo;
+
+    private String purchaseId;
+
 }