Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松 2024-12-06 18:30:31 +08:00
commit c1cbdba2e3
3 changed files with 94 additions and 102 deletions

View File

@ -169,13 +169,15 @@ public class PrintMechineConsumer {
List<OrderDetailPO.Detail> detailList = new ArrayList<>();
tbOrderDetails.parallelStream().forEach(it -> {
String categoryId = tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
log.info("获取当前类别是否未打印类别:{}", count);
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -188,7 +190,7 @@ public class PrintMechineConsumer {
BigDecimal subTotal = NumberUtil.mul(it.getNum(), unitPrice.subtract(NumberUtil.null2Zero(it.getDiscountSaleAmount())));
OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getProductName(), it.getNum().toString(), subTotal.toPlainString(), remark, it.getProGroupInfo());
detailList.add(detail);
}
});
String balance = "0";
@ -223,13 +225,15 @@ public class PrintMechineConsumer {
List<OrderDetailPO.Detail> detailList = new ArrayList<>();
tbOrderDetails.stream().forEach(it -> {
String categoryId = tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
log.info("获取当前类别是否未打印类别:{}", count);
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -489,14 +493,16 @@ public class PrintMechineConsumer {
if ("postPay".equals(orderInfo.getUseType()) && isPrint(it, orderInfo.getId())) {
return;
}
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
String categoryId = tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
log.info("获取当前类别是否未打印类别:{}", count);
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -535,9 +541,11 @@ public class PrintMechineConsumer {
c.getId().toString().equals(categoryId)
).count();
}
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
String remark = "";
if (it.getIsTemporary() == 0) {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
@ -582,14 +590,6 @@ public class PrintMechineConsumer {
if (ObjectUtil.isNotEmpty(tbOrderDetails) && tbOrderDetails.size() > 0) {
List<OrderDetailPO.Detail> detailList = new ArrayList<>();
tbOrderDetails.parallelStream().forEach(it -> {
String categoryId = tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
log.info("获取当前类别是否未打印类别:{}", count);
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -602,7 +602,6 @@ public class PrintMechineConsumer {
BigDecimal subTotal = NumberUtil.mul(it.getNum(), unitPrice.subtract(NumberUtil.null2Zero(it.getDiscountSaleAmount())));
OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getProductName(), it.getNum().toString(), subTotal.toPlainString(), remark, it.getProGroupInfo());
detailList.add(detail);
});
String balance = "0";
@ -647,13 +646,14 @@ public class PrintMechineConsumer {
} else {
categoryId = it.getCategoryId();
}
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -717,11 +717,14 @@ public class PrintMechineConsumer {
}
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -751,15 +754,15 @@ public class PrintMechineConsumer {
categoryId = it.getCategoryId();
}
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
log.info("获取当前类别是否未打印类别:{}", count);
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {

View File

@ -129,11 +129,11 @@ public abstract class PrinterHandler {
if (isTemporary == 1) {
count = 1;
}
if (machine.getClassifyPrint() != null && "1".equals(machine.getClassifyPrint()) && count == 0) {
log.warn("分类未添加菜品: {} : {}", item.getProductName(), sku.getSpecSnap());
return;
}
String classifyPrint = machine.getClassifyPrint();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if("1".equals(classifyPrint) && count == 0) {
}else{
String remark = StrUtil.isNotBlank(sku.getSpecSnap()) ? sku.getSpecSnap() : "";
item.setRemark(remark);
if (isReturn) {
@ -141,6 +141,7 @@ public abstract class PrinterHandler {
} else {
normalDishesPrint(orderInfo, item, machine);
}
}
});
}

View File

@ -186,6 +186,7 @@ public class CloudPrinterService {
it.setProductId(0);
it.setProductSkuId(0);
it.setProductName("【临】" + it.getProductName());
count = 1;
} else {
String categoryId = tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
count = categoryInfos.stream().filter(c ->
@ -193,8 +194,11 @@ public class CloudPrinterService {
).count();
}
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
String remark = "";
if (it.getIsTemporary() == 0) {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
@ -230,8 +234,11 @@ public class CloudPrinterService {
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -265,14 +272,6 @@ public class CloudPrinterService {
if (ObjectUtil.isNotEmpty(tbOrderDetails) && tbOrderDetails.size() > 0) {
List<OrderDetailPO.Detail> detailList = new ArrayList<>();
tbOrderDetails.parallelStream().forEach(it -> {
String categoryId = tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
log.info("获取当前类别是否未打印类别:{}", count);
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -285,7 +284,6 @@ public class CloudPrinterService {
BigDecimal subTotal = NumberUtil.mul(it.getNum(), unitPrice.subtract(NumberUtil.null2Zero(it.getDiscountSaleAmount())));
OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getProductName(), it.getNum().toString(), subTotal.toPlainString(), remark, it.getProGroupInfo());
detailList.add(detail);
});
String balance = "0";
@ -336,13 +334,14 @@ public class CloudPrinterService {
} else {
categoryId = it.getCategoryId();
}
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -412,14 +411,6 @@ public class CloudPrinterService {
if (ObjectUtil.isNotEmpty(tbOrderDetails) && tbOrderDetails.size() > 0) {
List<OrderDetailPO.Detail> detailList = new ArrayList<>();
tbOrderDetails.parallelStream().forEach(it -> {
String categoryId = tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
log.info("获取当前类别是否未打印类别:{}", count);
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -432,7 +423,6 @@ public class CloudPrinterService {
BigDecimal subTotal = NumberUtil.mul(it.getNum(), unitPrice.subtract(NumberUtil.null2Zero(it.getDiscountSaleAmount())));
OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getProductName(), it.getNum().toString(), subTotal.toPlainString(), remark, it.getProGroupInfo());
detailList.add(detail);
});
String balance = "0";
@ -477,12 +467,6 @@ public class CloudPrinterService {
categoryId = it.getCategoryId();
}
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
if (count > 0) {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -495,7 +479,6 @@ public class CloudPrinterService {
BigDecimal subTotal = NumberUtil.mul(it.getNumber(), unitPrice.subtract(NumberUtil.null2Zero(it.getDiscountSaleAmount())));
OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getName(), it.getNumber().toString(), subTotal.toPlainString(), remark, it.getProGroupInfo());
detailList.add(detail);
}
});
@ -559,8 +542,11 @@ public class CloudPrinterService {
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(categoryId)
).count();
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -589,11 +575,14 @@ public class CloudPrinterService {
List<TbCashierCart> cashierCarts = tbCashierCartMapper.selectByOrderId(orderInfo.getId().toString(), "closed");
if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) {
cashierCarts.parallelStream().forEach(it -> {
String classifyPrint = tbPrintMachineWithBLOBs.getClassifyPrint();
Long count = categoryInfos.stream().filter(c ->
c.getId().toString().equals(it.getCategoryId().toString())
).count();
// 如果是部分打印并且所属分类不在设置的列表中则不打印
if ("1".equals(classifyPrint) && count == 0) {
if (count > 0) {
} else {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId()));
String remark = "";
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
@ -604,7 +593,6 @@ public class CloudPrinterService {
for (int i = 0; i < it.getNumber().intValue(); i++) {
FeieyunPrintUtil.printLabelMsg(tbPrintMachineWithBLOBs.getAddress(), orderInfo.getOrderType().equals("miniapp") ? orderInfo.getTableName() : orderInfo.getMasterId(), it.getName(), 1, DateUtils.getTimes(new Date(orderInfo.getCreatedAt())), it.getSalePrice().toPlainString(), remark);
}
}
});
}