Browse Source

处理汇付订单退款异常问题

yjwang 2 weeks ago
parent
commit
9b2f804556

+ 4 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreAfterSalesScrmServiceImpl.java

@@ -588,11 +588,11 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
         if(order.getPayMoney().compareTo(BigDecimal.ZERO)==1){
             List<FsStorePaymentScrm> payments=paymentService.selectFsStorePaymentByOrderId(order.getId());
             if(payments!=null){
+                String json = configService.selectConfigByKey("store.pay");
+                FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
                 for(FsStorePaymentScrm payment:payments){
                     if (payment.getPayMode()==null||payment.getPayMode().equals("wx")){
                         WxPayConfig payConfig = new WxPayConfig();
-                        String json = configService.selectConfigByKey("store.pay");
-                        FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
                         payConfig.setAppId(fsPayConfig.getAppId());
                         payConfig.setMchId(fsPayConfig.getWxMchId());
                         payConfig.setMchKey(fsPayConfig.getWxMchKey());
@@ -625,6 +625,8 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
                     }else if (payment.getPayMode()!=null&&payment.getPayMode().equals("hf")){
                         V2TradePaymentScanpayRefundRequest request = new V2TradePaymentScanpayRefundRequest();
                         DecimalFormat df = new DecimalFormat("0.00");
+                        request.setOrgHfSeqId(payment.getTradeNo());
+                        request.setHuifuId(fsPayConfig.getHuifuId());
                         request.setOrdAmt(df.format(refundAmount));
                         request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
                         request.setReqSeqId("refund-"+payment.getPayCode());

+ 13 - 0
fs-service/src/main/java/com/fs/huifuPay/sdk/opps/core/request/V2TradePaymentScanpayRefundRequest.java

@@ -37,6 +37,12 @@ public class V2TradePaymentScanpayRefundRequest extends BaseRequest {
     @JSONField(name = "org_req_date")
     private String orgReqDate;
 
+    /**
+     *全局流水号
+     * **/
+    @JSONField(name = "org_hf_seq_id")
+    private String orgHfSeqId;
+
     @Override
     public FunctionCodeEnum getFunctionCode() {
         return FunctionCodeEnum.V2_TRADE_PAYMENT_SCANPAY_REFUND;
@@ -93,4 +99,11 @@ public class V2TradePaymentScanpayRefundRequest extends BaseRequest {
         this.orgReqDate = orgReqDate;
     }
 
+    public String getOrgHfSeqId() {
+        return orgHfSeqId;
+    }
+
+    public void setOrgHfSeqId(String orgHfSeqId) {
+        this.orgHfSeqId = orgHfSeqId;
+    }
 }