设备调用之前复位(初始化)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.dpkj.modules.keypad.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dpkj.common.constant.ErrorCodeConstants;
|
||||
import com.dpkj.common.constant.LexMarkConst;
|
||||
import com.dpkj.common.constant.MiddlewareFunctionsConst;
|
||||
import com.dpkj.common.dto.LexMarkDTO;
|
||||
@@ -38,6 +39,44 @@ public class KeypadServiceImpl implements KeypadService {
|
||||
*/
|
||||
@Override
|
||||
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("开始执行密码输入流程");
|
||||
|
||||
// 连接数字键盘
|
||||
@@ -47,7 +86,7 @@ public class KeypadServiceImpl implements KeypadService {
|
||||
connect.setActionName(MiddlewareFunctionsConst.OPEN_CONNECTION);
|
||||
connect.setCallID(1000);
|
||||
JSONObject connectParam = new JSONObject();
|
||||
connectParam.put("TimeOut", 90000);
|
||||
connectParam.put("TimeOut", 30000);
|
||||
connectParam.put("ServiceName", LexMarkConst.ENCRYPTOR);
|
||||
connect.setParam(connectParam.toJSONString());
|
||||
log.info("调用设备连接方法,参数: {}", connect);
|
||||
@@ -72,7 +111,7 @@ public class KeypadServiceImpl implements KeypadService {
|
||||
// 是否自动结束
|
||||
plaintextParam.put("bAutoEnd", 1);
|
||||
// 超时时间
|
||||
plaintextParam.put("TimeOut", 30000);
|
||||
plaintextParam.put("TimeOut", 80000);
|
||||
|
||||
plaintextParam.put("ActiveKeys", 81919);
|
||||
plaintextParam.put("TerminateKeys", 1024);
|
||||
@@ -104,14 +143,14 @@ public class KeypadServiceImpl implements KeypadService {
|
||||
}
|
||||
String password = webSocketClient.getPassword();
|
||||
log.info("密码输入完成,密码为: {}", password);
|
||||
return Result.ok("密码输入完成!", password);
|
||||
result = Result.ok("密码输入完成!", password);
|
||||
} else {
|
||||
log.error("密码输入异常!详情:{}", connectResult.getDesc());
|
||||
return Result.error("密码输入异常!详情:" + connectResult.getDesc());
|
||||
log.error("密码输入异常!详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(plaintextResult.getResult()));
|
||||
result = Result.error("密码输入异常!详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(plaintextResult.getResult()));
|
||||
}
|
||||
} else {
|
||||
log.error("数字键盘设备连接失败!详情:{}", connectResult.getDesc());
|
||||
return Result.error("数字键盘设备连接失败!详情:" + connectResult.getDesc());
|
||||
log.error("数字键盘设备连接失败!详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||
result = Result.error("数字键盘设备连接失败!详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||
}
|
||||
} finally {
|
||||
if (webSocketClient != null) {
|
||||
@@ -128,12 +167,12 @@ public class KeypadServiceImpl implements KeypadService {
|
||||
IDCardReadResultVO closeResult = thirdServiceUtil.callDevice(close, IDCardReadResultVO.class);
|
||||
log.info("设备关闭结果: {}", closeResult);
|
||||
if (closeResult.getResult() != 0) {
|
||||
log.error("数字键盘设备关闭异常!");
|
||||
log.error("数字键盘设备关闭异常!详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(closeResult.getResult()));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消输入 (明文或者密文)
|
||||
* @return
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.dpkj.modules.readcard.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dpkj.common.constant.ErrorCodeConstants;
|
||||
import com.dpkj.common.constant.LexMarkConst;
|
||||
import com.dpkj.common.constant.MiddlewareFunctionsConst;
|
||||
import com.dpkj.common.dto.LexMarkDTO;
|
||||
@@ -37,9 +38,11 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||
|
||||
/**
|
||||
* 身份证读取
|
||||
* 1. 连接身份证读取设备
|
||||
* 2. 非接触身份证读取
|
||||
* 3. 关闭设备
|
||||
* 1. 获取设备状态
|
||||
* 2. 设备连接状态需初始化
|
||||
* 3. 连接身份证读取设备
|
||||
* 4. 非接触身份证读取
|
||||
* 5. 关闭设备
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -48,71 +51,37 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||
Result result = null;
|
||||
log.info("开始执行身份证读取流程");
|
||||
try {
|
||||
log.info("准备连接非接身份证读卡模块");
|
||||
// 连接非接身份证读卡模块
|
||||
LexMarkDTO connect = new LexMarkDTO();
|
||||
connect.setActionName(MiddlewareFunctionsConst.OPEN_CONNECTION);
|
||||
connect.setCallID(19256);
|
||||
connect.setDevName(LexMarkConst.ID_CARD_READ);
|
||||
JSONObject connectParam = new JSONObject();
|
||||
connectParam.put("TimeOut", 30000);
|
||||
connectParam.put("ServiceName", LexMarkConst.ID_CARD_READ);
|
||||
connect.setParam(connectParam.toJSONString());
|
||||
log.info("调用设备连接方法,参数: {}", connect);
|
||||
IDCardReadResultVO connectResult = thirdServiceUtil.callDevice(connect, IDCardReadResultVO.class);
|
||||
log.info("设备连接结果: {}", connectResult);
|
||||
if (connectResult.getResult() == 0) {
|
||||
log.info("设备连接成功,准备读取身份证");
|
||||
// 身份证读取
|
||||
LexMarkDTO read = new LexMarkDTO();
|
||||
read.setActionName(MiddlewareFunctionsConst.ACCEPT_AND_READ_TRACKS);
|
||||
read.setCallID(19256);
|
||||
read.setDevName(LexMarkConst.ID_CARD_READ);
|
||||
JSONObject readParam = new JSONObject();
|
||||
readParam.put("TimeOut", 0);
|
||||
readParam.put("TrackMap", 776);
|
||||
read.setParam(readParam.toJSONString());
|
||||
log.info("调用设备读取方法,参数: {}", read);
|
||||
IDCardReadResultVO readResult = thirdServiceUtil.callDevice(read, IDCardReadResultVO.class);
|
||||
log.info("设备读取结果: {}", readResult);
|
||||
if (readResult.getResult() == 0) {
|
||||
log.info("身份证读取成功,开始解析身份证信息");
|
||||
IDCardReadResultVO.Param resultParam = JSON.parseObject(readResult.getParam().toString(), IDCardReadResultVO.Param.class);
|
||||
if (resultParam.getResult() == 0) {
|
||||
log.info("身份证信息解析成功,开始封装用户信息");
|
||||
UserInfoVO userInfoVO = new UserInfoVO();
|
||||
// 身份证基本信息 解析
|
||||
String[] array = Stream.of(resultParam.getChipdata().getDatas().split("\\|"))
|
||||
.filter(pair -> pair.contains("="))
|
||||
.map(pair -> pair.split("=")[1])
|
||||
.toArray(String[]::new);
|
||||
userInfoVO.setName(array[0]);
|
||||
userInfoVO.setSex(array[1]);
|
||||
userInfoVO.setNation(array[2]);
|
||||
userInfoVO.setBorn(array[3]);
|
||||
userInfoVO.setAddress(array[4]);
|
||||
userInfoVO.setIDCardNo(array[5]);
|
||||
userInfoVO.setGrantDept(array[6]);
|
||||
userInfoVO.setUserLifeBegin(array[7]);
|
||||
userInfoVO.setUserLifeEnd(array[8]);
|
||||
userInfoVO.setIDhead(array[9]);
|
||||
// 正面
|
||||
userInfoVO.setFrontimage(resultParam.getFrontimage().getDatas());
|
||||
// 反面
|
||||
userInfoVO.setBackimage(resultParam.getBackimage().getDatas());
|
||||
result = Result.ok(userInfoVO);
|
||||
log.info("用户信息封装成功,返回结果: {}", result);
|
||||
} else {
|
||||
result = Result.error("身份证读取失败!");
|
||||
log.error("身份证信息解析失败,返回结果: {}", result);
|
||||
}
|
||||
// 获取设备状态
|
||||
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(readResult.getDesc());
|
||||
log.error("身份证读取失败,错误信息: {}, 返回结果: {}", readResult.getDesc(), result);
|
||||
result = Result.error("身份证读取设备(初始化)异常,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(resetResult.getResult()));
|
||||
log.info("身份证读取设备(初始化)异常,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(resetResult.getResult()));
|
||||
}
|
||||
} else {
|
||||
result = Result.error(connectResult.getDesc());
|
||||
log.error("设备连接失败,错误信息: {}, 返回结果: {}", connectResult.getDesc(), result);
|
||||
// 设备未连接,无需复位(初始化)
|
||||
result = connectAndReadIDCard(result);
|
||||
}
|
||||
} finally {
|
||||
log.info("准备关闭身份证读卡设备");
|
||||
@@ -132,19 +101,128 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||
return result;
|
||||
}
|
||||
|
||||
private Result connectAndReadIDCard(Result result) {
|
||||
log.info("准备连接非接身份证读卡模块");
|
||||
// 连接非接身份证读卡模块
|
||||
LexMarkDTO connect = new LexMarkDTO();
|
||||
connect.setActionName(MiddlewareFunctionsConst.OPEN_CONNECTION);
|
||||
connect.setCallID(19256);
|
||||
connect.setDevName(LexMarkConst.ID_CARD_READ);
|
||||
JSONObject connectParam = new JSONObject();
|
||||
connectParam.put("TimeOut", 30000);
|
||||
connectParam.put("ServiceName", LexMarkConst.ID_CARD_READ);
|
||||
connect.setParam(connectParam.toJSONString());
|
||||
log.info("调用设备连接方法,参数: {}", connect);
|
||||
IDCardReadResultVO connectResult = thirdServiceUtil.callDevice(connect, IDCardReadResultVO.class);
|
||||
log.info("设备连接结果: {}", connectResult);
|
||||
if (connectResult.getResult() == 0) {
|
||||
log.info("设备连接成功,准备读取身份证");
|
||||
// 身份证读取
|
||||
LexMarkDTO read = new LexMarkDTO();
|
||||
read.setActionName(MiddlewareFunctionsConst.ACCEPT_AND_READ_TRACKS);
|
||||
read.setCallID(19256);
|
||||
read.setDevName(LexMarkConst.ID_CARD_READ);
|
||||
JSONObject readParam = new JSONObject();
|
||||
readParam.put("TimeOut", 80000);
|
||||
readParam.put("TrackMap", 776);
|
||||
read.setParam(readParam.toJSONString());
|
||||
log.info("调用设备读取方法,参数: {}", read);
|
||||
IDCardReadResultVO readResult = thirdServiceUtil.callDevice(read, IDCardReadResultVO.class);
|
||||
log.info("设备读取结果: {}", readResult);
|
||||
if (readResult.getResult() == 0) {
|
||||
log.info("身份证读取成功,开始解析身份证信息");
|
||||
IDCardReadResultVO.Param resultParam = JSON.parseObject(readResult.getParam().toString(), IDCardReadResultVO.Param.class);
|
||||
if (resultParam.getResult() == 0) {
|
||||
log.info("身份证信息解析成功,开始封装用户信息");
|
||||
UserInfoVO userInfoVO = new UserInfoVO();
|
||||
// 身份证基本信息 解析
|
||||
String[] array = Stream.of(resultParam.getChipdata().getDatas().split("\\|"))
|
||||
.filter(pair -> pair.contains("="))
|
||||
.map(pair -> pair.split("=")[1])
|
||||
.toArray(String[]::new);
|
||||
userInfoVO.setName(array[0]);
|
||||
userInfoVO.setSex(array[1]);
|
||||
userInfoVO.setNation(array[2]);
|
||||
userInfoVO.setBorn(array[3]);
|
||||
userInfoVO.setAddress(array[4]);
|
||||
userInfoVO.setIDCardNo(array[5]);
|
||||
userInfoVO.setGrantDept(array[6]);
|
||||
userInfoVO.setUserLifeBegin(array[7]);
|
||||
userInfoVO.setUserLifeEnd(array[8]);
|
||||
userInfoVO.setIDhead(array[9].replace("\\", "/"));
|
||||
// 正面
|
||||
userInfoVO.setFrontimage(resultParam.getFrontimage().getDatas().replace("\\", "/"));
|
||||
// 反面
|
||||
userInfoVO.setBackimage(resultParam.getBackimage().getDatas().replace("\\", "/"));
|
||||
result = Result.ok(userInfoVO);
|
||||
log.info("用户信息封装成功,返回结果: {}", result);
|
||||
} else {
|
||||
result = Result.error("身份证读取失败!失败原因:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(resultParam.getResult()));
|
||||
log.error("身份证信息解析失败,错误信息: {}, 返回结果: {}", ErrorCodeConstants.COMMON_ERROR_CODE.get(resultParam.getResult()), result);
|
||||
}
|
||||
} else {
|
||||
result = Result.error(ErrorCodeConstants.COMMON_ERROR_CODE.get(readResult.getResult()));
|
||||
log.error("身份证读取失败,错误信息: {}, 返回结果: {}", ErrorCodeConstants.COMMON_ERROR_CODE.get(readResult.getResult()), result);
|
||||
}
|
||||
} else {
|
||||
result = Result.error(ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||
log.error("设备连接失败,错误信息: {}, 返回结果: {}", connectResult, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 社保卡读取
|
||||
* 1. 连接社保卡读取设备
|
||||
* 2. 进卡读卡
|
||||
* 3. 读卡器上电
|
||||
* 4. 社保卡信息读取
|
||||
* 1. 获取社保卡读取设备状态
|
||||
* 2. 连接状态需复位(初始化)
|
||||
* 3. 连接社保卡读取设备
|
||||
* 4. 进卡读卡
|
||||
* 5. 读卡器上电
|
||||
* 6. 社保卡信息读取
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Override
|
||||
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("开始执行社保卡读取流程");
|
||||
|
||||
// 社保卡读卡设备连接
|
||||
@@ -172,7 +250,7 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||
JSONObject enterTheCardParam = new JSONObject();
|
||||
enterTheCardParam.put("DevType", 5);
|
||||
enterTheCardParam.put("TrackMap", 11);
|
||||
enterTheCardParam.put("TimeOut", 0);
|
||||
enterTheCardParam.put("TimeOut", 80000);
|
||||
enterTheCard.setParam(enterTheCardParam.toJSONString());
|
||||
log.info("调用进卡方法,参数: {}", enterTheCard);
|
||||
IDCardReadResultVO enterTheCardResult = thirdServiceUtil.callDevice(enterTheCard, IDCardReadResultVO.class);
|
||||
@@ -230,20 +308,20 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||
log.info("社保卡信息解析完成,返回成功结果");
|
||||
return Result.ok(socialSecurityCardInfoVO);
|
||||
} else {
|
||||
log.error("社保卡信息读取失败,详情:{}", socialSecurityCardReaderResult.getDesc());
|
||||
return Result.error("社保卡信息读取失败!详情:" + socialSecurityCardReaderResult.getDesc());
|
||||
log.error("社保卡信息读取失败,详情:{}", ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(socialSecurityCardReaderResult.getResult()));
|
||||
return Result.error("社保卡信息读取失败,详情:{}" + ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(socialSecurityCardReaderResult.getResult()));
|
||||
}
|
||||
} else {
|
||||
log.error("社保卡读取设备上电失败,详情:{}", powerOnResult.getDesc());
|
||||
return Result.error("社保卡读取设备上电失败!详情:" + powerOnResult.getDesc());
|
||||
log.error("社保卡读取设备上电失败,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(powerOnResult.getResult()));
|
||||
return Result.error("社保卡读取设备上电失败,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(powerOnResult.getResult()));
|
||||
}
|
||||
} else {
|
||||
log.error("社保卡读取设备进卡失败,详情:{}", enterTheCardResult.getDesc());
|
||||
return Result.error("社保卡读取设备进卡失败!详情:" + enterTheCardResult.getDesc());
|
||||
log.error("社保卡读取设备进卡失败,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(enterTheCardResult.getResult()));
|
||||
return Result.error("社保卡读取设备进卡失败,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(enterTheCardResult.getResult()));
|
||||
}
|
||||
} else {
|
||||
log.error("社保卡读取设备连接失败,详情:{}", connectResult.getDesc());
|
||||
return Result.error("社保卡读取设备连接失败!详情:" + connectResult.getDesc());
|
||||
log.error("社保卡读取设备连接失败,详情:{}", ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||
return Result.error("社保卡读取设备连接失败,详情:" + ErrorCodeConstants.COMMON_ERROR_CODE.get(connectResult.getResult()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,13 +361,13 @@ public class ReadCardServiceImpl implements ReadCardService {
|
||||
log.info("设备关闭操作结果: {}", closeResult);
|
||||
|
||||
if (closeResult.getResult() != 0) {
|
||||
log.error("社保卡读卡设备关闭异常!");
|
||||
log.error("社保卡读卡设备关闭异常!详情:{}", ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(closeResult.getResult()));
|
||||
}
|
||||
log.info("社保卡退卡流程完成,退卡成功");
|
||||
return Result.ok("退卡成功!");
|
||||
} else {
|
||||
log.error("退卡失败!请联系工作人员!");
|
||||
return Result.error("退卡失败!请联系工作人员!");
|
||||
log.error("退卡失败!请联系工作人员!失败原因:{}", ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(cardRefundResult.getResult()));
|
||||
return Result.error("退卡失败!请联系工作人员!失败原因:" + ErrorCodeConstants.SOCIAL_SECURITYCARD_ERROR_CODE.get(cardRefundResult.getResult()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user