|
|
@@ -22,11 +22,15 @@ import com.fs.huifuPay.domain.HuiFuQueryOrderResult;
|
|
|
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.domain.OrderResult;
|
|
|
+import com.fs.pay.pay.dto.OrderQueryDTO;
|
|
|
+import com.fs.pay.pay.service.PayService;
|
|
|
import com.fs.pay.pay.util.PayUtil;
|
|
|
import com.fs.store.domain.*;
|
|
|
import com.fs.store.service.IFsStoreOrderService;
|
|
|
import com.fs.store.service.channel.PaymentHandler;
|
|
|
import com.fs.store.service.channel.PaymentHandlerHolder;
|
|
|
+import com.fs.store.service.channel.YbPaymentHandler;
|
|
|
import com.fs.store.service.channel.param.PayProcessContext;
|
|
|
import com.fs.system.config.SnowflakeUtils;
|
|
|
import com.fs.tzBank.TzBankService;
|
|
|
@@ -316,12 +320,39 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService
|
|
|
return fsStorePaymentMapper.selectFsStorePaymentByTradeNo(tradeNo);
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PayService payService;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void paymentSync() {
|
|
|
List<FsStorePayment> fsStorePayments = fsStorePaymentMapper.queryPendingDelayState();
|
|
|
for (FsStorePayment fsStorePayment : fsStorePayments) {
|
|
|
try{
|
|
|
- queryHf(fsStorePayment);
|
|
|
+ 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 orderResult = payService.getOrder(orderQueryDTO);
|
|
|
+
|
|
|
+ if ("0".equals(orderResult.getState())) {
|
|
|
+ String[] order = orderResult.getLowOrderId().split("-");
|
|
|
+ if (orderResult.getStatus().equals("100")) {
|
|
|
+ switch (order[0]) {
|
|
|
+ case "store":
|
|
|
+ orderService.payConfirm(1, null, order[1], orderResult.getUpOrderId(), orderResult.getBankTrxId(), orderResult.getBankOrderId());
|
|
|
+ break;
|
|
|
+ case "store_remain":
|
|
|
+ orderService.payRemainConfirm(order[1], orderResult.getUpOrderId(), orderResult.getBankTrxId(), orderResult.getBankOrderId());
|
|
|
+ break;
|
|
|
+ case "payment":
|
|
|
+ this.payConfirm(order[1], orderResult.getUpOrderId(), orderResult.getBankTrxId(), orderResult.getBankOrderId());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}catch (Exception e){
|
|
|
logger.error("同步支付状态异常,订单号: {}",fsStorePayment.getOrderId(),e);
|
|
|
}
|
|
|
@@ -430,6 +461,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService
|
|
|
String sign = PayUtil.sign(orderQueryRequest.toSignMap());
|
|
|
orderQueryRequest.setSign(sign);
|
|
|
|
|
|
+
|
|
|
OrderQueryResponse orderQueryResponse = orderQueryService.queryOrder(orderQueryRequest);
|
|
|
if(ObjectUtil.equal(orderQueryResponse.getStatus(),100)){
|
|
|
Long orderId = fsStorePayment.getOrderId();
|