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
e7c53e59
Commit
e7c53e59
authored
May 13, 2021
by
liaoanyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改加班天数和漏报天数统计
parent
b2b20dab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
WorkTimeOrderMapper.xml
...-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
+1
-2
StatisticsTableDto.java
.../main/java/cn/wisenergy/model/dto/StatisticsTableDto.java
+3
-2
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+12
-4
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
View file @
e7c53e59
...
...
@@ -588,7 +588,7 @@
</select>
<select
id=
"getIsOvertime"
resultMap=
"BaseResultMap"
parameterType=
"map"
>
select project_id,user_id,`type`,is_overtime
select project_id,user_id,`type`,is_overtime
,work_time
from work_time_order
<where>
<if
test=
"deptId !=null"
>
...
...
@@ -599,6 +599,5 @@
AND user_id=#{userId}
</if>
</where>
group by day(work_day),is_overtime
</select>
</mapper>
wisenergy-model/src/main/java/cn/wisenergy/model/dto/StatisticsTableDto.java
View file @
e7c53e59
...
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -40,13 +41,13 @@ public class StatisticsTableDto implements Serializable {
* 用户姓名
*/
@ApiModelProperty
(
name
=
"overtimes"
,
value
=
"员工的加班天数"
)
private
Integer
overtimes
;
private
double
overtimes
;
/**
* 用户姓名
*/
@ApiModelProperty
(
name
=
"underreportings"
,
value
=
"漏报天数"
)
private
Integer
underreportings
;
private
double
underreportings
;
/**
* 一天工时类型和工时的集合
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
e7c53e59
...
...
@@ -141,19 +141,27 @@ public class StatisticsServiceImpl implements StatisticsService {
for
(
StatisticsTableDto
statisticsTableDto
:
statisticsTableDtos
)
{
map
.
put
(
"userId"
,
statisticsTableDto
.
getUserId
());
//员工的加班天数
Integer
overtimes
=
0
;
double
overtimes
=
0.00
0
;
//正常天数
Integer
days
=
0
;
double
days
=
0.00
0
;
List
<
WorkTimeOrder
>
isOvertime
=
workTimeOrderMapper
.
getIsOvertime
(
map
);
for
(
WorkTimeOrder
workTimeOrder
:
isOvertime
)
{
if
(
workTimeOrder
.
getIsOvertime
()==
1
)
{
overtimes
+=
1
;
//当前天数
double
overtimes1
=
workTimeOrder
.
getWorkTime
();
//统计天数
overtimes
+=
overtimes1
/
8
;
continue
;
}
if
(
workTimeOrder
.
getIsOvertime
()==
0
)
{
days
+=
1
;
//当前天数
double
days1
=
workTimeOrder
.
getWorkTime
();
//统计天数
days
+=
days1
/
8
;
System
.
out
.
println
(
"xxxxxxxxxxxxxxxxxxxxxxxx"
+
days1
);
System
.
out
.
println
(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+
days
);
}
}
statisticsTableDto
.
setOvertimes
(
overtimes
);
...
...
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