From c6d073a3fdd74c4e2087c98858ea408249b752b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Mon, 14 Oct 2024 15:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=9B=9E=E8=B0=83payType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/controller/NotifyController.java | 6 +++--- .../system/cashierservice/service/PayService.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java index bcaa549..03422d7 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java @@ -4,7 +4,6 @@ package com.chaozhanggui.system.cashierservice.controller; import cn.hutool.core.util.ObjectUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import com.chaozhanggui.system.cashierservice.entity.Enum.PayTypeConstant; import com.chaozhanggui.system.cashierservice.interceptor.RequestWrapper; import com.chaozhanggui.system.cashierservice.service.PayService; import com.chaozhanggui.system.cashierservice.sign.Result; @@ -17,7 +16,6 @@ import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.HashMap; import java.util.Map; -import java.util.Random; @CrossOrigin(origins = "*") @RestController @@ -81,6 +79,7 @@ public class NotifyController { && !"0100".equals(object.getStr("payType")) ){ String orderNo=object.getStr("orderNumber"); + return payService.callBackPay(orderNo); } } @@ -110,7 +109,8 @@ public class NotifyController { if("TRADE_SUCCESS".equals(object.get("state").toString())){ String orderNo=object.get("mchOrderNo").toString(); String tradeNo=object.get("payOrderId").toString(); - return payService.callBackPayFST(tradeNo); + String payType=object.getStr("payType"); + return payService.callBackPayFST(tradeNo,payType); }else { String tradeNo=object.get("payOrderId").toString(); return String.valueOf(payService.activateOrder(tradeNo)); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java index 774490f..d1e3678 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -8,8 +8,8 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.chaozhanggui.system.cashierservice.dao.*; -import com.chaozhanggui.system.cashierservice.entity.*; import com.chaozhanggui.system.cashierservice.entity.Enum.OrderUseTypeEnum; +import com.chaozhanggui.system.cashierservice.entity.*; import com.chaozhanggui.system.cashierservice.entity.dto.ReturnGroupOrderDto; import com.chaozhanggui.system.cashierservice.entity.dto.ShopEatTypeInfoDTO; import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo; @@ -1064,7 +1064,7 @@ public class PayService { @Transactional(rollbackFor = Exception.class) - public String callBackPayFST(String payOrderNO) { + public String callBackPayFST(String payOrderNO,String payType) { TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPayOrderNo(payOrderNO); if (ObjectUtil.isEmpty(orderInfo)) { return "订单信息不存在"; @@ -1089,7 +1089,7 @@ public class PayService { //修改主单状态 orderInfo.setStatus("closed"); - orderInfo.setPayType("wx_lite"); + orderInfo.setPayType(payType); orderInfo.setPayOrderNo(payOrderNO); orderInfo.setPayAmount(orderInfo.getOrderAmount()); orderInfo.setPaidTime(System.currentTimeMillis());