feat:ms439打印机相关接口,增加小票打印机获取接口

This commit is contained in:
2025-03-13 09:43:16 +08:00
parent f4edd0189b
commit 2ee5b3015a
17 changed files with 890 additions and 1 deletions

View File

@@ -0,0 +1,69 @@
package com.dpkj.modules.print.enums;
import lombok.Getter;
/**
* ms439打印机设备状态枚举
*
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
* @version 1.0
* @since 2025-03-06 11:31:25
*/
@Getter
public enum MS439DeviceStatusEnum {
/**
* 打印机正常
*/
HEALTHY(439200, "正常", "HEALTHY"),
/**
* 打印机忙碌,请稍后
*/
BUSY(439201, "打印机忙碌,请稍后", "BUSY"),
/**
* 打印机发生故障
*/
FATAL(439500, "打印机发生故障", "FATAL"),
/**
* 未发现打印机
*/
NODEVICE(439501, "未发现打印机", "NODEVICE"),
;
private final Integer code;
private final String msg;
private final String printCode;
MS439DeviceStatusEnum(Integer code, String msg, String printCode) {
this.code = code;
this.msg = msg;
this.printCode = printCode;
}
public static String getMessage(String printCode){
for (MS439DeviceStatusEnum value : MS439DeviceStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.msg;
}
}
return "打印机未知的错误";
}
public static int getPCode(String printCode){
for (MS439DeviceStatusEnum value : MS439DeviceStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.code;
}
}
return 500;
}
}

View File

@@ -0,0 +1,75 @@
package com.dpkj.modules.print.enums;
import lombok.Getter;
/**
* MS439打印机墨盒状态
*
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
* @version 1.0
* @since 2025-03-06 11:39:35
*/
@Getter
public enum MS439InkStatusEnum {
/**
* 墨盒满
*/
INKFULL(439200, "墨盒满", "INKFULL"),
/**
* 墨盒少
*/
INKLOW(439203, "墨盒少", "INKLOW"),
/**
* 缺墨盒
*/
INKOUT(439511, "缺墨盒", "INKOUT"),
/**
* 不支持墨盒检测
*/
INKNOTSUPP(439512, "不支持墨盒检测", "INKNOTSUPP"),
/**
* 墨盒状态未知
*/
INKUNKNOWN(439513, "墨盒未知", "INKUNKNOWN");
;
private final Integer code;
private final String msg;
private final String printCode;
MS439InkStatusEnum(Integer code, String msg, String printCode) {
this.code = code;
this.msg = msg;
this.printCode = printCode;
}
public static String getMessage(String printCode){
for (MS439InkStatusEnum value : MS439InkStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.msg;
}
}
return "打印机未知的错误";
}
public static int getPCode(String printCode){
for (MS439InkStatusEnum value : MS439InkStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.code;
}
}
return 500;
}
}

View File

@@ -0,0 +1,87 @@
package com.dpkj.modules.print.enums;
import lombok.Getter;
/**
* ms439打印机介质枚举
*
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
* @version 1.0
* @since 2025-03-06 11:38:08
*/
@Getter
public enum MS439MediaStatusEnum {
/**
* 介质在通道
*/
PRESENT(439200, "介质在通道", "PRESENT"),
/**
* 无介质
*/
NOTPRESENT(439502, "无介质", "NOTPRESENT"),
/**
* 卡介质
*/
JAMMED(439503, "卡介质", "JAMMED"),
/**
* 不支持
*/
NOTSUPP(439504, "不支持", "NOTSUPP"),
/**
* 未知
*/
UNKNOWN(439505, "未知", "UNKNOWN"),
/**
* 介质在出口
*/
EXITING(439506, "介质在出口", "EXITING"),
/**
* 介质被回收(复位时)
*/
RETRACTED(439507, "介质被回收(复位时)", "RETRACTED"),
;
private final Integer code;
private final String msg;
private final String printCode;
MS439MediaStatusEnum(Integer code, String msg, String printCode) {
this.code = code;
this.msg = msg;
this.printCode = printCode;
}
public static String getMessage(String printCode){
for (MS439MediaStatusEnum value : MS439MediaStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.msg;
}
}
return "打印机未知的错误";
}
public static int getPCode(String printCode){
for (MS439MediaStatusEnum value : MS439MediaStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.code;
}
}
return 500;
}
}

