打印
This commit is contained in:
@@ -2,6 +2,7 @@ package com.czg.mq;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.config.RabbitConstants;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
@@ -99,15 +100,23 @@ public class PrintMqListener {
|
||||
Long shopId = jsonObject.getLong("shopId");
|
||||
String printTypeEnum = jsonObject.getString("printTypeEnum");
|
||||
JSONObject data2 = jsonObject.getJSONObject("data");
|
||||
JSONArray data3 = null;
|
||||
if (data2 == null) {
|
||||
data3 = jsonObject.getJSONArray("data");
|
||||
}
|
||||
PrinterHandler.PrintTypeEnum typeEnum = PrinterHandler.PrintTypeEnum.valueOf(printTypeEnum);
|
||||
if (typeEnum != PrinterHandler.PrintTypeEnum.HANDOVER) {
|
||||
SysPrintData sysPrintData = new SysPrintData();
|
||||
sysPrintData.setShopId(shopId);
|
||||
sysPrintData.setData(data2.toJSONString());
|
||||
if (data2 != null) {
|
||||
sysPrintData.setData(data2.toJSONString());
|
||||
} else {
|
||||
sysPrintData.setData(data3.toJSONString());
|
||||
}
|
||||
sysPrintData.setType(typeEnum.toString());
|
||||
printDataService.save(sysPrintData);
|
||||
rabbitPublisher.sendOtherPrintLocalMsg(shopId, printTypeEnum, sysPrintData.getId());
|
||||
}
|
||||
printConfig.otherHandler(shopId, data2, typeEnum);
|
||||
printConfig.otherHandler(shopId, data2, data3, typeEnum);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user