Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PeiZhen-Java
peizhen-java
Commits
617d6f55
Commit
617d6f55
authored
Oct 10, 2023
by
sdif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
机构添加用户角色
parent
6c2ef512
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
pz-merchant/src/main/java/com/pz/merchant/controller/pc/CompanyController.java
+1
-1
pz-system/src/main/java/com/pz/merchant/service/impl/CompanyServiceImpl.java
+13
-0
No files found.
pz-merchant/src/main/java/com/pz/merchant/controller/pc/CompanyController.java
View file @
617d6f55
...
@@ -54,7 +54,7 @@ public class CompanyController extends BaseController {
...
@@ -54,7 +54,7 @@ public class CompanyController extends BaseController {
if
(
null
!=
roleId
&&
roleId
==
3
){
if
(
null
!=
roleId
&&
roleId
==
3
){
bo
.
setUid
(
getUserId
().
intValue
());
bo
.
setUid
(
getUserId
().
intValue
());
}
}
bo
.
setStatus
(
1
);
//
bo.setStatus(1);
return
R
.
ok
(
iCompanyService
.
queryListP
(
bo
));
return
R
.
ok
(
iCompanyService
.
queryListP
(
bo
));
}
}
...
...
pz-system/src/main/java/com/pz/merchant/service/impl/CompanyServiceImpl.java
View file @
617d6f55
...
@@ -22,12 +22,15 @@ import com.pz.merchant.mapper.CompanyMapper;
...
@@ -22,12 +22,15 @@ import com.pz.merchant.mapper.CompanyMapper;
import
com.pz.merchant.service.ICompanyService
;
import
com.pz.merchant.service.ICompanyService
;
import
com.pz.merchant.service.ISonOrderService
;
import
com.pz.merchant.service.ISonOrderService
;
import
com.pz.system.domain.Income
;
import
com.pz.system.domain.Income
;
import
com.pz.system.domain.SysUserRole
;
import
com.pz.system.domain.bo.DataViewBo
;
import
com.pz.system.domain.bo.DataViewBo
;
import
com.pz.system.domain.bo.WithdrawDepositBo
;
import
com.pz.system.domain.bo.WithdrawDepositBo
;
import
com.pz.system.domain.vo.DataViewVo
;
import
com.pz.system.domain.vo.DataViewVo
;
import
com.pz.system.mapper.CityMapper
;
import
com.pz.system.mapper.CityMapper
;
import
com.pz.system.mapper.IncomeMapper
;
import
com.pz.system.mapper.IncomeMapper
;
import
com.pz.system.mapper.SysUserMapper
;
import
com.pz.system.mapper.SysUserMapper
;
import
com.pz.system.mapper.SysUserRoleMapper
;
import
com.pz.system.service.ISysUserService
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -57,6 +60,10 @@ public class CompanyServiceImpl implements ICompanyService {
...
@@ -57,6 +60,10 @@ public class CompanyServiceImpl implements ICompanyService {
private
final
SysUserMapper
sysUserMapper
;
private
final
SysUserMapper
sysUserMapper
;
private
final
ISysUserService
iSysUserService
;
private
final
SysUserRoleMapper
userRoleMapper
;
/**
/**
* 查询商户
* 查询商户
*/
*/
...
@@ -142,9 +149,15 @@ public class CompanyServiceImpl implements ICompanyService {
...
@@ -142,9 +149,15 @@ public class CompanyServiceImpl implements ICompanyService {
if
(
update
.
getStatus
()
==
0
||
update
.
getStatus
()
==
2
){
if
(
update
.
getStatus
()
==
0
||
update
.
getStatus
()
==
2
){
sysUser
.
setUserType
(
UserType
.
XCX_USER
.
getUserType
());
sysUser
.
setUserType
(
UserType
.
XCX_USER
.
getUserType
());
sysUserMapper
.
updateById
(
sysUser
);
sysUserMapper
.
updateById
(
sysUser
);
userRoleMapper
.
delete
(
new
LambdaQueryWrapper
<
SysUserRole
>().
eq
(
SysUserRole:
:
getUserId
,
sysUser
.
getUserId
()));
}
else
if
(
update
.
getStatus
()
==
1
){
}
else
if
(
update
.
getStatus
()
==
1
){
sysUser
.
setUserType
(
UserType
.
AMERCHANT_USER
.
getUserType
());
sysUser
.
setUserType
(
UserType
.
AMERCHANT_USER
.
getUserType
());
sysUserMapper
.
updateById
(
sysUser
);
sysUserMapper
.
updateById
(
sysUser
);
// 新增用户与角色管理
SysUserRole
ur
=
new
SysUserRole
();
ur
.
setUserId
(
sysUser
.
getUserId
());
ur
.
setRoleId
(
3L
);
userRoleMapper
.
insert
(
ur
);
}
}
return
baseMapper
.
updateById
(
update
)
>
0
;
return
baseMapper
.
updateById
(
update
)
>
0
;
}
}
...
...
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