Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
4c3eddb9
Commit
4c3eddb9
authored
Oct 23, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员管理,证件号码和电话号码重复校验
parent
c442cabe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
TzsUserInfoController.java
...boot/module/tcm/biz/controller/TzsUserInfoController.java
+21
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzsUserInfoController.java
View file @
4c3eddb9
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.biz.controller;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.biz.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
...
@@ -12,6 +13,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
...
@@ -12,6 +13,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService
;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
...
@@ -46,6 +48,9 @@ public class TzsUserInfoController extends BaseController {
...
@@ -46,6 +48,9 @@ public class TzsUserInfoController extends BaseController {
private
ITzsUserInfoService
tzsUserInfoService
;
private
ITzsUserInfoService
tzsUserInfoService
;
@Autowired
@Autowired
private
TzsUserInfoMapper
tzsUserInfoMapper
;
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -54,6 +59,22 @@ public class TzsUserInfoController extends BaseController {
...
@@ -54,6 +59,22 @@ public class TzsUserInfoController extends BaseController {
public
ResponseModel
<
TzsUserInfoDto
>
save
(
@RequestBody
JSONObject
map
)
{
public
ResponseModel
<
TzsUserInfoDto
>
save
(
@RequestBody
JSONObject
map
)
{
Map
<
String
,
Object
>
userInfo
=
(
Map
<
String
,
Object
>)
map
.
get
(
"userInfo"
);
Map
<
String
,
Object
>
userInfo
=
(
Map
<
String
,
Object
>)
map
.
get
(
"userInfo"
);
TzsUserInfoDto
tzsUserInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
userInfo
),
TzsUserInfoDto
.
class
);
TzsUserInfoDto
tzsUserInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
userInfo
),
TzsUserInfoDto
.
class
);
LambdaQueryWrapper
<
TzsUserInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfo
.
getCertificateType
());
queryWrapper
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfo
.
getCertificateNum
());
TzsUserInfo
certificateNum
=
tzsUserInfoMapper
.
selectOne
(
queryWrapper
);
if
(!
ObjectUtils
.
isEmpty
(
certificateNum
)){
throw
new
BadRequest
(
"证件号码重复,请核对!"
);
}
LambdaQueryWrapper
<
TzsUserInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
TzsUserInfo:
:
getPhone
,
tzsUserInfo
.
getPhone
());
TzsUserInfo
phone
=
tzsUserInfoMapper
.
selectOne
(
queryWrapper1
);
if
(!
ObjectUtils
.
isEmpty
(
phone
)){
throw
new
BadRequest
(
"联系电话重复,请核对!"
);
}
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
null
;
return
null
;
...
...
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