72 lines
1.5 KiB
Java
72 lines
1.5 KiB
Java
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;
|
|
}
|
|
|
|
}
|
|
|