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

This commit is contained in:
2024-10-12 11:28:53 +08:00
4 changed files with 151 additions and 94 deletions

View File

@@ -35,6 +35,14 @@ public class TbPrintMachine implements Serializable {
private String productId; private String productId;
private String receiptSize;
private String classifyPrint;
private String tablePrint;
private String printQty;
private String printMethod;
private String printType;
private String printReceipt;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Integer getId() { public Integer getId() {
@@ -164,4 +172,60 @@ public class TbPrintMachine implements Serializable {
public void setProductId(String productId) { public void setProductId(String productId) {
this.productId = productId == null ? null : productId.trim(); this.productId = productId == null ? null : productId.trim();
} }
public String getReceiptSize() {
return receiptSize;
}
public void setReceiptSize(String receiptSize) {
this.receiptSize = receiptSize;
}
public String getClassifyPrint() {
return classifyPrint;
}
public void setClassifyPrint(String classifyPrint) {
this.classifyPrint = classifyPrint;
}
public String getTablePrint() {
return tablePrint;
}
public void setTablePrint(String tablePrint) {
this.tablePrint = tablePrint;
}
public String getPrintQty() {
return printQty;
}
public void setPrintQty(String printQty) {
this.printQty = printQty;
}
public String getPrintMethod() {
return printMethod;
}
public void setPrintMethod(String printMethod) {
this.printMethod = printMethod;
}
public String getPrintType() {
return printType;
}
public void setPrintType(String printType) {
this.printType = printType;
}
public String getPrintReceipt() {
return printReceipt;
}
public void setPrintReceipt(String printReceipt) {
this.printReceipt = printReceipt;
}
} }

View File

@@ -3,7 +3,6 @@ package com.chaozhanggui.system.cashierservice.rabbit;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.dao.*; import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*; import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.model.CategoryInfo; import com.chaozhanggui.system.cashierservice.model.CategoryInfo;
@@ -22,7 +21,10 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -99,16 +101,11 @@ public class PrintMechineConsumer {
return; return;
} }
JSONObject config = JSONObject.parseObject(tbPrintMachineWithBLOBs.getConfig()); String model = tbPrintMachineWithBLOBs.getPrintMethod();
String model = config.getString("model");
String printerNum = config.getString("printerNum"); String printerNum = StrUtil.isEmpty(tbPrintMachineWithBLOBs.getPrintQty()) ? "1" : tbPrintMachineWithBLOBs.getPrintQty().split("^")[1];
String feet = config.getString("feet"); List<CategoryInfo> categoryInfos = JSONUtil.parseJSONStr2TList(StrUtil.emptyToDefault(tbPrintMachineWithBLOBs.getCategoryList(), "[]"), CategoryInfo.class);
String autoCut = config.getString("autoCut");
List<CategoryInfo> categoryInfos=JSONUtil.parseJSONStr2TList(config.getJSONArray("categoryList").toString(),CategoryInfo.class);
switch (tbPrintMachineWithBLOBs.getContentType()) { switch (tbPrintMachineWithBLOBs.getContentType()) {
case "yxyPrinter": case "yxyPrinter":
@@ -130,6 +127,7 @@ public class PrintMechineConsumer {
/** /**
* 博时结云打印机 * 博时结云打印机
*
* @param tbPrintMachineWithBLOBs * @param tbPrintMachineWithBLOBs
* @param model * @param model
* @param orderInfo * @param orderInfo
@@ -353,8 +351,6 @@ public class PrintMechineConsumer {
} }
private void fePrinter(TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs, String model, TbOrderInfo orderInfo, TbShopInfo shopInfo, String printerNum, List<CategoryInfo> categoryInfos) { private void fePrinter(TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs, String model, TbOrderInfo orderInfo, TbShopInfo shopInfo, String printerNum, List<CategoryInfo> categoryInfos) {
String orderId = orderInfo.getId().toString(); String orderId = orderInfo.getId().toString();
switch (tbPrintMachineWithBLOBs.getSubType()) { switch (tbPrintMachineWithBLOBs.getSubType()) {

View File

@@ -2,7 +2,7 @@ package com.chaozhanggui.system.cashierservice.service;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import cn.hutool.core.util.StrUtil;
import com.chaozhanggui.system.cashierservice.dao.*; import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*; import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.model.CategoryInfo; import com.chaozhanggui.system.cashierservice.model.CategoryInfo;
@@ -46,8 +46,6 @@ public class CloudPrinterService {
private TbOrderDetailMapper tbOrderDetailMapper; private TbOrderDetailMapper tbOrderDetailMapper;
public Result printReceipt(String type, String orderId, Boolean ispre) { public Result printReceipt(String type, String orderId, Boolean ispre) {
try { try {
@@ -82,16 +80,12 @@ public class CloudPrinterService {
return; return;
} }
JSONObject config = JSONObject.parseObject(tbPrintMachineWithBLOBs.getConfig());
String model = config.getString("model");
String printerNum = config.getString("printerNum"); String model = tbPrintMachineWithBLOBs.getPrintMethod();
String feet = config.getString("feet"); String printerNum = StrUtil.isEmpty(tbPrintMachineWithBLOBs.getPrintQty()) ? "1" : tbPrintMachineWithBLOBs.getPrintQty().split("^")[1];
String autoCut = config.getString("autoCut"); List<CategoryInfo> categoryInfos = JSONUtil.parseJSONStr2TList(StrUtil.emptyToDefault(tbPrintMachineWithBLOBs.getCategoryList(), "[]"), CategoryInfo.class);
List<CategoryInfo> categoryInfos=JSONUtil.parseJSONStr2TList(config.getJSONArray("categoryList").toString(),CategoryInfo.class);
switch (tbPrintMachineWithBLOBs.getContentType()) { switch (tbPrintMachineWithBLOBs.getContentType()) {
case "yxyPrinter": case "yxyPrinter":
@@ -113,10 +107,9 @@ public class CloudPrinterService {
} }
/** /**
* 博时结云打印机 * 博时结云打印机
*
* @param tbPrintMachineWithBLOBs * @param tbPrintMachineWithBLOBs
* @param model * @param model
* @param orderInfo * @param orderInfo
@@ -220,8 +213,6 @@ public class CloudPrinterService {
} }
private void fePrinter(TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs, String model, TbOrderInfo orderInfo, TbShopInfo shopInfo, String printerNum, List<CategoryInfo> categoryInfos) { private void fePrinter(TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs, String model, TbOrderInfo orderInfo, TbShopInfo shopInfo, String printerNum, List<CategoryInfo> categoryInfos) {
String orderId = orderInfo.getId().toString(); String orderId = orderInfo.getId().toString();
switch (tbPrintMachineWithBLOBs.getSubType()) { switch (tbPrintMachineWithBLOBs.getSubType()) {
@@ -398,6 +389,4 @@ public class CloudPrinterService {
} }
} }

View File

@@ -18,6 +18,14 @@
<result column="sort" jdbcType="INTEGER" property="sort" /> <result column="sort" jdbcType="INTEGER" property="sort" />
<result column="vendor_id" jdbcType="VARCHAR" property="vendorId" /> <result column="vendor_id" jdbcType="VARCHAR" property="vendorId" />
<result column="product_id" jdbcType="VARCHAR" property="productId" /> <result column="product_id" jdbcType="VARCHAR" property="productId" />
<result column="receipt_size" jdbcType="VARCHAR" property="receiptSize" />
<result column="classify_print" jdbcType="VARCHAR" property="classifyPrint" />
<result column="table_print" jdbcType="VARCHAR" property="tablePrint" />
<result column="print_qty" jdbcType="VARCHAR" property="printQty" />
<result column="print_method" jdbcType="VARCHAR" property="printMethod" />
<result column="print_type" jdbcType="VARCHAR" property="printType" />
<result column="print_receipt" jdbcType="VARCHAR" property="printReceipt" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbPrintMachineWithBLOBs"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbPrintMachineWithBLOBs">
<result column="config" jdbcType="LONGVARCHAR" property="config" /> <result column="config" jdbcType="LONGVARCHAR" property="config" />
@@ -25,7 +33,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, type, connection_type, address, port, sub_type, status, shop_id, category_ids, id, name, type, connection_type, address, port, sub_type, status, shop_id, category_ids,
content_type, created_at, updated_at, sort, vendor_id, product_id content_type, created_at, updated_at, sort, vendor_id, product_id, receipt_size, classify_print, table_print, print_qty, print_method, print_type, print_receipt
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
config, category_list config, category_list