feat(商城): waynboot-mall H5商城v1.3.0版本代码优化

master
wayn 1 year ago
parent 93b6b2de9f
commit adbdf3ea4e

@ -20,7 +20,7 @@ public class RabbitTemplateConfig {
rabbitTemplate.setMandatory(true);
// 服务器收到消息确认回调
rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> log.info("消息发送成功:correlationData({}),ack({}),cause({})", correlationData, ack, cause));
// 消息投递到队列失败回调处理
// 消息投递到队列时,如果失败的话会进行 returnCallback 的回调处理,反之成功就不会回调。
rabbitTemplate.setReturnsCallback(returned -> {
log.info("returnCallback: " + "消息:" + returned.getMessage());
log.info("returnCallback: " + "回应码:" + returned.getReplyCode());

@ -2,7 +2,7 @@ package com.wayn.mobile.api.controller.callback;
import com.alibaba.fastjson.JSON;
import com.wayn.common.util.R;
import com.wayn.message.core.messsage.OrderDTO;
import com.wayn.message.core.dto.OrderDTO;
import com.wayn.mobile.api.service.IOrderService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;

@ -1,17 +1,12 @@
package com.wayn.mobile.api.controller.callback;
import com.alibaba.fastjson.JSON;
import com.wayn.common.util.R;
import com.wayn.message.core.messsage.OrderDTO;
import com.wayn.mobile.api.service.IOrderService;
import com.wayn.mobile.api.service.IOrderUnpaidService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
@RestController
@AllArgsConstructor
@RequestMapping("callback/order")

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.wayn.common.core.domain.shop.Order;
import com.wayn.common.core.domain.vo.OrderVO;
import com.wayn.common.util.R;
import com.wayn.message.core.messsage.OrderDTO;
import com.wayn.message.core.dto.OrderDTO;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@ -1,16 +1,8 @@
package com.wayn.mobile.api.service;
import com.alipay.api.AlipayApiException;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wayn.common.core.domain.shop.Order;
import com.wayn.common.core.domain.vo.OrderVO;
import com.wayn.common.util.R;
import com.wayn.message.core.messsage.OrderDTO;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
/**
*

@ -41,12 +41,11 @@ import com.wayn.common.util.bean.MyBeanUtil;
import com.wayn.common.util.ip.IpUtils;
import com.wayn.data.redis.manager.RedisCache;
import com.wayn.message.core.constant.MQConstants;
import com.wayn.message.core.messsage.OrderDTO;
import com.wayn.message.core.dto.OrderDTO;
import com.wayn.mobile.api.domain.Cart;
import com.wayn.mobile.api.mapper.OrderMapper;
import com.wayn.mobile.api.service.ICartService;
import com.wayn.mobile.api.service.IOrderService;
import com.wayn.mobile.api.task.OrderUnpaidTask;
import com.wayn.mobile.api.util.OrderSnGenUtil;
import com.wayn.mobile.framework.security.util.MobileSecurityUtils;
import jakarta.servlet.http.HttpServletRequest;

@ -40,7 +40,6 @@ public class OrderUnpaidServiceImpl extends ServiceImpl<OrderMapper, Order> impl
public R unpaid(String orderSn) {
log.info("订单编号:{},未支付取消操作开始", orderSn);
Order order = orderService.getOne(Wrappers.lambdaQuery(Order.class)
.eq(Order::getOrderStatus, OrderUtil.STATUS_CREATE)
.eq(Order::getOrderSn, orderSn));
// 订单状态不是刚生成不做处理
if (!OrderUtil.isCreateStatus(order)) {

Loading…
Cancel
Save