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
36067bde
Commit
36067bde
authored
Nov 27, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.使用登记单据变更功能,增加详情页面控制按钮权限字段,控制当前人是否有修改的权限,当有权限且满足后续无业务发生时,页面才显示编辑设备按钮
parent
329e44f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
FillingEditPermForCurrentUser.java
...le/jg/biz/service/impl/FillingEditPermForCurrentUser.java
+43
-0
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+8
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/FillingEditPermForCurrentUser.java
0 → 100644
View file @
36067bde
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.GroupModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.List
;
@Slf4j
public
class
FillingEditPermForCurrentUser
extends
BaseUseRegisterResultData
{
public
FillingEditPermForCurrentUser
(
JSONObject
data
)
{
super
(
data
);
}
@Override
public
JSONObject
getData
()
{
JSONObject
data
=
super
.
getData
();
fillingEditPermission
(
data
);
return
data
;
}
private
void
fillingEditPermission
(
JSONObject
jsonObject
)
{
String
HAS_PERMISSION
=
"hasPermission"
;
jsonObject
.
put
(
HAS_PERMISSION
,
false
);
// 当前登录人所在用户组
List
<
GroupModel
>
groupModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
groupClient
.
queryByUserId
(
RequestContext
.
getExeUserId
()));
// 有权限编辑设备的用户组(value为用户组名称)
List
<
DictionarieValueModel
>
hasPermGroup
=
FeignUtil
.
remoteCall
(()
->
Systemctl
.
dictionarieClient
.
dictValues
(
"USE_REG_PERMISSION_GROUP"
));
if
(
groupModels
.
stream
().
anyMatch
(
g
->
hasPermGroup
.
stream
().
anyMatch
(
h
->
h
.
getDictDataValue
().
equals
(
g
.
getGroupName
()))))
{
jsonObject
.
put
(
HAS_PERMISSION
,
true
);
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
36067bde
...
@@ -1761,7 +1761,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1761,7 +1761,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 转化 附件 字段
// 转化 附件 字段
commonServiceImpl
.
convertStringToJsonobject
(
jsonObject
,
jsonFields
);
commonServiceImpl
.
convertStringToJsonobject
(
jsonObject
,
jsonFields
);
// 结果增强,填充单据是否可变更设备状态,用来控制前端按钮的显示隐藏。
// 结果增强,填充单据是否可变更设备状态,用来控制前端按钮的显示隐藏。
return
new
FillingUseRegisterResult
(
sequenceNbr
,
jsonObject
,
applicationContext
).
getData
();
new
FillingUseRegisterResult
(
sequenceNbr
,
jsonObject
,
applicationContext
).
getData
();
// 结果增强,填充当前人是否有编辑按钮权限
new
FillingEditPermForCurrentUser
(
jsonObject
).
getData
();
return
jsonObject
;
}
}
// 基本信息 + 制造信息
// 基本信息 + 制造信息
Map
<
String
,
Object
>
detail
=
this
.
baseMapper
.
getDetail
(
record
);
Map
<
String
,
Object
>
detail
=
this
.
baseMapper
.
getDetail
(
record
);
...
@@ -1809,7 +1812,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1809,7 +1812,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
result
.
putAll
(
detail
);
result
.
putAll
(
detail
);
// 结果增强,填充单据是否可变更设备状态
// 结果增强,填充单据是否可变更设备状态
return
new
DefaultUseRegisterResult
(
result
).
getData
();
new
DefaultUseRegisterResult
(
result
).
getData
();
// 结果增强,填充当前人是否有编辑按钮权限
new
FillingEditPermForCurrentUser
(
result
).
getData
();
return
result
;
}
}
...
...
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