|
@@ -2,6 +2,9 @@ package com.fs.task;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fs.common.annotation.QuartzRunnable;
|
|
|
+import com.fs.huifuPay.domain.HuiFuQueryOrderResult;
|
|
|
+import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayQueryRequest;
|
|
|
+import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.pay.pay.domain.OrderResult;
|
|
|
import com.fs.pay.pay.dto.OrderQueryDTO;
|
|
|
import com.fs.pay.pay.service.PayService;
|
|
@@ -15,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
@@ -29,11 +33,7 @@ public class PaymentTask {
|
|
|
private FsStorePaymentMapper fsStorePaymentMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private ISysConfigService configService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private PayService payService;
|
|
|
-
|
|
|
+ private HuiFuService huiFuService;
|
|
|
|
|
|
/**
|
|
|
* 补偿机制,定时反查台州银行
|
|
@@ -58,18 +58,22 @@ public class PaymentTask {
|
|
|
public void fixTransactionNull(){
|
|
|
List<FsStorePayment> list = fsStorePaymentMapper.queryNormalData();
|
|
|
for (FsStorePayment fsStorePayment : list) {
|
|
|
- String json = configService.selectConfigByKey("store.pay");
|
|
|
- FsPayConfig fsPayConfig = JSON.parseObject(json, FsPayConfig.class);
|
|
|
- OrderQueryDTO orderQueryDTO = new OrderQueryDTO();
|
|
|
- orderQueryDTO.setAccount(fsPayConfig.getYbAccount());
|
|
|
- orderQueryDTO.setUpOrderId(fsStorePayment.getTradeNo());
|
|
|
- OrderResult order = payService.getOrder(orderQueryDTO);
|
|
|
- if(order != null) {
|
|
|
- fsStorePayment.setBankTransactionId(order.getBankTrxId());
|
|
|
- fsStorePayment.setBankSerialNo(order.getBankOrderId());
|
|
|
- }
|
|
|
|
|
|
- fsStorePaymentMapper.updateFsStorePayment(fsStorePayment);
|
|
|
+ V2TradePaymentScanpayQueryRequest request = new V2TradePaymentScanpayQueryRequest();
|
|
|
+ request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(fsStorePayment.getCreateTime()));
|
|
|
+ request.setOrgHfSeqId(fsStorePayment.getTradeNo());
|
|
|
+ HuiFuQueryOrderResult huiFuQueryOrderResult;
|
|
|
+ try {
|
|
|
+ huiFuQueryOrderResult = huiFuService.queryOrder(request);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ log.info("汇付返回 {}",huiFuQueryOrderResult);
|
|
|
+ if ("00000000".equals(huiFuQueryOrderResult.getResp_code())) {
|
|
|
+ fsStorePayment.setBankTransactionId(huiFuQueryOrderResult.getOut_trans_id());
|
|
|
+ fsStorePayment.setBankSerialNo(huiFuQueryOrderResult.getParty_order_id());
|
|
|
+ fsStorePaymentMapper.updateFsStorePayment(fsStorePayment);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|