Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
zlmy-cloud
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
zlmy
zlmy-cloud
Commits
7ffc6f21
Commit
7ffc6f21
authored
Aug 15, 2025
by
鲁鸿波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
值班日志人员按顺序导入显示
parent
a39ad782
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
Person.java
...rc/main/java/com/testor/module/duty/model/dto/Person.java
+2
-0
DutyServiceImpl.java
.../com/testor/module/duty/service/impl/DutyServiceImpl.java
+24
-3
No files found.
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/duty/model/dto/Person.java
View file @
7ffc6f21
...
@@ -46,4 +46,6 @@ public class Person {
...
@@ -46,4 +46,6 @@ public class Person {
private
String
dutyLogDraft
;
private
String
dutyLogDraft
;
@ApiModelProperty
(
value
=
"日志是否暂存"
)
@ApiModelProperty
(
value
=
"日志是否暂存"
)
private
String
dutyLogId
;
private
String
dutyLogId
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/duty/service/impl/DutyServiceImpl.java
View file @
7ffc6f21
...
@@ -74,6 +74,7 @@ import java.time.format.DateTimeFormatter;
...
@@ -74,6 +74,7 @@ import java.time.format.DateTimeFormatter;
import
java.time.temporal.TemporalAdjusters
;
import
java.time.temporal.TemporalAdjusters
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collector
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -850,7 +851,15 @@ public class DutyServiceImpl extends ServiceImpl<DutyDao, TSysDuty> implements D
...
@@ -850,7 +851,15 @@ public class DutyServiceImpl extends ServiceImpl<DutyDao, TSysDuty> implements D
}
}
//存储同一天多个人到list
//存储同一天多个人到list
people
.
add
(
person
);
people
.
add
(
person
);
List
<
Person
>
collect1
=
people
.
stream
().
sorted
(
Comparator
.
comparing
(
Person:
:
getCreateDate
).
thenComparing
(
Person:
:
getId
)).
collect
(
Collectors
.
toList
());
//List<Person> collect1 = people.stream().sorted(Comparator.comparing(Person::getCreateDate).thenComparing(Person::getId)).collect(Collectors.toList());
List
<
Person
>
collect1
=
people
.
stream
()
.
sorted
(
Comparator
.
comparing
(
Person:
:
getCreateDate
)
.
thenComparing
(
Person:
:
getSort
)
// 新增sort升序排序
.
thenComparing
(
Person:
:
getId
)
)
.
collect
(
Collectors
.
toList
());
duty
.
setPersonList
(
collect1
);
duty
.
setPersonList
(
collect1
);
}
}
duties
.
add
(
duty
);
duties
.
add
(
duty
);
...
@@ -974,9 +983,20 @@ public class DutyServiceImpl extends ServiceImpl<DutyDao, TSysDuty> implements D
...
@@ -974,9 +983,20 @@ public class DutyServiceImpl extends ServiceImpl<DutyDao, TSysDuty> implements D
//获取年月对应表id
//获取年月对应表id
TSysDuty
dutyMonthId
=
getDutyMonthId
(
list
,
tSysDuty
,
sysOrg
,
loginUser
);
TSysDuty
dutyMonthId
=
getDutyMonthId
(
list
,
tSysDuty
,
sysOrg
,
loginUser
);
String
monthId
=
dutyMonthId
.
getId
();
String
monthId
=
dutyMonthId
.
getId
();
list
.
stream
().
forEach
(
item
->
{
/*list.stream().forEach(item -> {
Person person = this.saveDuty(item, tSysDuty, sysOrg, loginUser, monthId);
Person person = this.saveDuty(item, tSysDuty, sysOrg, loginUser, monthId);
people.add(person);
people.add(person);
});*/
// 创建自增索引计数器 - 从1开始(若需要从0开始则用0)
AtomicInteger
index
=
new
AtomicInteger
(
1
);
list
.
stream
().
forEach
(
item
->
{
Person
person
=
this
.
saveDuty
(
item
,
tSysDuty
,
sysOrg
,
loginUser
,
monthId
,
index
.
getAndIncrement
());
people
.
add
(
person
);
});
});
response
.
setData
(
people
);
response
.
setData
(
people
);
// 导入成功启动流程
// 导入成功启动流程
...
@@ -1258,7 +1278,7 @@ public class DutyServiceImpl extends ServiceImpl<DutyDao, TSysDuty> implements D
...
@@ -1258,7 +1278,7 @@ public class DutyServiceImpl extends ServiceImpl<DutyDao, TSysDuty> implements D
}
}
@SneakyThrows
@SneakyThrows
public
Person
saveDuty
(
Map
<
Integer
,
Object
>
item
,
TSysDuty
duty
,
SysOrg
sysOrg
,
UserInfo
loginUser
,
String
monthId
)
{
public
Person
saveDuty
(
Map
<
Integer
,
Object
>
item
,
TSysDuty
duty
,
SysOrg
sysOrg
,
UserInfo
loginUser
,
String
monthId
,
int
index
)
{
TSysDuty
tSysDuty
=
BeanHelper
.
beanToBean
(
duty
,
TSysDuty
.
class
);
TSysDuty
tSysDuty
=
BeanHelper
.
beanToBean
(
duty
,
TSysDuty
.
class
);
String
month
=
item
.
get
(
3
)+
""
;
String
month
=
item
.
get
(
3
)+
""
;
String
day
=
item
.
get
(
4
)+
""
;
String
day
=
item
.
get
(
4
)+
""
;
...
@@ -1297,6 +1317,7 @@ public class DutyServiceImpl extends ServiceImpl<DutyDao, TSysDuty> implements D
...
@@ -1297,6 +1317,7 @@ public class DutyServiceImpl extends ServiceImpl<DutyDao, TSysDuty> implements D
tSysDuty
.
setTenantId
(
duty
.
getTenantId
());
tSysDuty
.
setTenantId
(
duty
.
getTenantId
());
tSysDuty
.
setStatus
(
"0"
);
tSysDuty
.
setStatus
(
"0"
);
tSysDuty
.
setProcessStatus
(
"3"
);
tSysDuty
.
setProcessStatus
(
"3"
);
tSysDuty
.
setSort
(
index
);
QueryWrapper
<
TSysDuty
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
TSysDuty
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
ObjectHelper
.
isNotEmpty
(
tSysDuty
.
getTenantId
()))
{
if
(
ObjectHelper
.
isNotEmpty
(
tSysDuty
.
getTenantId
()))
{
queryWrapper
.
eq
(
"tenant_id"
,
tSysDuty
.
getTenantId
());
queryWrapper
.
eq
(
"tenant_id"
,
tSysDuty
.
getTenantId
());
...
...
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