From 042b9aebad182534bdd320439ef9c8d35eebfa90 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Sat, 21 Dec 2024 16:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heritage/service/wxpay/impl/WeChatServiceImpl.java | 5 ++++- src/test/java/com/cultural/heritage/test/Hello.java | 2 ++ src/test/java/com/cultural/heritage/test/Test.java | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/cultural/heritage/service/wxpay/impl/WeChatServiceImpl.java b/src/main/java/com/cultural/heritage/service/wxpay/impl/WeChatServiceImpl.java index 595d8af..a7cbe13 100644 --- a/src/main/java/com/cultural/heritage/service/wxpay/impl/WeChatServiceImpl.java +++ b/src/main/java/com/cultural/heritage/service/wxpay/impl/WeChatServiceImpl.java @@ -4,6 +4,7 @@ package com.cultural.heritage.service.wxpay.impl; import cn.binarywang.wx.miniapp.api.WxMaMsgService; import cn.binarywang.wx.miniapp.api.WxMaService; import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage; +import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.cultural.heritage.common.ErrorCode; import com.cultural.heritage.config.WxOpenConfig; @@ -98,7 +99,6 @@ public class WeChatServiceImpl implements WeChatService { // 微信回调地址 request.setNotifyUrl(wxPayConfig.getNotifyUrl() + "/api/wechat/payment/callback"); // 商户订单号 - request.setOutTradeNo(orderNumber); //返回数据,前端调起支付 return wxPayConfig.getJsapiServiceExtension().prepayWithRequestPayment(request); @@ -125,6 +125,7 @@ public class WeChatServiceImpl implements WeChatService { } // 修改订单状态 order.setOrderStatus(OrderStatusConstant.PENDING_SHIPMENT); + order.setUpdateTime(DateUtil.date()); boolean update = orderService.updateById(order); ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "订单状态修改失败"); @@ -182,6 +183,7 @@ public class WeChatServiceImpl implements WeChatService { // 修改订单状态 order.setOrderStatus(OrderStatusConstant.PAYMENT_REFUNDED); + order.setUpdateTime(DateUtil.date()); boolean update = orderService.updateById(order); ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "订单状态修改失败"); @@ -215,6 +217,7 @@ public class WeChatServiceImpl implements WeChatService { // 原有的库存 Integer inventory = good.getInventory(); good.setInventory(quantity + inventory); + good.setUpdateTime(DateUtil.date()); } boolean updateBatch = goodService.updateBatchById(goodList); ThrowUtils.throwIf(!updateBatch, ErrorCode.SYSTEM_ERROR, "商品库存恢复失败"); diff --git a/src/test/java/com/cultural/heritage/test/Hello.java b/src/test/java/com/cultural/heritage/test/Hello.java index a57d474..4876448 100644 --- a/src/test/java/com/cultural/heritage/test/Hello.java +++ b/src/test/java/com/cultural/heritage/test/Hello.java @@ -19,5 +19,7 @@ public class Hello { BigDecimal minPrice = new BigDecimal(10); BigDecimal maxPrice = new BigDecimal(20); System.out.println(minPrice.compareTo(maxPrice)); + + } } diff --git a/src/test/java/com/cultural/heritage/test/Test.java b/src/test/java/com/cultural/heritage/test/Test.java index b5e0364..290576c 100644 --- a/src/test/java/com/cultural/heritage/test/Test.java +++ b/src/test/java/com/cultural/heritage/test/Test.java @@ -1,5 +1,7 @@ package com.cultural.heritage.test; +import cn.hutool.core.date.DateUtil; + public class Test { public static void main(String[] args) { // Date date = new Date(); @@ -45,6 +47,8 @@ public class Test { // System.out.println(Objects.equals(new A().num, new B().num)); + System.out.println(DateUtil.date()); + } }