View File

@@ -0,0 +1,80 @@
package com.dpkj.modules.print.enums;
import lombok.Getter;
/**
* MS439打印机纸盒状态枚举
*
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
* @version 1.0
* @since 2025-03-06 11:53:21
*/
@Getter
public enum MS439PaperStatusEnum {
/**
* 纸满
*/
PAPERFULL(439200, "纸满", "PAPERFULL"),
/**
* 少纸
*/
PAPERLOW(439204, "少纸", "PAPERLOW"),
/**
* 缺纸
*/
PAPEROUT(439514, "缺纸", "PAPEROUT"),
/**
* 不支持纸箱检测
*/
PAPERNOTSUPP(439515, "不支持纸箱检测", "PAPERNOTSUPP"),
/**
* 卡纸
*/
PAPERJAMMED(439516, "卡纸", "PAPERJAMMED"),
/**
* 纸箱未知
*/
PAPERUNKNOWN(439517, "纸箱未知", "PAPERUNKNOWN");
;
private final Integer code;
private final String msg;
private final String printCode;
MS439PaperStatusEnum(Integer code, String msg, String printCode) {
this.code = code;
this.msg = msg;
this.printCode = printCode;
}
public static String getMessage(String printCode){
for (MS439PaperStatusEnum value : MS439PaperStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.msg;
}
}
return "打印机未知的错误";
}
public static int getPCode(String printCode){
for (MS439PaperStatusEnum value : MS439PaperStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.code;
}
}
return 500;
}
}

View File

@@ -0,0 +1,71 @@
package com.dpkj.modules.print.enums;
import lombok.Getter;
/**
* 盖章机状态枚举
*
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
* @version 1.0
* @since 2025-03-06 15:13:58
*/
@Getter
public enum MS439StampStatusEnum {
/**
* 盖章机正常
*/
HEALTHY(439200, "正常", "HEALTHY"),
/**
* 盖章机忙碌,请稍后
*/
BUSY(439201, "盖章机忙碌,请稍后", "BUSY"),
/**
* 盖章机发生故障
*/
FATAL(439500, "盖章机发生故障", "FATAL"),
/**
* 未发现盖章机
*/
NODEVICE(439501, "未发现盖章机", "NODEVICE"),
;
private final Integer code;
private final String msg;
private final String printCode;
MS439StampStatusEnum(Integer code, String msg, String printCode) {
this.code = code;
this.msg = msg;
this.printCode = printCode;
}
public static String getMessage(String printCode){
for (MS439StampStatusEnum value : MS439StampStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.msg;
}
}
return "盖章机未知的错误";
}
public static int getPCode(String printCode){
for (MS439StampStatusEnum value : MS439StampStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.code;
}
}
return 500;
}
}

View File

@@ -0,0 +1,75 @@
package com.dpkj.modules.print.enums;
import lombok.Getter;
/**
* MS439打印机 磁带状态
*
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
* @version 1.0
* @since 2025-03-06 11:38:48
*/
@Getter
public enum MS439TonerStatusEnum {
/**
* 磁带满
*/
TONERFULL(439200, "碳带满", "TONERFULL"),
/**
* 碳带少
*/
TONERLOW(439202, "碳带少", "TONERLOW"),
/**
* 缺碳带
*/
TONEROUT(439508, "缺碳带", "TONEROUT"),
/**
* 不支持碳带检测
*/
TONERNOTSUPP(439509, "不支持碳带检测", "TONERNOTSUPP"),
/**
* 碳带状态未知
*/
TONERUNKNOWN(439510, "碳带未知", "TONERUNKNOWN")
;
private final Integer code;
private final String msg;
private final String printCode;
MS439TonerStatusEnum(Integer code, String msg, String printCode) {
this.code = code;
this.msg = msg;
this.printCode = printCode;
}
public static String getMessage(String printCode){
for (MS439TonerStatusEnum value : MS439TonerStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.msg;
}
}
return "打印机未知的错误";
}
public static int getPCode(String printCode){
for (MS439TonerStatusEnum value : MS439TonerStatusEnum.values()) {
if ( value.getPrintCode().equals(printCode)){
return value.code;
}
}
return 500;
}
}