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()); + } }