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
6aee4b2a
Commit
6aee4b2a
authored
Oct 25, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新根据id删除orgUsr表数据
parent
26d455ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
37 deletions
+44
-37
WelderController.java
...amos/boot/module/ugp/biz/controller/WelderController.java
+5
-2
WelderServiceImpl.java
...s/boot/module/ugp/biz/service/impl/WelderServiceImpl.java
+39
-35
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WelderController.java
View file @
6aee4b2a
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl;
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.WelderServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.WelderServiceImpl
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.apache.poi.ss.formula.functions.T
;
...
@@ -154,10 +155,12 @@ public class WelderController extends BaseController {
...
@@ -154,10 +155,12 @@ public class WelderController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@DeleteMapping
(
value
=
"/
deleteOneById/
{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr删除人员信息表"
,
notes
=
"根据sequenceNbr删除人员信息表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr删除人员信息表"
,
notes
=
"根据sequenceNbr删除人员信息表"
)
public
void
deleteOneById
(
@PathVariable
String
sequenceNbr
)
throws
Exception
{
public
ResponseModel
<
String
>
deleteOneById
(
@PathVariable
String
sequenceNbr
)
throws
Exception
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
orgServiceImpl
.
getOrgUsrById
(
sequenceNbr
).
getAmosOrgId
());
orgServiceImpl
.
delectInfo
(
sequenceNbr
);
orgServiceImpl
.
delectInfo
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/WelderServiceImpl.java
View file @
6aee4b2a
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.feign.privilege.util.DesUtil;
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.feign.privilege.util.DesUtil;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -87,42 +88,45 @@ public class WelderServiceImpl {
...
@@ -87,42 +88,45 @@ public class WelderServiceImpl {
*/
*/
@BusinessIdentify
@BusinessIdentify
public
OrgUsrDto
savePerson
(
JSONObject
jsonObject
,
String
bizOrgType
,
String
sequenceNbr
){
public
OrgUsrDto
savePerson
(
JSONObject
jsonObject
,
String
bizOrgType
,
String
sequenceNbr
){
Long
companyId
=
orgService
.
getReginParams
().
getCompany
().
getSequenceNbr
();
if
(
ValidationUtil
.
isEmpty
(
sequenceNbr
)){
Set
<
String
>
roleNameSet
=
new
HashSet
<>();
Long
companyId
=
orgService
.
getReginParams
().
getCompany
().
getSequenceNbr
();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
Set
<
String
>
roleNameSet
=
new
HashSet
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
Map
<
Long
,
List
<
Long
>>
roleSeqsMap
=
new
HashMap
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
Map
<
Long
,
List
<
Long
>>
roleSeqsMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
//用户基本信息
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
agencyUserModel
.
setRealName
(
jsonObject
.
getString
(
"name"
));
//用户基本信息
agencyUserModel
.
setAgencyCode
(
"ugp"
);
agencyUserModel
.
setRealName
(
jsonObject
.
getString
(
"name"
));
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setAgencyCode
(
"ugp"
);
agencyUserModel
.
setMobile
(
jsonObject
.
getString
(
"phone"
));
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setCreateTime
(
new
Date
());
agencyUserModel
.
setMobile
(
jsonObject
.
getString
(
"phone"
));
agencyUserModel
.
setUserName
(
jsonObject
.
getString
(
"phone"
));
agencyUserModel
.
setCreateTime
(
new
Date
());
agencyUserModel
.
setPassword
(
DesUtil
.
encode
(
jsonObject
.
getString
(
"phone"
),
secretKey
));
agencyUserModel
.
setUserName
(
jsonObject
.
getString
(
"phone"
));
agencyUserModel
.
setRePassword
(
DesUtil
.
encode
(
jsonObject
.
getString
(
"phone"
),
secretKey
));
agencyUserModel
.
setPassword
(
DesUtil
.
encode
(
jsonObject
.
getString
(
"phone"
),
secretKey
));
//用户角色信息
agencyUserModel
.
setRePassword
(
DesUtil
.
encode
(
jsonObject
.
getString
(
"phone"
),
secretKey
));
List
<
RoleModel
>
allRoleList
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
).
getResult
();
//用户角色信息
if
(
1
==
jsonObject
.
getInteger
(
"isWelder"
)){
List
<
RoleModel
>
allRoleList
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
).
getResult
();
roleNameSet
.
add
(
OrgEnum
.
焊工
.
getName
());
if
(
1
==
jsonObject
.
getInteger
(
"isWelder"
)){
}
else
{
roleNameSet
.
add
(
OrgEnum
.
焊工
.
getName
());
roleNameSet
.
add
(
OrgEnum
.
普通人员
.
getName
());
}
else
{
}
roleNameSet
.
add
(
OrgEnum
.
普通人员
.
getName
());
userRoleList
=
allRoleList
.
stream
().
filter
(
r
->
r
.
getRoleName
().
equals
(
roleNameSet
)).
collect
(
Collectors
.
toList
());
userRoleList
.
stream
().
forEach
(
r
->
{
if
(!
roleIds
.
contains
(
r
.
getSequenceNbr
()))
{
roleIds
.
add
(
r
.
getSequenceNbr
());
}
}
});
userRoleList
=
allRoleList
.
stream
().
filter
(
r
->
r
.
getRoleName
().
equals
(
roleNameSet
)).
collect
(
Collectors
.
toList
());
roleSeqsMap
.
put
(
companyId
,
roleIds
);
userRoleList
.
stream
().
forEach
(
r
->
{
orgRoles
.
put
(
companyId
,
userRoleList
);
if
(!
roleIds
.
contains
(
r
.
getSequenceNbr
()))
{
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
roleIds
.
add
(
r
.
getSequenceNbr
());
agencyUserModel
.
setOrgRoles
(
orgRoles
);
}
//创建用户
});
agencyUserModel
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
).
getResult
();
roleSeqsMap
.
put
(
companyId
,
roleIds
);
jsonObject
.
put
(
"amosOrgId"
,
agencyUserModel
.
getSequenceNbr
());
orgRoles
.
put
(
companyId
,
userRoleList
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
//创建用户
agencyUserModel
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
).
getResult
();
jsonObject
.
put
(
"amosOrgId"
,
agencyUserModel
.
getSequenceNbr
());
}
return
orgService
.
dataHandling
(
jsonObject
,
bizOrgType
,
sequenceNbr
);
return
orgService
.
dataHandling
(
jsonObject
,
bizOrgType
,
sequenceNbr
);
}
}
}
}
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