Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
work_service
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
licc
work_service
Commits
c0e3cb96
Commit
c0e3cb96
authored
Mar 31, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
37ce4902
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
DateUtil.java
...mon/src/main/java/cn/wisenergy/common/utils/DateUtil.java
+5
-2
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+3
-0
WorkCollectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkCollectServiceImpl.java
+2
-0
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/DateUtil.java
View file @
c0e3cb96
...
...
@@ -836,14 +836,17 @@ public class DateUtil {
public
static
Date
getLastDayByMonth2
(
Date
date
)
{
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
cal
.
set
(
Calendar
.
MONTH
,
cal
.
get
(
Calendar
.
MONTH
)+
1
);
cal
.
set
(
Calendar
.
DATE
,
0
);
//设置年份
cal
.
set
(
Calendar
.
YEAR
,
getYear
(
date
));
/*
cal.set(Calendar.YEAR,getYear(date));
//设置月份
cal.set(Calendar.MONTH, getMonth(date));
//获取某月最大天数
int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
//设置日历中月份的最大天数
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
lastDay
);
cal.set(Calendar.DAY_OF_MONTH, lastDay);
*/
cal
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
cal
.
set
(
Calendar
.
MINUTE
,
0
);
cal
.
set
(
Calendar
.
SECOND
,
0
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
c0e3cb96
...
...
@@ -1138,7 +1138,9 @@ public class StatisticsServiceImpl implements StatisticsService {
return
sheets
;
}
//获取一个月应上班日期,如果是当月,时间截至到当天
@Override
public
List
<
Date
>
currentMonthWorkDays
(
Date
date
,
boolean
toToday
)
{
log
.
info
(
"StatisticsServiceImpl[]currentMonthWorkDays[]input.method"
);
// 时间为本月,起始时间为参数时间当月第一天,截至时间为当天。否则,截至时间为当月最后一天
...
...
@@ -1150,6 +1152,7 @@ public class StatisticsServiceImpl implements StatisticsService {
endDate
=
DateUtil
.
getStartOfDay
(
now
);
System
.
out
.
println
(
"endDate1 = "
+
DateUtils
.
dateToStringWithPattern
(
endDate
,
"yyyy-MM-dd"
));
}
else
{
System
.
out
.
println
(
DateUtils
.
dateToShortString
(
date
));
endDate
=
DateUtil
.
getLastDayByMonth2
(
date
);
System
.
out
.
println
(
"endDate2 = "
+
DateUtils
.
dateToStringWithPattern
(
endDate
,
"yyyy-MM-dd"
));
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkCollectServiceImpl.java
View file @
c0e3cb96
...
...
@@ -196,6 +196,8 @@ public class WorkCollectServiceImpl implements WorkCollectService {
*/
private
List
<
Date
>
getNotCompletedByMonth
(
WorkUser
user
,
Date
month
)
{
boolean
flag
=
DateUtil
.
isYearAndMonthEqual
(
month
,
new
Date
());
System
.
out
.
println
(
"month"
+
DateUtils
.
dateToShortString
(
month
));
System
.
out
.
println
(
"flag = "
+
flag
);
List
<
Date
>
workDays
=
statisticsService
.
currentMonthWorkDays
(
month
,
flag
);
Date
createDate
=
DateUtils
.
bigDateToShortDate
(
user
.
getCreateTime
());
workDays
.
removeIf
(
workDay
->
workDay
.
compareTo
(
createDate
)
<
0
);
...
...
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