设备调用之前复位(初始化)
This commit is contained in:
parent
563bc271f3
commit
6107203f9f
|
@ -0,0 +1,227 @@
|
||||||
|
package com.dpkj.common.constant;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public final class ErrorCodeConstants {
|
||||||
|
private ErrorCodeConstants() {
|
||||||
|
throw new AssertionError("This class should not be instantiated.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 公共错误码
|
||||||
|
public static final Map<Integer, String> COMMON_ERROR_CODE;
|
||||||
|
|
||||||
|
static {
|
||||||
|
COMMON_ERROR_CODE = new HashMap<>();
|
||||||
|
COMMON_ERROR_CODE.put(-1, "应用已经调用过WFSStartUp并且之后并未调用WFSCleanUp");
|
||||||
|
COMMON_ERROR_CODE.put(-2, "应用要求的XFS API版本过高");
|
||||||
|
COMMON_ERROR_CODE.put(-3, "应用要求的XFS API版本过低");
|
||||||
|
COMMON_ERROR_CODE.put(-4, "请求被取消");
|
||||||
|
COMMON_ERROR_CODE.put(-5, "hKey并未对应当前打开的key(注册表项)");
|
||||||
|
COMMON_ERROR_CODE.put(-6, "在当前的key中不存在指定的lpszValueName(键名)");
|
||||||
|
COMMON_ERROR_CODE.put(-7, "在当前的key中不存在指定的lpszSubKey(子键)");
|
||||||
|
COMMON_ERROR_CODE.put(-8, "在当前的key中不存在指定的键值");
|
||||||
|
COMMON_ERROR_CODE.put(-9, "待删除的key包含子键,无法删除");
|
||||||
|
COMMON_ERROR_CODE.put(-10, "返回的键名字符串的长度超过了缓存的长度");
|
||||||
|
COMMON_ERROR_CODE.put(-11, "本项已经为最后一项,没有下一项");
|
||||||
|
COMMON_ERROR_CODE.put(-12, "返回的键值数据的长度超过了缓存的长度");
|
||||||
|
COMMON_ERROR_CODE.put(-13, "函数必须的设备访问,但设备尚未准备好或已超时");
|
||||||
|
COMMON_ERROR_CODE.put(-14, "函数必须的设备访问,但设备出错");
|
||||||
|
COMMON_ERROR_CODE.put(-15, "XFS子系统内发生的内部不一致或其他异常错误");
|
||||||
|
COMMON_ERROR_CODE.put(-16, "lpvOriginal地址参数错误,未指向上次申请的缓存");
|
||||||
|
COMMON_ERROR_CODE.put(-17, "无效的应用句柄(例如由不当的函数调用顺序引起)");
|
||||||
|
COMMON_ERROR_CODE.put(-18, "lpvData参数未指向一个申请的缓存结构");
|
||||||
|
COMMON_ERROR_CODE.put(-19, "当前的服务类(service class)不支持dwCategory参数");
|
||||||
|
COMMON_ERROR_CODE.put(-20, "当前的服务类不支持发出的dwCommand");
|
||||||
|
COMMON_ERROR_CODE.put(-21, "当前的服务类不支持dwEventClass指定的一个或多个事件类");
|
||||||
|
COMMON_ERROR_CODE.put(-22, "hService参数是无效的服务句柄");
|
||||||
|
COMMON_ERROR_CODE.put(-23, "hProvider参数是无效的Provier句柄");
|
||||||
|
COMMON_ERROR_CODE.put(-24, "hWnd参数是无效的窗口句柄");
|
||||||
|
COMMON_ERROR_CODE.put(-25, "hWndReg参数是无效的窗口句柄");
|
||||||
|
COMMON_ERROR_CODE.put(-26, "指针参数不指向可访问内存");
|
||||||
|
COMMON_ERROR_CODE.put(-27, "RequestID参数不符合对服务的未处理请求");
|
||||||
|
COMMON_ERROR_CODE.put(-28, "lpResult参数不是一个指向WFSRESULT结构的指针");
|
||||||
|
COMMON_ERROR_CODE.put(-29, "SP的文件无效或损坏");
|
||||||
|
COMMON_ERROR_CODE.put(-30, "hWnd与usTimerID没有对应当前活动的timer");
|
||||||
|
COMMON_ERROR_CODE.put(-31, "dwTraceLevel参数的值为无效值");
|
||||||
|
COMMON_ERROR_CODE.put(-32, "服务被另一个hService锁定");
|
||||||
|
COMMON_ERROR_CODE.put(-33, "调用被阻塞");
|
||||||
|
COMMON_ERROR_CODE.put(-34, "SP的文件不存在");
|
||||||
|
COMMON_ERROR_CODE.put(-35, "指定的线程不存在");
|
||||||
|
COMMON_ERROR_CODE.put(-36, "timer创建失败");
|
||||||
|
COMMON_ERROR_CODE.put(-37, "应用请求解锁,而此设备并未被加锁");
|
||||||
|
COMMON_ERROR_CODE.put(-38, "XFS卸载SP DLL失败");
|
||||||
|
COMMON_ERROR_CODE.put(-39, "应用程序此前还没有成功的执行WFSStartUp");
|
||||||
|
COMMON_ERROR_CODE.put(-40, "hWndReg窗口没有指定接收任何事件类");
|
||||||
|
COMMON_ERROR_CODE.put(-41, "在该线程上有一个阻塞操作正在进行;此时只允许WFSCancelBlockingCall和WFSIsBlocking");
|
||||||
|
COMMON_ERROR_CODE.put(-42, "申请的空间不足");
|
||||||
|
COMMON_ERROR_CODE.put(-43, "逻辑名无效");
|
||||||
|
COMMON_ERROR_CODE.put(-44, "SPI版本过高");
|
||||||
|
COMMON_ERROR_CODE.put(-45, "SPI版本过低");
|
||||||
|
COMMON_ERROR_CODE.put(-46, "应用请求的服务版本过高");
|
||||||
|
COMMON_ERROR_CODE.put(-47, "应用请求的服务版本过低");
|
||||||
|
COMMON_ERROR_CODE.put(-48, "超时周期到期");
|
||||||
|
COMMON_ERROR_CODE.put(-49, "dwCategory虽然有效,但不被SP支持");
|
||||||
|
COMMON_ERROR_CODE.put(-50, "尽管发出的dwCommand对此服务类别有效,但此服务提供程序或设备不支持发出的dwCommand");
|
||||||
|
COMMON_ERROR_CODE.put(-51, "服务中的两个模块版本不匹配");
|
||||||
|
COMMON_ERROR_CODE.put(-52, "输入参数中包含无效数据");
|
||||||
|
COMMON_ERROR_CODE.put(-53, "函数必须的配置信息访问,但软件出错");
|
||||||
|
COMMON_ERROR_CODE.put(-54, "与服务的连接丢失");
|
||||||
|
COMMON_ERROR_CODE.put(-55, "用户在阻止设备的正确操作");
|
||||||
|
COMMON_ERROR_CODE.put(-56, "尽管作为输入参数传递的数据结构对此服务类别有效,但此服务提供程序或设备不支持该数据结构");
|
||||||
|
COMMON_ERROR_CODE.put(-57, "一些设备能够识别试图欺骗获得重要信息或媒介的恶意物理攻击。在这些情况下,将返回此错误代码,显示用户试图对该设备采取欺骗行为");
|
||||||
|
COMMON_ERROR_CODE.put(-58, "此时被请求的操作无效,或在设备当时的状态下,被请求的操作无效");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 社保卡相关错误码
|
||||||
|
public static final Map<Integer, String> SOCIAL_SECURITYCARD_ERROR_CODE;
|
||||||
|
|
||||||
|
static {
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE = new HashMap<>();
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-1, "卡类型不对");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-2, "无卡");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-3, "有卡未上电");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-4, "卡无应答");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-5, "加载动态库错");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-11, "读卡器连接错");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-12, "未建立连接");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-13, "(动态库)不支持该命令");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-14, "(发给动态库的)命令参数错");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-15, "信息校验和出错");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-20, "卡识别码格式错");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-21, "内部认证失败(用户卡不合法)");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-22, "传入数据与卡内不符");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-23, "传入数据不合法");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-24, "PSAM卡密钥级别不够");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-31, "用户取消密码输入");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-32, "密码输入操作超时");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-33, "输入密码长度错");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-34, "两次输入密码不一致");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-35, "(预留) 初始密码不能交易");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-36, "(预留) 不能改为初始密码");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-41, "运算数据含非法字符");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-42, "运算数据长度错");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-51, "PIN校验失败,剩余次数N次(根据卡返回信息)");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-52, "PIN锁定");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-2201, "无PSAM卡");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-2202, "PSAM卡算法不支持(即PSAM卡内没有SSF33算法或SM4算法)");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-2203, "PSAM卡内没有RKSSSE密钥(3.0卡读个人基本信息需要RKSSSE密钥外部认证)");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-2204, "不需要加密机认证");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-25536, "外部认证失败,剩余可尝试次数2次");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-25537, "外部认证失败,剩余可尝试次数1次");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-25538, "外部认证失败,剩余可尝试次数0次");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-26368, "Lc/Le不正确");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-26881, "命令不接受(无效状态)");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27009, "命令与文件结构不相符、当前文件非所需文件");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27010, "不满足安全条件");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27011, "密钥锁定(算法锁定)鉴别方法锁定");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27012, "引用数据无效、随机数无效");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27013, "不满足使用条件、应用被锁定、应用未选择、余额上溢");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27016, "安全报文数据项不正确、MAC不正确");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27264, "数据域参数不正确");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27265, "不支持该功能、卡中无MF、卡被锁定、应用锁定");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27266, "未找到文件、文件标识相重、SFI不正确");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27267, "未找到记录");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-27272, "未找到引用数据、未找到密钥");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-37634, "MAC无效");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-37635, "应用已被永久锁定、卡片锁定");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-37891, "PSAM卡不支持消费交易");
|
||||||
|
SOCIAL_SECURITYCARD_ERROR_CODE.put(-37894, "所需MAC(或/和TAC)不可用");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static final Map<Integer, String> KEYPAD_ERROR_CODE;
|
||||||
|
|
||||||
|
static {
|
||||||
|
KEYPAD_ERROR_CODE = new HashMap<>();
|
||||||
|
|
||||||
|
KEYPAD_ERROR_CODE.put(400, "按键未找到");
|
||||||
|
KEYPAD_ERROR_CODE.put(401, "不支持的模式");
|
||||||
|
KEYPAD_ERROR_CODE.put(402, "访问拒绝");
|
||||||
|
KEYPAD_ERROR_CODE.put(403, "ID无效");
|
||||||
|
KEYPAD_ERROR_CODE.put(404, "Key已存在");
|
||||||
|
KEYPAD_ERROR_CODE.put(406, "Key没有加载");
|
||||||
|
KEYPAD_ERROR_CODE.put(407, "Key使用不对");
|
||||||
|
KEYPAD_ERROR_CODE.put(408, "键盘中没有密码");
|
||||||
|
KEYPAD_ERROR_CODE.put(409, "无效的Key长度");
|
||||||
|
KEYPAD_ERROR_CODE.put(410, "无效的按键");
|
||||||
|
KEYPAD_ERROR_CODE.put(411, "存在不支持的按键");
|
||||||
|
KEYPAD_ERROR_CODE.put(412, "没有激活任何按键");
|
||||||
|
KEYPAD_ERROR_CODE.put(413, "无效的key");
|
||||||
|
KEYPAD_ERROR_CODE.put(414, "没有终止键");
|
||||||
|
KEYPAD_ERROR_CODE.put(415, "最小密码长度无效");
|
||||||
|
KEYPAD_ERROR_CODE.put(416, "协议不支持");
|
||||||
|
KEYPAD_ERROR_CODE.put(417, "无效的数据");
|
||||||
|
KEYPAD_ERROR_CODE.put(418, "不允许进行操作");
|
||||||
|
KEYPAD_ERROR_CODE.put(419, "Key RAM空间不够");
|
||||||
|
KEYPAD_ERROR_CODE.put(420, "还没开始ChipTransaction");
|
||||||
|
KEYPAD_ERROR_CODE.put(421, "算法不支持");
|
||||||
|
KEYPAD_ERROR_CODE.put(422, "格式不支持");
|
||||||
|
KEYPAD_ERROR_CODE.put(423, "HSMSTATE无效");
|
||||||
|
KEYPAD_ERROR_CODE.put(424, "MAC无效");
|
||||||
|
KEYPAD_ERROR_CODE.put(425, "协议无效");
|
||||||
|
KEYPAD_ERROR_CODE.put(426, "格式无效");
|
||||||
|
KEYPAD_ERROR_CODE.put(427, "内容无效");
|
||||||
|
|
||||||
|
KEYPAD_ERROR_CODE.put(-999, "找不到设备服务,原因设备服务名不存在");
|
||||||
|
KEYPAD_ERROR_CODE.put(-998, "无法连接到设备服务,或设备服务未打开");
|
||||||
|
KEYPAD_ERROR_CODE.put(-1, "应用已经调用过WFSStartUp并且之后并未调用WFSCleanUp");
|
||||||
|
KEYPAD_ERROR_CODE.put(-2, "应用要求的XFS API版本过高");
|
||||||
|
KEYPAD_ERROR_CODE.put(-3, "应用要求的XFS API版本过低");
|
||||||
|
KEYPAD_ERROR_CODE.put(-4, "请求被取消");
|
||||||
|
KEYPAD_ERROR_CODE.put(-5, "hKey并未对应当前打开的key(注册表项)");
|
||||||
|
KEYPAD_ERROR_CODE.put(-6, "在当前的key中不存在指定的lpszValueName(键名)");
|
||||||
|
KEYPAD_ERROR_CODE.put(-7, "在当前的key中不存在指定的lpszSubKey(子键)");
|
||||||
|
KEYPAD_ERROR_CODE.put(-8, "在当前的key中不存在指定的键值");
|
||||||
|
KEYPAD_ERROR_CODE.put(-9, "待删除的key包含子键,无法删除");
|
||||||
|
KEYPAD_ERROR_CODE.put(-10, "返回的键名字符串的长度超过了缓存的长度");
|
||||||
|
KEYPAD_ERROR_CODE.put(-11, "本项已经为最后一项,没有下一项");
|
||||||
|
KEYPAD_ERROR_CODE.put(-12, "返回的键值数据的长度超过了缓存的长度");
|
||||||
|
KEYPAD_ERROR_CODE.put(-13, "函数必须的设备访问,但设备尚未准备好或已超时");
|
||||||
|
KEYPAD_ERROR_CODE.put(-14, "函数必须的设备访问,但设备出错");
|
||||||
|
KEYPAD_ERROR_CODE.put(-15, "XFS子系统内发生的内部不一致或其他异常错误");
|
||||||
|
KEYPAD_ERROR_CODE.put(-16, "lpvOriginal地址参数错误,未指向上次申请的缓存");
|
||||||
|
KEYPAD_ERROR_CODE.put(-17, "无效的应用句柄(例如由不当的函数调用顺序引起)");
|
||||||
|
KEYPAD_ERROR_CODE.put(-18, "lpvData参数未指向一个申请的缓存结构");
|
||||||
|
KEYPAD_ERROR_CODE.put(-19, "当前的服务类(service class)不支持dwCategory参数");
|
||||||
|
KEYPAD_ERROR_CODE.put(-20, "当前的服务类不支持发出的dwCommand");
|
||||||
|
KEYPAD_ERROR_CODE.put(-21, "当前的服务类不支持dwEventClass指定的一个或多个事件类");
|
||||||
|
KEYPAD_ERROR_CODE.put(-22, "hService参数是无效的服务句柄");
|
||||||
|
KEYPAD_ERROR_CODE.put(-23, "hProvider参数是无效的Provier句柄");
|
||||||
|
KEYPAD_ERROR_CODE.put(-24, "hWnd参数是无效的窗口句柄");
|
||||||
|
KEYPAD_ERROR_CODE.put(-25, "hWndReg参数是无效的窗口句柄");
|
||||||
|
KEYPAD_ERROR_CODE.put(-26, "指针参数不指向可访问内存");
|
||||||
|
KEYPAD_ERROR_CODE.put(-27, "RequestID参数不符合对服务的未处理请求");
|
||||||
|
KEYPAD_ERROR_CODE.put(-28, "lpResult参数不是一个指向WFSRESULT结构的指针");
|
||||||
|
KEYPAD_ERROR_CODE.put(-29, "SP的文件无效或损坏");
|
||||||
|
KEYPAD_ERROR_CODE.put(-30, "hWnd与usTimerID没有对应当前活动的timer");
|
||||||
|
KEYPAD_ERROR_CODE.put(-31, "dwTraceLevel参数的值为无效值");
|
||||||
|
KEYPAD_ERROR_CODE.put(-32, "服务被另一个hService锁定");
|
||||||
|
KEYPAD_ERROR_CODE.put(-33, "调用被阻塞");
|
||||||
|
KEYPAD_ERROR_CODE.put(-34, "SP的文件不存在");
|
||||||
|
KEYPAD_ERROR_CODE.put(-35, "指定的线程不存在");
|
||||||
|
KEYPAD_ERROR_CODE.put(-36, "timer创建失败");
|
||||||
|
KEYPAD_ERROR_CODE.put(-37, "应用请求解锁,而此设备并未被加锁");
|
||||||
|
KEYPAD_ERROR_CODE.put(-38, "XFS卸载SP DLL失败");
|
||||||
|
KEYPAD_ERROR_CODE.put(-39, "应用程序此前还没有成功的执行WFSStartUp");
|
||||||
|
KEYPAD_ERROR_CODE.put(-40, "hWndReg窗口没有指定接收任何事件类");
|
||||||
|
KEYPAD_ERROR_CODE.put(-41, "在该线程上有一个阻塞操作正在进行;此时只允许WFSCancelBlockingCall和WFSIsBlocking");
|
||||||
|
KEYPAD_ERROR_CODE.put(-42, "申请的空间不足");
|
||||||
|
KEYPAD_ERROR_CODE.put(-43, "逻辑名无效");
|
||||||
|
KEYPAD_ERROR_CODE.put(-44, "SPI版本过高");
|
||||||
|
KEYPAD_ERROR_CODE.put(-45, "SPI版本过低");
|
||||||
|
KEYPAD_ERROR_CODE.put(-46, "应用请求的服务版本过高");
|
||||||
|
KEYPAD_ERROR_CODE.put(-47, "应用请求的服务版本过低");
|
||||||
|
KEYPAD_ERROR_CODE.put(-48, "超时周期到期");
|
||||||
|
KEYPAD_ERROR_CODE.put(-49, "dwCategory虽然有效,但不被SP支持");
|
||||||
|
KEYPAD_ERROR_CODE.put(-50, "尽管发出的dwCommand对此服务类别有效,但此服务提供程序或设备不支持发出的dwCommand");
|
||||||
|
KEYPAD_ERROR_CODE.put(-51, "服务中的两个模块版本不匹配");
|
||||||
|
KEYPAD_ERROR_CODE.put(-52, "输入参数中包含无效数据");
|
||||||
|
KEYPAD_ERROR_CODE.put(-53, "函数必须的配置信息访问,但软件出错");
|
||||||
|
KEYPAD_ERROR_CODE.put(-54, "与服务的连接丢失");
|
||||||
|
KEYPAD_ERROR_CODE.put(-55, "用户在阻止设备的正确操作");
|
||||||
|
KEYPAD_ERROR_CODE.put(-56, "尽管作为输入参数传递的数据结构对此服务类别有效,但此服务提供程序或设备不支持该数据结构");
|
||||||
|
KEYPAD_ERROR_CODE.put(-57, "一些设备能够识别试图欺骗获得重要信息或媒介的恶意物理攻击。在这些情况下,将返回此错误代码,显示用户试图对该设备采取欺骗行为");
|
||||||
|
KEYPAD_ERROR_CODE.put(-58, "此时被请求的操作无效,或在设备当时的状态下,被请求的操作无效");
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,6 +19,11 @@ public interface MiddlewareFunctionsConst {
|
||||||
String CLOSE_CONNECTION_SYNC = "CloseConnectionSync";
|
String CLOSE_CONNECTION_SYNC = "CloseConnectionSync";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复位(初始化)
|
||||||
|
*/
|
||||||
|
String RESET = "Reset";
|
||||||
|
|
||||||
/** ------------------- 读卡模块 --------------------*/
|
/** ------------------- 读卡模块 --------------------*/
|
||||||
/**
|
/**
|
||||||
* 进卡读卡(异步)/ (同步)
|
* 进卡读卡(异步)/ (同步)
|
||||||
|
@ -91,10 +96,6 @@ public interface MiddlewareFunctionsConst {
|
||||||
String CANCEL_INPUT = "CancelInput";
|
String CANCEL_INPUT = "CancelInput";
|
||||||
|
|
||||||
/** ------------------ 条码读取模块 -------------------*/
|
/** ------------------ 条码读取模块 -------------------*/
|
||||||
/**
|
|
||||||
* 复位扫描仪
|
|
||||||
*/
|
|
||||||
String RESET = "Reset";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫描条码
|
* 扫描条码
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dpkj.modules.keypad.service.impl;
|
package com.dpkj.modules.keypad.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.dpkj.common.constant.ErrorCodeConstants;
|
||||||
import com.dpkj.common.constant.LexMarkConst;
|
import com.dpkj.common.constant.LexMarkConst;
|
||||||
import com.dpkj.common.constant.MiddlewareFunctionsConst;
|
import com.dpkj.common.constant.MiddlewareFunctionsConst;
|
||||||
import com.dpkj.common.dto.LexMarkDTO;
|
import com.dpkj.common.dto.LexMarkDTO;
|
||||||
|
@ -38,6 +39,44 @@ public class KeypadServiceImpl implements KeypadService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result inputData() {
|
public Result inputData() {
|
||||||
|
Result result = null;
|
||||||
|
// 获取设备状态
|
||||||
|
LexMarkDTO status = new LexMarkDTO();
|
||||||
|
status.setDevName(LexMarkConst.ENCRYPTOR);
|
||||||
|
status.setCallID(0);
|
||||||
|
status.setActionName(MiddlewareFunctionsConst.GET_STATUS_SYNC);
|
||||||
|
JSONObject statusParam = new JSONObject();
|
||||||
|
statusParam.put("timeout", 0);
|
||||||
|
log.info("获取设备状态,参数: {}", status);
|
||||||
|
IDCardReadResultVO statusResult = thirdServiceUtil.callDevice(status, IDCardReadResultVO.class);
|
||||||
|
log.info("获取设备状态结果: {}", statusResult);
|
||||||
|
if (statusResult.getResult() == 0) {
|
||||||
|
// 连接状态,初始化
|
||||||
|
LexMarkDTO reset = new LexMarkDTO();
|
||||||
|
reset.setDevName(LexMarkConst.ENCRYPTOR);
|
||||||
|
reset.setCallID(0);
|
||||||
|
reset.setActionName(MiddlewareFunctionsConst.RESET);
|
||||||
|
JSONObject resetParam = new JSONObject();
|
||||||
|
resetParam.put("ResetAction", 1);
|
||||||
|
log.info("调用复位(初始化)方法,参数: {}", reset);
|
||||||
|
IDCardReadResultVO resetResult = thirdServiceUtil.callDevice(reset, IDCardReadResultVO.class);
|
||||||
|
log.info("设备复位(初始化)结果: {}", resetResult);
|
||||||
|
if (resetResult.getResult() == 0) {
|
||||||
|
// 复位成功
|
||||||
|
result = connectAndInputData(result);
|
||||||
|
} else {
|
||||||
|
result = Result.error("密码键盘(初始化)异常,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(resetResult.getResult()));
|
||||||
|
log.info("密码键盘(初始化)异常,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(resetResult.getResult()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 设备未连接,无需复位(初始化)
|
||||||
|
result = connectAndInputData(result);
|
||||||
|
}
|
||||||
|
log.info("密码输入流程结束,最终返回结果: {}", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result connectAndInputData(Result result){
|
||||||
log.info("开始执行密码输入流程");
|
log.info("开始执行密码输入流程");
|
||||||
|
|
||||||
// 连接数字键盘
|
// 连接数字键盘
|
||||||
|
@ -47,7 +86,7 @@ public class KeypadServiceImpl implements KeypadService {
|
||||||
connect.setActionName(MiddlewareFunctionsConst.OPEN_CONNECTION);
|
connect.setActionName(MiddlewareFunctionsConst.OPEN_CONNECTION);
|
||||||
connect.setCallID(1000);
|
connect.setCallID(1000);
|
||||||
JSONObject connectParam = new JSONObject();
|
JSONObject connectParam = new JSONObject();
|
||||||
connectParam.put("TimeOut", 90000);
|
connectParam.put("TimeOut", 30000);
|
||||||
connectParam.put("ServiceName", LexMarkConst.ENCRYPTOR);
|
connectParam.put("ServiceName", LexMarkConst.ENCRYPTOR);
|
||||||
connect.setParam(connectParam.toJSONString());
|
connect.setParam(connectParam.toJSONString());
|
||||||
log.info("调用设备连接方法,参数: {}", connect);
|
log.info("调用设备连接方法,参数: {}", connect);
|
||||||
|
@ -72,7 +111,7 @@ public class KeypadServiceImpl implements KeypadService {
|
||||||
// 是否自动结束
|
// 是否自动结束
|
||||||
plaintextParam.put("bAutoEnd", 1);
|
plaintextParam.put("bAutoEnd", 1);
|
||||||
// 超时时间
|
// 超时时间
|
||||||
plaintextParam.put("TimeOut", 30000);
|
plaintextParam.put("TimeOut", 80000);
|
||||||
|
|
||||||
plaintextParam.put("ActiveKeys", 81919);
|
plaintextParam.put("ActiveKeys", 81919);
|
||||||
plaintextParam.put("TerminateKeys", 1024);
|
plaintextParam.put("TerminateKeys", 1024);
|
||||||
|
@ -104,14 +143,14 @@ public class KeypadServiceImpl implements KeypadService {
|
||||||
}
|
}
|
||||||
String password = webSocketClient.getPassword();
|
String password = webSocketClient.getPassword();
|
||||||
log.info("密码输入完成,密码为: {}", password);
|
log.info("密码输入完成,密码为: {}", password);
|
||||||
return Result.ok("密码输入完成!", password);
|
result = Result.ok("密码输入完成!", password);
|
||||||
} else {
|
} else {
|
||||||
log.error("密码输入异常!详情:{}", connectResult.getDesc());
|
log.error("密码输入异常!详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(plaintextResult.getResult()));
|
||||||
return Result.error("密码输入异常!详情:" + connectResult.getDesc());
|
result = Result.error("密码输入异常!详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(plaintextResult.getResult()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.error("数字键盘设备连接失败!详情:{}", connectResult.getDesc());
|
log.error("数字键盘设备连接失败!详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||||
return Result.error("数字键盘设备连接失败!详情:" + connectResult.getDesc());
|
result = Result.error("数字键盘设备连接失败!详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (webSocketClient != null) {
|
if (webSocketClient != null) {
|
||||||
|
@ -128,12 +167,12 @@ public class KeypadServiceImpl implements KeypadService {
|
||||||
IDCardReadResultVO closeResult = thirdServiceUtil.callDevice(close, IDCardReadResultVO.class);
|
IDCardReadResultVO closeResult = thirdServiceUtil.callDevice(close, IDCardReadResultVO.class);
|
||||||
log.info("设备关闭结果: {}", closeResult);
|
log.info("设备关闭结果: {}", closeResult);
|
||||||
if (closeResult.getResult() != 0) {
|
if (closeResult.getResult() != 0) {
|
||||||
log.error("数字键盘设备关闭异常!");
|
log.error("数字键盘设备关闭异常!详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(closeResult.getResult()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消输入 (明文或者密文)
|
* 取消输入 (明文或者密文)
|
||||||
* @return
|
* @return
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.dpkj.modules.readcard.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.dpkj.common.constant.ErrorCodeConstants;
|
||||||
import com.dpkj.common.constant.LexMarkConst;
|
import com.dpkj.common.constant.LexMarkConst;
|
||||||
import com.dpkj.common.constant.MiddlewareFunctionsConst;
|
import com.dpkj.common.constant.MiddlewareFunctionsConst;
|
||||||
import com.dpkj.common.dto.LexMarkDTO;
|
import com.dpkj.common.dto.LexMarkDTO;
|
||||||
|
@ -37,9 +38,11 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份证读取
|
* 身份证读取
|
||||||
* 1. 连接身份证读取设备
|
* 1. 获取设备状态
|
||||||
* 2. 非接触身份证读取
|
* 2. 设备连接状态需初始化
|
||||||
* 3. 关闭设备
|
* 3. 连接身份证读取设备
|
||||||
|
* 4. 非接触身份证读取
|
||||||
|
* 5. 关闭设备
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -48,6 +51,57 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||||
Result result = null;
|
Result result = null;
|
||||||
log.info("开始执行身份证读取流程");
|
log.info("开始执行身份证读取流程");
|
||||||
try {
|
try {
|
||||||
|
// 获取设备状态
|
||||||
|
LexMarkDTO status = new LexMarkDTO();
|
||||||
|
status.setDevName(LexMarkConst.ID_CARD_READ);
|
||||||
|
status.setCallID(0);
|
||||||
|
status.setActionName(MiddlewareFunctionsConst.GET_STATUS_SYNC);
|
||||||
|
JSONObject statusParam = new JSONObject();
|
||||||
|
statusParam.put("timeout", 0);
|
||||||
|
log.info("获取设备状态,参数: {}", status);
|
||||||
|
IDCardReadResultVO statusResult = thirdServiceUtil.callDevice(status, IDCardReadResultVO.class);
|
||||||
|
log.info("获取设备状态结果: {}", statusResult);
|
||||||
|
if (statusResult.getResult() == 0) {
|
||||||
|
// 连接状态,初始化
|
||||||
|
LexMarkDTO reset = new LexMarkDTO();
|
||||||
|
reset.setDevName(LexMarkConst.ID_CARD_READ);
|
||||||
|
reset.setCallID(0);
|
||||||
|
reset.setActionName(MiddlewareFunctionsConst.RESET);
|
||||||
|
JSONObject resetParam = new JSONObject();
|
||||||
|
resetParam.put("ResetAction", 1);
|
||||||
|
log.info("调用复位(初始化)方法,参数: {}", reset);
|
||||||
|
IDCardReadResultVO resetResult = thirdServiceUtil.callDevice(reset, IDCardReadResultVO.class);
|
||||||
|
log.info("设备复位(初始化)结果: {}", resetResult);
|
||||||
|
if (resetResult.getResult() == 0) {
|
||||||
|
// 复位成功
|
||||||
|
result = connectAndReadIDCard(result);
|
||||||
|
} else {
|
||||||
|
result = Result.error("身份证读取设备(初始化)异常,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(resetResult.getResult()));
|
||||||
|
log.info("身份证读取设备(初始化)异常,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(resetResult.getResult()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 设备未连接,无需复位(初始化)
|
||||||
|
result = connectAndReadIDCard(result);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
log.info("准备关闭身份证读卡设备");
|
||||||
|
// 关闭身份证读卡设备
|
||||||
|
LexMarkDTO close = new LexMarkDTO();
|
||||||
|
close.setDevName(LexMarkConst.ID_CARD_READ);
|
||||||
|
close.setCallID(0);
|
||||||
|
close.setActionName(MiddlewareFunctionsConst.CLOSE_CONNECTION);
|
||||||
|
log.info("调用设备关闭方法,参数: {}", close);
|
||||||
|
IDCardReadResultVO closeResult = thirdServiceUtil.callDevice(close, IDCardReadResultVO.class);
|
||||||
|
log.info("设备关闭结果: {}", closeResult);
|
||||||
|
if (closeResult.getResult() != 0) {
|
||||||
|
log.error("身份证读卡设备关闭异常!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("身份证读取流程结束,最终返回结果: {}", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Result connectAndReadIDCard(Result result) {
|
||||||
log.info("准备连接非接身份证读卡模块");
|
log.info("准备连接非接身份证读卡模块");
|
||||||
// 连接非接身份证读卡模块
|
// 连接非接身份证读卡模块
|
||||||
LexMarkDTO connect = new LexMarkDTO();
|
LexMarkDTO connect = new LexMarkDTO();
|
||||||
|
@ -69,7 +123,7 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||||
read.setCallID(19256);
|
read.setCallID(19256);
|
||||||
read.setDevName(LexMarkConst.ID_CARD_READ);
|
read.setDevName(LexMarkConst.ID_CARD_READ);
|
||||||
JSONObject readParam = new JSONObject();
|
JSONObject readParam = new JSONObject();
|
||||||
readParam.put("TimeOut", 0);
|
readParam.put("TimeOut", 80000);
|
||||||
readParam.put("TrackMap", 776);
|
readParam.put("TrackMap", 776);
|
||||||
read.setParam(readParam.toJSONString());
|
read.setParam(readParam.toJSONString());
|
||||||
log.info("调用设备读取方法,参数: {}", read);
|
log.info("调用设备读取方法,参数: {}", read);
|
||||||
|
@ -95,56 +149,80 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||||
userInfoVO.setGrantDept(array[6]);
|
userInfoVO.setGrantDept(array[6]);
|
||||||
userInfoVO.setUserLifeBegin(array[7]);
|
userInfoVO.setUserLifeBegin(array[7]);
|
||||||
userInfoVO.setUserLifeEnd(array[8]);
|
userInfoVO.setUserLifeEnd(array[8]);
|
||||||
userInfoVO.setIDhead(array[9]);
|
userInfoVO.setIDhead(array[9].replace("\\", "/"));
|
||||||
// 正面
|
// 正面
|
||||||
userInfoVO.setFrontimage(resultParam.getFrontimage().getDatas());
|
userInfoVO.setFrontimage(resultParam.getFrontimage().getDatas().replace("\\", "/"));
|
||||||
// 反面
|
// 反面
|
||||||
userInfoVO.setBackimage(resultParam.getBackimage().getDatas());
|
userInfoVO.setBackimage(resultParam.getBackimage().getDatas().replace("\\", "/"));
|
||||||
result = Result.ok(userInfoVO);
|
result = Result.ok(userInfoVO);
|
||||||
log.info("用户信息封装成功,返回结果: {}", result);
|
log.info("用户信息封装成功,返回结果: {}", result);
|
||||||
} else {
|
} else {
|
||||||
result = Result.error("身份证读取失败!");
|
result = Result.error("身份证读取失败!失败原因:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(resultParam.getResult()));
|
||||||
log.error("身份证信息解析失败,返回结果: {}", result);
|
log.error("身份证信息解析失败,错误信息: {}, 返回结果: {}", ErrorCodeConstants.COMMON_ERROR_CODE.get(resultParam.getResult()), result);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result = Result.error(readResult.getDesc());
|
result = Result.error(ErrorCodeConstants.COMMON_ERROR_CODE.get(readResult.getResult()));
|
||||||
log.error("身份证读取失败,错误信息: {}, 返回结果: {}", readResult.getDesc(), result);
|
log.error("身份证读取失败,错误信息: {}, 返回结果: {}", ErrorCodeConstants.COMMON_ERROR_CODE.get(readResult.getResult()), result);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result = Result.error(connectResult.getDesc());
|
result = Result.error(ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||||
log.error("设备连接失败,错误信息: {}, 返回结果: {}", connectResult.getDesc(), result);
|
log.error("设备连接失败,错误信息: {}, 返回结果: {}", connectResult, result);
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
log.info("准备关闭身份证读卡设备");
|
|
||||||
// 关闭身份证读卡设备
|
|
||||||
LexMarkDTO close = new LexMarkDTO();
|
|
||||||
close.setDevName(LexMarkConst.ID_CARD_READ);
|
|
||||||
close.setCallID(0);
|
|
||||||
close.setActionName(MiddlewareFunctionsConst.CLOSE_CONNECTION);
|
|
||||||
log.info("调用设备关闭方法,参数: {}", close);
|
|
||||||
IDCardReadResultVO closeResult = thirdServiceUtil.callDevice(close, IDCardReadResultVO.class);
|
|
||||||
log.info("设备关闭结果: {}", closeResult);
|
|
||||||
if (closeResult.getResult() != 0) {
|
|
||||||
log.error("身份证读卡设备关闭异常!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
log.info("身份证读取流程结束,最终返回结果: {}", result);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社保卡读取
|
* 社保卡读取
|
||||||
* 1. 连接社保卡读取设备
|
* 1. 获取社保卡读取设备状态
|
||||||
* 2. 进卡读卡
|
* 2. 连接状态需复位(初始化)
|
||||||
* 3. 读卡器上电
|
* 3. 连接社保卡读取设备
|
||||||
* 4. 社保卡信息读取
|
* 4. 进卡读卡
|
||||||
|
* 5. 读卡器上电
|
||||||
|
* 6. 社保卡信息读取
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result SocialSecurityCardReader() {
|
public Result SocialSecurityCardReader() {
|
||||||
|
Result result = null;
|
||||||
|
// 获取设备状态
|
||||||
|
LexMarkDTO status = new LexMarkDTO();
|
||||||
|
status.setDevName(LexMarkConst.CARD_READER);
|
||||||
|
status.setCallID(0);
|
||||||
|
status.setActionName(MiddlewareFunctionsConst.GET_STATUS_SYNC);
|
||||||
|
JSONObject statusParam = new JSONObject();
|
||||||
|
statusParam.put("timeout", 0);
|
||||||
|
log.info("获取设备状态,参数: {}", status);
|
||||||
|
IDCardReadResultVO statusResult = thirdServiceUtil.callDevice(status, IDCardReadResultVO.class);
|
||||||
|
log.info("获取设备状态结果: {}", statusResult);
|
||||||
|
if (statusResult.getResult() == 0) {
|
||||||
|
// 连接状态,初始化
|
||||||
|
LexMarkDTO reset = new LexMarkDTO();
|
||||||
|
reset.setDevName(LexMarkConst.CARD_READER);
|
||||||
|
reset.setCallID(0);
|
||||||
|
reset.setActionName(MiddlewareFunctionsConst.RESET);
|
||||||
|
JSONObject resetParam = new JSONObject();
|
||||||
|
resetParam.put("ResetAction", 1);
|
||||||
|
log.info("调用复位(初始化)方法,参数: {}", reset);
|
||||||
|
IDCardReadResultVO resetResult = thirdServiceUtil.callDevice(reset, IDCardReadResultVO.class);
|
||||||
|
log.info("设备复位(初始化)结果: {}", resetResult);
|
||||||
|
if (resetResult.getResult() == 0) {
|
||||||
|
// 复位成功
|
||||||
|
result = connectAndSocialSecurityCardReader(result);
|
||||||
|
} else {
|
||||||
|
result = Result.error("社保卡读取设备(初始化)异常,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(resetResult.getResult()));
|
||||||
|
log.info("社保卡读取设备(初始化)异常,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(resetResult.getResult()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 设备未连接,无需复位(初始化)
|
||||||
|
result = connectAndSocialSecurityCardReader(result);
|
||||||
|
}
|
||||||
|
log.info("社保卡读取流程结束,最终返回结果: {}", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result connectAndSocialSecurityCardReader(Result result) {
|
||||||
log.info("开始执行社保卡读取流程");
|
log.info("开始执行社保卡读取流程");
|
||||||
|
|
||||||
// 社保卡读卡设备连接
|
// 社保卡读卡设备连接
|
||||||
|
@ -172,7 +250,7 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||||
JSONObject enterTheCardParam = new JSONObject();
|
JSONObject enterTheCardParam = new JSONObject();
|
||||||
enterTheCardParam.put("DevType", 5);
|
enterTheCardParam.put("DevType", 5);
|
||||||
enterTheCardParam.put("TrackMap", 11);
|
enterTheCardParam.put("TrackMap", 11);
|
||||||
enterTheCardParam.put("TimeOut", 0);
|
enterTheCardParam.put("TimeOut", 80000);
|
||||||
enterTheCard.setParam(enterTheCardParam.toJSONString());
|
enterTheCard.setParam(enterTheCardParam.toJSONString());
|
||||||
log.info("调用进卡方法,参数: {}", enterTheCard);
|
log.info("调用进卡方法,参数: {}", enterTheCard);
|
||||||
IDCardReadResultVO enterTheCardResult = thirdServiceUtil.callDevice(enterTheCard, IDCardReadResultVO.class);
|
IDCardReadResultVO enterTheCardResult = thirdServiceUtil.callDevice(enterTheCard, IDCardReadResultVO.class);
|
||||||
|
@ -230,20 +308,20 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||||
log.info("社保卡信息解析完成,返回成功结果");
|
log.info("社保卡信息解析完成,返回成功结果");
|
||||||
return Result.ok(socialSecurityCardInfoVO);
|
return Result.ok(socialSecurityCardInfoVO);
|
||||||
} else {
|
} else {
|
||||||
log.error("社保卡信息读取失败,详情:{}", socialSecurityCardReaderResult.getDesc());
|
log.error("社保卡信息读取失败,详情:{}", ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(socialSecurityCardReaderResult.getResult()));
|
||||||
return Result.error("社保卡信息读取失败!详情:" + socialSecurityCardReaderResult.getDesc());
|
return Result.error("社保卡信息读取失败,详情:{}" + ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(socialSecurityCardReaderResult.getResult()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.error("社保卡读取设备上电失败,详情:{}", powerOnResult.getDesc());
|
log.error("社保卡读取设备上电失败,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(powerOnResult.getResult()));
|
||||||
return Result.error("社保卡读取设备上电失败!详情:" + powerOnResult.getDesc());
|
return Result.error("社保卡读取设备上电失败,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(powerOnResult.getResult()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.error("社保卡读取设备进卡失败,详情:{}", enterTheCardResult.getDesc());
|
log.error("社保卡读取设备进卡失败,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(enterTheCardResult.getResult()));
|
||||||
return Result.error("社保卡读取设备进卡失败!详情:" + enterTheCardResult.getDesc());
|
return Result.error("社保卡读取设备进卡失败,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(enterTheCardResult.getResult()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.error("社保卡读取设备连接失败,详情:{}", connectResult.getDesc());
|
log.error("社保卡读取设备连接失败,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||||
return Result.error("社保卡读取设备连接失败!详情:" + connectResult.getDesc());
|
return Result.error("社保卡读取设备连接失败,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,13 +361,13 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||||
log.info("设备关闭操作结果: {}", closeResult);
|
log.info("设备关闭操作结果: {}", closeResult);
|
||||||
|
|
||||||
if (closeResult.getResult() != 0) {
|
if (closeResult.getResult() != 0) {
|
||||||
log.error("社保卡读卡设备关闭异常!");
|
log.error("社保卡读卡设备关闭异常!详情:{}", ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(closeResult.getResult()));
|
||||||
}
|
}
|
||||||
log.info("社保卡退卡流程完成,退卡成功");
|
log.info("社保卡退卡流程完成,退卡成功");
|
||||||
return Result.ok("退卡成功!");
|
return Result.ok("退卡成功!");
|
||||||
} else {
|
} else {
|
||||||
log.error("退卡失败!请联系工作人员!");
|
log.error("退卡失败!请联系工作人员!失败原因:{}", ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(cardRefundResult.getResult()));
|
||||||
return Result.error("退卡失败!请联系工作人员!");
|
return Result.error("退卡失败!请联系工作人员!失败原因:" + ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(cardRefundResult.getResult()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue