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
9b707d69
Commit
9b707d69
authored
Mar 13, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
74477e43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
29 deletions
+20
-29
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+20
-29
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
9b707d69
...
...
@@ -776,8 +776,9 @@ public class StatisticsServiceImpl implements StatisticsService {
// 项目行
HSSFRow
row_2
=
sheet1
.
createRow
(
2
);
for
(
int
i
=
0
;
i
<
projectWorkTimeAndType
.
size
();
i
++)
{
// 项目名称
// 项目名称
单元格
HSSFCell
row_1Cell
;
// 总计行单元格
HSSFCell
totalRow2Cell
;
if
(!
"请假"
.
equals
(
projectWorkTimeAndType
.
get
(
i
).
getProjectName
())
&&
!
"调休"
.
equals
(
projectWorkTimeAndType
.
get
(
i
).
getProjectName
()))
{
// 项目名称或类型名称
...
...
@@ -786,42 +787,27 @@ public class StatisticsServiceImpl implements StatisticsService {
// 正常工时
HSSFCell
row2Cell
=
row_2
.
createCell
((
i
+
1
)
*
2
);
row2Cell
.
setCellValue
(
"正常工时"
);
// 该项目正常工时合计
HSSFCell
cell1
=
totalRow1
.
createCell
((
i
+
1
)
*
2
);
cell1
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getNormalTime
());
// 加班工时
HSSFCell
row2Cell1
=
row_2
.
createCell
((
i
+
1
)
*
2
+
1
);
row2Cell1
.
setCellValue
(
"加班工时"
);
// 该项目加班工时合计
HSSFCell
cell2
=
totalRow1
.
createCell
((
i
+
1
)
*
2
+
1
);
cell2
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getOverTime
());
}
else
{
// 调休和请假没有加班工时和正常工时之分
row_1Cell
=
row_1
.
createCell
((
i
+
1
)
*
2
);
// 加班工时和正常工时行最后的
short
lastCellNum
=
row_2
.
getLastCellNum
();
// 调休和请假的类型名单元格
row_1Cell
=
row_1
.
createCell
(
lastCellNum
);
// 请假或调休的总计单元格
totalRow2Cell
=
totalRow2
.
createCell
(
lastCellNum
);
// 类型名称
row_1Cell
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getProjectName
());
// 请假合计
HSSFCell
cell1
=
totalRow1
.
createCell
(
(
i
+
1
)
*
2
);
// 请假
或调休
合计
HSSFCell
cell1
=
totalRow1
.
createCell
(
lastCellNum
);
cell1
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getNormalTime
());
// 请假总计
HSSFCell
cell3
=
totalRow2
.
createCell
((
i
+
1
)
*
2
);
cell3
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getNormalTime
());
i
++;
row_1Cell
=
row_1
.
createCell
((
i
+
1
)
*
2
-
1
);
row_1Cell
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getProjectName
());
// 调休合计
HSSFCell
cell2
=
totalRow1
.
createCell
((
i
+
1
)
*
2
-
1
);
cell2
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getNormalTime
());
// 调休总计
HSSFCell
cell4
=
totalRow2
.
createCell
((
i
+
1
)
*
2
-
1
);
cell4
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getNormalTime
());
// 合计行的合计
HSSFCell
cell5
=
totalRow1
.
createCell
((
i
+
1
)
*
2
);
cell5
.
setCellValue
(
userWorkTimeStatisticsByProject
.
getTotalTime
());
// 总计行的合计
HSSFCell
cell6
=
totalRow2
.
createCell
((
i
+
1
)
*
2
);
cell6
.
setCellValue
(
userWorkTimeStatisticsByProject
.
getTotalTime
());
break
;
}
row_1Cell
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getProjectName
());
totalRow2Cell
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getTotalTime
());
...
...
@@ -831,8 +817,12 @@ public class StatisticsServiceImpl implements StatisticsService {
short
row1_lastCellNum
=
row_1
.
getLastCellNum
();
if
(
lastProjectName
.
equals
(
"请假"
)
||
lastProjectName
.
equals
(
"调休"
))
{
row_1
.
createCell
(
row1_lastCellNum
).
setCellValue
(
"合计"
);
totalRow1
.
createCell
(
row1_lastCellNum
).
setCellValue
(
userWorkTimeStatisticsByProject
.
getTotalTime
());
totalRow2
.
createCell
(
row1_lastCellNum
).
setCellValue
(
userWorkTimeStatisticsByProject
.
getTotalTime
());
}
else
{
row_1
.
createCell
(
row1_lastCellNum
+
1
).
setCellValue
(
"合计"
);
totalRow1
.
createCell
(
row1_lastCellNum
+
1
).
setCellValue
(
userWorkTimeStatisticsByProject
.
getTotalTime
());
totalRow2
.
createCell
(
row1_lastCellNum
+
1
).
setCellValue
(
userWorkTimeStatisticsByProject
.
getTotalTime
());
}
for
(
int
i
=
0
;
i
<
userWorkTimeStatisticsReport
.
size
()
-
2
;
i
++)
{
...
...
@@ -1136,7 +1126,7 @@ public class StatisticsServiceImpl implements StatisticsService {
String
date
=
new
String
();
if
(
i
<
statisticsDateAndWorkTimes
.
size
())
{
date
=
statisticsDateAndWorkTimes
.
get
(
i
).
getDate
();
}
else
{
}
else
{
break
;
}
// 时间不连续,创建对象
...
...
@@ -1268,7 +1258,8 @@ public class StatisticsServiceImpl implements StatisticsService {
}
}
}
public
void
closeSheets
(
HSSFWorkbook
sheets
){
public
void
closeSheets
(
HSSFWorkbook
sheets
)
{
try
{
sheets
.
close
();
}
catch
(
IOException
e
)
{
...
...
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