|
@@ -1,12 +1,14 @@
|
|
package com.fs.store.service.impl;
|
|
package com.fs.store.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -18,7 +20,10 @@ import com.fs.common.utils.DateUtils;
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.service.ICompanyService;
|
|
import com.fs.company.service.ICompanyService;
|
|
import com.fs.company.service.ICompanyUserService;
|
|
import com.fs.company.service.ICompanyUserService;
|
|
|
|
+import com.fs.huifuPay.domain.HuiFuQueryOrderResult;
|
|
import com.fs.huifuPay.dto.*;
|
|
import com.fs.huifuPay.dto.*;
|
|
|
|
+import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayQueryRequest;
|
|
|
|
+import com.fs.huifuPay.service.HuiFuService;
|
|
import com.fs.pay.pay.util.PayUtil;
|
|
import com.fs.pay.pay.util.PayUtil;
|
|
import com.fs.store.domain.*;
|
|
import com.fs.store.domain.*;
|
|
import com.fs.store.service.IFsStoreOrderService;
|
|
import com.fs.store.service.IFsStoreOrderService;
|
|
@@ -86,6 +91,9 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService
|
|
@Value("${wx.miniapp.configs[0].account}")
|
|
@Value("${wx.miniapp.configs[0].account}")
|
|
private String account;
|
|
private String account;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private HuiFuService huiFuService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询支付明细
|
|
* 查询支付明细
|
|
*
|
|
*
|
|
@@ -316,7 +324,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService
|
|
public void paymentSync() {
|
|
public void paymentSync() {
|
|
List<FsStorePayment> fsStorePayments = fsStorePaymentMapper.queryPendingDelayState();
|
|
List<FsStorePayment> fsStorePayments = fsStorePaymentMapper.queryPendingDelayState();
|
|
for (FsStorePayment fsStorePayment : fsStorePayments) {
|
|
for (FsStorePayment fsStorePayment : fsStorePayments) {
|
|
- queryYb(fsStorePayment);
|
|
|
|
|
|
+ queryHf(fsStorePayment);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -414,4 +422,35 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean queryHf(FsStorePayment payment) {
|
|
|
|
+ V2TradePaymentScanpayQueryRequest request = new V2TradePaymentScanpayQueryRequest();
|
|
|
|
+ HuiFuQueryOrderResult o;
|
|
|
|
+ try {
|
|
|
|
+ request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
|
|
|
|
+ request.setOrgHfSeqId(payment.getTradeNo());
|
|
|
|
+ o = huiFuService.queryOrder(request);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
+ }
|
|
|
|
+ logger.info("汇付返回"+o);
|
|
|
|
+ if ("00000000".equals(o.getResp_code())) {
|
|
|
|
+ if (o.getTrans_stat().equals("S")) {
|
|
|
|
+ String[] order=o.getOrg_req_seq_id().split("-");
|
|
|
|
+ switch (order[0]) {
|
|
|
|
+ case "store":
|
|
|
|
+ orderService.payConfirm(1,null,order[1], o.getOrg_hf_seq_id(),o.getOut_trans_id(),o.getParty_order_id());
|
|
|
|
+ break;
|
|
|
|
+ case "store_remain":
|
|
|
|
+ orderService.payRemainConfirm( order[1], o.getOrg_hf_seq_id(),o.getOut_trans_id(),o.getParty_order_id());
|
|
|
|
+ break;
|
|
|
|
+ case "payment":
|
|
|
|
+ this.payConfirm(order[1],o.getOrg_hf_seq_id(),o.getOut_trans_id(),o.getParty_order_id());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|