|
@@ -27,6 +27,7 @@ import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
|
import com.fs.huifuPay.dto.*;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.store.constants.StoreConstants;
|
|
|
+import com.fs.store.service.IFsStoreOrderService;
|
|
|
import com.fs.tzBank.TzBankService;
|
|
|
import com.fs.pay.pay.domain.CreateWxOrderResult;
|
|
|
import com.fs.pay.pay.dto.WxJspayDTO;
|
|
@@ -37,6 +38,7 @@ import com.fs.store.param.FsStoreStatisticsParam;
|
|
|
import com.fs.store.service.IFsCouponScheduleService;
|
|
|
import com.fs.store.vo.FsStorePaymentStatisticsVO;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
+import com.fs.tzBank.utils.TzConfigUtils;
|
|
|
import com.fs.wx.miniapp.config.WxMaProperties;
|
|
|
import com.fs.wx.pay.config.WxPayProperties;
|
|
|
import com.fs.store.domain.FsUser;
|
|
@@ -94,6 +96,10 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService
|
|
|
IFsCouponScheduleService fsCouponScheduleService;
|
|
|
@Autowired
|
|
|
TzBankService tzBankService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderService orderService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询支付明细
|
|
|
*
|
|
@@ -446,4 +452,47 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService
|
|
|
public FsStorePayment selectFsStorePaymentByTradeNo(String tradeNo) {
|
|
|
return fsStorePaymentMapper.selectFsStorePaymentByTradeNo(tradeNo);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void paymentSync() {
|
|
|
+ List<FsStorePayment> fsStorePayments = fsStorePaymentMapper.queryPendingDelayState();
|
|
|
+ for (FsStorePayment fsStorePayment : fsStorePayments) {
|
|
|
+ RequestDTO<QueryOrderRestDTO> requestDTO = new RequestDTO<>();
|
|
|
+
|
|
|
+ QueryOrderRestDTO queryOrderRestDTO = new QueryOrderRestDTO();
|
|
|
+
|
|
|
+ queryOrderRestDTO.setOrderFlowNo(fsStorePayment.getTradeNo());
|
|
|
+ TzConfigInfoDTO tzConfigInfoDTO = TzConfigUtils.getConfig();
|
|
|
+
|
|
|
+ queryOrderRestDTO.setPlatMerCstNo(tzConfigInfoDTO.getPlatMerCstNo());
|
|
|
+
|
|
|
+ requestDTO.setReqBody(queryOrderRestDTO);
|
|
|
+ requestDTO.setReqHeader(TzReqHeaderDTO.getInstance(fsStorePayment.getPayCode()));
|
|
|
+
|
|
|
+ TzReqResultDTO<QueryOrderInfoDTO> resultDTO = null;
|
|
|
+ try {
|
|
|
+ resultDTO = tzBankService.payQueryOrder(requestDTO);
|
|
|
+ String retCode = resultDTO.getRetCode();
|
|
|
+ // 如果查询支付成功
|
|
|
+ if(retCode.equals("00000000")){
|
|
|
+ QueryOrderInfoDTO body = resultDTO.getBody();
|
|
|
+ String status = body.getStatus();
|
|
|
+ Long orderId = fsStorePayment.getOrderId();
|
|
|
+ String payCode = fsStorePayment.getPayCode();
|
|
|
+ if("90".equals(status)){
|
|
|
+ // 如果查询支付成功 更新订单状态
|
|
|
+ orderService.payConfirm(1,orderId,fsStorePayment.getPayCode(),
|
|
|
+ fsStorePayment.getTradeNo(),body.getChlTrxId(),fsStorePayment.getTradeNo());
|
|
|
+
|
|
|
+ } else if("70".equals(status) || "80".equals(status)) {
|
|
|
+ fsStorePayment.setStatus(-2);
|
|
|
+ this.updateFsStorePayment(fsStorePayment);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("台州银行支付回调查询失败:",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|