Преглед на файлове

付款管理-支付相关轮询接口添加银行类别区分

ZhangWenQiang преди 4 години
родител
ревизия
00abb4d1be

+ 5 - 5
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayaccount/mapper/HlwPayRecordMapper.java

@@ -9,18 +9,18 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 /**
  * @Description: hlw_pay_record
  * @Author: jeecg-boot
- * @Date:   2020-07-24
+ * @Date: 2020-07-24
  * @Version: V1.0
  */
 public interface HlwPayRecordMapper extends BaseMapper<HlwPayRecord> {
 
-    List<HlwPayRecord> findNoPayList();
+    List<HlwPayRecord> findNoPayList(@Param("bankType") Integer bankType);
 
-    List<HlwPayRecord> findNoPayRsaList();
+    List<HlwPayRecord> findNoPayRsaList(@Param("bankType") Integer bankType);
 
     List<HlwPayRecord> findNoStatementList();
 
-    List<HlwPayRecord> findDetailNoStatementList();
+    List<HlwPayRecord> findDetailNoStatementList(@Param("bankType") Integer bankType);
 
-    List<HlwPayRecord> findDetailSuppleNoStatementList();
+    List<HlwPayRecord> findDetailSuppleNoStatementList(@Param("bankType") Integer bankType);
 }

+ 27 - 8
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayaccount/mapper/xml/HlwPayRecordMapper.xml

@@ -3,20 +3,30 @@
 <mapper namespace="org.jeecg.modules.hlwpayaccount.mapper.HlwPayRecordMapper">
 
     <select id="findNoPayList" resultType="org.jeecg.modules.hlwpayaccount.entity.HlwPayRecord">
-        select * from hlw_pay_record
+        select a.* from hlw_pay_record a
+        LEFT JOIN hlw_payment p on a.payment_id = p.id
+        LEFT JOIN hlw_subcontractor s on p.subcontractor_id = s.id
         <where>
-            del_flag = '0'
-            and (recsts is null OR (recsts != 'SY' and recsts != 'VD' and recsts != 'CL'
-            and recsts != 'WF' and recsts != 'UF' and recsts != 'OF'))
+            a.del_flag = '0'
+            and (a.recsts is null OR (a.recsts != 'SY' and a.recsts != 'VD' and a.recsts != 'CL'
+            and a.recsts != 'WF' and a.recsts != 'UF' and a.recsts != 'OF'))
+            <if test="bankType != null">
+                and s.bank_type = #{bankType}
+            </if>
         </where>
     </select>
 
     <select id="findNoPayRsaList" resultType="org.jeecg.modules.hlwpayaccount.entity.HlwPayRecord">
-        select * from hlw_pay_record
+        select a.* from hlw_pay_record a
+        LEFT JOIN hlw_payment p on a.payment_id = p.id
+        LEFT JOIN hlw_subcontractor s on p.subcontractor_id = s.id
         <where>
-            del_flag = '0'
-            and (recsts is null OR (recsts != 'FIN' and recsts != 'SY' and recsts != 'VD' and recsts != 'CL'
-            and recsts != 'WF' and recsts != 'UF' and recsts != 'OF'))
+            a.del_flag = '0'
+            and (a.recsts is null OR (a.recsts != 'FIN' and a.recsts != 'SY' and a.recsts != 'VD' and a.recsts != 'CL'
+            and a.recsts != 'WF' and a.recsts != 'UF' and a.recsts != 'OF'))
+            <if test="bankType != null">
+                and s.bank_type = #{bankType}
+            </if>
         </where>
     </select>
 
@@ -45,11 +55,15 @@
         hlw_pay_record a
         left join hlw_payment p on p.id = a.payment_id
         left join hlw_payment_detail pd on pd.payment_id = p.id and pd.status = 3
+        LEFT JOIN hlw_subcontractor s on p.subcontractor_id = s.id
         <where>
             pd.statement_url IS NULL
             AND a.payment_detail_id IS NULL
             AND p.is_statement = 1
             AND TO_DAYS(NOW()) - TO_DAYS(a.create_time) &gt;= 1
+            <if test="bankType != null">
+                and s.bank_type = #{bankType}
+            </if>
         </where>
         GROUP BY a.id
 	</select>
@@ -60,12 +74,17 @@
         a.*
         FROM
         hlw_pay_record a
