打印机接口
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
package com.czg.account.dto.print;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class PrinterAddDTO {
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@NotBlank(message = "设备名称不为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 现在打印机支持USB 和 网络、蓝牙
|
||||
*/
|
||||
@NotBlank
|
||||
private String connectionType;
|
||||
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
private String port;
|
||||
|
||||
/**
|
||||
* 打印类型(分类)label标签cash小票kitchen出品
|
||||
*/
|
||||
private String subType;
|
||||
|
||||
|
||||
/**
|
||||
* 打印机品牌
|
||||
*/
|
||||
@NotBlank(message = "打印机品牌不为空")
|
||||
private String contentType;
|
||||
|
||||
|
||||
/**
|
||||
* 打印分类Id
|
||||
*/
|
||||
private String categoryIds;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
private String categoryList;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 小票尺寸 58mm 80mm
|
||||
*/
|
||||
private String receiptSize;
|
||||
|
||||
/**
|
||||
* 分类打印 0-所有 1-部分分类 2-部分商品
|
||||
*/
|
||||
@NotBlank(message = "打印分类不为空")
|
||||
private String classifyPrint;
|
||||
|
||||
/**
|
||||
* 打印数量 c1m1^2=顾客+商家[2张] m1^1=商家[1张] c1^1顾客[1张] c2m1^3顾客2+商家1[3张]
|
||||
*/
|
||||
@NotBlank(message = "打印数量不为空")
|
||||
private String printQty;
|
||||
|
||||
/**
|
||||
* 打印方式 all-全部打印 normal-仅打印结账单「前台」one-仅打印制作单「厨房」
|
||||
*/
|
||||
@NotBlank(message = "打印方式不为空")
|
||||
private String printMethod;
|
||||
|
||||
/**
|
||||
* 打印类型,JSON数组 refund-确认退款单 handover-交班单 queue-排队取号
|
||||
*/
|
||||
@NotBlank(message = "打印类型不为空")
|
||||
private String printType;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.czg.account.dto.print;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class PrinterDelDTO {
|
||||
@NotNull(message = "打印机id不为空")
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.czg.account.dto.print;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class PrinterEditDTO {
|
||||
@NotNull(message = "打印机id不为空")
|
||||
private Long id;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 现在打印机支持USB 和 网络、蓝牙
|
||||
*/
|
||||
private String connectionType;
|
||||
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
private String port;
|
||||
|
||||
/**
|
||||
* 打印类型(分类)label标签cash小票kitchen出品
|
||||
*/
|
||||
private String subType;
|
||||
|
||||
|
||||
/**
|
||||
* 打印机品牌
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
|
||||
/**
|
||||
* 打印分类Id
|
||||
*/
|
||||
private String categoryIds;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
private String categoryList;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 小票尺寸 58mm 80mm
|
||||
*/
|
||||
private String receiptSize;
|
||||
|
||||
/**
|
||||
* 分类打印 0-所有 1-部分分类 2-部分商品
|
||||
*/
|
||||
private String classifyPrint;
|
||||
|
||||
/**
|
||||
* 打印数量 c1m1^2=顾客+商家[2张] m1^1=商家[1张] c1^1顾客[1张] c2m1^3顾客2+商家1[3张]
|
||||
*/
|
||||
private String printQty;
|
||||
|
||||
/**
|
||||
* 打印方式 all-全部打印 normal-仅打印结账单「前台」one-仅打印制作单「厨房」
|
||||
*/
|
||||
private String printMethod;
|
||||
|
||||
/**
|
||||
* 打印类型,JSON数组 refund-确认退款单 handover-交班单 queue-排队取号
|
||||
*/
|
||||
private String printType;
|
||||
|
||||
/**
|
||||
* 打印机状态 online在线
|
||||
*/
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 打印机设备 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_print_machine")
|
||||
public class PrintMachine implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 现在打印机支持USB 和 网络、蓝牙
|
||||
*/
|
||||
private String connectionType;
|
||||
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
private String port;
|
||||
|
||||
/**
|
||||
* 打印类型(分类)label标签cash小票kitchen出品
|
||||
*/
|
||||
private String subType;
|
||||
|
||||
/**
|
||||
* 状态 online
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 店铺Id
|
||||
*/
|
||||
private String shopId;
|
||||
|
||||
/**
|
||||
* 分类Id
|
||||
*/
|
||||
private String categoryIds;
|
||||
|
||||
/**
|
||||
* 现在打印机支持USB 和 网络两种
|
||||
*/
|
||||
private String contentType;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
private String categoryList;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 小票尺寸 58mm 80mm
|
||||
*/
|
||||
private String receiptSize;
|
||||
|
||||
/**
|
||||
* 分类打印 0-所有 1-部分分类 2-部分商品
|
||||
*/
|
||||
private String classifyPrint;
|
||||
|
||||
/**
|
||||
* 打印数量 c1m1^2=顾客+商家[2张] m1^1=商家[1张] c1^1顾客[1张] c2m1^3顾客2+商家1[3张]
|
||||
*/
|
||||
private String printQty;
|
||||
|
||||
/**
|
||||
* 打印方式 all-全部打印 normal-仅打印结账单「前台」one-仅打印制作单「厨房」
|
||||
*/
|
||||
private String printMethod;
|
||||
|
||||
/**
|
||||
* 打印类型,JSON数组 refund-确认退款单 handover-交班单 queue-排队取号
|
||||
*/
|
||||
private String printType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.print.PrinterAddDTO;
|
||||
import com.czg.account.dto.print.PrinterEditDTO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.account.entity.PrintMachine;
|
||||
|
||||
/**
|
||||
* 打印机设备 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-20
|
||||
*/
|
||||
public interface PrintMachineService extends IService<PrintMachine> {
|
||||
|
||||
boolean add(Long shopId, PrinterAddDTO printerAddDTO);
|
||||
|
||||
Boolean edit(Long shopId, PrinterEditDTO printerEditDTO);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user