赋值问题
This commit is contained in:
@@ -9,7 +9,7 @@ import com.czg.order.entity.MqLog;
|
||||
import com.czg.order.service.MqLogService;
|
||||
import com.czg.order.service.OrderInfoCustomService;
|
||||
import com.czg.order.service.OrderInfoRpcService;
|
||||
import com.czg.service.order.utils.FunUtil;
|
||||
import com.czg.service.RedisService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
@@ -31,7 +31,7 @@ public class OrderMqListener {
|
||||
@Resource
|
||||
private OrderInfoCustomService orderInfoCustomService;
|
||||
@Resource
|
||||
private FunUtil funUtil;
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 订单上菜
|
||||
@@ -44,7 +44,7 @@ public class OrderMqListener {
|
||||
info = info.replace("UP_ORDER_DETAIL:", "");
|
||||
log.info("接收到修改菜品状态mq, info: {}", info);
|
||||
String finalInfo = info;
|
||||
funUtil.debounce("UP_ORDER_DETAIL:" + info, 5, () -> {
|
||||
redisService.debounce("UP_ORDER_DETAIL:" + info, 5, () -> {
|
||||
orderInfoCustomService.updateOrderDetailStatus(Long.valueOf(finalInfo));
|
||||
|
||||
});
|
||||
|
||||
@@ -6,8 +6,8 @@ import com.czg.config.RabbitConstants;
|
||||
import com.czg.config.RedisCst;
|
||||
import com.czg.order.entity.MqLog;
|
||||
import com.czg.order.service.MqLogService;
|
||||
import com.czg.service.RedisService;
|
||||
import com.czg.service.order.print.PrinterHandler;
|
||||
import com.czg.service.order.utils.FunUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
@@ -27,7 +27,7 @@ public class PrintMqListener {
|
||||
@Resource
|
||||
private MqLogService mqLogService;
|
||||
@Resource
|
||||
private FunUtil funUtil;
|
||||
private RedisService redisService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
@@ -59,7 +59,7 @@ public class PrintMqListener {
|
||||
throw new RuntimeException("订单打印失败,未传递orderId");
|
||||
}
|
||||
Boolean printOrder = jsonObject.getBoolean("printOrder");
|
||||
funUtil.runFunAndCheckKey(() -> {
|
||||
redisService.runFunAndCheckKey(() -> {
|
||||
printerHandler.handler(orderId, printOrder != null && !printOrder ? PrinterHandler.PrintTypeEnum.ONE : PrinterHandler.PrintTypeEnum.ONE_AND_ORDER);
|
||||
return null;
|
||||
}, RedisCst.getLockKey("orderPrint", orderId));
|
||||
|
||||
Reference in New Issue
Block a user