From e419446784b168e8821457baca6c22022197a0b4 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Wed, 9 Oct 2024 15:34:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8F=96=E6=B6=88=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E9=87=8D=E6=96=B0=E8=AE=BE=E7=BD=AE=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/NotifyController.java | 3 +++ .../cashierservice/service/PayService.java | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) 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 3ad44f8..67a425e 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java @@ -100,6 +100,9 @@ public class NotifyController { String orderNo=object.get("mchOrderNo").toString(); String tradeNo=object.get("payOrderId").toString(); return payService.callBackPayFST(tradeNo); + }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 9408aaf..69e87e4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; 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.dto.ReturnGroupOrderDto; @@ -13,6 +14,7 @@ import com.chaozhanggui.system.cashierservice.entity.dto.ShopEatTypeInfoDTO; import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo; import com.chaozhanggui.system.cashierservice.exception.MsgException; import com.chaozhanggui.system.cashierservice.mapper.MpOrderDetailMapper; +import com.chaozhanggui.system.cashierservice.mapper.MpOrderInfoMapper; import com.chaozhanggui.system.cashierservice.model.PayReq; import com.chaozhanggui.system.cashierservice.model.TradeQueryReq; import com.chaozhanggui.system.cashierservice.netty.PushToClientChannelHandlerAdapter; @@ -169,6 +171,8 @@ public class PayService { private ShopUtils shopUtils; @Autowired private MpOrderDetailMapper mpOrderDetailMapper; + @Autowired + private MpOrderInfoMapper mpOrderInfoMapper; public PayService(@Qualifier("tbShopSongOrderServiceImpl") TbShopSongOrderService shopSongOrderService) { this.shopSongOrderService = shopSongOrderService; @@ -1471,6 +1475,19 @@ public class PayService { } + /** + * 重新激活支付中的订单 + * + * @param tradeNo + * @return + */ + public int activateOrder(String tradeNo) { + return mpOrderInfoMapper.update(null, new LambdaUpdateWrapper() + .eq(TbOrderInfo::getOrderNo, tradeNo) + .eq(TbOrderInfo::getStatus, "paying") + .set(TbOrderInfo::getStatus, "unpaid")); + } + // public Result returnOrder(){ //