+        left join hlw_payment p on p.id = a.payment_id
         left join hlw_payment_detail pd on pd.id = a.payment_detail_id and pd.status = 3
+        LEFT JOIN hlw_subcontractor s on p.subcontractor_id = s.id
         <where>
             pd.statement_url IS NULL
             AND a.payment_detail_id IS NOT NULL
             AND pd.is_supplement_payment = 1
             AND TO_DAYS(NOW()) - TO_DAYS(a.create_time) &gt;= 1
+            <if test="bankType != null">
+                and s.bank_type = #{bankType}
+            </if>
         </where>
         GROUP BY a.id
 	</select>

+ 5 - 4
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayaccount/service/IHlwPayRecordService.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.hlwpayaccount.service;
 
+import io.swagger.models.auth.In;
 import org.jeecg.modules.hlwpayaccount.entity.HlwPayRecord;
 import com.baomidou.mybatisplus.extension.service.IService;
 
@@ -13,13 +14,13 @@ import java.util.List;
  */
 public interface IHlwPayRecordService extends IService<HlwPayRecord> {
 
-    List<HlwPayRecord> findNoPayList();
+    List<HlwPayRecord> findNoPayList(Integer bankType);
 
-    List<HlwPayRecord> findNoPayRsaList();
+    List<HlwPayRecord> findNoPayRsaList(Integer bankType);
 
     List<HlwPayRecord> findNoStatementList();
 
-    List<HlwPayRecord> findDetailNoStatementList();
+    List<HlwPayRecord> findDetailNoStatementList(Integer bankType);
 
-    List<HlwPayRecord> findDetailSuppleNoStatementList();
+    List<HlwPayRecord> findDetailSuppleNoStatementList(Integer bankType);
 }

+ 10 - 9
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayaccount/service/impl/HlwPayRecordServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.hlwpayaccount.service.impl;
 
+import io.swagger.models.auth.In;
 import org.jeecg.modules.hlwpayaccount.entity.HlwPayRecord;
 import org.jeecg.modules.hlwpayaccount.mapper.HlwPayRecordMapper;
 import org.jeecg.modules.hlwpayaccount.service.IHlwPayRecordService;
@@ -12,20 +13,20 @@ import java.util.List;
 /**
  * @Description: hlw_pay_record
  * @Author: jeecg-boot
- * @Date:   2020-07-24
+ * @Date: 2020-07-24
  * @Version: V1.0
  */
 @Service
 public class HlwPayRecordServiceImpl extends ServiceImpl<HlwPayRecordMapper, HlwPayRecord> implements IHlwPayRecordService {
 
     @Override
-    public List<HlwPayRecord> findNoPayList() {
-        return baseMapper.findNoPayList();
+    public List<HlwPayRecord> findNoPayList(Integer bankType) {
+        return baseMapper.findNoPayList(bankType);
     }
 
     @Override
-    public List<HlwPayRecord> findNoPayRsaList() {
-        return baseMapper.findNoPayRsaList();
+    public List<HlwPayRecord> findNoPayRsaList(Integer bankType) {
+        return baseMapper.findNoPayRsaList(bankType);
     }
 
     @Override
@@ -34,12 +35,12 @@ public class HlwPayRecordServiceImpl extends ServiceImpl<HlwPayRecordMapper, Hlw
     }
 
     @Override
-    public List<HlwPayRecord> findDetailNoStatementList() {
-        return baseMapper.findDetailNoStatementList();
+    public List<HlwPayRecord> findDetailNoStatementList(Integer bankType) {
+        return baseMapper.findDetailNoStatementList(bankType);
     }
 
     @Override
-    public List<HlwPayRecord> findDetailSuppleNoStatementList() {
-        return baseMapper.findDetailSuppleNoStatementList();
+    public List<HlwPayRecord> findDetailSuppleNoStatementList(Integer bankType) {
+        return baseMapper.findDetailSuppleNoStatementList(bankType);
     }
 }

+ 1 - 1
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/task/PaymentJob.java

@@ -59,7 +59,7 @@ public class PaymentJob {
         XxlJobLogger.log(String.format(" 支付查询定时器!  时间:" + DateUtils.getTimestamp()));
 
         //查询所有没结果的付款批次(终态包括:VD,CL,WF,UF,OF,SY)
-        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findNoPayList();
+        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findNoPayList(1);
         log.info("未有付款结果======={}", hlwPayRecordList.size());
         for (HlwPayRecord hlwPayRecord : hlwPayRecordList) {
             //完税金额

+ 2 - 2
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/task/PaymentNbcbDownloadJob.java

@@ -95,7 +95,7 @@ public class PaymentNbcbDownloadJob {
         logger.info(String.format(" 回执单定时器!  时间:" + DateUtils.getTimestamp()));
         XxlJobLogger.log(String.format(" 回执单定时器!  时间:" + DateUtils.getTimestamp()));
         //查询前一天未下载对账单的付款记录(考虑补发,按付款批次记录查询)
-        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findDetailNoStatementList();
+        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findDetailNoStatementList(2);
         for (HlwPayRecord hlwPayRecord : hlwPayRecordList) {
             //付款单
             HlwPayment hlwPayment = hlwPaymentService.getById(hlwPayRecord.getPaymentId());
@@ -134,7 +134,7 @@ public class PaymentNbcbDownloadJob {
         logger.info(String.format(" 回执单定时器!  时间:" + DateUtils.getTimestamp()));
         XxlJobLogger.log(String.format(" 回执单定时器!  时间:" + DateUtils.getTimestamp()));
         //查询前一天未下载对账单的付款记录(考虑补发,按付款批次记录查询)
-        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findDetailSuppleNoStatementList();
+        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findDetailSuppleNoStatementList(2);
         for (HlwPayRecord hlwPayRecord : hlwPayRecordList) {
             //付款单
             HlwPayment hlwPayment = hlwPaymentService.getById(hlwPayRecord.getPaymentId());

+ 1 - 1
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/task/PaymentNbcbJob.java

@@ -63,7 +63,7 @@ public class PaymentNbcbJob {
         XxlJobLogger.log(String.format(" 支付查询定时器!  时间:" + DateUtils.getTimestamp()));
 
         //查询所有交易状态为在途(不为FIN))的批次
-        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findNoPayRsaList();
+        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findNoPayRsaList(2);
         logger.info("未有付款结果======={}", hlwPayRecordList.size());
         for (HlwPayRecord hlwPayRecord : hlwPayRecordList) {
             //完税金额

+ 2 - 2
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/task/PaymentRsaDownloadJob.java

@@ -136,7 +136,7 @@ public class PaymentRsaDownloadJob {
         log.info(String.format(" 回执单定时器!  时间:" + DateUtils.getTimestamp()));
         XxlJobLogger.log(String.format(" 回执单定时器!  时间:" + DateUtils.getTimestamp()));
         //查询前一天未下载对账单的付款记录(考虑补发,按付款批次记录查询)
-        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findDetailNoStatementList();
+        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findDetailNoStatementList(1);
         for (HlwPayRecord hlwPayRecord : hlwPayRecordList) {
             //付款单
             HlwPayment hlwPayment = hlwPaymentService.getById(hlwPayRecord.getPaymentId());
@@ -173,7 +173,7 @@ public class PaymentRsaDownloadJob {
         log.info(String.format(" 回执单定时器!  时间:" + DateUtils.getTimestamp()));
         XxlJobLogger.log(String.format(" 回执单定时器!  时间:" + DateUtils.getTimestamp()));
         //查询前一天未下载对账单的付款记录(考虑补发,按付款批次记录查询)
-        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findDetailSuppleNoStatementList();
+        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findDetailSuppleNoStatementList(1);
         for (HlwPayRecord hlwPayRecord : hlwPayRecordList) {
             //付款单
             HlwPayment hlwPayment = hlwPaymentService.getById(hlwPayRecord.getPaymentId());

+ 1 - 1
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/task/PaymentRsaJob.java

@@ -60,7 +60,7 @@ public class PaymentRsaJob {
         XxlJobLogger.log(String.format(" 支付查询定时器!  时间:" + DateUtils.getTimestamp()));
 
         //查询所有交易状态为在途(不为FIN))的批次
-        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findNoPayRsaList();
+        List<HlwPayRecord> hlwPayRecordList = hlwPayRecordService.findNoPayRsaList(1);
         log.info("未有付款结果======={}", hlwPayRecordList.size());
         for (HlwPayRecord hlwPayRecord : hlwPayRecordList) {
             //完税金额