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,26 +169,28 @@ 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())) {
remark = tbProductSkuWithBLOBs.getSpecSnap();
}
BigDecimal unitPrice = it.getPrice();
if(it.getIsMember() == 1){
if (it.getIsMember() == 1) {
unitPrice = it.getMemberPrice();
}
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,20 +225,22 @@ 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())) {
remark = tbProductSkuWithBLOBs.getSpecSnap();
}
BigDecimal unitPrice = it.getPrice();
if(it.getIsMember() == 1){
if (it.getIsMember() == 1) {
unitPrice = it.getMemberPrice();
}
BigDecimal subTotal = NumberUtil.mul(it.getNum(), unitPrice.subtract(NumberUtil.null2Zero(it.getDiscountSaleAmount())));
@ -301,7 +305,7 @@ public class PrintMechineConsumer {
log.info("开始打印一菜一品票据,:{}", it.getProductName());
long count;
Integer isWaitCall = ObjectUtil.defaultIfNull(it.getIsWaitCall(), 0);
if(isWaitCall == 1) {
if (isWaitCall == 1) {
it.setProductName("【等叫】" + it.getProductName());
}
if (it.getIsTemporary() == 1) {
@ -344,7 +348,7 @@ public class PrintMechineConsumer {
log.info("已打印数量, {}, 未打印数量: {}", info, printerNum);
String remark = "";
if(it.getIsTemporary() == 0) {
if (it.getIsTemporary() == 0) {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(it.getProductSkuId());
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
remark = 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())) {
@ -522,22 +528,24 @@ public class PrintMechineConsumer {
details.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(it -> {
long count = 0;
Integer isWaitCall = ObjectUtil.defaultIfNull(it.getIsWaitCall(), 0);
if(isWaitCall == 1) {
if (isWaitCall == 1) {
it.setProductName("【等叫】" + it.getProductName());
}
if (it.getIsTemporary() == 1) {
it.setProductId(0);
it.setProductSkuId(0);
it.setProductName("【临】" + it.getProductName());
}else{
} else {
String categoryId = tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
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 {
String remark = "";
if (it.getIsTemporary() == 0) {
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getProductSkuId()));
@ -582,27 +590,18 @@ 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())) {
remark = tbProductSkuWithBLOBs.getSpecSnap();
}
BigDecimal unitPrice = it.getPrice();
if(it.getIsMember() == 1){
if (it.getIsMember() == 1) {
unitPrice = it.getMemberPrice();
}
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,20 +646,21 @@ 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())) {
remark = tbProductSkuWithBLOBs.getSpecSnap();
}
BigDecimal unitPrice = it.getSalePrice();
if(it.getIsMember() == 1){
if (it.getIsMember() == 1) {
unitPrice = it.getMemberPrice();
}
BigDecimal subTotal = NumberUtil.mul(it.getNumber(), unitPrice.subtract(NumberUtil.null2Zero(it.getDiscountSaleAmount())));
@ -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

@ -179,13 +179,14 @@ public class CloudPrinterService {
details.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(it -> {
long count = 0;
Integer isWaitCall = ObjectUtil.defaultIfNull(it.getIsWaitCall(), 0);
if(isWaitCall == 1) {
if (isWaitCall == 1) {
it.setProductName("【等叫】" + it.getProductName());
}
if (it.getIsTemporary() == 1) {
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,27 +272,18 @@ 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())) {
remark = tbProductSkuWithBLOBs.getSpecSnap();
}
BigDecimal unitPrice = it.getPrice();
if(it.getIsMember() == 1){
if (it.getIsMember() == 1) {
unitPrice = it.getMemberPrice();
}
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,20 +334,21 @@ 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())) {
remark = tbProductSkuWithBLOBs.getSpecSnap();
}
BigDecimal unitPrice = it.getSalePrice();
if(it.getIsMember() == 1){
if (it.getIsMember() == 1) {
unitPrice = it.getMemberPrice();
}
BigDecimal subTotal = NumberUtil.mul(it.getNumber(), unitPrice.subtract(NumberUtil.null2Zero(it.getDiscountSaleAmount())));
@ -412,27 +411,18 @@ 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())) {
remark = tbProductSkuWithBLOBs.getSpecSnap();
}
BigDecimal unitPrice = it.getPrice();
if(it.getIsMember() == 1){
if (it.getIsMember() == 1) {
unitPrice = it.getMemberPrice();
}
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,25 +467,18 @@ 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())) {
remark = tbProductSkuWithBLOBs.getSpecSnap();
}
BigDecimal unitPrice = it.getSalePrice();
if(it.getIsMember() == 1){
if (it.getIsMember() == 1) {
unitPrice = it.getMemberPrice();
}
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);
}
}
});
}