Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
b94e7e4d
Commit
b94e7e4d
authored
Dec 09, 2022
by
ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并
parent
ede6dc08
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
DeviceServerHandler.java
.../java/iot/sixiang/license/device/DeviceServerHandler.java
+2
-1
DeviceServiceImpl.java
...a/iot/sixiang/license/service/impl/DeviceServiceImpl.java
+3
-3
CommonUtil.java
...se/src/main/java/iot/sixiang/license/util/CommonUtil.java
+4
-1
No files found.
license/src/main/java/iot/sixiang/license/device/DeviceServerHandler.java
View file @
b94e7e4d
...
@@ -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
handle
r
CheckAuth
(
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
);
...
...
license/src/main/java/iot/sixiang/license/service/impl/DeviceServiceImpl.java
View file @
b94e7e4d
...
@@ -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
);
...
...
license/src/main/java/iot/sixiang/license/util/CommonUtil.java
View file @
b94e7e4d
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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment