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
84b5c6cf
Commit
84b5c6cf
authored
Mar 15, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加判断当前用户是否场站
parent
73f95aa7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
2 deletions
+43
-2
MaintenanceUtil.java
...ejoin/amos/boot/module/hygf/api/util/MaintenanceUtil.java
+2
-2
IPermissionService.java
...mos/boot/module/jxiop/api/service/IPermissionService.java
+3
-0
PrivilegeController.java
...boot/module/jxiop/biz/controller/PrivilegeController.java
+11
-0
IPermissionServiceImpl.java
...module/jxiop/biz/service/impl/IPermissionServiceImpl.java
+27
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/util/MaintenanceUtil.java
View file @
84b5c6cf
...
...
@@ -22,8 +22,8 @@ public class MaintenanceUtil {
public
static
final
String
NO
=
"否"
;
// 是否签订安全协议
public
static
final
Integer
QD
=
1
;
public
static
final
Integer
WQD
=
0
;
public
static
final
Integer
QD
=
0
;
public
static
final
Integer
WQD
=
1
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/service/IPermissionService.java
View file @
84b5c6cf
...
...
@@ -2,8 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.api.service;
import
java.util.List
;
import
java.util.Map
;
public
interface
IPermissionService
{
List
<
String
>
getCurrentUserPermissions
();
List
<
String
>
getCurrentUserProjectOrgCodes
();
Map
<
String
,
String
>
judgeUserIsStation
();
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PrivilegeController.java
View file @
84b5c6cf
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IPermissionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -51,6 +52,8 @@ public class PrivilegeController extends BaseController {
private
RedisUtils
redisUtils
;
@Autowired
private
UserEmpowerMapper
userEmpowerMapper
;
@Autowired
IPermissionService
iPermissionService
;
@Value
(
"${yth.qg.id}"
)
private
Long
qgCompanyId
;
...
...
@@ -238,4 +241,12 @@ public class PrivilegeController extends BaseController {
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/judgeUserIsStation"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前人是否为场站层级"
,
notes
=
"查询当前人是否为场站层级"
)
public
ResponseModel
<
Map
<
String
,
String
>>
judgeUserIsStation
()
{
return
ResponseHelper
.
buildResponse
(
iPermissionService
.
judgeUserIsStation
());
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/IPermissionServiceImpl.java
View file @
84b5c6cf
...
...
@@ -16,6 +16,7 @@ import org.springframework.util.ObjectUtils;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -61,6 +62,32 @@ public class IPermissionServiceImpl implements IPermissionService {
return
result
;
}
public
Map
<
String
,
String
>
judgeUserIsStation
()
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
));
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
map
.
put
(
"isStation"
,
"false"
);
}
else
{
String
permissionOrgCode
=
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
);
Map
<
String
,
String
>
companyInfo
=
userEmpowerMapper
.
getCompanyInfoByOrgCode
(
permissionOrgCode
);
String
companyLevel
=
companyInfo
.
get
(
"level"
);
if
(
companyLevel
.
equals
(
"categroy_leve2"
))
{
map
.
put
(
"isStation"
,
"false"
);
}
if
(
companyLevel
.
equals
(
"area"
))
{
map
.
put
(
"isStation"
,
"false"
);
}
if
(
companyLevel
.
equals
(
"station"
))
{
map
.
put
(
"isStation"
,
"false"
);
}
}
return
map
;
}
@Override
public
List
<
String
>
getCurrentUserProjectOrgCodes
()
{
List
<
String
>
result
=
new
ArrayList
<>();
...
...
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