Просмотр исходного кода

宁波银行-批量转账,明细流水号根据每日付款明细数量来决定,依次往后叠加

ZhangWenQiang 4 лет назад
Родитель
Сommit
4676c91140

+ 4 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/common/nbcbutils/PayNbcbConst.java

@@ -60,6 +60,10 @@ public class PayNbcbConst {
      * 业务类型-费用报销
      */
     public static String NIS_SMART_EXPENSE = "nis_smart_expense";
+    /**
+     * 业务类型-批量转账
+     */
+    public static String NIS_BATCH_TRANSFER = "nis_batch_transfer";
 
     /**
      * 业务备注

+ 2 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/mapper/HlwPaymentDetailMapper.java

@@ -49,4 +49,6 @@ public interface HlwPaymentDetailMapper extends BaseMapper<HlwPaymentDetail> {
     Double monthPayment(Date date);
 
     Double yearPayment();
+
+    int getCountForToday();
 }

+ 10 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/mapper/xml/HlwPaymentDetailMapper.xml

@@ -503,4 +503,14 @@
 			and YEAR(a.payment_time)=YEAR(NOW())
 		</where>
 	</select>
+
+	<select id="getCountForToday" resultType="int">
+		select count(a.id)
+		FROM hlw_payment_detail a
+		<where>
+			a.del_flag = 0
+			and (a.status = 2 or a.status = 3 or a.status = 4)
+			and TO_DAYS(a.payment_time) = TO_DAYS(NOW())
+		</where>
+	</select>
 </mapper>

+ 2 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/service/IHlwPaymentDetailService.java

@@ -52,4 +52,6 @@ public interface IHlwPaymentDetailService extends IService<HlwPaymentDetail> {
     Double yearPayment();
 
     Result<?> chargeBack(String ids);
+
+    int getCountForToday();
 }

+ 5 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/service/impl/HlwPaymentDetailServiceImpl.java

@@ -346,4 +346,9 @@ public class HlwPaymentDetailServiceImpl extends ServiceImpl<HlwPaymentDetailMap
         }
         return Result.ok("退单成功");
     }
+
+    @Override
+    public int getCountForToday() {
+        return baseMapper.getCountForToday();
+    }
 }

+ 9 - 1
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/utils/PayNbcbCommon.java

@@ -11,6 +11,7 @@ import org.jeecg.modules.hlwpayaccount.entity.HlwPayAccountCmb;
 import org.jeecg.modules.hlwpayaccount.entity.HlwPayRecord;
 import org.jeecg.modules.hlwpayaccount.service.IHlwPayAccountCmbService;
 import org.jeecg.modules.hlwpayment.entity.HlwPaymentDetail;
+import org.jeecg.modules.hlwpayment.service.IHlwPaymentDetailService;
 import org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -35,15 +36,20 @@ public class PayNbcbCommon {
     private static final Logger logger = LoggerFactory.getLogger(PayNbcbCommon.class);
     @Autowired
     private IHlwPayAccountCmbService hlwPayAccountCmbService;
+    @Autowired
+    private IHlwPaymentDetailService hlwPaymentDetailService;
 
     public static PayNbcbCommon payCommon;
 
     public static IHlwPayAccountCmbService iHlwPayAccountCmbService;
 
+    public static IHlwPaymentDetailService iHlwPaymentDetailService;
+
     @PostConstruct
     public void init() {
         payCommon = this;
         iHlwPayAccountCmbService = hlwPayAccountCmbService;
+        iHlwPaymentDetailService = hlwPaymentDetailService;
     }
 
     /**
@@ -151,12 +157,14 @@ public class PayNbcbCommon {
              * 明细信息
              */
             JSONArray jsonArrayRequest3 = new JSONArray();
+            //查询今天已支付付款明细数(包含:付款中,已付款)
+            int count = iHlwPaymentDetailService.getCountForToday();
             for (int i = 0; i < payLength; i++) {
                 JSONObject trs = new JSONObject();
                 HlwPaymentDetail hlgPaymentDetail = hlgPaymentDetailList.get(i);
                 //明细流水号=8位日期+8位数字
                 //为8位纯数字,格式为:00000001、00000002...
-                String trxseq = Stream.iterate(i + 1, item -> item + 1).limit(1)
+                String trxseq = Stream.iterate(i + 1 + count, item -> item + 1).limit(1)
                         .map(item -> String.valueOf(item))
                         .map(item -> {
                             while (item.length() < numLength) {