更新了商品类别

This commit is contained in:
chen-xin-zhi 2024-12-21 16:09:40 +08:00
parent 0822ad590a
commit 042b9aebad
3 changed files with 10 additions and 1 deletions

View File

@ -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, "商品库存恢复失败");

View File

@ -19,5 +19,7 @@ public class Hello {
BigDecimal minPrice = new BigDecimal(10);
BigDecimal maxPrice = new BigDecimal(20);
System.out.println(minPrice.compareTo(maxPrice));
}
}

View File

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