消息数据转换
This commit is contained in:
@@ -176,7 +176,7 @@ public class PrintConfig implements ApplicationRunner {
|
||||
* @param data 传递的数据
|
||||
* @param printTypeEnum IN_STOCK DAY_REPORT PRODUCT_REPORT RECHARGE STOCK_CHECK
|
||||
*/
|
||||
public void otherHandler(Long shopId, Object data, PrinterHandler.PrintTypeEnum printTypeEnum) {
|
||||
public void otherHandler(Long shopId, JSONObject data, PrinterHandler.PrintTypeEnum printTypeEnum) {
|
||||
if (shopId == null || Objects.isNull(data)) {
|
||||
log.info("otherHandler 打印数据为空, shopId: {}, data: {}", shopId, data);
|
||||
return;
|
||||
@@ -186,38 +186,38 @@ public class PrintConfig implements ApplicationRunner {
|
||||
case PrinterHandler.PrintTypeEnum.STOCK:
|
||||
getPrintMachine(shopId, printTypeEnum)
|
||||
.forEach(machine -> getPrinter(machine.getBrand())
|
||||
.stockPrint(machine, shopInfo.getShopName(), (StockPrintDTO) data));
|
||||
.stockPrint(machine, shopInfo.getShopName(), JSONObject.parseObject(data.toJSONString(), StockPrintDTO.class)));
|
||||
break;
|
||||
case PrinterHandler.PrintTypeEnum.DAY_REPORT:
|
||||
getPrintMachine(shopId, printTypeEnum)
|
||||
.forEach(machine -> getPrinter(machine.getBrand())
|
||||
.dayReportPrint(machine, shopInfo.getShopName(), (DayReportPrintDTO) data));
|
||||
.dayReportPrint(machine, shopInfo.getShopName(), JSONObject.parseObject(data.toJSONString(), DayReportPrintDTO.class)));
|
||||
break;
|
||||
case PrinterHandler.PrintTypeEnum.PRODUCT_REPORT:
|
||||
getPrintMachine(shopId, printTypeEnum)
|
||||
.forEach(machine -> getPrinter(machine.getBrand())
|
||||
.productReportPrint(machine, shopInfo.getShopName(), (ProductReportPrintDTO) data));
|
||||
.productReportPrint(machine, shopInfo.getShopName(), JSONObject.parseObject(data.toJSONString(), ProductReportPrintDTO.class)));
|
||||
break;
|
||||
case PrinterHandler.PrintTypeEnum.RECHARGE:
|
||||
getPrintMachine(shopId, printTypeEnum)
|
||||
.forEach(machine -> getPrinter(machine.getBrand())
|
||||
.rechargePrint(machine, shopInfo.getShopName(), (RechargePrintDTO) data));
|
||||
.rechargePrint(machine, shopInfo.getShopName(), JSONObject.parseObject(data.toJSONString(), RechargePrintDTO.class)));
|
||||
break;
|
||||
case PrinterHandler.PrintTypeEnum.STOCK_CHECK:
|
||||
getPrintMachine(shopId, printTypeEnum)
|
||||
.forEach(machine -> getPrinter(machine.getBrand())
|
||||
.stockCheckPrint(machine, shopInfo.getShopName(), (StockCheckPrintDTO) data));
|
||||
.stockCheckPrint(machine, shopInfo.getShopName(), JSONObject.parseObject(data.toJSONString(), StockCheckPrintDTO.class)));
|
||||
break;
|
||||
case PrinterHandler.PrintTypeEnum.HANDOVER:
|
||||
log.info("准备开始打印交班");
|
||||
getPrintMachine(shopId, printTypeEnum)
|
||||
.forEach(machine -> getPrinter(machine.getBrand()).handoverPrint(machine, shopInfo.getShopName(), (HandoverRecordDTO) data));
|
||||
.forEach(machine -> getPrinter(machine.getBrand()).handoverPrint(machine, shopInfo.getShopName(), JSONObject.parseObject(data.toJSONString(), HandoverRecordDTO.class)));
|
||||
break;
|
||||
case PrinterHandler.PrintTypeEnum.CALL:
|
||||
log.info("准备开始打印叫号单");
|
||||
getPrintMachine(shopId, printTypeEnum)
|
||||
.forEach(machine -> getPrinter(machine.getBrand())
|
||||
.callNumPrintBefore(machine, shopInfo.getShopName(), (CallQueue) data));
|
||||
.callNumPrintBefore(machine, shopInfo.getShopName(), JSONObject.parseObject(data.toJSONString(), CallQueue.class)));
|
||||
break;
|
||||
default:
|
||||
throw new CzgException("otherHandler 未知打印类型");
|
||||
|
||||
Reference in New Issue
Block a user