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
4abe0b2d
Commit
4abe0b2d
authored
Apr 11, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.使用登记 使用单位编辑设备功能开发
parent
5c36c998
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
JgUseRegistrationController.java
...module/jg/biz/controller/JgUseRegistrationController.java
+1
-1
FillingEditPermForCurrentUser.java
...le/jg/biz/service/impl/FillingEditPermForCurrentUser.java
+18
-3
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+5
-5
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/controller/JgUseRegistrationController.java
View file @
4abe0b2d
...
@@ -175,7 +175,7 @@ public class JgUseRegistrationController extends BaseController {
...
@@ -175,7 +175,7 @@ public class JgUseRegistrationController extends BaseController {
@GetMapping
(
value
=
"/getDetail"
)
@GetMapping
(
value
=
"/getDetail"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getDetail
(
@RequestParam
(
value
=
"record"
,
required
=
false
)
String
record
,
public
ResponseModel
<
Map
<
String
,
Object
>>
getDetail
(
@RequestParam
(
value
=
"record"
,
required
=
false
)
String
record
,
@RequestParam
(
value
=
"sequenceNbr"
,
required
=
false
)
Long
sequenceNbr
)
{
@RequestParam
(
value
=
"sequenceNbr"
,
required
=
false
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgUseRegistrationServiceImpl
.
getDetail
(
record
,
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
jgUseRegistrationServiceImpl
.
getDetail
(
record
,
sequenceNbr
,
getSelectedOrgInfo
()
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
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
View file @
4abe0b2d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.GroupModel
;
import
com.yeejoin.amos.feign.privilege.model.GroupModel
;
...
@@ -14,9 +17,16 @@ import java.util.List;
...
@@ -14,9 +17,16 @@ import java.util.List;
@Slf4j
@Slf4j
public
class
FillingEditPermForCurrentUser
extends
BaseUseRegisterResultData
{
public
class
FillingEditPermForCurrentUser
extends
BaseUseRegisterResultData
{
private
final
CompanyBo
company
;
public
FillingEditPermForCurrentUser
(
JSONObject
data
)
{
private
static
final
String
COMPANY_TYPE
=
"companyType"
;
private
static
final
String
HAS_PERMISSION
=
"hasPermission"
;
public
FillingEditPermForCurrentUser
(
JSONObject
data
,
CompanyBo
company
)
{
super
(
data
);
super
(
data
);
this
.
company
=
company
;
}
}
...
@@ -29,7 +39,6 @@ public class FillingEditPermForCurrentUser extends BaseUseRegisterResultData {
...
@@ -29,7 +39,6 @@ public class FillingEditPermForCurrentUser extends BaseUseRegisterResultData {
private
void
fillingEditPermission
(
JSONObject
jsonObject
)
{
private
void
fillingEditPermission
(
JSONObject
jsonObject
)
{
String
HAS_PERMISSION
=
"hasPermission"
;
jsonObject
.
put
(
HAS_PERMISSION
,
false
);
jsonObject
.
put
(
HAS_PERMISSION
,
false
);
// 当前登录人所在用户组
// 当前登录人所在用户组
List
<
GroupModel
>
groupModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
groupClient
.
queryByUserId
(
RequestContext
.
getExeUserId
()));
List
<
GroupModel
>
groupModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
groupClient
.
queryByUserId
(
RequestContext
.
getExeUserId
()));
...
@@ -38,6 +47,12 @@ public class FillingEditPermForCurrentUser extends BaseUseRegisterResultData {
...
@@ -38,6 +47,12 @@ public class FillingEditPermForCurrentUser extends BaseUseRegisterResultData {
if
(
groupModels
.
stream
().
anyMatch
(
g
->
hasPermGroup
.
stream
().
anyMatch
(
h
->
h
.
getDictDataValue
().
equals
(
g
.
getGroupName
()))))
{
if
(
groupModels
.
stream
().
anyMatch
(
g
->
hasPermGroup
.
stream
().
anyMatch
(
h
->
h
.
getDictDataValue
().
equals
(
g
.
getGroupName
()))))
{
jsonObject
.
put
(
HAS_PERMISSION
,
true
);
jsonObject
.
put
(
HAS_PERMISSION
,
true
);
}
}
if
(
company
!=
null
)
{
if
(
company
.
getLevel
().
equals
(
BaseController
.
COMPANY_TYPE_COMPANY
))
{
jsonObject
.
put
(
COMPANY_TYPE
,
BaseController
.
COMPANY_TYPE_COMPANY
);
}
else
{
jsonObject
.
put
(
COMPANY_TYPE
,
BaseController
.
COMPANY_TYPE_SUPERVISION
);
}
}
}
}
}
}
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 @
4abe0b2d
...
@@ -2144,16 +2144,16 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -2144,16 +2144,16 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
}
}
public
Map
<
String
,
Object
>
getDetail
(
String
record
,
Long
sequenceNbr
)
{
public
Map
<
String
,
Object
>
getDetail
(
String
record
,
Long
sequenceNbr
,
ReginParams
selectedOrgInfo
)
{
if
(!
ObjectUtils
.
isEmpty
(
sequenceNbr
))
{
if
(!
ObjectUtils
.
isEmpty
(
sequenceNbr
))
{
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
this
.
doCompensate
(
jgUseRegistration
);
this
.
doCompensate
(
jgUseRegistration
);
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
);
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
);
lambda
.
eq
(
JgRegistrationHistory:
:
getIsDelete
,
false
);
lambda
.
eq
(
JgRegistrationHistory:
:
getIsDelete
,
false
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
jsonObject
.
put
(
"manageType"
,
jgUseRegistration
.
getManageType
());
jsonObject
.
put
(
"createUserId"
,
jgUseRegistration
.
getCreateUserId
());
jsonObject
.
put
(
"createUserId"
,
jgUseRegistration
.
getCreateUserId
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"status"
,
jgUseRegistration
.
getStatus
());
jsonObject
.
put
(
"status"
,
jgUseRegistration
.
getStatus
());
...
@@ -2219,7 +2219,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -2219,7 +2219,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 结果增强,填充单据是否可变更设备状态,用来控制前端按钮的显示隐藏。
// 结果增强,填充单据是否可变更设备状态,用来控制前端按钮的显示隐藏。
new
FillingUseRegisterResult
(
sequenceNbr
,
jsonObject
,
applicationContext
).
getData
();
new
FillingUseRegisterResult
(
sequenceNbr
,
jsonObject
,
applicationContext
).
getData
();
// 结果增强,填充当前人是否有编辑按钮权限
// 结果增强,填充当前人是否有编辑按钮权限
new
FillingEditPermForCurrentUser
(
jsonObject
).
getData
();
new
FillingEditPermForCurrentUser
(
jsonObject
,
Optional
.
ofNullable
(
selectedOrgInfo
).
map
(
ReginParams:
:
getCompany
).
orElse
(
null
)
).
getData
();
return
jsonObject
;
return
jsonObject
;
}
}
// 基本信息 + 制造信息
// 基本信息 + 制造信息
...
@@ -2270,7 +2270,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -2270,7 +2270,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 结果增强,填充单据是否可变更设备状态
// 结果增强,填充单据是否可变更设备状态
new
DefaultUseRegisterResult
(
result
).
getData
();
new
DefaultUseRegisterResult
(
result
).
getData
();
// 结果增强,填充当前人是否有编辑按钮权限
// 结果增强,填充当前人是否有编辑按钮权限
new
FillingEditPermForCurrentUser
(
result
).
getData
();
new
FillingEditPermForCurrentUser
(
result
,
selectedOrgInfo
.
getCompany
()
).
getData
();
return
result
;
return
result
;
}
}
...
@@ -4478,7 +4478,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -4478,7 +4478,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(
CollUtil
.
isNotEmpty
(
useRegistrations
)){
if
(
CollUtil
.
isNotEmpty
(
useRegistrations
)){
for
(
JgUseRegistration
useRegistration
:
useRegistrations
)
{
for
(
JgUseRegistration
useRegistration
:
useRegistrations
)
{
try
{
try
{
Map
<
String
,
Object
>
detail
=
this
.
getDetail
(
null
,
useRegistration
.
getSequenceNbr
());
Map
<
String
,
Object
>
detail
=
this
.
getDetail
(
null
,
useRegistration
.
getSequenceNbr
()
,
null
);
String
jsonString
=
JSONObject
.
toJSONString
(
detail
);
String
jsonString
=
JSONObject
.
toJSONString
(
detail
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonString
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonString
);
FeignClientResult
<
AgencyUserModel
>
agencyUserModelFeignClientResult
=
Privilege
.
agencyUserClient
.
queryByUserId
((
String
)
detail
.
get
(
"createUserId"
));
FeignClientResult
<
AgencyUserModel
>
agencyUserModelFeignClientResult
=
Privilege
.
agencyUserClient
.
queryByUserId
((
String
)
detail
.
get
(
"createUserId"
));
...
...
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