소스 검색

发票报销业务添加报销批次
分所和总所业务更改和项目等相同

user5 2 년 전
부모
커밋
2644e9bfda
21개의 변경된 파일648개의 추가작업 그리고 62개의 파일을 삭제
  1. 3 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementDTO.java
  2. 33 10
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementSysMapper.xml
  3. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/impl/AccountantReimbursementSysServiceImpl.java
  4. 3 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/domain/dto/AssessReimbursementDTO.java
  5. 33 10
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/mapper/xml/AssessReimbursementSysMapper.xml
  6. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/service/impl/AssessReimbursementSysServiceImpl.java
  7. 3 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/domain/dto/ProjectReimbursementDTO.java
  8. 33 10
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/mapper/xml/ProjectReimbursementSysMapper.xml
  9. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/service/impl/ProjectReimbursementSysServiceImpl.java
  10. 44 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementSysController.java
  11. 43 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/WuHanReimbursementSysController.java
  12. 4 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementDTO.java
  13. 4 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/WuHanReimbursementDTO.java
  14. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementSysMapper.java
  15. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/WuHanReimbursementSysMapper.java
  16. 94 8
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementSysMapper.xml
  17. 90 8
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/WuHanReimbursementSysMapper.xml
  18. 17 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementSysService.java
  19. 16 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/WuHanReimbursementSysService.java
  20. 82 9
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementSysServiceImpl.java
  21. 75 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/WuHanReimbursementSysServiceImpl.java

+ 3 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementDTO.java

