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
66d35aa5
Commit
66d35aa5
authored
Oct 24, 2022
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
cac12356
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
DutyPersonServiceImpl.java
...module/common/biz/service/impl/DutyPersonServiceImpl.java
+27
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyPersonServiceImpl.java
View file @
66d35aa5
...
...
@@ -10,8 +10,12 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.biz.enums.DataDictionaryTypeEnum
;
import
com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCodeEnum
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -74,7 +78,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
}
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
dutyPersonDto
);
buildDataMap
(
map
,
userId
);
if
(!
instances
.
isEmpty
())
{
// 0.定位instanceId,准备进行更新操作
instanceId
=
instances
.
get
(
0
).
getInstanceId
();
// 已经有了走更新方法
...
...
@@ -132,7 +136,27 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
}
private
Map
<
String
,
Object
>
buildDataMap
(
Map
<
String
,
Object
>
d
,
String
userId
)
{
// 表单存在人员类型,获取用户ID,查询人员类型赋值
if
(!
ObjectUtils
.
isEmpty
(
userId
))
{
List
<
DynamicFormInstance
>
instances
=
dynamicFormInstanceService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getFieldCode
,
"peopleType"
)
.
eq
(
DynamicFormInstance:
:
getInstanceId
,
userId
)
.
eq
(
DynamicFormInstance:
:
getGroupCode
,
DynamicGroupCodeEnum
.
JCS_PERSON
.
getCode
()));
if
(!
CollectionUtils
.
isEmpty
(
instances
))
{
String
fieldValue
=
instances
.
get
(
0
).
getFieldValue
();
List
<
DataDictionary
>
dictionaryList
=
dataDictionaryService
.
getByType
(
DataDictionaryTypeEnum
.
PERSON_TYPE
.
getCode
());
if
(
StringUtils
.
isNotBlank
(
fieldValue
)
&&
!
CollectionUtils
.
isEmpty
(
dictionaryList
))
{
Map
<
String
,
List
<
DataDictionary
>>
map
=
dictionaryList
.
stream
().
collect
(
Collectors
.
groupingBy
(
DataDictionary:
:
getCode
));
List
<
DataDictionary
>
list
=
map
.
get
(
fieldValue
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
d
.
put
(
"personType"
,
list
.
get
(
0
).
getName
());
}
}
}
}
return
d
;
}
@Override
public
DutyPersonDto
update
(
Long
instanceId
,
DutyPersonDto
dutyPersonDto
)
{
String
groupCode
=
this
.
getGroupCode
();
...
...
@@ -144,6 +168,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
List
<
DynamicFormColumn
>
columns
=
dynamicFormColumnService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
groupCode
));
//页面数据转Map
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
dutyPersonDto
);
buildDataMap
(
map
,
dutyPersonDto
.
getUserId
());
//4.已列为主 填充动态表单数据
List
<
DynamicFormInstance
>
entrys
=
new
ArrayList
<>();
for
(
DynamicFormColumn
column
:
columns
)
{
...
...
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