更新
This commit is contained in:
@@ -260,7 +260,6 @@ public class BuyOrderController {
|
||||
totalPrice = totalPrice.add(getShoppingAmount(buyOrder));
|
||||
String orderSn = IdWorker.getTimeId().substring(0, 32);
|
||||
buyOrder.setOrderSn(orderSn);
|
||||
// buyOrder.setPaymentDate(new Date());//这个是支付时间
|
||||
QueryWrapper<UserAddress> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", buyOrder.getAddressId());
|
||||
UserAddress userAddress = userAddressService.getOne(queryWrapper);
|
||||
@@ -272,6 +271,7 @@ public class BuyOrderController {
|
||||
buyOrder.setAddress(userAddress.getDetailAddress());
|
||||
buyOrderService.save(buyOrder);
|
||||
|
||||
//解决购物车相关问题
|
||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||
buyOrderProduct.setOrderId(buyOrder.getOrderId());
|
||||
if (Constants.BUY_TYPE_CART.equals(buyOrder.getBuyType())) {
|
||||
@@ -458,6 +458,12 @@ public class BuyOrderController {
|
||||
paymentInfo.setBuyOrderId(Integer.valueOf(buyOrderEntity.getProductId()));
|
||||
paymentInfo.setTotalAmount(buyOrderEntity.getRealMoney());
|
||||
wxpayService.prepay(paymentInfo);
|
||||
rabbitTemplate.convertAndSend(
|
||||
DelayQueueConfig.ORDER_TO_BE_PAY_EXCHANGE,
|
||||
DelayQueueConfig.ORDER_TO_BE_PAY_ROUTING_KEY,
|
||||
buyOrder.getOrderId(),
|
||||
messagePostProcessor()
|
||||
);
|
||||
return R.ok().put("orderSn", timeId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user