Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
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
王衍超
cloud-fb
Commits
69323753
Commit
69323753
authored
May 19, 2021
by
wukaiqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复excel下载报错问题
parent
d015baa7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
DownLoadStatisticsServiceImpl.java
...stics/internal/service/DownLoadStatisticsServiceImpl.java
+8
-6
DownLoadStatisticsController.java
...st/dinas/statistics/web/DownLoadStatisticsController.java
+6
-6
No files found.
backend/xyst.dinas.statistics/src/main/java/com/xyst/dinas/statistics/internal/service/DownLoadStatisticsServiceImpl.java
View file @
69323753
...
...
@@ -3,6 +3,7 @@ package com.xyst.dinas.statistics.internal.service;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -88,6 +89,7 @@ public class DownLoadStatisticsServiceImpl implements DownLoadStatisticsService
String
endDate
,
String
purchaseSandUnit
,
String
project
,
String
fundType
,
String
paymentDetailsList
)
throws
IOException
{
String
fileName
=
new
String
(
"回款明细表"
.
getBytes
(
"gb2312"
),
"ISO8859-1"
)
+
".xlsx"
;
//String fileName = URLEncoder.encode("回款明细表", "utf-8");
InputStream
is
=
null
;
for
(
Resource
resource
:
resourcesXlsx
)
{
...
...
@@ -117,27 +119,27 @@ public class DownLoadStatisticsServiceImpl implements DownLoadStatisticsService
cell0
.
setCellStyle
(
textBorderStyle
);
XSSFCell
cell1
=
row
.
createCell
(
1
);
cell1
.
setCellValue
(
paymentDetail
.
get
CreateTime
());
cell1
.
setCellValue
(
paymentDetail
.
get
PurchaseSandUnit
());
cell1
.
setCellStyle
(
textBorderStyle
);
XSSFCell
cell2
=
row
.
createCell
(
2
);
cell2
.
setCellValue
(
paymentDetail
.
get
CreateTime
());
cell2
.
setCellValue
(
paymentDetail
.
get
Project
());
cell2
.
setCellStyle
(
textBorderStyle
);
XSSFCell
cell3
=
row
.
createCell
(
3
);
cell3
.
setCellValue
(
paymentDetail
.
get
CreateTim
e
());
cell3
.
setCellValue
(
paymentDetail
.
get
FundTyp
e
());
cell3
.
setCellStyle
(
textBorderStyle
);
XSSFCell
cell4
=
row
.
createCell
(
4
);
cell4
.
setCellValue
(
paymentDetail
.
get
CreateTime
());
cell4
.
setCellValue
(
paymentDetail
.
get
RechargeAmount
());
cell4
.
setCellStyle
(
textBorderStyle
);
XSSFCell
cell5
=
row
.
createCell
(
5
);
cell5
.
setCellValue
(
paymentDetail
.
get
CreateTime
());
cell5
.
setCellValue
(
paymentDetail
.
get
ActualRefundAmount
());
cell5
.
setCellStyle
(
textBorderStyle
);
XSSFCell
cell6
=
row
.
createCell
(
6
);
cell6
.
setCellValue
(
paymentDetail
.
get
CreateTime
());
cell6
.
setCellValue
(
paymentDetail
.
get
Remark
());
cell6
.
setCellStyle
(
textBorderStyle
);
r
++;
}
...
...
backend/xyst.dinas.statistics/src/main/java/com/xyst/dinas/statistics/web/DownLoadStatisticsController.java
View file @
69323753
...
...
@@ -4,9 +4,12 @@ import java.io.IOException;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.
web.bind.annotation.PostMapping
;
import
org.springframework.
stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.xyst.dinas.statistics.service.DownLoadStatisticsService
;
import
com.xyst.dinas.statistics.web.Info.ConditionsDetailsInfo
;
...
...
@@ -16,18 +19,15 @@ public class DownLoadStatisticsController {
@Autowired
DownLoadStatisticsService
downLoadStatisticsService
;
@
PostMapping
(
value
=
"/DownLoadStatistics/downLoadStatisticsService"
,
consumes
=
"application/json"
)
public
Object
downLoadStatisticsService
(
HttpServletResponse
response
,
HttpServletRequest
request
,
@
RequestMapping
(
value
=
"/DownLoadStatistics/downLoadStatisticsService"
,
method
=
RequestMethod
.
GET
)
public
void
downLoadStatisticsService
(
HttpServletResponse
response
,
HttpServletRequest
request
,
@RequestBody
ConditionsDetailsInfo
conditionsDetailsInfo
)
{
try
{
downLoadStatisticsService
.
downLoadStatisticsServiceTable
(
response
,
request
,
conditionsDetailsInfo
);
return
ResponseObj
.
success
(
"数据下成功"
);
}
catch
(
RuntimeException
e
)
{
// TODO: handle exception
return
ResponseObj
.
error
(
"数据下成功操作后台失败!详情请查看日志"
,
e
.
getMessage
());
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
return
ResponseObj
.
error
(
"数据下成功操作后台失败!详情请查看日志"
,
e
.
getMessage
());
}
}
}
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