|
|
@@ -34,7 +34,11 @@ import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
|
|
|
import com.fs.hisStore.mapper.FsStoreProductAttrValueScrmMapper;
|
|
|
import com.fs.hisStore.param.*;
|
|
|
import com.fs.hisStore.service.*;
|
|
|
+import com.fs.huifuPay.domain.HuiFuQueryOrderResult;
|
|
|
+import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayQueryRequest;
|
|
|
+import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.live.domain.LiveOrder;
|
|
|
+import com.fs.live.domain.LiveOrderPayment;
|
|
|
import com.fs.pay.pay.dto.OrderQueryDTO;
|
|
|
import com.fs.pay.service.IPayService;
|
|
|
import com.fs.store.config.StoreConfig;
|
|
|
@@ -50,6 +54,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
@@ -160,6 +165,39 @@ public class MallStoreTask
|
|
|
|
|
|
//@Autowired
|
|
|
//private IFsUserOnlineStateService fsUserOnlineStateService;
|
|
|
+ @Autowired
|
|
|
+ private HuiFuService huiFuService;
|
|
|
+
|
|
|
+ // 订单银行回调数据丢失补偿
|
|
|
+ public void recoveryBankOrder() {
|
|
|
+ // 查询出来最近15分钟的订单 待支付 未退款
|
|
|
+ List<FsStoreOrderScrm> list = fsStoreOrderMapper.selectBankOrder();
|
|
|
+ if(list == null || list.isEmpty()) return;
|
|
|
+ for (FsStoreOrderScrm order : list) {
|
|
|
+ List<FsStorePaymentScrm> orderPayments = fsStorePaymentMapper.selectFsStorePaymentByOrderId(order.getId());
|
|
|
+ if(orderPayments == null || orderPayments.isEmpty()) continue;
|
|
|
+ for (FsStorePaymentScrm payment : orderPayments) {
|
|
|
+ V2TradePaymentScanpayQueryRequest request = new V2TradePaymentScanpayQueryRequest();
|
|
|
+ request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
|
|
|
+ request.setOrgHfSeqId(payment.getTradeNo());
|
|
|
+ request.setAppId(payment.getAppId());
|
|
|
+ HuiFuQueryOrderResult o = null;
|
|
|
+ try {
|
|
|
+ o = huiFuService.queryOrder(request);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询失败:"+e.getMessage());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ log.info("汇付返回"+o);
|
|
|
+ if ("00000000".equals(o.getResp_code()) && "S".equals(o.getTrans_stat())) {
|
|
|
+ String[] orderSpilt=o.getOrg_req_seq_id().split("-");
|
|
|
+ if ("store".equals(orderSpilt[0])) {
|
|
|
+ orderService.payConfirm(1, null, orderSpilt[1], o.getOrg_hf_seq_id(), o.getOut_trans_id(), o.getParty_order_id());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public void PushErp() throws ParseException {
|
|
|
List<Long> ids;
|