浏览代码

feat: 手动通知

xdd 2 月之前
父节点
当前提交
0b18d0fe51
共有 1 个文件被更改,包括 24 次插入0 次删除
  1. 24 0
      fs-admin/src/main/java/com/fs/store/controller/FsStorePaymentController.java

+ 24 - 0
fs-admin/src/main/java/com/fs/store/controller/FsStorePaymentController.java

@@ -43,6 +43,7 @@ import com.ijpay.alipay.AliPayApi;
 import com.ijpay.alipay.AliPayApiConfig;
 import com.ijpay.alipay.AliPayApiConfig;
 import com.ijpay.alipay.AliPayApiConfigKit;
 import com.ijpay.alipay.AliPayApiConfigKit;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import org.apache.http.util.Asserts;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Propagation;
@@ -210,7 +211,30 @@ public class FsStorePaymentController extends BaseController
                 }
                 }
             }
             }
         } else if(payMode.equals("tzbk")){
         } else if(payMode.equals("tzbk")){
+            FsStoreOrder fsStoreOrder = orderService.selectFsStoreOrderById(payment.getOrderId());
+            Asserts.notNull(fsStoreOrder,"当前订单不存在!");
 
 
+            RequestDTO<QueryOrderRestDTO> requestDTO = new RequestDTO<>();
+
+            QueryOrderRestDTO queryOrderRestDTO = new QueryOrderRestDTO();
+            queryOrderRestDTO.setOrderFlowNo(payment.getTradeNo());
+            TzConfigInfoDTO tzConfigInfoDTO = TzConfigUtils.getConfig();
+
+            queryOrderRestDTO.setPlatMerCstNo(tzConfigInfoDTO.getPlatMerCstNo());
+
+            requestDTO.setReqBody(queryOrderRestDTO);
+            requestDTO.setReqHeader(TzReqHeaderDTO.getInstance(payment.getPayCode()));
+
+            TzReqResultDTO<QueryOrderInfoDTO> resultDTO = tzBankService.payQueryOrder(requestDTO);
+            String retCode = resultDTO.getRetCode();
+            if(!retCode.equals("00000000")){
+                logger.info("台州银行支付回调查询失败{}",resultDTO);
+                throw new CustomException("台州银行支付回调查询失败! msg="+resultDTO.getRetCode());
+            }
+            QueryOrderInfoDTO body = resultDTO.getBody();
+
+            orderService.payConfirm(1, fsStoreOrder.getId(), payment.getPayCode(),
+                    payment.getTradeNo(),body.getChlTrxId(),payment.getTradeNo());
         }
         }
 
 
         return R.error("请检查外部订单号");
         return R.error("请检查外部订单号");