Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
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
fangxinjiang
yifu-mvp
Commits
292fdad3
Commit
292fdad3
authored
Jun 29, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员档案相关-身份证、手机号校验优化
parent
50391d15
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
32 deletions
+79
-32
TEmployeeInfoController.java
.../v1/yifu/archives/controller/TEmployeeInfoController.java
+1
-2
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+39
-15
TCheckMobileController.java
...loud/plus/v1/check/controller/TCheckMobileController.java
+13
-5
TCheckMobileService.java
...yifu/cloud/plus/v1/check/service/TCheckMobileService.java
+1
-1
TCheckIdCardServiceImpl.java
...d/plus/v1/check/service/impl/TCheckIdCardServiceImpl.java
+9
-2
TCheckMobileServiceImpl.java
...d/plus/v1/check/service/impl/TCheckMobileServiceImpl.java
+16
-7
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeInfoController.java
View file @
292fdad3
...
...
@@ -279,10 +279,9 @@ public class TEmployeeInfoController {
* @Date: 2022/6/23 17:40
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"档案复档
temployeeinfo_restore
"
,
description
=
"档案复档 projectIds:项目档案ids"
)
@Operation
(
summary
=
"档案复档"
,
description
=
"档案复档 projectIds:项目档案ids"
)
@SysLog
(
"档案复档"
)
@GetMapping
(
"/restoreEmployee"
)
@PreAuthorize
(
"@pms.hasPermission('temployeeinfo_restore')"
)
public
R
<
String
>
restoreEmployee
(
@RequestParam
String
id
,
String
projectIds
)
{
return
tEmployeeInfoService
.
restoreEmployee
(
id
,
projectIds
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
292fdad3
...
...
@@ -507,12 +507,20 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
return
R
.
failed
(
"该手机号已被使用!"
);
}
// 调用校验服务-校验手机号
R
<
Boolean
>
checkMobileR
=
HttpDaprUtil
.
invokeMethodPost
(
daprCheckProperties
.
getAppUrl
(),
daprCheckProperties
.
getAppId
()
,
"/tcheckmobile/inner/checkOneMobile"
,
employeeInfo
.
getEmpPhone
(),
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
checkMobileR
!=
null
&&
checkMobileR
.
getData
()
!=
null
)
{
if
(
Boolean
.
FALSE
.
equals
(
checkMobileR
.
getData
()))
{
return
R
.
failed
(
"手机号校验错误!"
);
TCheckMobile
checkMobile
=
new
TCheckMobile
();
checkMobile
.
setMobile
(
employeeInfo
.
getEmpPhone
());
R
<
TCheckMobile
>
a
=
HttpDaprUtil
.
invokeMethodPost
(
daprCheckProperties
.
getAppUrl
(),
daprCheckProperties
.
getAppId
()
,
"/tcheckmobile/inner/checkOneMobile"
,
checkMobile
,
TCheckMobile
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
a
!=
null
&&
a
.
getData
()
!=
null
)
{
checkMobile
=
a
.
getData
();
if
(
checkMobile
!=
null
&&
Common
.
isNotNull
(
checkMobile
.
getStatus
()))
{
if
(!
CommonConstants
.
ONE_STRING
.
equals
(
checkMobile
.
getStatus
()))
{
return
R
.
failed
(
checkMobile
.
getMessage
());
}
}
else
{
return
R
.
failed
(
"校验服务错误,请联系管理员!"
);
}
}
}
...
...
@@ -757,11 +765,19 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_PHONE_EXIST_ERROR
,
existEmp
.
getEmpIdcard
()));
}
}
else
{
R
<
Boolean
>
checkMobileR
=
HttpDaprUtil
.
invokeMethodPost
(
daprCheckProperties
.
getAppUrl
(),
daprCheckProperties
.
getAppId
()
,
"/tcheckmobile/inner/checkOneMobile"
,
excel
.
getEmpPhone
(),
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
checkMobileR
!=
null
&&
checkMobileR
.
getData
()
!=
null
)
{
if
(
Boolean
.
FALSE
.
equals
(
checkMobileR
.
getData
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_PHONE_CHECK_ERROR
,
excel
.
getEmpIdcard
()));
// 调用校验服务-校验手机号
TCheckMobile
checkMobile
=
new
TCheckMobile
();
checkMobile
.
setMobile
(
excel
.
getEmpPhone
());
R
<
TCheckMobile
>
a
=
HttpDaprUtil
.
invokeMethodPost
(
daprCheckProperties
.
getAppUrl
(),
daprCheckProperties
.
getAppId
()
,
"/tcheckmobile/inner/checkOneMobile"
,
checkMobile
,
TCheckMobile
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
a
!=
null
&&
a
.
getData
()
!=
null
)
{
checkMobile
=
a
.
getData
();
if
(
checkMobile
!=
null
&&
Common
.
isNotNull
(
checkMobile
.
getStatus
()))
{
if
(!
CommonConstants
.
ONE_STRING
.
equals
(
checkMobile
.
getStatus
()))
{
errorMsg
.
add
(
checkMobile
.
getMessage
());
}
}
else
{
errorMsg
.
add
(
"校验服务错误,请联系管理员!"
);
}
}
}
...
...
@@ -1126,11 +1142,19 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_PHONE_EXIST_ERROR
,
existEmp
.
getEmpIdcard
()));
}
}
else
{
R
<
Boolean
>
checkMobileR
=
HttpDaprUtil
.
invokeMethodPost
(
daprCheckProperties
.
getAppUrl
(),
daprCheckProperties
.
getAppId
()
,
"/tcheckmobile/inner/checkOneMobile"
,
excel
.
getEmpPhone
(),
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
checkMobileR
!=
null
&&
checkMobileR
.
getData
()
!=
null
)
{
if
(
Boolean
.
FALSE
.
equals
(
checkMobileR
.
getData
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_PHONE_CHECK_ERROR
,
excel
.
getEmpIdcard
()));
// 调用校验服务-校验手机号
TCheckMobile
checkMobile
=
new
TCheckMobile
();
checkMobile
.
setMobile
(
excel
.
getEmpPhone
());
R
<
TCheckMobile
>
a
=
HttpDaprUtil
.
invokeMethodPost
(
daprCheckProperties
.
getAppUrl
(),
daprCheckProperties
.
getAppId
()
,
"/tcheckmobile/inner/checkOneMobile"
,
checkMobile
,
TCheckMobile
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
a
!=
null
&&
a
.
getData
()
!=
null
)
{
checkMobile
=
a
.
getData
();
if
(
checkMobile
!=
null
&&
Common
.
isNotNull
(
checkMobile
.
getStatus
()))
{
if
(!
CommonConstants
.
ONE_STRING
.
equals
(
checkMobile
.
getStatus
()))
{
errorMsg
.
add
(
checkMobile
.
getMessage
());
}
}
else
{
errorMsg
.
add
(
"校验服务错误,请联系管理员!"
);
}
}
}
...
...
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/controller/TCheckMobileController.java
View file @
292fdad3
...
...
@@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckMobile
;
import
com.yifu.cloud.plus.v1.check.service.TCheckMobileService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
...
...
@@ -133,8 +135,8 @@ public class TCheckMobileController {
@Operation
(
description
=
"检测手机号,多个手机号码用英文半角逗号隔开,仅支持国内号码"
)
@SysLog
(
"检测手机号状态"
)
@Inner
@
Ge
tMapping
(
"/inner/checkMobiles"
)
public
R
<
Map
<
String
,
TCheckMobile
>>
checkMobilesInner
(
String
mobiles
)
{
@
Pos
tMapping
(
"/inner/checkMobiles"
)
public
R
<
Map
<
String
,
TCheckMobile
>>
checkMobilesInner
(
@RequestParam
String
mobiles
)
{
return
tCheckMobileService
.
checkMobiles
(
mobiles
);
}
...
...
@@ -147,9 +149,15 @@ public class TCheckMobileController {
@Operation
(
description
=
"单个检测手机号,仅支持国内号码"
)
@SysLog
(
"单个检测手机号状态"
)
@Inner
@GetMapping
(
"/inner/checkOneMobile"
)
public
boolean
checkOneMobile
(
String
mobile
)
{
return
tCheckMobileService
.
checkOneMobile
(
mobile
);
@PostMapping
(
"/inner/checkOneMobile"
)
public
TCheckMobile
checkOneMobile
(
@RequestBody
TCheckMobile
checkMobile
)
{
if
(
Common
.
isNotNull
(
checkMobile
.
getMobile
()))
{
return
tCheckMobileService
.
checkOneMobile
(
checkMobile
.
getMobile
());
}
else
{
checkMobile
.
setStatus
(
CommonConstants
.
ZERO_STRING
);
checkMobile
.
setMessage
(
"手机号必填"
);
return
checkMobile
;
}
}
}
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/service/TCheckMobileService.java
View file @
292fdad3
...
...
@@ -33,5 +33,5 @@ public interface TCheckMobileService extends IService<TCheckMobile> {
R
<
Map
<
String
,
TCheckMobile
>>
checkMobiles
(
String
mobiles
);
boolean
checkOneMobile
(
String
mobile
);
TCheckMobile
checkOneMobile
(
String
mobile
);
}
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/service/impl/TCheckIdCardServiceImpl.java
View file @
292fdad3
...
...
@@ -250,7 +250,12 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
.
eq
(
TCheckIdCard:
:
getIsTrue
,
CommonConstants
.
ONE_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
checkIdCard
)){
if
(
name
.
equals
(
checkIdCard
.
getName
()))
{
tCheckIdCard
.
setIsTrue
(
CommonConstants
.
ONE_INT
);
}
else
{
tCheckIdCard
.
setIsTrue
(
CommonConstants
.
ZERO_INT
);
tCheckIdCard
.
setReason
(
"【"
+
name
+
"】错误,正确的姓名:"
+
checkIdCard
.
getName
());
}
return
tCheckIdCard
;
}
else
{
// 没找到正确的,再去找有没有错误的,如果还没有,再查
...
...
@@ -270,7 +275,9 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
c
.
setName
(
name
);
ChecksUtil
.
checkIdCard
(
c
,
canCheckService
.
getCanCheck
());
baseMapper
.
insert
(
c
);
return
c
;
tCheckIdCard
.
setIsTrue
(
c
.
getIsTrue
());
tCheckIdCard
.
setReason
(
c
.
getReason
());
return
tCheckIdCard
;
}
}
}
...
...
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/service/impl/TCheckMobileServiceImpl.java
View file @
292fdad3
...
...
@@ -113,7 +113,11 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
}
@Override
public
synchronized
boolean
checkOneMobile
(
String
mobile
)
{
public
synchronized
TCheckMobile
checkOneMobile
(
String
mobile
)
{
TCheckMobile
returnMobile
=
new
TCheckMobile
();
returnMobile
.
setMobile
(
mobile
);
returnMobile
.
setMessage
(
"未找到!"
);
returnMobile
.
setStatus
(
CommonConstants
.
ZERO_STRING
);
if
(
Common
.
isNotNull
(
mobile
))
{
//1.先从本地库获取正常数据
List
<
TCheckMobile
>
checkMobiles
=
baseMapper
.
selectList
(
Wrappers
.<
TCheckMobile
>
query
().
lambda
()
...
...
@@ -121,29 +125,34 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
if
(
Common
.
isNotNull
(
checkMobiles
))
{
for
(
TCheckMobile
c
:
checkMobiles
)
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
c
.
getStatus
()))
{
return
true
;
returnMobile
.
setStatus
(
CommonConstants
.
ONE_STRING
);
return
returnMobile
;
}
}
return
fals
e
;
return
returnMobil
e
;
}
else
{
//2.从远处端获取数据
R
<
Map
<
String
,
TCheckMobile
>>
mobileMapR
=
ChecksUtil
.
checkMobile
(
mobile
,
canCheckService
.
getCanCheck
());
if
(
Common
.
isEmpty
(
mobileMapR
)
||
Common
.
isEmpty
(
mobileMapR
.
getData
()))
{
return
false
;
if
(
mobileMapR
!=
null
)
{
returnMobile
.
setMessage
(
mobileMapR
.
getMsg
());
}
return
returnMobile
;
}
Map
<
String
,
TCheckMobile
>
checkMobileMap
=
mobileMapR
.
getData
();
if
(
Common
.
isNotNull
(
checkMobileMap
)
&&
checkMobileMap
.
get
(
mobile
)
!=
null
)
{
TCheckMobile
checkMobile
=
checkMobileMap
.
get
(
mobile
);
this
.
save
(
checkMobile
);
if
(
checkMobile
!=
null
&&
CommonConstants
.
ONE_STRING
.
equals
(
checkMobile
.
getStatus
()))
{
return
true
;
returnMobile
.
setStatus
(
CommonConstants
.
ONE_STRING
);
return
returnMobile
;
}
else
{
return
fals
e
;
return
returnMobil
e
;
}
}
}
}
return
fals
e
;
return
returnMobil
e
;
}
}
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