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
979412bf
Commit
979412bf
authored
Mar 12, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
e9d30782
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+4
-2
StatisticsController.java
...energy/web/admin/controller/app/StatisticsController.java
+1
-1
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
979412bf
...
@@ -872,13 +872,13 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -872,13 +872,13 @@ public class StatisticsServiceImpl implements StatisticsService {
sheet1
.
addMergedRegion
(
cellRangeAddress2
);
sheet1
.
addMergedRegion
(
cellRangeAddress2
);
setBorderStyle
(
BorderStyle
.
THIN
,
cellRangeAddress2
,
sheet1
);
setBorderStyle
(
BorderStyle
.
THIN
,
cellRangeAddress2
,
sheet1
);
// 合计行
// 合计行
CellRangeAddress
cellRangeAddress3
=
new
CellRangeAddress
(
userWorkTimeStatisticsReport
.
size
()
+
2
,
userWorkTimeStatisticsReport
.
size
()
+
2
,
0
,
1
);
CellRangeAddress
cellRangeAddress3
=
new
CellRangeAddress
(
userWorkTimeStatisticsReport
.
size
()
+
1
,
userWorkTimeStatisticsReport
.
size
()
+
1
,
0
,
1
);
sheet1
.
addMergedRegion
(
cellRangeAddress3
);
sheet1
.
addMergedRegion
(
cellRangeAddress3
);
setBorderStyle
(
BorderStyle
.
THIN
,
cellRangeAddress3
,
sheet1
);
setBorderStyle
(
BorderStyle
.
THIN
,
cellRangeAddress3
,
sheet1
);
// 项目行和总计行
// 项目行和总计行
for
(
int
i
=
0
;
i
<
row1_lastCellNum
/
2
-
1
;
i
++)
{
for
(
int
i
=
0
;
i
<
row1_lastCellNum
/
2
-
1
;
i
++)
{
// 总计行
// 总计行
CellRangeAddress
cellRangeAddress4
=
new
CellRangeAddress
(
userWorkTimeStatisticsReport
.
size
()
+
3
,
userWorkTimeStatisticsReport
.
size
()
+
3
,
i
*
2
,
i
*
2
+
1
);
CellRangeAddress
cellRangeAddress4
=
new
CellRangeAddress
(
userWorkTimeStatisticsReport
.
size
()
+
2
,
userWorkTimeStatisticsReport
.
size
()
+
2
,
i
*
2
,
i
*
2
+
1
);
sheet1
.
addMergedRegion
(
cellRangeAddress4
);
sheet1
.
addMergedRegion
(
cellRangeAddress4
);
setBorderStyle
(
BorderStyle
.
THIN
,
cellRangeAddress4
,
sheet1
);
setBorderStyle
(
BorderStyle
.
THIN
,
cellRangeAddress4
,
sheet1
);
if
(
i
>
0
)
{
if
(
i
>
0
)
{
...
@@ -1078,6 +1078,8 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -1078,6 +1078,8 @@ public class StatisticsServiceImpl implements StatisticsService {
// 设置单元格基本样式
// 设置单元格基本样式
HSSFCellStyle
createOrdinaryCellStyle
(
HSSFWorkbook
sheets
)
{
HSSFCellStyle
createOrdinaryCellStyle
(
HSSFWorkbook
sheets
)
{
HSSFCellStyle
cellStyle
=
sheets
.
createCellStyle
();
HSSFCellStyle
cellStyle
=
sheets
.
createCellStyle
();
// cellStyle.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
cellStyle
.
setFillForegroundColor
(
HSSFColor
.
HSSFColorPredefined
.
WHITE
.
getIndex
());
// 设置全填充
// 设置全填充
cellStyle
.
setFillPattern
(
FillPatternType
.
SOLID_FOREGROUND
);
cellStyle
.
setFillPattern
(
FillPatternType
.
SOLID_FOREGROUND
);
// 垂直、水平中心对齐
// 垂直、水平中心对齐
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/StatisticsController.java
View file @
979412bf
...
@@ -169,7 +169,7 @@ public class StatisticsController extends BaseController {
...
@@ -169,7 +169,7 @@ public class StatisticsController extends BaseController {
// String fileName = deptName + "-" + param.getYear() + "年" + param.getMonth() + "月工时汇总";
// String fileName = deptName + "-" + param.getYear() + "年" + param.getMonth() + "月工时汇总";
//响应类型为application/octet- stream情况下使用了这个头信息的话,那就意味着不想直接显示内容
//响应类型为application/octet- stream情况下使用了这个头信息的话,那就意味着不想直接显示内容
response
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
);
response
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
);
String
fileName
=
"导出
人员工时统计
"
;
String
fileName
=
"导出
项目工时统计明细
"
;
//attachment为以附件方式下载
//attachment为以附件方式下载
try
{
try
{
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
...
...
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