Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
858eff67
Commit
858eff67
authored
Jun 15, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除管理员判断
parent
d3e7c8be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
81 deletions
+0
-81
AdminController.java
...com/gic/haoban/manage/web/controller/AdminController.java
+0
-11
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+0
-32
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+0
-38
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AdminController.java
View file @
858eff67
...
...
@@ -45,10 +45,6 @@ public class AdminController extends WebBaseController {
@RequestMapping
(
"admin-list"
)
public
HaobanResponse
adminList
()
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaffId
()
;
if
(
StringUtils
.
isBlank
(
staffId
))
{
return
this
.
resultResponse
(
HaoBanErrCode
.
ERR_10030
)
;
}
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
...
...
@@ -74,11 +70,7 @@ public class AdminController extends WebBaseController {
logger
.
info
(
"UserIds"
);
list
=
staffApiService
.
listByUserIdsAndWxEnterpriseId
(
openUserIds
,
wxEnterpriseId
);
}
boolean
flag
=
false
;
for
(
StaffDTO
staffDTO
:
list
)
{
if
(
staffDTO
.
getStaffId
().
equals
(
staffId
))
{
flag
=
true
;
}
AdminVO
vo
=
new
AdminVO
();
vo
.
setRoleId
(
staffDTO
.
getStaffId
());
vo
.
setRoleName
(
"管理员"
);
...
...
@@ -96,9 +88,6 @@ public class AdminController extends WebBaseController {
resultList
.
add
(
vo
);
}
}
if
(!
flag
)
{
return
this
.
resultResponse
(
HaoBanErrCode
.
ERR_10030
)
;
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultList
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
858eff67
...
...
@@ -438,9 +438,6 @@ public class DepartmentContoller extends WebBaseController {
*/
@RequestMapping
(
"department-list-cache"
)
public
HaobanResponse
departmentCachelist
()
{
if
(!
isAdmin
())
{
return
this
.
resultResponse
(
HaoBanErrCode
.
ERR_10030
)
;
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
...
...
@@ -455,33 +452,4 @@ public class DepartmentContoller extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
cache
);
}
}
private
boolean
isAdmin
(){
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaffId
()
;
if
(
StringUtils
.
isBlank
(
staffId
))
{
return
false
;
}
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
corpid
=
enterprise
.
getCorpid
();
logger
.
info
(
"【管理员查询】corpid={},siteId={},agentId={}"
,
corpid
,
application
.
getSiteId
(),
application
.
getAgentId
());
String
adminList
=
qywxSuiteApiService
.
getAdminList
(
corpid
,
application
.
getSiteId
(),
Integer
.
parseInt
(
application
.
getAgentId
()));
logger
.
info
(
"【管理员查询】userIds={}"
,
JSON
.
toJSONString
(
adminList
));
List
<
String
>
openUserIds
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
adminList
))
{
JSONArray
jsonArr
=
JSON
.
parseArray
(
adminList
);
for
(
Object
object
:
jsonArr
)
{
JSONObject
json
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
object
));
openUserIds
.
add
(
json
.
getString
(
"userid"
));
}
}
StaffDTO
staff
=
this
.
staffApiService
.
selectById
(
staffId
)
;
if
(
openUserIds
.
contains
(
staff
.
getWxUserId
())
||
openUserIds
.
contains
(
staff
.
getWxOpenUseId
()))
{
return
true
;
}
return
false
;
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
858eff67
...
...
@@ -141,9 +141,6 @@ public class StaffController extends WebBaseController {
Integer
relationFlag
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
if
(!
isAdmin
())
{
return
this
.
resultResponse
(
HaoBanErrCode
.
ERR_10030
)
;
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
String
>
departmentIds
=
new
ArrayList
<>();
...
...
@@ -462,9 +459,6 @@ public class StaffController extends WebBaseController {
*/
@RequestMapping
(
"staff-export"
)
public
HaobanResponse
staffExport
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
departmentId
,
Integer
activeFlag
,
Integer
relationFlag
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
if
(!
isAdmin
())
{
return
this
.
resultResponse
(
HaoBanErrCode
.
ERR_10030
)
;
}
List
<
String
>
departmentIdSet
=
new
ArrayList
<>();
departmentIdSet
.
add
(
departmentId
);
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
...
...
@@ -568,9 +562,6 @@ public class StaffController extends WebBaseController {
*/
@RequestMapping
(
"sync-qywx"
)
public
Object
syncQywx
()
{
if
(!
isAdmin
())
{
return
this
.
resultResponse
(
HaoBanErrCode
.
ERR_10030
)
;
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
...
...
@@ -586,33 +577,4 @@ public class StaffController extends WebBaseController {
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
private
boolean
isAdmin
(){
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaffId
()
;
if
(
StringUtils
.
isBlank
(
staffId
))
{
return
false
;
}
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
corpid
=
enterprise
.
getCorpid
();
logger
.
info
(
"【管理员查询】corpid={},siteId={},agentId={}"
,
corpid
,
application
.
getSiteId
(),
application
.
getAgentId
());
String
adminList
=
qywxSuiteApiService
.
getAdminList
(
corpid
,
application
.
getSiteId
(),
Integer
.
parseInt
(
application
.
getAgentId
()));
logger
.
info
(
"【管理员查询】userIds={}"
,
JSON
.
toJSONString
(
adminList
));
List
<
String
>
openUserIds
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
adminList
))
{
JSONArray
jsonArr
=
JSON
.
parseArray
(
adminList
);
for
(
Object
object
:
jsonArr
)
{
JSONObject
json
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
object
));
openUserIds
.
add
(
json
.
getString
(
"userid"
));
}
}
StaffDTO
staff
=
this
.
staffApiService
.
selectById
(
staffId
)
;
if
(
openUserIds
.
contains
(
staff
.
getWxUserId
())
||
openUserIds
.
contains
(
staff
.
getWxOpenUseId
()))
{
return
true
;
}
return
false
;
}
}
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