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
6e5ef91b
Commit
6e5ef91b
authored
Jun 16, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户资质信息修改
parent
45d4f62d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
12 deletions
+93
-12
ITzsUserInfoService.java
...amos/boot/module/tzs/api/service/ITzsUserInfoService.java
+2
-1
TzsUserInfoController.java
...boot/module/tzs/biz/controller/TzsUserInfoController.java
+8
-7
TzsUserInfoServiceImpl.java
...t/module/tzs/biz/service/impl/TzsUserInfoServiceImpl.java
+83
-4
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/ITzsUserInfoService.java
View file @
6e5ef91b
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.TzsUserQualificationsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsUserQualifications
;
...
...
@@ -21,4 +20,6 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
void
deleteBatch
(
List
<
Long
>
ids
);
Map
<
String
,
Object
>
getDetail
(
Long
id
);
boolean
BindAccount
(
Map
<
String
,
Object
>
map
);
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TzsUserInfoController.java
View file @
6e5ef91b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CommonFile
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsUserQualifications
;
import
com.yeejoin.amos.boot.module.tzs.api.service.ITzsUserInfoService
;
...
...
@@ -17,9 +15,6 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
liquibase.pro.packaged.A
;
import
liquibase.pro.packaged.O
;
import
liquibase.pro.packaged.S
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -28,8 +23,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -125,4 +118,12 @@ public class TzsUserInfoController extends BaseController {
page
.
setSize
(
Long
.
parseLong
(
size
));
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
page
(
dto
,
page
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/BindAccount"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"人员绑定用户"
,
notes
=
"人员绑定用户"
)
public
ResponseModel
<
Boolean
>
BindAccount
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
BindAccount
(
map
));
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzsUserInfoServiceImpl.java
View file @
6e5ef91b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.TzsUserQualificationsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CommonFile
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TzsUserQualifications
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.TzsUserInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.TzsUserQualificationsMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.ITzsUserInfoService
;
import
com.yeejoin.amos.boot.module.tzs.api.vo.TzsUserInfoVo
;
import
com.yeejoin.amos.boot.module.tzs.api.vo.TzsUserQualificationsVo
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.*
;
...
...
@@ -31,6 +38,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
private
TzsUserInfoMapper
tzsUserInfoMapper
;
@Autowired
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
TzsUserQualificationsServiceImpl
tzsUserQualificationsService
;
@Override
public
Page
<
TzsUserInfoDto
>
page
(
TzsUserInfoDto
dto
,
Page
<
TzsUserInfoDto
>
page
)
{
...
...
@@ -131,4 +144,70 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
maps
.
put
(
"qualificationsInfo"
,
subForm
);
return
maps
;
}
@Override
public
boolean
BindAccount
(
Map
<
String
,
Object
>
map
)
{
String
loginName
=
map
.
get
(
"userName"
).
toString
();
String
pwd
=
map
.
get
(
"password"
).
toString
();
String
sequenceNbr
=
map
.
get
(
"sequenceNbr"
).
toString
();
String
roles
=
map
.
get
(
"role"
).
toString
();
String
status
=
map
.
get
(
"status"
).
toString
();
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
try
{
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
agencyUserModel
.
setUserName
(
loginName
);
agencyUserModel
.
setRealName
(
loginName
);
agencyUserModel
.
setLockStatus
(
status
);
agencyUserModel
.
setPassword
(
pwd
);
agencyUserModel
.
setRePassword
(
pwd
);
agencyUserModel
.
setAgencyCode
(
"tzs"
);
agencyUserModel
.
setMobile
(
null
);
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
false
;
}
Long
companySeq
=
reginParams
.
getCompany
().
getSequenceNbr
();
List
<
String
>
appCodesSet
=
reginParams
.
getUserModel
().
getAppCodes
();
List
<
RoleModel
>
allRoleList
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
DataDictionary
unitType
=
iDataDictionaryService
.
getOne
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getCode
,
roles
));
String
role
=
unitType
.
getExtend
()
!=
null
?
unitType
.
getExtend
()
:
""
;
for
(
String
s
:
role
.
split
(
","
))
{
RoleModel
roleModel
=
Privilege
.
roleClient
.
seleteOne
(
Long
.
valueOf
(
s
)).
getResult
();
allRoleList
.
add
(
roleModel
);
}
allRoleList
.
forEach
(
r
->
{
if
(!
roleIds
.
contains
(
r
.
getSequenceNbr
()))
{
roleIds
.
add
(
r
.
getSequenceNbr
());
}
});
Map
<
Long
,
List
<
Long
>>
roleSeqMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
roleSeqMap
.
put
(
companySeq
,
roleIds
);
orgRoles
.
put
(
companySeq
,
allRoleList
);
agencyUserModel
.
setAppCodes
(
new
ArrayList
<>(
appCodesSet
));
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
if
(
userResult
.
getStatus
()
==
200
)
{
TzsUserInfo
tzsUserInfo
=
tzsUserInfoMapper
.
selectById
(
sequenceNbr
);
tzsUserInfo
.
setAmosUserId
(
userResult
.
getResult
().
getUserId
());
tzsUserInfo
.
setAmosUserName
(
userResult
.
getResult
().
getUserName
());
tzsUserInfoMapper
.
updateById
(
tzsUserInfo
);
}
return
true
;
}
catch
(
Exception
e
)
{
if
(
userResult
!=
null
&&
userResult
.
getResult
()
!=
null
&&
StringUtils
.
isNotEmpty
(
userResult
.
getResult
().
getUserId
()))
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
userResult
.
getResult
().
getUserId
());
}
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
e
.
getMessage
());
}
}
}
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