@@ -22,8 +22,10 @@ import java.util.List;
 @TableName("zs_reimbursement_info")
 public class AccountantReimbursementDTO extends TreeEntity<AccountantReimbursementDTO> {
     private static final long serialVersionUID = 1L;
+    @Excel(name = "报销批次")
+    private String businessCode;    //报销批次
     @Excel(name = "业务编号")
-    private String businessCode;    //业务编号
+    private String reimbursementBatch;    //业务编号
     private String businessCodeId;    //业务编号id
     @Excel(name = "发票代码")
     private String invoiceCode;     //发票代码

+ 33 - 10
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementSysMapper.xml

@@ -12,6 +12,7 @@
 		a.parent_id AS "parent.id",
 		a.parent_id AS "parentId",
 		a.parent_ids AS "parentIds",
+        a.reimbursement_batch AS "reimbursementBatch",
         a.invoice_code AS "invoiceCode",
         a.invoice_number AS "invoiceNumber",
         a.firm_name AS "firmName",
@@ -69,7 +70,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.business_code
+        order by a.business_code asc ,a.sort asc
     </select>
 
     <select id="getInvoiceList" resultType="com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO">
@@ -81,14 +82,32 @@
             <if test="invoiceNumber != null and invoiceNumber != ''">
                 and a.invoice_number like concat('%',#{invoiceNumber},'%')
             </if>
+            <if test="reimbursementBatch != null and reimbursementBatch != ''">
+                and a.reimbursement_batch like concat('%',#{reimbursementBatch},'%')
+            </if>
             <if test="proposer != null and proposer != ''">
                 and a.proposer like concat('%',#{proposer},'%')
             </if>
             <if test="partner != null and partner != ''">
                 and a.partner like concat('%',#{partner},'%')
             </if>
+            <if test="firmName != null and firmName != ''">
+                and a.firm_name like concat('%',#{firmName},'%')
+            </if>
+            <if test="beginIncome != null and beginIncome != ''">
+                and a.income >= #{beginIncome}
+            </if>
+            <if test="endIncome != null and endIncome != ''">
+                and a.income &lt;= #{endIncome}
+            </if>
+            <if test="beginDate != null">
+                and a.make_time >= #{beginDate}
+            </if>
+            <if test="endDate != null">
+                and a.make_time &lt;= #{endDate}
+            </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getInvoiceByIdList" resultType="com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO">
@@ -104,7 +123,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getReceiptInvoiceIncomeByReimbursementId" resultType="java.lang.String">
@@ -116,7 +135,7 @@
             and a.parent_id =#{parentId}
             and a.gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getReimbursementRatioByReimbursementId" resultType="java.lang.String">
@@ -127,7 +146,7 @@
             a.del_flag = 0
             and a.id =#{id}
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getInvoiceByParentIdList" resultType="com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO">
@@ -143,7 +162,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="selectOldInvoiceNumber" resultType="java.lang.String">
@@ -234,6 +253,7 @@
             del_flag,
             parent_id,
             parent_ids,
+            reimbursement_batch,
             invoice_code,
             invoice_number,
             firm_name,
@@ -259,6 +279,7 @@
             #{item.delFlag},
             #{item.parentId},
             #{item.parentIds},
+            #{item.reimbursementBatch},
             #{item.invoiceCode},
             #{item.invoiceNumber},
             #{item.firmName},
@@ -318,6 +339,7 @@
             <if test="randomType != null and randomType != ''">
                 ,random_type = #{randomType}
             </if>
+            ,sort = 2
         where
             id = #{id} and del_flag = 0
     </update>
@@ -351,7 +373,8 @@
         update zs_reimbursement_accountant_info
         set
             update_by = #{updateBy},
-            update_date = #{updateDate}
+            update_date = #{updateDate},
+            sort = 0
         <if test="batchFlag != null and batchFlag != ''">
             ,batch_flag = #{batchFlag}
         </if>
@@ -486,7 +509,7 @@
             </if>
             and gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getNotGatheringTimeInvoice" resultType="com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO">
@@ -499,7 +522,7 @@
             select business_code from zs_reimbursement_invoice_accountant_info where id = #{businessCode}
             ) and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <update id="updateGatheringTime">
@@ -531,7 +554,7 @@
             and parent_id = #{businessCodeId}
             and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getLastRandomBusinessCodeIndex" resultType="java.lang.String">

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/impl/AccountantReimbursementSysServiceImpl.java

@@ -170,6 +170,7 @@ public class AccountantReimbursementSysServiceImpl implements AccountantReimburs
                 null != reimbursement.getBeginDate() ||
                 null != reimbursement.getEndDate() ||
                 StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getReimbursementBatch()) ||
                 StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
                 StringUtils.isNotBlank(reimbursement.getFirmName())){
             List<AccountantReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);

+ 3 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/domain/dto/AssessReimbursementDTO.java

@@ -20,8 +20,10 @@ import java.util.List;
 @TableName("zs_reimbursement_info")
 public class AssessReimbursementDTO extends TreeEntity<AssessReimbursementDTO> {
     private static final long serialVersionUID = 1L;
+    @Excel(name = "报销批次")
+    private String businessCode;    //报销批次
     @Excel(name = "业务编号")
-    private String businessCode;    //业务编号
+    private String reimbursementBatch;    //业务编号
     private String businessCodeId;    //业务编号id
     @Excel(name = "发票代码")
     private String invoiceCode;     //发票代码

+ 33 - 10
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/mapper/xml/AssessReimbursementSysMapper.xml

@@ -12,6 +12,7 @@
 		a.parent_id AS "parent.id",
 		a.parent_id AS "parentId",
 		a.parent_ids AS "parentIds",
+        a.reimbursement_batch AS "reimbursementBatch",
         a.invoice_code AS "invoiceCode",
         a.invoice_number AS "invoiceNumber",
         a.firm_name AS "firmName",
@@ -69,7 +70,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.business_code
+        order by a.business_code asc ,a.sort asc
     </select>
 
     <select id="getInvoiceList" resultType="com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementDTO">
@@ -81,14 +82,32 @@
             <if test="invoiceNumber != null and invoiceNumber != ''">
                 and a.invoice_number like concat('%',#{invoiceNumber},'%')
             </if>
+            <if test="reimbursementBatch != null and reimbursementBatch != ''">
+                and a.reimbursement_batch like concat('%',#{reimbursementBatch},'%')
+            </if>
             <if test="proposer != null and proposer != ''">
                 and a.proposer like concat('%',#{proposer},'%')
             </if>
             <if test="partner != null and partner != ''">
                 and a.partner like concat('%',#{partner},'%')
             </if>
+            <if test="firmName != null and firmName != ''">
+                and a.firm_name like concat('%',#{firmName},'%')
+            </if>
+            <if test="beginIncome != null and beginIncome != ''">
+                and a.income >= #{beginIncome}
+            </if>
+            <if test="endIncome != null and endIncome != ''">
+                and a.income &lt;= #{endIncome}
+            </if>
+            <if test="beginDate != null">
+                and a.make_time >= #{beginDate}
+            </if>
+            <if test="endDate != null">
+                and a.make_time &lt;= #{endDate}
+            </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getInvoiceByIdList" resultType="com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementDTO">
@@ -104,7 +123,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getReceiptInvoiceIncomeByReimbursementId" resultType="java.lang.String">
@@ -116,7 +135,7 @@
             and a.parent_id =#{parentId}
             and a.gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getReimbursementRatioByReimbursementId" resultType="java.lang.String">
@@ -127,7 +146,7 @@
             a.del_flag = 0
             and a.id =#{id}
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getInvoiceByParentIdList" resultType="com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementDTO">
@@ -143,7 +162,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="selectOldInvoiceNumber" resultType="java.lang.String">
@@ -234,6 +253,7 @@
             del_flag,
             parent_id,
             parent_ids,
+            reimbursement_batch,
             invoice_code,
             invoice_number,
             firm_name,
@@ -259,6 +279,7 @@
             #{item.delFlag},
             #{item.parentId},
             #{item.parentIds},
+            #{item.reimbursementBatch},
             #{item.invoiceCode},
             #{item.invoiceNumber},
             #{item.firmName},
@@ -318,6 +339,7 @@
             <if test="randomType != null and randomType != ''">
                 ,random_type = #{randomType}
             </if>
+            ,sort = 2
         where
             id = #{id} and del_flag = 0
     </update>
@@ -351,7 +373,8 @@
         update zs_reimbursement_assess_info
         set
             update_by = #{updateBy},
-            update_date = #{updateDate}
+            update_date = #{updateDate},
+            sort = 0
         <if test="batchFlag != null and batchFlag != ''">
             ,batch_flag = #{batchFlag}
         </if>
@@ -486,7 +509,7 @@
             </if>
             and gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getNotGatheringTimeInvoice" resultType="com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementDTO">
@@ -499,7 +522,7 @@
             select business_code from zs_reimbursement_invoice_assess_info where id = #{businessCode}
             ) and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <update id="updateGatheringTime">
@@ -531,7 +554,7 @@
             and parent_id = #{businessCodeId}
             and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getLastRandomBusinessCodeIndex" resultType="java.lang.String">

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/service/impl/AssessReimbursementSysServiceImpl.java

@@ -171,6 +171,7 @@ public class AssessReimbursementSysServiceImpl implements AssessReimbursementSys
                 null != reimbursement.getBeginDate() ||
                 null != reimbursement.getEndDate() ||
                 StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getReimbursementBatch()) ||
                 StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
                 StringUtils.isNotBlank(reimbursement.getFirmName())){
             List<AssessReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);

+ 3 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/domain/dto/ProjectReimbursementDTO.java

@@ -20,8 +20,10 @@ import java.util.List;
 @TableName("zs_reimbursement_info")
 public class ProjectReimbursementDTO extends TreeEntity<ProjectReimbursementDTO> {
     private static final long serialVersionUID = 1L;
+    @Excel(name = "报销批次")
+    private String businessCode;    //报销批次
     @Excel(name = "业务编号")
-    private String businessCode;    //业务编号
+    private String reimbursementBatch;    //业务编号
     private String businessCodeId;    //业务编号id
     @Excel(name = "发票代码")
     private String invoiceCode;     //发票代码

+ 33 - 10
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/mapper/xml/ProjectReimbursementSysMapper.xml

@@ -12,6 +12,7 @@
 		a.parent_id AS "parent.id",
 		a.parent_id AS "parentId",
 		a.parent_ids AS "parentIds",
+        a.reimbursement_batch AS "reimbursementBatch",
         a.invoice_code AS "invoiceCode",
         a.invoice_number AS "invoiceNumber",
         a.firm_name AS "firmName",
@@ -69,7 +70,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.business_code
+        order by a.business_code asc ,a.sort asc
     </select>
 
     <select id="getInvoiceList" resultType="com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO">
@@ -81,14 +82,32 @@
             <if test="invoiceNumber != null and invoiceNumber != ''">
                 and a.invoice_number like concat('%',#{invoiceNumber},'%')
             </if>
+            <if test="reimbursementBatch != null and reimbursementBatch != ''">
+                and a.reimbursement_batch like concat('%',#{reimbursementBatch},'%')
+            </if>
             <if test="proposer != null and proposer != ''">
                 and a.proposer like concat('%',#{proposer},'%')
             </if>
             <if test="partner != null and partner != ''">
                 and a.partner like concat('%',#{partner},'%')
             </if>
+            <if test="firmName != null and firmName != ''">
+                and a.firm_name like concat('%',#{firmName},'%')
+            </if>
+            <if test="beginIncome != null and beginIncome != ''">
+                and a.income >= #{beginIncome}
+            </if>
+            <if test="endIncome != null and endIncome != ''">
+                and a.income &lt;= #{endIncome}
+            </if>
+            <if test="beginDate != null">
+                and a.make_time >= #{beginDate}
+            </if>
+            <if test="endDate != null">
+                and a.make_time &lt;= #{endDate}
+            </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getInvoiceByIdList" resultType="com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO">
@@ -104,7 +123,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getReceiptInvoiceIncomeByReimbursementId" resultType="java.lang.String">
@@ -116,7 +135,7 @@
             and a.parent_id =#{parentId}
             and a.gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getReimbursementRatioByReimbursementId" resultType="java.lang.String">
@@ -127,7 +146,7 @@
             a.del_flag = 0
             and a.id =#{id}
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getInvoiceByParentIdList" resultType="com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO">
@@ -143,7 +162,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="selectOldInvoiceNumber" resultType="java.lang.String">
@@ -234,6 +253,7 @@
             del_flag,
             parent_id,
             parent_ids,
+            reimbursement_batch,
             invoice_code,
             invoice_number,
             firm_name,
@@ -259,6 +279,7 @@
             #{item.delFlag},
             #{item.parentId},
             #{item.parentIds},
+            #{item.reimbursementBatch},
             #{item.invoiceCode},
             #{item.invoiceNumber},
             #{item.firmName},
@@ -318,6 +339,7 @@
             <if test="randomType != null and randomType != ''">
                 ,random_type = #{randomType}
             </if>
+            ,sort = 2
         where
             id = #{id} and del_flag = 0
     </update>
@@ -351,7 +373,8 @@
         update zs_reimbursement_project_info
         set
             update_by = #{updateBy},
-            update_date = #{updateDate}
+            update_date = #{updateDate},
+            sort = 0
         <if test="batchFlag != null and batchFlag != ''">
             ,batch_flag = #{batchFlag}
         </if>
@@ -486,7 +509,7 @@
             </if>
             and gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getNotGatheringTimeInvoice" resultType="com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO">
@@ -499,7 +522,7 @@
             select business_code from zs_reimbursement_invoice_project_info where id = #{businessCode}
             ) and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <update id="updateGatheringTime">
@@ -531,7 +554,7 @@
             and parent_id = #{businessCodeId}
             and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getLastRandomBusinessCodeIndex" resultType="java.lang.String">

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/service/impl/ProjectReimbursementSysServiceImpl.java

@@ -171,6 +171,7 @@ public class ProjectReimbursementSysServiceImpl implements ProjectReimbursementS
                 null != reimbursement.getBeginDate() ||
                 null != reimbursement.getEndDate() ||
                 StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getReimbursementBatch()) ||
                 StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
                 StringUtils.isNotBlank(reimbursement.getFirmName())){
             List<ProjectReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);

+ 44 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementSysController.java

@@ -12,6 +12,7 @@ import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementImportDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserImportDTO;
@@ -31,6 +32,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -51,6 +53,17 @@ public class ReimbursementSysController {
     private ReimbursementSysService service;
 
     /**
+     * 查询报销信息
+     * @return
+     */
+    @ApiLog("查询未进行报销流程的发票信息集合")
+    @GetMapping("list")
+    public ResponseEntity list(ReimbursementDTO reimbursementDTO,  Page<ReimbursementDTO> page) {
+        IPage<ReimbursementDTO> list = service.findList(page,reimbursementDTO);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
      * 根据id查询部门
      * @param id
      * @return
@@ -75,6 +88,19 @@ public class ReimbursementSysController {
         return ResponseEntity.ok (reimbursementDTO);
     }
 
+    /**
+     * 根据发票id查询业务信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据发票id查询业务具体信息")
+    @PreAuthorize("hasAnyAuthority('reimbursement:view','reimbursement:add','reimbursement:edit')")
+    @GetMapping("queryBusinessByInvoiceId")
+    public ResponseEntity queryBusinessByInvoiceId(@RequestParam String id) {
+        ReimbursementDTO reimbursementDTO = service.queryBusinessByInvoiceId (id);
+        return ResponseEntity.ok (reimbursementDTO);
+    }
+
 
     /**
      * 查询报销信息
@@ -284,4 +310,22 @@ public class ReimbursementSysController {
             e.printStackTrace();
         }
     }
+
+    /**
+     * 批次报销
+     * @param invoiceNumbers
+     * @return
+     */
+    @DemoMode
+    @ApiLog("批次报销")
+    @PreAuthorize("hasAuthority('reimbursement:addBatchReimbursement')")
+    @PutMapping("addBatchReimbursement")
+    public ResponseEntity addBatchReimbursement(String[] invoiceNumbers) {
+        ArrayList<String> invoiceIdList = Lists.newArrayList(invoiceNumbers);
+        if(invoiceIdList.size()<=0){
+            return ResponseEntity.badRequest().body ("请选择需要批量报销的发票信息");
+        }
+        service.addBatchReimbursement (invoiceIdList);
+        return ResponseEntity.ok ("批量报销操作成功");
+    }
 }

+ 43 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/WuHanReimbursementSysController.java

@@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -44,6 +45,17 @@ public class WuHanReimbursementSysController {
     private WuHanReimbursementSysService service;
 
     /**
+     * 查询报销信息
+     * @return
+     */
+    @ApiLog("查询未进行报销流程的发票信息集合")
+    @GetMapping("list")
+    public ResponseEntity list(WuHanReimbursementDTO reimbursementDTO,  Page<WuHanReimbursementDTO> page) {
+        IPage<WuHanReimbursementDTO> list = service.findList(page,reimbursementDTO);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
      * 根据id查询部门
      * @param id
      * @return
@@ -68,6 +80,19 @@ public class WuHanReimbursementSysController {
         return ResponseEntity.ok (reimbursementDTO);
     }
 
+    /**
+     * 根据发票id查询业务信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据发票id查询业务具体信息")
+    @PreAuthorize("hasAnyAuthority('wuHanReimbursement:view','wuHanReimbursement:add','wuHanReimbursement:edit')")
+    @GetMapping("queryBusinessByInvoiceId")
+    public ResponseEntity queryBusinessByInvoiceId(@RequestParam String id) {
+        WuHanReimbursementDTO reimbursementDTO = service.queryBusinessByInvoiceId (id);
+        return ResponseEntity.ok (reimbursementDTO);
+    }
+
 
     /**
      * 查询报销信息
@@ -248,4 +273,22 @@ public class WuHanReimbursementSysController {
         }
         EasyPoiUtil.exportExcel ( result, "总所报销数据",  options.getSheetName ( ), WuHanReimbursementDTO.class, fileName, response );
     }
+
+    /**
+     * 批次报销
+     * @param invoiceNumbers
+     * @return
+     */
+    @DemoMode
+    @ApiLog("批次报销")
+    @PreAuthorize("hasAuthority('project:reimbursement:addBatchReimbursement')")
+    @PutMapping("addBatchReimbursement")
+    public ResponseEntity addBatchReimbursement(String[] invoiceNumbers) {
+        ArrayList<String> invoiceIdList = Lists.newArrayList(invoiceNumbers);
+        if(invoiceIdList.size()<=0){
+            return ResponseEntity.badRequest().body ("请选择需要批量报销的发票信息");
+        }
+        service.addBatchReimbursement (invoiceIdList);
+        return ResponseEntity.ok ("批量报销操作成功");
+    }
 }

+ 4 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementDTO.java

@@ -23,8 +23,10 @@ import java.util.List;
 @TableName("zs_reimbursement_info")
 public class ReimbursementDTO extends TreeEntity<ReimbursementDTO> {
     private static final long serialVersionUID = 1L;
+    @Excel(name = "报销批次")
+    private String businessCode;    //报销批次
     @Excel(name = "业务编号")
-    private String businessCode;    //业务编号
+    private String reimbursementBatch;    //业务编号
     //@Excel(name = "所属年份")
     private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String businessCodeId;    //业务编号id
@@ -64,6 +66,7 @@ public class ReimbursementDTO extends TreeEntity<ReimbursementDTO> {
     private String reimbursementType;    //报销比例
     private String gatheringStatus;    //收款状态
     private String reimbursementStatus;    //报销状态
+    private String businessFlag;    //报销判定条件(1:表示该数据没有业务编码,即没有进行报销;0:表示该数据有业务编码)
     private String randomType;    //随机状态(1:随机业务编码,2:指定业务编码)(默认为指定业务编码仅业务表中使用)
     private String batchFlag;    //批量报销状态(1:批量报销)(仅业务表中使用)
     private String randomBusinessCodeIndex;    //随即业务编码序号

+ 4 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/WuHanReimbursementDTO.java

@@ -19,8 +19,10 @@ import java.util.List;
 @TableName("zs_wuhan_reimbursement_info")
 public class WuHanReimbursementDTO extends TreeEntity<WuHanReimbursementDTO> {
     private static final long serialVersionUID = 1L;
+    @Excel(name = "报销批次")
+    private String businessCode;    //报销批次
     @Excel(name = "业务编号")
-    private String businessCode;    //业务编号
+    private String reimbursementBatch;    //业务编号
     //@Excel(name = "所属年份")
     private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String businessCodeId;    //业务编号id
@@ -61,6 +63,7 @@ public class WuHanReimbursementDTO extends TreeEntity<WuHanReimbursementDTO> {
     private String reimbursementType;    //报销比例
     private String gatheringStatus;    //收款状态
     private String reimbursementStatus;    //报销状态
+    private String businessFlag;    //报销判定条件(1:表示该数据没有业务编码,即没有进行报销;0:表示该数据有业务编码)
     private String randomType;    //随机状态(1:随机业务编码,2:指定业务编码)(默认为指定业务编码仅业务表中使用)
     private String batchFlag;    //批量报销状态(1:批量报销)(仅业务表中使用)
     private String randomBusinessCodeIndex;    //随即业务编码序号

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementSysMapper.java

@@ -3,6 +3,7 @@ package com.jeeplus.test.reimbursementsys.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import org.apache.ibatis.annotations.Param;
 
@@ -22,12 +23,26 @@ public interface ReimbursementSysMapper  extends BaseMapper<ReimbursementDTO> {
      * @param reimbursement
      * @return
      */
+    IPage<ReimbursementDTO> findList(Page<ReimbursementDTO> page, @Param("reimbursement")ReimbursementDTO reimbursement);
+    /**
+     * 根据条件查询数据信息
+     * @param page
+     * @param reimbursement
+     * @return
+     */
     IPage<ReimbursementDTO> queryAllList(Page<ReimbursementDTO> page, @Param("reimbursement")ReimbursementDTO reimbursement);
 
 
     List<ReimbursementDTO> getInvoiceList(ReimbursementDTO reimbursement);
 
     /**
+     * 根据发票id查询业务具体信息
+     * @param id
+     * @return
+     */
+    ReimbursementDTO queryBusinessByInvoiceId(String id);
+
+    /**
      * 根据父id查询已收款的发票信息的首款额度总和
      * @param parentId
      * @return
@@ -205,4 +220,23 @@ public interface ReimbursementSysMapper  extends BaseMapper<ReimbursementDTO> {
      * @param id
      */
     void removeBusinessById(String id);
+
+    /**
+     * 根据发票id查询发票信息
+     * @param idList
+     * @return
+     */
+    List<ReimbursementDTO> getInvoiceByIdList(@Param("idList") List<String> idList);
+
+    /**
+     * 根据id删除对应业务信息(物理删除)
+     * @param idList
+     */
+    void deleteBusinessByIdList(@Param("idList")List<String> idList);
+
+    /**
+     * 修改业务信息
+     * @param reimbursement
+     */
+    int updateById(ReimbursementDTO reimbursement);
 }

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/WuHanReimbursementSysMapper.java

@@ -3,6 +3,7 @@ package com.jeeplus.test.reimbursementsys.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO;
 import org.apache.ibatis.annotations.Param;
 
@@ -22,6 +23,13 @@ public interface WuHanReimbursementSysMapper extends BaseMapper<WuHanReimburseme
      * @param reimbursement
      * @return
      */
+    IPage<WuHanReimbursementDTO> findList(Page<WuHanReimbursementDTO> page, @Param("reimbursement")WuHanReimbursementDTO reimbursement);
+    /**
+     * 根据条件查询数据信息
+     * @param page
+     * @param reimbursement
+     * @return
+     */
     IPage<WuHanReimbursementDTO> queryAllList(Page<WuHanReimbursementDTO> page, @Param("reimbursement")WuHanReimbursementDTO reimbursement);
 
 
@@ -96,6 +104,13 @@ public interface WuHanReimbursementSysMapper extends BaseMapper<WuHanReimburseme
     WuHanReimbursementDTO queryInvoiceById(String id);
 
     /**
+     * 根据发票id查询业务具体信息
+     * @param id
+     * @return
+     */
+    WuHanReimbursementDTO queryBusinessByInvoiceId(String id);
+
+    /**
      * 保存业务编码
      * @param reimbursement
      * @return
@@ -193,4 +208,23 @@ public interface WuHanReimbursementSysMapper extends BaseMapper<WuHanReimburseme
      * @return
      */
     String getLastRandomBusinessCodeIndex(String year);
+
+    /**
+     * 根据发票id查询发票信息
+     * @param idList
+     * @return
+     */
+    List<WuHanReimbursementDTO> getInvoiceByIdList(@Param("idList") List<String> idList);
+
+    /**
+     * 根据id删除对应业务信息(物理删除)
+     * @param idList
+     */
+    void deleteBusinessByIdList(@Param("idList")List<String> idList);
+
+    /**
+     * 修改业务信息
+     * @param reimbursement
+     */
+    int updateById(WuHanReimbursementDTO reimbursement);
 }

+ 94 - 8
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementSysMapper.xml

@@ -21,6 +21,7 @@
         a.tax AS "tax",
         a.income AS "income",
         a.business_code AS "businessCode",
+        a.reimbursement_batch AS "reimbursementBatch",
         DATE_FORMAT(a.gathering_time,'%Y-%m-%d') AS "gatheringTime",
         a.proposer AS "proposer",
         a.partner AS "partner",
@@ -32,6 +33,30 @@
         a.random_type AS "randomType"
     </sql>
 
+
+
+    <select id="findList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
+        SELECT
+        <include refid="reimbursementColumns"/>
+        FROM zs_reimbursement_invoice_info a
+        left join zs_reimbursement_info b on a.parent_id = b.id
+        <where>
+            a.del_flag = 0
+            and a.batch_flag = 0
+            and (b.business_code is null or b.business_code = '')
+            <if test="reimbursement.invoiceNumber != null and reimbursement.invoiceNumber != ''">
+                and a.invoice_number like concat('%',#{reimbursement.invoiceNumber},'%')
+            </if>
+            <if test="reimbursement.proposer != null and reimbursement.proposer != ''">
+                and a.proposer like concat('%',#{reimbursement.proposer},'%')
+            </if>
+            <if test="reimbursement.partner != null and reimbursement.partner != ''">
+                and a.partner like concat('%',#{reimbursement.partner},'%')
+            </if>
+        </where>
+        order by a.sort asc
+    </select>
+
     <select id="queryAllList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
         SELECT
             <include refid="reimbursementColumns"/>
@@ -48,7 +73,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.business_code
+        order by a.business_code asc ,a.sort asc
     </select>
 
     <select id="getInvoiceList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
@@ -60,6 +85,9 @@
             <if test="invoiceNumber != null and invoiceNumber != ''">
                 and a.invoice_number like concat('%',#{invoiceNumber},'%')
             </if>
+            <if test="reimbursementBatch != null and reimbursementBatch != ''">
+                and a.reimbursement_batch like concat('%',#{reimbursementBatch},'%')
+            </if>
             <if test="proposer != null and proposer != ''">
                 and a.proposer like concat('%',#{proposer},'%')
             </if>
@@ -82,7 +110,19 @@
                 and a.make_time &lt;= #{endDate}
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
+    </select>
+
+
+    <select id="queryBusinessByInvoiceId" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
+        SELECT
+        <include refid="reimbursementColumns"/>
+        FROM zs_reimbursement_info a
+        <where>
+            a.del_flag = 0
+            and a.id = (select parent_id from zs_reimbursement_invoice_info where id = #{id})
+        </where>
+        order by a.business_code asc ,a.sort asc
     </select>
 
     <select id="getReceiptInvoiceIncomeByReimbursementId" resultType="java.lang.String">
@@ -94,7 +134,7 @@
             and a.parent_id =#{parentId}
             and a.gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getReimbursementRatioByReimbursementId" resultType="java.lang.String">
@@ -105,7 +145,7 @@
             a.del_flag = 0
             and a.id =#{id}
         </where>
-        order by a.invoice_number
+        order by a.business_code asc ,a.sort asc
     </select>
 
     <select id="getInvoiceByParentIdList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
@@ -121,7 +161,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="selectOldInvoiceNumber" resultType="java.lang.String">
@@ -212,6 +252,7 @@
             del_flag,
             parent_id,
             parent_ids,
+            reimbursement_batch,
             invoice_code,
             invoice_number,
             firm_name,
@@ -237,6 +278,7 @@
             #{item.delFlag},
             #{item.parentId},
             #{item.parentIds},
+            #{item.reimbursementBatch},
             #{item.invoiceCode},
             #{item.invoiceNumber},
             #{item.firmName},
@@ -272,6 +314,7 @@
             a.del_flag = 0
             and a.id = #{id}
         </where>
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <update id="saveBusiness">
@@ -286,6 +329,7 @@
             <if test="randomType != null and randomType != ''">
                 ,random_type = #{randomType}
             </if>
+            ,sort = 2
         where
             id = #{id} and del_flag = 0
     </update>
@@ -419,7 +463,7 @@
             </if>
             and gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getNotGatheringTimeInvoice" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
@@ -432,7 +476,7 @@
             select parent_id from zs_reimbursement_invoice_info where id = #{id}
             ) and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getNotGatheringTimeInvoiceBybusinessCodeId" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
@@ -444,7 +488,7 @@
             and parent_id = #{businessCodeId}
             and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <update id="updateGatheringTime">
@@ -486,4 +530,46 @@
         set del_flag = 1
         where id = (select parent_id from zs_reimbursement_invoice_info where id = #{id})
     </update>
+
+    <select id="getInvoiceByIdList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
+        SELECT
+        <include refid="reimbursementColumns"/>
+        FROM zs_reimbursement_invoice_info a
+        <where>
+            a.del_flag = 0
+            <if test="idList != null and idList.size>0">
+                and a.id in
+                <foreach collection="idList" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </if>
+        </where>
+        order by a.invoice_number asc ,a.sort asc
+    </select>
+
+    <delete id="deleteBusinessByIdList">
+        delete from zs_reimbursement_info
+        <where>
+            <if test="idList != null and idList.size>0">
+                and id in
+                <foreach collection="idList" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </if>
+        </where>
+    </delete>
+
+    <update id="updateById">
+        update zs_reimbursement_info
+        set
+        update_by = #{updateBy},
+        update_date = #{updateDate},
+        sort = 0
+        <if test="batchFlag != null and batchFlag != ''">
+            ,batch_flag = #{batchFlag}
+        </if>
+        where
+        id = #{id} and del_flag = 0
+    </update>
+
 </mapper>

+ 90 - 8
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/WuHanReimbursementSysMapper.xml

@@ -21,6 +21,7 @@
         a.tax AS "tax",
         a.income AS "income",
         a.business_code AS "businessCode",
+        a.reimbursement_batch AS "reimbursementBatch",
         DATE_FORMAT(a.gathering_time,'%Y-%m-%d') AS "gatheringTime",
         a.proposer AS "proposer",
         a.partner AS "partner",
@@ -32,6 +33,30 @@
         a.random_type AS "randomType"
     </sql>
 
+
+
+    <select id="findList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
+        SELECT
+        <include refid="reimbursementColumns"/>
+        FROM zs_wuhan_reimbursement_invoice_info a
+        left join zs_wuhan_reimbursement_info b on a.parent_id = b.id
+        <where>
+            a.del_flag = 0
+            and a.batch_flag = 0
+            and (b.business_code is null or b.business_code = '')
+            <if test="reimbursement.invoiceNumber != null and reimbursement.invoiceNumber != ''">
+                and a.invoice_number like concat('%',#{reimbursement.invoiceNumber},'%')
+            </if>
+            <if test="reimbursement.proposer != null and reimbursement.proposer != ''">
+                and a.proposer like concat('%',#{reimbursement.proposer},'%')
+            </if>
+            <if test="reimbursement.partner != null and reimbursement.partner != ''">
+                and a.partner like concat('%',#{reimbursement.partner},'%')
+            </if>
+        </where>
+        order by a.sort asc
+    </select>
+
     <select id="queryAllList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO">
         SELECT
             <include refid="reimbursementColumns"/>
@@ -48,7 +73,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.business_code
+        order by a.business_code asc ,a.sort asc
     </select>
 
     <select id="getInvoiceList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO">
@@ -60,6 +85,9 @@
             <if test="invoiceNumber != null and invoiceNumber != ''">
                 and a.invoice_number like concat('%',#{invoiceNumber},'%')
             </if>
+            <if test="reimbursementBatch != null and reimbursementBatch != ''">
+                and a.reimbursement_batch like concat('%',#{reimbursementBatch},'%')
+            </if>
             <if test="proposer != null and proposer != ''">
                 and a.proposer like concat('%',#{proposer},'%')
             </if>
@@ -82,7 +110,17 @@
                 and a.make_time &lt;= #{endDate}
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
+    </select>
+
+    <select id="queryBusinessByInvoiceId" resultType="com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO">
+        SELECT
+        <include refid="reimbursementColumns"/>
+        FROM zs_wuhan_reimbursement_info a
+        <where>
+            a.del_flag = 0
+            and a.id = (select parent_id from zs_wuhan_reimbursement_invoice_info where id = #{id})
+        </where>
     </select>
 
     <select id="getReceiptInvoiceIncomeByReimbursementId" resultType="java.lang.String">
@@ -94,7 +132,7 @@
             and a.parent_id =#{parentId}
             and a.gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getReimbursementRatioByReimbursementId" resultType="java.lang.String">
@@ -105,7 +143,7 @@
             a.del_flag = 0
             and a.id =#{id}
         </where>
-        order by a.invoice_number
+        order by a.business_code asc ,a.sort asc
     </select>
 
     <select id="getInvoiceByParentIdList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO">
@@ -121,7 +159,7 @@
                 </foreach>
             </if>
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="selectOldInvoiceNumber" resultType="java.lang.String">
@@ -212,6 +250,7 @@
             del_flag,
             parent_id,
             parent_ids,
+            reimbursement_batch,
             invoice_code,
             invoice_number,
             firm_name,
@@ -237,6 +276,7 @@
             #{item.delFlag},
             #{item.parentId},
             #{item.parentIds},
+            #{item.reimbursementBatch,},
             #{item.invoiceCode},
             #{item.invoiceNumber},
             #{item.firmName},
@@ -419,7 +459,7 @@
             </if>
             and gathering_time is not null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getNotGatheringTimeInvoice" resultType="com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO">
@@ -432,7 +472,7 @@
             select parent_id from zs_wuhan_reimbursement_invoice_info where id = #{id}
             ) and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <select id="getNotGatheringTimeInvoiceBybusinessCodeId" resultType="com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO">
@@ -444,7 +484,7 @@
             and parent_id = #{businessCodeId}
             and gathering_time is null
         </where>
-        order by a.invoice_number
+        order by a.invoice_number asc ,a.sort asc
     </select>
 
     <update id="updateGatheringTime">
@@ -472,4 +512,46 @@
             year = #{year}
         </where>
     </select>
+
+    <select id="getInvoiceByIdList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO">
+        SELECT
+        <include refid="reimbursementColumns"/>
+        FROM zs_wuhan_reimbursement_invoice_info a
+        <where>
+            a.del_flag = 0
+            <if test="idList != null and idList.size>0">
+                and a.id in
+                <foreach collection="idList" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </if>
+        </where>
+        order by a.invoice_number asc ,a.sort asc
+    </select>
+
+    <delete id="deleteBusinessByIdList">
+        delete from zs_wuhan_reimbursement_info
+        <where>
+            <if test="idList != null and idList.size>0">
+                and id in
+                <foreach collection="idList" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </if>
+        </where>
+    </delete>
+
+    <update id="updateById">
+        update zs_wuhan_reimbursement_info
+        set
+        update_by = #{updateBy},
+        update_date = #{updateDate},
+        sort = 0
+        <if test="batchFlag != null and batchFlag != ''">
+            ,batch_flag = #{batchFlag}
+        </if>
+        where
+        id = #{id} and del_flag = 0
+    </update>
+
 </mapper>

+ 17 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementSysService.java

@@ -2,6 +2,7 @@ package com.jeeplus.test.reimbursementsys.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO;
 
@@ -17,6 +18,9 @@ import java.util.Map;
  */
 
 public interface ReimbursementSysService {
+
+
+    IPage<ReimbursementDTO> findList(Page<ReimbursementDTO> page, ReimbursementDTO reimbursement);
     /**
      * 查询业务具体信息
      * @param id
@@ -30,6 +34,13 @@ public interface ReimbursementSysService {
      */
     ReimbursementDTO queryInvoiceById(String id);
 
+    /**
+     * 根据发票id查询业务具体信息
+     * @param id
+     * @return
+     */
+    ReimbursementDTO queryBusinessByInvoiceId(String id);
+
     IPage<ReimbursementDTO> treeData(Page<ReimbursementDTO> page, ReimbursementDTO reimbursement);
 
     /**
@@ -93,4 +104,10 @@ public interface ReimbursementSysService {
      * @param reimbursement
      */
     void updateReimbursementRatio(ReimbursementDTO reimbursement);
+
+    /**
+     * 根据发票id删除发票信息(逻辑删除)
+     * @param idList
+     */
+    Map<String,Object>  addBatchReimbursement(List <String> idList);
 }

+ 16 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/WuHanReimbursementSysService.java

@@ -17,6 +17,9 @@ import java.util.Map;
  */
 
 public interface WuHanReimbursementSysService {
+
+
+    IPage<WuHanReimbursementDTO> findList(Page<WuHanReimbursementDTO> page, WuHanReimbursementDTO reimbursement);
     /**
      * 查询业务具体信息
      * @param id
@@ -30,6 +33,13 @@ public interface WuHanReimbursementSysService {
      */
     WuHanReimbursementDTO queryInvoiceById(String id);
 
+    /**
+     * 根据发票id查询业务具体信息
+     * @param id
+     * @return
+     */
+    WuHanReimbursementDTO queryBusinessByInvoiceId(String id);
+
     IPage<WuHanReimbursementDTO> treeData(Page<WuHanReimbursementDTO> page, WuHanReimbursementDTO reimbursement);
 
     List<WuHanReimbursementDTO> findPage(Page<WuHanReimbursementDTO> page, WuHanReimbursementDTO reimbursement);
@@ -87,4 +97,10 @@ public interface WuHanReimbursementSysService {
      * @param reimbursement
      */
     void updateReimbursementRatio(WuHanReimbursementDTO reimbursement);
+
+    /**
+     * 根据发票id删除发票信息(逻辑删除)
+     * @param idList
+     */
+    Map<String,Object>  addBatchReimbursement(List <String> idList);
 }

+ 82 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementSysServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.test.reimbursementAccountant.utils.MyBeanUtils;
 import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.mapper.ReimbursementSysMapper;
@@ -33,6 +34,12 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
 
 
     @Override
+    public IPage<ReimbursementDTO> findList(Page<ReimbursementDTO> page, ReimbursementDTO reimbursement) {
+        IPage<ReimbursementDTO> list = mapper.findList(page, reimbursement);
+        return list;
+    }
+
+    @Override
     public ReimbursementDTO queryBusinessById(String id) {
         ReimbursementDTO reimbursementDTO = mapper.queryBusinessById(id);
         //如果没有随即类型,则将随即类型默认为非随机(即指定业务编码)
@@ -47,6 +54,17 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
         return mapper.queryInvoiceById(id);
     }
 
+    @Override
+    public ReimbursementDTO queryBusinessByInvoiceId(String id) {
+        //根据发票id查询业务具体信息
+        ReimbursementDTO reimbursementDTO = mapper.queryBusinessByInvoiceId(id);
+        //如果没有随即类型,则将随即类型默认为非随机(即指定业务编码)
+        if(null != reimbursementDTO && StringUtils.isBlank(reimbursementDTO.getRandomType())){
+            reimbursementDTO.setRandomType("0");
+        }
+        return reimbursementDTO;
+    }
+
 
     @Override
     public IPage<ReimbursementDTO> treeData(Page<ReimbursementDTO> page, ReimbursementDTO reimbursement) {
@@ -59,6 +77,7 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
                 null != reimbursement.getEndDate() ||
                 StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
                 StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getReimbursementBatch()) ||
                 StringUtils.isNotBlank(reimbursement.getFirmName())){
             List<ReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);
             //如果存在发票信息,则根据发票的父节点查询对应的业务信息
@@ -79,7 +98,14 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
                         for (String key : invoiceListMap.keySet()) {
                             if (info.getId().equals(key)) {
                                 List<ReimbursementDTO> children = invoiceListMap.get(key);
-                                info.setChildren(children);
+                                if(StringUtils.isNotBlank(info.getBusinessCode()) || "1".equals(info.getBatchFlag())){
+                                    info.setChildren(children);
+                                    info.setBusinessFlag("0");
+                                }else{
+                                    //空业务编码添加状态
+                                    info.setBusinessFlag("1");
+                                    MyBeanUtils.copyBeanNotNull2Bean(children.get(0), info);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                                }
                             }
                         }
                         ReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
@@ -112,7 +138,14 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
                         for (String key : invoiceListMap.keySet()) {
                             if (info.getId().equals(key)) {
                                 List<ReimbursementDTO> children = invoiceListMap.get(key);
-                                info.setChildren(children);
+                                if(StringUtils.isNotBlank(info.getBusinessCode()) || "1".equals(info.getBatchFlag())){
+                                    info.setChildren(children);
+                                    info.setBusinessFlag("0");
+                                }else{
+                                    //空业务编码添加状态
+                                    info.setBusinessFlag("1");
+                                    MyBeanUtils.copyBeanNotNull2Bean(children.get(0), info);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                                }
                             }
                         }
                         ReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
@@ -305,10 +338,10 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
         Calendar date = Calendar.getInstance();
         String year = String.valueOf(date.get(Calendar.YEAR));
 
-        //查询非空的业务编号数据在数据库中是否存在,若存在,返回已存在的业务编号集合
+        //查询非空的报销批次数据在数据库中是否存在,若存在,返回已存在的报销批次集合
         List<ReimbursementDTO> oldBusinessCodeList = mapper.selectOldBusinessCodeByInfo(businessCodeList,year);
         if (oldBusinessCodeList.size()>0){
-            //如果数据库已存在部分业务编号信息,则去除该部分的业务编号信息
+            //如果数据库已存在部分报销批次信息,则去除该部分的报销批次信息
             for (ReimbursementDTO oldBusinessCode: oldBusinessCodeList) {
                 Iterator iterator = businessCodeInfoList.iterator();
                 while (iterator.hasNext()) {
@@ -321,12 +354,12 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
 
         }
 
-        //将空的业务编号 的信息添加到集合中
+        //将空的报销批次 的信息添加到集合中
         businessCodeInfoList.addAll(businessCodeNullList);
         List<ReimbursementDTO> newBusinessCodeInfoList = Lists.newArrayList();
         newBusinessCodeInfoList.addAll(businessCodeInfoList);
 
-        //对业务编号的数据进行新增保存
+        //对报销批次的数据进行新增保存
         Iterator iterator = businessCodeInfoList.iterator();
         while (iterator.hasNext()) {
             ReimbursementDTO data = (ReimbursementDTO) iterator.next();
@@ -345,12 +378,12 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
         }
 
 
-        //业务编号对应的数据集合
+        //报销批次对应的数据集合
         List<ReimbursementDTO> invoiceInfoList = Lists.newArrayList();
 
         for (ReimbursementDTO info : newBusinessCodeInfoList) {
             if(StringUtils.isNotBlank(info.getBusinessCode())){
-                //处理业务编号不为空的数据
+                //处理报销批次不为空的数据
                 for (String key : businessCodeListMap.keySet()) {
                     if(info.getBusinessCode().equals(key)){
                         List<ReimbursementDTO> infoList = businessCodeListMap.get(key);
@@ -365,7 +398,7 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
                 }
 
             }else{
-                //处理业务编号为空的数据
+                //处理报销批次为空的数据
                 info.setParentId(info.getId());
                 String parentIds = "0," + info.getId() + ",";
                 info.setParentIds(parentIds);
@@ -576,6 +609,46 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
         mapper.updateReimbursementRatio(reimbursement);
     }
 
+    @Override
+    public Map<String, Object> addBatchReimbursement(List<String> idList) {
+        Map<String,Object> map = new HashMap<String,Object>();
+        //根据发票id查询对应的发票信息
+        List<ReimbursementDTO> invoiceList = mapper.getInvoiceByIdList(idList);
+        if(invoiceList.size()>0){
+            String firstParentId = invoiceList.get(0).getParentId();
+            String firstParentIds = invoiceList.get(0).getParentIds();
+            Set<String> reimbursementIdSet = new HashSet<String>();
+            for (ReimbursementDTO info : invoiceList) {
+                reimbursementIdSet.add(info.getParentId());
+            }
+            reimbursementIdSet.remove(firstParentId);
+            //删除除第一个以外的所有业务信息
+            if(reimbursementIdSet.size()>0){
+                mapper.deleteBusinessByIdList(new ArrayList<>(reimbursementIdSet));
+            }
+            //将所有发票信息的父节点变更为存在的业务信息id
+            for (ReimbursementDTO info : invoiceList) {
+                info.setParentId(firstParentId);
+                info.setParentIds(firstParentIds);
+                info.setBatchFlag("1");
+                info.preUpdate();
+            }
+            //批量修改发票信息
+            mapper.updateInvoiceList(invoiceList);
+            //修改业务信息(添加状态)
+            ReimbursementDTO info = new ReimbursementDTO();
+            info.setId(firstParentId);
+            info.setBatchFlag("1");
+            info.preUpdate();
+            mapper.updateById(info);
+
+        } else {
+            map.put("success", false);
+            map.put("message", "未查询到符合条件的发票信息");
+        }
+        return map;
+    }
+
     /**
      * 文件数据分组
      * @param dataList

+ 75 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/WuHanReimbursementSysServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.test.reimbursementAccountant.utils.MyBeanUtils;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.mapper.WuHanReimbursementSysMapper;
@@ -33,6 +34,12 @@ public class WuHanReimbursementSysServiceImpl implements WuHanReimbursementSysSe
 
 
     @Override
+    public IPage<WuHanReimbursementDTO> findList(Page<WuHanReimbursementDTO> page, WuHanReimbursementDTO reimbursement) {
+        IPage<WuHanReimbursementDTO> list = mapper.findList(page, reimbursement);
+        return list;
+    }
+
+    @Override
     public WuHanReimbursementDTO queryBusinessById(String id) {
         WuHanReimbursementDTO reimbursementDTO = mapper.queryBusinessById(id);
         //如果没有随即类型,则将随即类型默认为非随机(即指定业务编码)
@@ -47,6 +54,18 @@ public class WuHanReimbursementSysServiceImpl implements WuHanReimbursementSysSe
         return mapper.queryInvoiceById(id);
     }
 
+    @Override
+    public WuHanReimbursementDTO queryBusinessByInvoiceId(String id) {
+
+        //根据发票id查询业务具体信息
+        WuHanReimbursementDTO reimbursementDTO = mapper.queryBusinessByInvoiceId(id);
+        //如果没有随即类型,则将随即类型默认为非随机(即指定业务编码)
+        if(null != reimbursementDTO && StringUtils.isBlank(reimbursementDTO.getRandomType())){
+            reimbursementDTO.setRandomType("0");
+        }
+        return reimbursementDTO;
+    }
+
 
     @Override
     public IPage<WuHanReimbursementDTO> treeData(Page<WuHanReimbursementDTO> page, WuHanReimbursementDTO reimbursement) {
@@ -79,7 +98,14 @@ public class WuHanReimbursementSysServiceImpl implements WuHanReimbursementSysSe
                         for (String key : invoiceListMap.keySet()) {
                             if (info.getId().equals(key)) {
                                 List<WuHanReimbursementDTO> children = invoiceListMap.get(key);
-                                info.setChildren(children);
+                                if(StringUtils.isNotBlank(info.getBusinessCode()) || "1".equals(info.getBatchFlag())){
+                                    info.setChildren(children);
+                                    info.setBusinessFlag("0");
+                                }else{
+                                    //空业务编码添加状态
+                                    info.setBusinessFlag("1");
+                                    MyBeanUtils.copyBeanNotNull2Bean(children.get(0), info);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                                }
                             }
                         }
                         WuHanReimbursementDTO businessById = reimbursementBusinessService.getWuHanBusinessById(info.getId());
@@ -112,7 +138,14 @@ public class WuHanReimbursementSysServiceImpl implements WuHanReimbursementSysSe
                         for (String key : invoiceListMap.keySet()) {
                             if (info.getId().equals(key)) {
                                 List<WuHanReimbursementDTO> children = invoiceListMap.get(key);
-                                info.setChildren(children);
+                                if(StringUtils.isNotBlank(info.getBusinessCode()) || "1".equals(info.getBatchFlag())){
+                                    info.setChildren(children);
+                                    info.setBusinessFlag("0");
+                                }else{
+                                    //空业务编码添加状态
+                                    info.setBusinessFlag("1");
+                                    MyBeanUtils.copyBeanNotNull2Bean(children.get(0), info);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                                }
                             }
                         }
                         WuHanReimbursementDTO businessById = reimbursementBusinessService.getWuHanBusinessById(info.getId());
@@ -564,6 +597,46 @@ public class WuHanReimbursementSysServiceImpl implements WuHanReimbursementSysSe
         mapper.updateReimbursementRatio(reimbursement);
     }
 
+    @Override
+    public Map<String, Object> addBatchReimbursement(List<String> idList) {
+        Map<String,Object> map = new HashMap<String,Object>();
+        //根据发票id查询对应的发票信息
+        List<WuHanReimbursementDTO> invoiceList = mapper.getInvoiceByIdList(idList);
+        if(invoiceList.size()>0){
+            String firstParentId = invoiceList.get(0).getParentId();
+            String firstParentIds = invoiceList.get(0).getParentIds();
+            Set<String> reimbursementIdSet = new HashSet<String>();
+            for (WuHanReimbursementDTO info : invoiceList) {
+                reimbursementIdSet.add(info.getParentId());
+            }
+            reimbursementIdSet.remove(firstParentId);
+            //删除除第一个以外的所有业务信息
+            if(reimbursementIdSet.size()>0){
+                mapper.deleteBusinessByIdList(new ArrayList<>(reimbursementIdSet));
+            }
+            //将所有发票信息的父节点变更为存在的业务信息id
+            for (WuHanReimbursementDTO info : invoiceList) {
+                info.setParentId(firstParentId);
+                info.setParentIds(firstParentIds);
+                info.setBatchFlag("1");
+                info.preUpdate();
+            }
+            //批量修改发票信息
+            mapper.updateInvoiceList(invoiceList);
+            //修改业务信息(添加状态)
+            WuHanReimbursementDTO info = new WuHanReimbursementDTO();
+            info.setId(firstParentId);
+            info.setBatchFlag("1");
+            info.preUpdate();
+            mapper.updateById(info);
+
+        } else {
+            map.put("success", false);
+            map.put("message", "未查询到符合条件的发票信息");
+        }
+        return map;
+    }
+
     /**
      * 文件数据分组
      * @param dataList