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
bdafefc5
Commit
bdafefc5
authored
Sep 09, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm
parent
c6ed332e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
DutyCommonServiceImpl.java
...module/common/biz/service/impl/DutyCommonServiceImpl.java
+31
-0
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/DutyCommonServiceImpl.java
View file @
bdafefc5
...
...
@@ -85,16 +85,43 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
private
void
fillDutyShiftData
(
String
beginDate
,
String
endDate
,
Map
<
String
,
Object
>
m
)
throws
ParseException
{
// 获取值班的实例id
String
instanceId
=
m
.
get
(
"instanceId"
).
toString
();
// 根据appkey 获取未删除的值班班次
List
<
DutyShift
>
dutyShifts
=
dutyShiftService
.
list
(
new
LambdaQueryWrapper
<
DutyShift
>()
.
eq
(
BaseEntity:
:
getIsDelete
,
false
).
eq
(
DutyShift:
:
getAppKey
,
RequestContext
.
getAppKey
()));
// 根据id 保存成key -value
Map
<
Long
,
DutyShift
>
keyNameMap
=
dutyShifts
.
stream
()
.
collect
(
Collectors
.
toMap
(
BaseEntity:
:
getSequenceNbr
,
Function
.
identity
()));
// 根据时间 查询值班关系表
// BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm
if
(
beginDate
!=
null
)
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
DateUtils
.
longStr2Date
(
beginDate
));
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
c
.
set
(
Calendar
.
MINUTE
,
0
);
c
.
set
(
Calendar
.
SECOND
,
0
);
beginDate
=
DateUtils
.
date2LongStr
(
c
.
getTime
());
}
if
(
endDate
!=
null
)
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
DateUtils
.
longStr2Date
(
beginDate
));
c
.
add
(
Calendar
.
MONTH
,
1
);
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
c
.
add
(
Calendar
.
DATE
,
-
1
);
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
c
.
set
(
Calendar
.
MINUTE
,
59
);
c
.
set
(
Calendar
.
SECOND
,
59
);
endDate
=
DateUtils
.
date2LongStr
(
c
.
getTime
());
}
List
<
DutyPersonShiftDto
>
personShiftList
=
dutyPersonShiftService
.
list
(
new
LambdaQueryWrapper
<
DutyPersonShift
>().
eq
(
DutyPersonShift:
:
getInstanceId
,
instanceId
)
.
ge
(
beginDate
!=
null
,
DutyPersonShift:
:
getDutyDate
,
beginDate
)
.
le
(
endDate
!=
null
,
DutyPersonShift:
:
getDutyDate
,
endDate
))
.
stream
().
map
(
e
->
{
// 值班关系查询到以后 重新封装
DutyPersonShiftDto
dto
=
new
DutyPersonShiftDto
();
Bean
.
copyExistPropertis
(
e
,
dto
);
// 没值班信息,默认休
...
...
@@ -152,6 +179,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
public
List
<
Map
<
String
,
Object
>>
list
(
Long
teamId
,
String
beginDate
,
String
endDate
)
throws
ParseException
{
// 1.已column为准 进行返回
String
groupCode
=
this
.
getGroupCode
();
// 动态表单查询所有值班信息
List
<
Map
<
String
,
Object
>>
list
=
dynamicFormInstanceService
.
listAll
(
groupCode
);
// 2.组织值班数据
...
...
@@ -299,6 +327,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Override
public
Boolean
deleteDutyData
(
Long
instanceId
)
{
// 一个人共用一个 instanceId
dynamicFormInstanceService
.
remove
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getInstanceId
,
instanceId
));
dutyPersonShiftService
...
...
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