额外打印 店铺名称
This commit is contained in:
@@ -11,6 +11,7 @@ import com.czg.order.entity.OrderInfo;
|
|||||||
import com.czg.print.*;
|
import com.czg.print.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
@@ -29,6 +30,7 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Qualifier("feiPrinter")
|
||||||
public class FeiPrinter extends PrinterHandler implements PrinterImpl {
|
public class FeiPrinter extends PrinterHandler implements PrinterImpl {
|
||||||
|
|
||||||
// API 地址
|
// API 地址
|
||||||
@@ -143,7 +145,7 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void stockPrint(PrintMachine machine, StockPrintDTO record) {
|
protected void stockPrint(PrintMachine machine, String shopName, StockPrintDTO record) {
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
String data = buildStockData(record);
|
String data = buildStockData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
@@ -151,7 +153,8 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dayReportPrint(PrintMachine machine, DayReportPrintDTO record) {
|
protected void dayReportPrint(PrintMachine machine, String shopName, DayReportPrintDTO record) {
|
||||||
|
record.setShopName(shopName);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
String data = buildDayReportData(record);
|
String data = buildDayReportData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
@@ -159,7 +162,8 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void productReportPrint(PrintMachine machine, ProductReportPrintDTO record) {
|
protected void productReportPrint(PrintMachine machine, String shopName, ProductReportPrintDTO record) {
|
||||||
|
record.setShopName(shopName);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
String data = buildProductReportData(record);
|
String data = buildProductReportData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
@@ -167,7 +171,8 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void rechargePrint(PrintMachine machine, RechargePrintDTO record) {
|
protected void rechargePrint(PrintMachine machine, String shopName, RechargePrintDTO record) {
|
||||||
|
record.setShopName(shopName);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
String data = buildRechargeData(record);
|
String data = buildRechargeData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
@@ -175,7 +180,8 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void stockCheckPrint(PrintMachine machine, StockCheckPrintDTO record) {
|
protected void stockCheckPrint(PrintMachine machine, String shopName, StockCheckPrintDTO record) {
|
||||||
|
record.setShopName(shopName);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
String data = buildStockCheckData(record);
|
String data = buildStockCheckData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
@@ -183,7 +189,8 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handoverPrint(PrintMachine machine, HandoverRecordDTO record) {
|
protected void handoverPrint(PrintMachine machine, String shopName, HandoverRecordDTO record) {
|
||||||
|
record.setShopName(shopName);
|
||||||
String string = buildHandoverData(record);
|
String string = buildHandoverData(record);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
sendPrintRequest(machine.getAddress(), string, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
sendPrintRequest(machine.getAddress(), string, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
|
|||||||
@@ -9,23 +9,21 @@ import com.czg.account.dto.HandoverRecordDTO;
|
|||||||
import com.czg.account.dto.PrintOrderDetailDTO;
|
import com.czg.account.dto.PrintOrderDetailDTO;
|
||||||
import com.czg.account.entity.*;
|
import com.czg.account.entity.*;
|
||||||
import com.czg.account.service.*;
|
import com.czg.account.service.*;
|
||||||
import com.czg.exception.CzgException;
|
|
||||||
import com.czg.print.*;
|
|
||||||
import com.czg.config.RedisCst;
|
import com.czg.config.RedisCst;
|
||||||
import com.czg.constants.ParamCodeCst;
|
import com.czg.constants.ParamCodeCst;
|
||||||
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.market.service.OrderInfoService;
|
import com.czg.market.service.OrderInfoService;
|
||||||
import com.czg.order.entity.OrderDetail;
|
import com.czg.order.entity.OrderDetail;
|
||||||
import com.czg.order.entity.OrderInfo;
|
import com.czg.order.entity.OrderInfo;
|
||||||
import com.czg.order.service.OrderDetailService;
|
import com.czg.order.service.OrderDetailService;
|
||||||
import com.czg.order.service.PrintMachineLogService;
|
import com.czg.order.service.PrintMachineLogService;
|
||||||
|
import com.czg.print.*;
|
||||||
import com.czg.product.entity.ProdSku;
|
import com.czg.product.entity.ProdSku;
|
||||||
import com.czg.product.entity.Product;
|
import com.czg.product.entity.Product;
|
||||||
import com.czg.product.service.ProdSkuService;
|
import com.czg.product.service.ProdSkuService;
|
||||||
import com.czg.product.service.ProductService;
|
import com.czg.product.service.ProductService;
|
||||||
import com.czg.resp.CzgResult;
|
|
||||||
import com.czg.service.RedisService;
|
import com.czg.service.RedisService;
|
||||||
import com.czg.service.order.enums.OrderStatusEnums;
|
import com.czg.service.order.enums.OrderStatusEnums;
|
||||||
import com.czg.system.dto.SysParamsDTO;
|
|
||||||
import com.czg.system.service.SysParamsService;
|
import com.czg.system.service.SysParamsService;
|
||||||
import com.czg.utils.FunUtils;
|
import com.czg.utils.FunUtils;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
@@ -211,36 +209,37 @@ public abstract class PrinterHandler {
|
|||||||
log.info("otherHandler 打印数据为空, shopId: {}, data: {}", shopId, data);
|
log.info("otherHandler 打印数据为空, shopId: {}, data: {}", shopId, data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ShopInfo shopInfo = shopInfoService.getById(shopId);
|
||||||
switch (printTypeEnum) {
|
switch (printTypeEnum) {
|
||||||
case PrintTypeEnum.STOCK:
|
case PrintTypeEnum.STOCK:
|
||||||
getPrintMachine(shopId, printTypeEnum)
|
getPrintMachine(shopId, printTypeEnum)
|
||||||
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).stockPrint(machine, (StockPrintDTO) data));
|
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).stockPrint(machine, shopInfo.getShopName(), (StockPrintDTO) data));
|
||||||
break;
|
break;
|
||||||
case PrintTypeEnum.DAY_REPORT:
|
case PrintTypeEnum.DAY_REPORT:
|
||||||
getPrintMachine(shopId, printTypeEnum)
|
getPrintMachine(shopId, printTypeEnum)
|
||||||
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).dayReportPrint(machine, (DayReportPrintDTO) data));
|
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).dayReportPrint(machine, shopInfo.getShopName(), (DayReportPrintDTO) data));
|
||||||
break;
|
break;
|
||||||
case PrintTypeEnum.PRODUCT_REPORT:
|
case PrintTypeEnum.PRODUCT_REPORT:
|
||||||
getPrintMachine(shopId, printTypeEnum)
|
getPrintMachine(shopId, printTypeEnum)
|
||||||
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).productReportPrint(machine, (ProductReportPrintDTO) data));
|
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).productReportPrint(machine, shopInfo.getShopName(), (ProductReportPrintDTO) data));
|
||||||
break;
|
break;
|
||||||
case PrintTypeEnum.RECHARGE:
|
case PrintTypeEnum.RECHARGE:
|
||||||
getPrintMachine(shopId, printTypeEnum)
|
getPrintMachine(shopId, printTypeEnum)
|
||||||
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).rechargePrint(machine, (RechargePrintDTO) data));
|
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).rechargePrint(machine, shopInfo.getShopName(), (RechargePrintDTO) data));
|
||||||
break;
|
break;
|
||||||
case PrintTypeEnum.STOCK_CHECK:
|
case PrintTypeEnum.STOCK_CHECK:
|
||||||
getPrintMachine(shopId, printTypeEnum)
|
getPrintMachine(shopId, printTypeEnum)
|
||||||
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).stockCheckPrint(machine, (StockCheckPrintDTO) data));
|
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).stockCheckPrint(machine, shopInfo.getShopName(), (StockCheckPrintDTO) data));
|
||||||
break;
|
break;
|
||||||
case PrintTypeEnum.HANDOVER:
|
case PrintTypeEnum.HANDOVER:
|
||||||
log.info("准备开始打印交班");
|
log.info("准备开始打印交班");
|
||||||
getPrintMachine(shopId, printTypeEnum)
|
getPrintMachine(shopId, printTypeEnum)
|
||||||
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).handoverPrint(machine, (HandoverRecordDTO) data));
|
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).handoverPrint(machine, shopInfo.getShopName(), (HandoverRecordDTO) data));
|
||||||
break;
|
break;
|
||||||
case PrintTypeEnum.CALL:
|
case PrintTypeEnum.CALL:
|
||||||
log.info("准备开始打印叫号单");
|
log.info("准备开始打印叫号单");
|
||||||
getPrintMachine(shopId, printTypeEnum)
|
getPrintMachine(shopId, printTypeEnum)
|
||||||
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).callNumPrintBefore(machine, (CallQueue) data));
|
.forEach(machine -> printConfig.getPrinter(machine.getBrand()).callNumPrintBefore(machine, shopInfo.getShopName(), (CallQueue) data));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new CzgException("otherHandler 未知打印类型");
|
throw new CzgException("otherHandler 未知打印类型");
|
||||||
@@ -339,11 +338,11 @@ public abstract class PrinterHandler {
|
|||||||
}
|
}
|
||||||
List<Long> productIds = tbOrderDetailList.stream().map(OrderDetail::getProductId).collect(Collectors.toList());
|
List<Long> productIds = tbOrderDetailList.stream().map(OrderDetail::getProductId).collect(Collectors.toList());
|
||||||
canPrintProSet = productService.list(new QueryWrapper()
|
canPrintProSet = productService.list(new QueryWrapper()
|
||||||
.in(Product::getCategoryId, categoryIds)
|
.in(Product::getCategoryId, categoryIds)
|
||||||
.in(Product::getId, productIds))
|
.in(Product::getId, productIds))
|
||||||
.stream()
|
.stream()
|
||||||
.map(Product::getId)
|
.map(Product::getId)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
ArrayList<OrderDetail> orderDetails = new ArrayList<>();
|
ArrayList<OrderDetail> orderDetails = new ArrayList<>();
|
||||||
for (OrderDetail item : tbOrderDetailList) {
|
for (OrderDetail item : tbOrderDetailList) {
|
||||||
@@ -465,26 +464,20 @@ public abstract class PrinterHandler {
|
|||||||
/**
|
/**
|
||||||
* 打印排队小票
|
* 打印排队小票
|
||||||
*/
|
*/
|
||||||
private void callNumPrintBefore(PrintMachine machine, CallQueue queue) {
|
private void callNumPrintBefore(PrintMachine machine, String shopName, CallQueue queue) {
|
||||||
if (queue == null) {
|
if (queue == null) {
|
||||||
log.warn("叫号记录不存在");
|
log.warn("叫号记录不存在");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
String callUrl = sysParamsService.getSysParamValue(ParamCodeCst.System.CALL_PAGE_URL);
|
||||||
CzgResult<SysParamsDTO> paramsByCode = sysParamsService.getParamsByCode(ParamCodeCst.System.CALL_PAGE_URL);
|
|
||||||
SysParamsDTO params = paramsByCode.getData();
|
|
||||||
String callUrl = null;
|
|
||||||
if (params != null && StrUtil.isNotBlank(params.getParamValue())) {
|
|
||||||
callUrl = params.getParamValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
CallTable tbCallTable = callTableService.getById(queue.getCallTableId());
|
CallTable tbCallTable = callTableService.getById(queue.getCallTableId());
|
||||||
ShopInfo shopInfo = shopInfoService.getById(queue.getShopId());
|
long count = callQueueService.count(new QueryWrapper()
|
||||||
callNumPrint(machine, queue.getCallNum(), shopInfo.getShopName(), tbCallTable.getName(), tbCallTable.getNote(), String.valueOf(callQueueService.count(new QueryWrapper()
|
.eq(CallQueue::getShopId, queue.getShopId())
|
||||||
.eq(CallQueue::getShopId, queue.getShopId())
|
.eq(CallQueue::getCallTableId, queue.getCallTableId())
|
||||||
.eq(CallQueue::getCallTableId, queue.getCallTableId())
|
.lt(CallQueue::getId, queue.getId())
|
||||||
.lt(CallQueue::getId, queue.getId())
|
.in(CallQueue::getState, 0, 1));
|
||||||
.in(CallQueue::getState, 0, 1))), callUrl == null ? "未配置页面" : StrUtil.format(callUrl, queue.getShopId(), queue.getId()), queue.getCreateTime(),
|
callNumPrint(machine, queue.getCallNum(), shopName, tbCallTable.getName(), tbCallTable.getNote(), String.valueOf(count),
|
||||||
|
StrUtil.isEmpty(callUrl) ? "未配置页面" : StrUtil.format(callUrl, queue.getShopId(), queue.getId()), queue.getCreateTime(),
|
||||||
StrUtil.format("过号顺延{}桌 {}桌后需重新排号 谢谢理解!", tbCallTable.getPostponeNum(), tbCallTable.getPostponeNum()));
|
StrUtil.format("过号顺延{}桌 {}桌后需重新排号 谢谢理解!", tbCallTable.getPostponeNum(), tbCallTable.getPostponeNum()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -621,33 +614,33 @@ public abstract class PrinterHandler {
|
|||||||
/**
|
/**
|
||||||
* 出入库打印单
|
* 出入库打印单
|
||||||
*/
|
*/
|
||||||
protected abstract void stockPrint(PrintMachine machine, StockPrintDTO record);
|
protected abstract void stockPrint(PrintMachine machine, String shopName, StockPrintDTO record);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 经营日报打印
|
* 经营日报打印
|
||||||
*/
|
*/
|
||||||
protected abstract void dayReportPrint(PrintMachine machine, DayReportPrintDTO record);
|
protected abstract void dayReportPrint(PrintMachine machine, String shopName, DayReportPrintDTO record);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品报表打印
|
* 商品报表打印
|
||||||
*/
|
*/
|
||||||
protected abstract void productReportPrint(PrintMachine machine, ProductReportPrintDTO record);
|
protected abstract void productReportPrint(PrintMachine machine, String shopName, ProductReportPrintDTO record);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 储值单打印
|
* 储值单打印
|
||||||
*/
|
*/
|
||||||
protected abstract void rechargePrint(PrintMachine machine, RechargePrintDTO record);
|
protected abstract void rechargePrint(PrintMachine machine, String shopName, RechargePrintDTO record);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存盘点打印
|
* 库存盘点打印
|
||||||
*/
|
*/
|
||||||
protected abstract void stockCheckPrint(PrintMachine machine, StockCheckPrintDTO record);
|
protected abstract void stockCheckPrint(PrintMachine machine, String shopName, StockCheckPrintDTO record);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 交班打印
|
* 交班打印
|
||||||
*/
|
*/
|
||||||
protected abstract void handoverPrint(PrintMachine machine, HandoverRecordDTO record);
|
protected abstract void handoverPrint(PrintMachine machine, String shopName, HandoverRecordDTO record);
|
||||||
|
|
||||||
|
|
||||||
private OrderPrintDTO getPrintInfoDTO(OrderInfo orderInfo, String printTitle) {
|
private OrderPrintDTO getPrintInfoDTO(OrderInfo orderInfo, String printTitle) {
|
||||||
|
|||||||
@@ -799,7 +799,7 @@ public interface PrinterImpl {
|
|||||||
* @param callNum 号码
|
* @param callNum 号码
|
||||||
* @param preNum 前面还有几桌
|
* @param preNum 前面还有几桌
|
||||||
* @param codeUrl 二维码地址
|
* @param codeUrl 二维码地址
|
||||||
* @param shopNote 店铺备注
|
* @param shopNote 店铺备注 过号顺延{}桌 {}桌后需重新排号 谢谢理解!
|
||||||
* @param takeTime 取号时间
|
* @param takeTime 取号时间
|
||||||
* @return 元数据
|
* @return 元数据
|
||||||
*/
|
*/
|
||||||
@@ -817,7 +817,7 @@ public interface PrinterImpl {
|
|||||||
getFormatLabel(codeUrl, signLabelInfo.center, signLabelInfo.qr) +
|
getFormatLabel(codeUrl, signLabelInfo.center, signLabelInfo.qr) +
|
||||||
signLabelInfo.br +
|
signLabelInfo.br +
|
||||||
"--------------------------------" + signLabelInfo.br +
|
"--------------------------------" + signLabelInfo.br +
|
||||||
getFormatLabel("听到叫号请到前台,过号可顺延1桌", signLabelInfo.s) +
|
getFormatLabel(shopNote, signLabelInfo.s) +
|
||||||
getFormatLabel(StrUtil.format("取号时间: {}", DateUtil.format(takeTime, "yyyy-MM-dd HH:mm:ss")), signLabelInfo.s) +
|
getFormatLabel(StrUtil.format("取号时间: {}", DateUtil.format(takeTime, "yyyy-MM-dd HH:mm:ss")), signLabelInfo.s) +
|
||||||
signLabelInfo.br +
|
signLabelInfo.br +
|
||||||
signLabelInfo.cut;
|
signLabelInfo.cut;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.czg.order.entity.OrderDetail;
|
|||||||
import com.czg.order.entity.OrderInfo;
|
import com.czg.order.entity.OrderInfo;
|
||||||
import com.czg.print.*;
|
import com.czg.print.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
@@ -26,6 +27,7 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
|
@Qualifier("yxyPrinter")
|
||||||
public class YxyPrinter extends PrinterHandler implements PrinterImpl {
|
public class YxyPrinter extends PrinterHandler implements PrinterImpl {
|
||||||
|
|
||||||
//请求地址
|
//请求地址
|
||||||
@@ -141,7 +143,8 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void stockPrint(PrintMachine machine, StockPrintDTO record) {
|
protected void stockPrint(PrintMachine machine, String shopName, StockPrintDTO record) {
|
||||||
|
record.setShopName(shopName);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
String data = buildStockData(record);
|
String data = buildStockData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
@@ -149,7 +152,8 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dayReportPrint(PrintMachine machine, DayReportPrintDTO record) {
|
protected void dayReportPrint(PrintMachine machine, String shopName, DayReportPrintDTO record) {
|
||||||
|
record.setShopName(shopName);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
String data = buildDayReportData(record);
|
String data = buildDayReportData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
@@ -157,7 +161,8 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void productReportPrint(PrintMachine machine, ProductReportPrintDTO record) {
|
protected void productReportPrint(PrintMachine machine, String shopName, ProductReportPrintDTO record) {
|
||||||
|
record.setShopName(shopName);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
String data = buildProductReportData(record);
|
String data = buildProductReportData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
@@ -165,16 +170,18 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void rechargePrint(PrintMachine machine, RechargePrintDTO record) {
|
protected void rechargePrint(PrintMachine machine, String shopName, RechargePrintDTO record) {
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
|
record.setShopName(shopName);
|
||||||
String data = buildRechargeData(record);
|
String data = buildRechargeData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
printMachineLogService.save(machine, "储值单", data, resp);
|
printMachineLogService.save(machine, "储值单", data, resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void stockCheckPrint(PrintMachine machine, StockCheckPrintDTO record) {
|
protected void stockCheckPrint(PrintMachine machine, String shopName, StockCheckPrintDTO record) {
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
|
record.setShopName(shopName);
|
||||||
String data = buildStockCheckData(record);
|
String data = buildStockCheckData(record);
|
||||||
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
String resp = sendPrintRequest(machine.getAddress(), data, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
printMachineLogService.save(machine, "盘点单", data, resp);
|
printMachineLogService.save(machine, "盘点单", data, resp);
|
||||||
@@ -185,7 +192,7 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
* 交班单打印
|
* 交班单打印
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void handoverPrint(PrintMachine machine, HandoverRecordDTO record) {
|
protected void handoverPrint(PrintMachine machine, String shopName, HandoverRecordDTO record) {
|
||||||
String string = buildHandoverData(record);
|
String string = buildHandoverData(record);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
|
||||||
sendPrintRequest(machine.getAddress(), string, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
sendPrintRequest(machine.getAddress(), string, voiceJson, machine.getPrintNum() == null ? "1" : machine.getPrintNum().toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user