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
17525a14
Commit
17525a14
authored
Feb 01, 2023
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发送成功消息
parent
062405e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
PmsUseServiceImpl.java
...a/iot/sixiang/license/service/impl/PmsUseServiceImpl.java
+16
-1
CommonUtil.java
...se/src/main/java/iot/sixiang/license/util/CommonUtil.java
+24
-2
No files found.
license/src/main/java/iot/sixiang/license/service/impl/PmsUseServiceImpl.java
View file @
17525a14
...
...
@@ -7,6 +7,8 @@ import iot.sixiang.license.mapper.PmsUseLogMapper;
import
iot.sixiang.license.model.PageInfoModel
;
import
iot.sixiang.license.model.dto.ReportErrorMsgDTO
;
import
iot.sixiang.license.service.PmsUseService
;
import
iot.sixiang.license.util.CommonUtil
;
import
org.owasp.esapi.ESAPI
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -45,7 +47,20 @@ public class PmsUseServiceImpl implements PmsUseService {
PmsUseLog
pmsUseLog
=
new
PmsUseLog
();
pmsUseLog
.
setId
(
reportErrorMsgDTO
.
getId
());
pmsUseLog
.
setStatus
(
1
);
pmsUseLog
.
setMessage
(
reportErrorMsgDTO
.
getErrorMsg
());
if
(
reportErrorMsgDTO
.
getErrorMsg
()
!=
null
)
{
String
[]
successMessage
=
reportErrorMsgDTO
.
getErrorMsg
().
split
(
","
);
if
(
successMessage
.
length
==
2
)
{
// 身份证脱敏
String
idCardString
=
ESAPI
.
encoder
().
encodeForDN
(
CommonUtil
.
idCardEncrypt
(
successMessage
[
1
]));
// 姓名脱敏
String
nameString
=
ESAPI
.
encoder
().
encodeForDN
(
CommonUtil
.
nameDesensitization
(
CommonUtil
.
unicodeToStr
(
successMessage
[
0
])));
pmsUseLog
.
setMessage
(
nameString
+
","
+
idCardString
);
}
else
{
pmsUseLog
.
setMessage
(
reportErrorMsgDTO
.
getErrorMsg
());
}
}
pmsUseLogMapper
.
updateById
(
pmsUseLog
);
}
...
...
license/src/main/java/iot/sixiang/license/util/CommonUtil.java
View file @
17525a14
...
...
@@ -14,7 +14,12 @@ import java.security.NoSuchAlgorithmException;
import
java.security.SecureRandom
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.Calendar
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
...
...
@@ -301,7 +306,7 @@ public class CommonUtil {
return
myName
;
}
//身份证前三后四脱敏
//
身份证前三后四脱敏
public
static
String
idCardEncrypt
(
String
idcard
)
{
if
(
idcard
==
null
||
idcard
.
length
()
==
0
||
idcard
.
contains
(
"*"
))
{
return
idcard
;
...
...
@@ -386,4 +391,21 @@ public class CommonUtil {
}
).
collect
(
Collectors
.
toList
());
}
/**
* UNICODE转字符串
*
* @param unicode
* @return
*/
public
static
String
unicodeToStr
(
String
unicode
)
{
StringBuilder
sb
=
new
StringBuilder
();
String
[]
hex
=
unicode
.
split
(
"\\\\u"
);
for
(
int
i
=
1
;
i
<
hex
.
length
;
i
++)
{
int
index
=
Integer
.
parseInt
(
hex
[
i
],
16
);
sb
.
append
((
char
)
index
);
}
return
sb
.
toString
();
}
}
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