Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
d21ab452
Commit
d21ab452
authored
Dec 06, 2021
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改BUG402 8小时现在缺少一个主账号替换的功能
parent
008e0e7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
src/main/java/cn/timer/api/controller/qyzx/Auth.java
+34
-2
src/main/java/cn/timer/api/dto/qyzx/QyzxAuthDto.java
+3
-0
No files found.
src/main/java/cn/timer/api/controller/qyzx/Auth.java
View file @
d21ab452
...
...
@@ -13,8 +13,10 @@ import java.util.Comparator;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -145,7 +147,8 @@ public class Auth {
YgglMainEmp
yg
=
YgglMainEmp
.
builder
().
build
()
.
selectOne
(
new
LambdaQueryWrapper
<
YgglMainEmp
>().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
)
.
select
(
YgglMainEmp:
:
getName
,
YgglMainEmp:
:
getPhone
,
YgglMainEmp:
:
getEmpNum
));
.
select
(
YgglMainEmp:
:
getName
,
YgglMainEmp:
:
getPhone
,
YgglMainEmp:
:
getEmpNum
,
YgglMainEmp:
:
getCustomNum
));
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
id
(
empNum
).
build
().
selectById
();
QyzxEmpEntAsso
qyzxEmpEntAsso
=
QyzxEmpEntAsso
.
builder
().
build
()
.
selectOne
(
new
LambdaQueryWrapper
<
QyzxEmpEntAsso
>()
...
...
@@ -154,7 +157,8 @@ public class Auth {
QyzxAuthDto
dto
=
new
QyzxAuthDto
();
dto
.
setEmpNum
(
empNum
);
dto
.
setName
(
yg
.
getName
());
dto
.
setPhone
(
yg
.
getPhone
());
dto
.
setPhone
(
qyzxEmpLogin
.
getPhone
());
dto
.
setCustomNum
(
yg
.
getCustomNum
());
if
(
qyzxEmpEntAsso
!=
null
)
dto
.
setUserType
(
qyzxEmpEntAsso
.
getUserType
());
if
(
yg
!=
null
)
...
...
@@ -164,4 +168,32 @@ public class Auth {
return
ResultUtil
.
data
(
ygs
,
"查询成功"
);
}
@PostMapping
(
value
=
"/moveAdminEmp"
)
@ApiOperation
(
value
=
"超管转移"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@Log
(
title
=
"修改-超管转移"
,
businessType
=
BusinessType
.
INSERT
)
public
Result
<
Void
>
moveAdminEmp
(
@CurrentUser
UserBean
userBean
,
@RequestParam
Integer
childEmpNum
)
{
Integer
orgCode
=
userBean
.
getOrgCode
();
Integer
empNum
=
userBean
.
getEmpNum
();
QyzxEmpEntAsso
currentQyzxEmpEntAsso
=
selectMain
(
orgCode
,
empNum
);
if
(
StringUtils
.
isEmpty
(
currentQyzxEmpEntAsso
)
||
!
SysRoleType
.
U_TYPE_ADMIN
.
getType
().
equals
(
currentQyzxEmpEntAsso
.
getUserType
())){
return
ResultUtil
.
error
(
"当前用户无权限操作"
);
}
QyzxEmpEntAsso
qyzxEmpEntAsso
=
selectMain_
(
orgCode
,
childEmpNum
);
if
(
qyzxEmpEntAsso
!=
null
)
{
if
(
qyzxEmpEntAsso
.
getUserType
()
==
SysRoleType
.
U_TYPE_ADMIN
.
getType
()){
return
ResultUtil
.
error
(
"指定用户已是超管理员"
);
}
if
(
QyzxEmpEntAsso
.
builder
().
userType
(
SysRoleType
.
U_TYPE_ADMIN
.
getType
()).
build
()
.
update
(
new
LambdaQueryWrapper
<
QyzxEmpEntAsso
>().
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
orgCode
)
.
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
childEmpNum
))){
//转移后自己成为普通员工
QyzxEmpEntAsso
.
builder
().
userType
(
SysRoleType
.
U_TYPE_EMP
.
getType
()).
build
()
.
update
(
new
LambdaQueryWrapper
<
QyzxEmpEntAsso
>().
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
orgCode
)
.
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
empNum
));
return
ResultUtil
.
success
(
"转移成功"
);
}
}
return
ResultUtil
.
error
(
"当前用户无权限操作"
);
}
}
src/main/java/cn/timer/api/dto/qyzx/QyzxAuthDto.java
View file @
d21ab452
...
...
@@ -7,6 +7,7 @@
*/
package
cn
.
timer
.
api
.
dto
.
qyzx
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
@@ -31,5 +32,7 @@ public class QyzxAuthDto {
private
String
name
;
private
String
phone
;
private
Integer
userType
;
@ApiModelProperty
(
value
=
"自定义工号"
,
example
=
""
)
private
String
customNum
;
}
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