Commit b94e7e4d authored by ma's avatar ma

合并

parent ede6dc08
...@@ -18,6 +18,7 @@ import iot.sixiang.license.model.SessionContext; ...@@ -18,6 +18,7 @@ import iot.sixiang.license.model.SessionContext;
import iot.sixiang.license.model.dto.ReportErrorMsgDTO; import iot.sixiang.license.model.dto.ReportErrorMsgDTO;
import iot.sixiang.license.service.PmsUseService; import iot.sixiang.license.service.PmsUseService;
import iot.sixiang.license.service.TerminalDeviceService; import iot.sixiang.license.service.TerminalDeviceService;
import iot.sixiang.license.third_lib.LibHelper;
import iot.sixiang.license.util.CommonUtil; import iot.sixiang.license.util.CommonUtil;
import iot.sixiang.license.util.HexUtil; import iot.sixiang.license.util.HexUtil;
import iot.sixiang.license.util.SpringUtil; import iot.sixiang.license.util.SpringUtil;
...@@ -121,7 +122,7 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> { ...@@ -121,7 +122,7 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
ctx.close(); ctx.close();
} }
private boolean handlerCheckAuth(SocketChannel channel, String remoteIp, int remotePort, DeviceProtocol protocol) { private boolean handleCheckAuth(SocketChannel channel, String remoteIp, int remotePort, DeviceProtocol protocol) {
// 正式代码要放开 // 正式代码要放开
LibHelper libHelper = SpringUtil.getBean(LibHelper.class); LibHelper libHelper = SpringUtil.getBean(LibHelper.class);
byte[] bytes = libHelper.decodeExtendedPayload(protocol.getContent(), 0, protocol.getContent().length); byte[] bytes = libHelper.decodeExtendedPayload(protocol.getContent(), 0, protocol.getContent().length);
......
...@@ -153,7 +153,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -153,7 +153,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
if (deviceId.equals(device.getDeviceId())) { if (deviceId.equals(device.getDeviceId())) {
return BaseResult.success(); return BaseResult.success();
} else { } else {
return BaseResult.failed().msg("设备sn已被绑定"); return BaseResult.failed().setMsgValue("设备sn已被绑定");
} }
} }
LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
...@@ -161,10 +161,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -161,10 +161,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
Device tempDevice = deviceMapper.selectOne(wrapper); Device tempDevice = deviceMapper.selectOne(wrapper);
if (tempDevice != null) { if (tempDevice != null) {
if (!StringUtils.isEmpty(tempDevice.getSnBind())) { if (!StringUtils.isEmpty(tempDevice.getSnBind())) {
return BaseResult.failed().msg("设备已绑定sn"); return BaseResult.failed().setMsgValue("设备已绑定sn");
} }
} else { } else {
return BaseResult.failed().msg("请输入正确的id"); return BaseResult.failed().setMsgValue("请输入正确的id");
} }
tempDevice.setSn(sn); tempDevice.setSn(sn);
tempDevice.setSnBind(snBind); tempDevice.setSnBind(snBind);
......
package iot.sixiang.license.util; package iot.sixiang.license.util;
import iot.sixiang.license.consts.Constant; import iot.sixiang.license.consts.Constant;
import iot.sixiang.license.model.ResResult;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.util.TextUtils; import org.apache.http.util.TextUtils;
...@@ -272,7 +273,9 @@ public class CommonUtil { ...@@ -272,7 +273,9 @@ public class CommonUtil {
//身份证前三后四脱敏 //身份证前三后四脱敏
public static String idCardEncrypt(String idcard) { public static String idCardEncrypt(String idcard) {
if (idcard == null || idcard.length() == 0 || idcard.contains("*")) return idcard; if (idcard == null || idcard.length() == 0 || idcard.contains("*")) {
return idcard;
}
if (StringUtils.isEmpty(idcard) || (idcard.length() < 8)) { if (StringUtils.isEmpty(idcard) || (idcard.length() < 8)) {
return idcard; return idcard;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment