等叫菜小票打印

This commit is contained in:
谭凯凯
2024-12-02 09:59:26 +08:00
committed by Tankaikai
parent f9d873461f
commit 9b817bf27d
5 changed files with 27 additions and 3 deletions

View File

@@ -53,6 +53,7 @@ public class TbOrderDetail implements Serializable {
private Integer isMember; private Integer isMember;
private Integer isTemporary; private Integer isTemporary;
private Integer isThirdCoupon; private Integer isThirdCoupon;
private Integer isWaitCall;
private Integer userCouponId; private Integer userCouponId;
private String useCouponInfo; private String useCouponInfo;
private BigDecimal canReturnAmount; private BigDecimal canReturnAmount;

View File

@@ -288,6 +288,10 @@ public class PrintMechineConsumer {
tbOrderDetails.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(it -> { tbOrderDetails.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(it -> {
log.info("开始打印一菜一品票据,:{}", it.getProductName()); log.info("开始打印一菜一品票据,:{}", it.getProductName());
long count; long count;
Integer isWaitCall = ObjectUtil.defaultIfNull(it.getIsWaitCall(), 0);
if(isWaitCall == 1) {
it.setProductName("【等叫】" + it.getProductName());
}
if (it.getIsTemporary() == 1) { if (it.getIsTemporary() == 1) {
it.setProductId(0); it.setProductId(0);
it.setProductSkuId(0); it.setProductSkuId(0);
@@ -505,6 +509,10 @@ public class PrintMechineConsumer {
if (ObjectUtil.isNotEmpty(details) && details.size() > 0) { if (ObjectUtil.isNotEmpty(details) && details.size() > 0) {
details.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(it -> { details.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(it -> {
long count = 0; long count = 0;
Integer isWaitCall = ObjectUtil.defaultIfNull(it.getIsWaitCall(), 0);
if(isWaitCall == 1) {
it.setProductName("【等叫】" + it.getProductName());
}
if (it.getIsTemporary() == 1) { if (it.getIsTemporary() == 1) {
it.setProductId(0); it.setProductId(0);
it.setProductSkuId(0); it.setProductSkuId(0);

View File

@@ -85,12 +85,18 @@ public abstract class PrinterHandler {
private void onlyKitchen(TbPrintMachine machine, TbOrderInfo orderInfo, List<TbOrderDetail> tbOrderDetailList, List<CategoryInfo> categoryInfos, boolean isReturn) { private void onlyKitchen(TbPrintMachine machine, TbOrderInfo orderInfo, List<TbOrderDetail> tbOrderDetailList, List<CategoryInfo> categoryInfos, boolean isReturn) {
tbOrderDetailList.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(item -> { tbOrderDetailList.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(item -> {
log.info("开始打印退单菜品,商品名:{}", item.getProductName()); log.info("开始打印退单菜品,商品名:{}", item.getProductName());
Integer isWaitCall = ObjectUtil.defaultIfNull(item.getIsWaitCall(), 0);
if (isWaitCall == 1) {
if (!item.getProductName().startsWith("【等叫】")) {
item.setProductName("【等叫】" + item.getProductName());
}
}
Integer isTemporary = ObjectUtil.defaultIfNull(item.getIsTemporary(), 0); Integer isTemporary = ObjectUtil.defaultIfNull(item.getIsTemporary(), 0);
String categoryId = "0"; String categoryId = "0";
if (isTemporary == 1) { if (isTemporary == 1) {
item.setProductId(0); item.setProductId(0);
item.setProductSkuId(0); item.setProductSkuId(0);
if(!item.getProductName().startsWith("【临】")){ if (!item.getProductName().startsWith("【临】")) {
item.setProductName("【临】" + item.getProductName()); item.setProductName("【临】" + item.getProductName());
} }
} }
@@ -108,7 +114,7 @@ public abstract class PrinterHandler {
if (isTemporary == 0 && sku == null) { if (isTemporary == 0 && sku == null) {
log.error("商品不存在, id: {}", item.getProductSkuId()); log.error("商品不存在, id: {}", item.getProductSkuId());
return; return;
} else if(isTemporary == 1){ } else if (isTemporary == 1) {
sku = new TbProductSkuWithBLOBs(); sku = new TbProductSkuWithBLOBs();
} }
if (StrUtil.isEmpty(machine.getClassifyPrint())) { if (StrUtil.isEmpty(machine.getClassifyPrint())) {
@@ -155,6 +161,10 @@ public abstract class PrinterHandler {
remark = tbProductSkuWithBLOBs.getSpecSnap(); remark = tbProductSkuWithBLOBs.getSpecSnap();
} }
} }
Integer isWaitCall = ObjectUtil.defaultIfNull(it.getIsWaitCall(), 0);
if (isWaitCall == 1) {
it.setProductName("【等叫】" + it.getProductName());
}
if (isTemporary == 1) { if (isTemporary == 1) {
it.setProductName("【临】" + it.getProductName()); it.setProductName("【临】" + it.getProductName());
} }

View File

@@ -177,6 +177,10 @@ public class CloudPrinterService {
if (ObjectUtil.isNotEmpty(details) && details.size() > 0) { if (ObjectUtil.isNotEmpty(details) && details.size() > 0) {
details.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(it -> { details.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(it -> {
long count = 0; long count = 0;
Integer isWaitCall = ObjectUtil.defaultIfNull(it.getIsWaitCall(), 0);
if(isWaitCall == 1) {
it.setProductName("【等叫】" + it.getProductName());
}
if (it.getIsTemporary() == 1) { if (it.getIsTemporary() == 1) {
it.setProductId(0); it.setProductId(0);
it.setProductSkuId(0); it.setProductSkuId(0);

View File

@@ -19,10 +19,11 @@
<result column="price_amount" jdbcType="DECIMAL" property="priceAmount"/> <result column="price_amount" jdbcType="DECIMAL" property="priceAmount"/>
<result column="pack_amount" jdbcType="DECIMAL" property="packAmount"/> <result column="pack_amount" jdbcType="DECIMAL" property="packAmount"/>
<result column="is_temporary" jdbcType="INTEGER" property="isTemporary"/> <result column="is_temporary" jdbcType="INTEGER" property="isTemporary"/>
<result column="is_wait_call" jdbcType="INTEGER" property="isWaitCall"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, order_id, shop_id, product_id, product_sku_id, num, product_name, product_sku_name, id, order_id, shop_id, product_id, product_sku_id, num, product_name, product_sku_name,
product_img, create_time, update_time, price, price_amount,status,pack_amount,return_num,is_temporary product_img, create_time, update_time, price, price_amount,status,pack_amount,return_num,is_temporary,is_wait_call
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select