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
b32177f8
Commit
b32177f8
authored
Jan 26, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试
parent
1b884197
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
WorkTimeOrderMapper.xml
...-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
+1
-1
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+15
-11
StatisticsController.java
...energy/web/admin/controller/app/StatisticsController.java
+2
-1
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
View file @
b32177f8
...
...
@@ -179,7 +179,7 @@
#{projectId}
</foreach>
<if
test=
"firstDayOfMonth != null"
>
work_day >= #{firstDayOfMonth}
AND work_day >= date(#{firstDayOfMonth})
</if>
group by `type`,dept_id, project_id
</select>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
b32177f8
...
...
@@ -236,24 +236,28 @@ public class StatisticsServiceImpl implements StatisticsService {
Date
firstDayOfMonth
=
DateUtil
.
getFirstDayOfMonth
(
now
);
//本月第一天到当日的日期集合
List
<
Date
>
workDays
=
DateUtil
.
getDatesBetweenTwoDate
(
firstDayOfMonth
,
now
);
//除去周末
和节假日
//除去周末
Iterator
<
Date
>
iterator
=
workDays
.
iterator
();
while
(
iterator
.
hasNext
())
{
Date
next
=
iterator
.
next
(
);
if
(
w
orkHolidayService
.
isHoliday
(
next
)
)
{
int
week
=
DateUtil
.
getWeek
(
iterator
.
next
()
);
if
(
w
eek
==
6
||
week
==
7
)
{
iterator
.
remove
();
}
}
//获取当月的节日和周末上班日期
List
<
WorkHoliday
>
specialDates
=
workHolidayMapper
.
getByDate
(
firstDayOfMonth
,
now
);
if
(
CollectionUtil
.
isNotEmpty
(
specialDates
))
{
for
(
WorkHoliday
specialDate
:
specialDates
)
{
//获取的是工作日
if
(
specialDate
.
getDayType
().
equals
(
HolidayTypeEnum
.
WORKING_DAY
.
getCode
()))
{
//在本月应上班集合中加上这天,一般都是放假前后的周末调整上班
List
<
Date
>
isWorkDays
=
DateUtil
.
getDatesBetweenTwoDate
(
specialDate
.
getDayStart
(),
specialDate
.
getDayEnd
());
workDays
.
addAll
(
isWorkDays
);
}
if
(
CollectionUtil
.
isEmpty
(
specialDates
))
{
return
workDays
;
}
for
(
WorkHoliday
specialDate
:
specialDates
)
{
List
<
Date
>
isWorkDays
=
DateUtil
.
getDatesBetweenTwoDate
(
specialDate
.
getDayStart
(),
specialDate
.
getDayEnd
());
//获取的是工作日
if
(
specialDate
.
getDayType
().
equals
(
HolidayTypeEnum
.
WORKING_DAY
.
getCode
()))
{
//在本月应上班集合中加上这天,一般都是放假前后的周末调整上班
workDays
.
addAll
(
isWorkDays
);
}
else
{
//否则就除去假日
workDays
.
removeAll
(
isWorkDays
);
}
}
return
workDays
;
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/StatisticsController.java
View file @
b32177f8
...
...
@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -57,7 +58,7 @@ public class StatisticsController extends BaseController {
@ApiOperation
(
value
=
"获取负责项目工时汇总"
,
notes
=
"获取负责项目工时汇总"
)
@GetMapping
(
"/getCurrentMonthWorkTimeCollect"
)
public
List
<
WorkTimeAndCostCollect
>
getWorkTimeCollect
(
Integer
userId
,
Date
startTime
)
{
public
List
<
WorkTimeAndCostCollect
>
getWorkTimeCollect
(
Integer
userId
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
startTime
)
{
log
.
info
(
"WorkUserController[]getCurrentMonthWorkTimeCollect[]input.param"
+
userId
,
startTime
);
if
(
userId
==
null
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
...
...
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