订单打印修改
This commit is contained in:
@@ -7,6 +7,7 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.account.dto.print.PrinterOrderDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
|
||||
import com.czg.account.entity.*;
|
||||
import com.czg.account.service.*;
|
||||
@@ -15,10 +16,8 @@ import com.czg.config.RedisCst;
|
||||
import com.czg.entity.notify.CzgPayNotifyDTO;
|
||||
import com.czg.entity.notify.CzgRefundNotifyDTO;
|
||||
import com.czg.enums.ShopUserFlowBizEnum;
|
||||
import com.czg.order.dto.BigDecimalDTO;
|
||||
import com.czg.order.dto.CheckOrderPay;
|
||||
import com.czg.order.dto.OrderInfoAddDTO;
|
||||
import com.czg.order.dto.OrderInfoQueryDTO;
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.czg.order.dto.*;
|
||||
import com.czg.order.entity.CashierCart;
|
||||
import com.czg.order.entity.OrderDetail;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
@@ -751,4 +750,19 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
redisService.set(key, count, 24 * 60 * 60);
|
||||
return "#" + count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean printOrder(Long shopId, OrderInfoPrintDTO orderInfoPrintDTO) {
|
||||
OrderInfo orderInfo = getOne(new QueryWrapper().eq(OrderInfo::getShopId, shopId).eq(OrderInfo::getId, orderInfoPrintDTO.getId()));
|
||||
if (orderInfo == null) {
|
||||
throw new ApiNotPrintException("订单信息不存在");
|
||||
}
|
||||
|
||||
long count = count(new QueryWrapper().eq(PrintMachine::getShopId, shopId));
|
||||
if (count == 0) {
|
||||
throw new ApiNotPrintException("未配置打印机");
|
||||
}
|
||||
rabbitPublisher.sendOrderPrintMsg(orderInfo.getId().toString());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user