Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
07dd1550
Commit
07dd1550
authored
Apr 04, 2019
by
kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#
parent
85955a2c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
114 deletions
+70
-114
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+70
-114
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
07dd1550
...
...
@@ -8,7 +8,6 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Sets
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
...
...
@@ -20,8 +19,6 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.POIUtil
;
import
pwc.taxtech.atms.common.message.ErrorMessage
;
...
...
@@ -345,17 +342,15 @@ public class ReportServiceImpl extends BaseService {
andStartDateLessThanOrEqualTo
(
queryDate
).
andEndDateGreaterThanOrEqualTo
(
queryDate
).
andStatusEqualTo
(
0
);
List
<
RevenueTypeMapping
>
mappingList
=
revenueTypeMappingMapper
.
selectByExample
(
mappingExample
);
//先清除数据
InvoiceRecord
delRecord
=
new
InvoiceRecord
();
delRecord
.
setRevenueCofId
(
null
);
if
(!
isMergeManualData
)
{
delRecord
.
setModifyRevenueCofId
(
null
);
}
InvoiceRecordExample
delExample
=
new
InvoiceRecordExample
();
delExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
)
.
andProjectIdEqualTo
(
projectId
).
delExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
Integer
.
valueOf
(
queryDate
.
replace
(
"-"
,
""
)));
invoiceRecordMapper
.
deleteByExample
(
delExample
);
if
(
isMergeManualData
)
{
invoiceRecordMapper
.
clearRevenueCof
(
true
,
false
,
delExample
);
}
else
{
invoiceRecordMapper
.
clearRevenueCof
(
true
,
true
,
delExample
);
}
Map
<
String
,
Long
>
map
=
new
HashMap
<>();
for
(
RevenueTypeMapping
mapping
:
mappingList
)
{
if
(!
map
.
containsKey
(
mapping
.
getContent
()))
{
...
...
@@ -475,12 +470,14 @@ public class ReportServiceImpl extends BaseService {
for
(
int
r
=
sheet
.
getFirstRowNum
();
r
<=
sheet
.
getLastRowNum
();
r
++)
{
Row
row
=
sheet
.
getRow
(
r
);
for
(
int
c
=
row
.
getFirstCellNum
();
c
<=
row
.
getLastCellNum
();
c
++)
{
Cell
cell
=
row
.
getCell
(
c
);
if
(
cell
==
null
)
{
continue
;
//todo cell == null 如何处理
}
if
(
r
<=
addRowIndex
+
1
)
{
if
(
r
==
addRowIndex
+
1
&&
c
>
TaxesCalculateReportEnum
.
Column
.
Column_14
.
getIndex
()){
assembleOriginalTemplateData
(
template
,
projectId
,
period
,
r
,
c
,
addRowIndex
,
cellTemplateList
,
cellTemplateConfigList
);
}
else
{
String
cellId
=
projectId
+
template
.
getId
()
+
period
+
r
+
c
;
if
((
r
-
1
)
>=
0
&&
(
r
-
1
)
<
configIds
.
size
())
{
cellId
+=
configIds
.
get
(
configIds
.
size
()
-
r
);
...
...
@@ -542,7 +539,26 @@ public class ReportServiceImpl extends BaseService {
if
(
r
>
0
&&
r
<=
addRowIndex
&&
hasHandDatas
.
contains
(
c
))
{
addManualConfig
(
cellTemplate
,
cell
,
now
,
cellTemplateConfigList
);
}
}
}
else
{
assembleOriginalTemplateData
(
template
,
projectId
,
period
,
r
,
c
,
addRowIndex
,
cellTemplateList
,
cellTemplateConfigList
);
}
}
}
List
<
List
<
PeriodCellTemplate
>>
tmpList
=
CommonUtils
.
subListWithLen
(
cellTemplateList
,
CommonUtils
.
BATCH_NUM
);
// tmpList.forEach(list -> cellTemplateMapper.batchInsert2(list));
tmpList
.
forEach
(
list
->
periodCellTemplateMapper
.
batchInsert
(
list
));
//todo 批量插入优化
List
<
List
<
PeriodCellTemplateConfig
>>
tmpConfigList
=
CommonUtils
.
subListWithLen
(
cellTemplateConfigList
,
CommonUtils
.
BATCH_NUM
);
tmpConfigList
.
forEach
(
list
->
periodCellTemplateConfigMapper
.
batchInsert
(
list
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"importTemplateExcelFile error."
,
e
);
throw
new
ServiceException
(
ErrorMessage
.
SystemError
);
}
}
public
void
assembleOriginalTemplateData
(
Template
template
,
String
projectId
,
Integer
period
,
Integer
r
,
Integer
c
,
Integer
addRowIndex
,
List
<
PeriodCellTemplate
>
cellTemplateList
,
List
<
PeriodCellTemplateConfig
>
cellTemplateConfigList
)
{
//查询原来行cell是否有CellTemplate
CellTemplateExample
cellTemplateExample
=
new
CellTemplateExample
();
cellTemplateExample
.
createCriteria
().
andReportTemplateIdEqualTo
(
template
.
getId
()).
andRowIndexEqualTo
(
r
-
addRowIndex
).
andColumnIndexEqualTo
(
c
);
...
...
@@ -610,18 +626,6 @@ public class ReportServiceImpl extends BaseService {
}
}
}
}
}
List
<
List
<
PeriodCellTemplate
>>
tmpList
=
CommonUtils
.
subListWithLen
(
cellTemplateList
,
CommonUtils
.
BATCH_NUM
);
// tmpList.forEach(list -> cellTemplateMapper.batchInsert2(list));
tmpList
.
forEach
(
list
->
periodCellTemplateMapper
.
batchInsert
(
list
));
//todo 批量插入优化
List
<
List
<
PeriodCellTemplateConfig
>>
tmpConfigList
=
CommonUtils
.
subListWithLen
(
cellTemplateConfigList
,
CommonUtils
.
BATCH_NUM
);
tmpConfigList
.
forEach
(
list
->
periodCellTemplateConfigMapper
.
batchInsert
(
list
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"importTemplateExcelFile error."
,
e
);
throw
new
ServiceException
(
ErrorMessage
.
SystemError
);
}
}
private
void
addManualConfig
(
PeriodCellTemplate
cellTemplate
,
Cell
cell
,
Date
now
,
List
<
PeriodCellTemplateConfig
>
list
)
{
PeriodCellTemplateConfig
configManual
=
new
PeriodCellTemplateConfig
();
...
...
@@ -1230,6 +1234,7 @@ public class ReportServiceImpl extends BaseService {
}
private
static
final
Integer
specialConsideration
=
0
;
//特殊因素考虑
private
static
final
String
ebitRate
=
"1%"
;
//ebit 比率
public
List
<
CellTemplateReferenceDto
>
getTemplateReferences
(
int
period
)
{
return
new
ArrayList
<>();
...
...
@@ -1244,7 +1249,7 @@ public class ReportServiceImpl extends BaseService {
OperationResultDto
<
ReportDataDto
>
cellData
=
getCellData
(
reportId
,
getProjId
(
orgId
,
period
));
ReportDataDto
reportDataDto
=
new
ReportDataDto
();
//特殊因素考虑 默认为0 rate 默认为1%
EbitDataDto
ebitDataDto1
=
loadEbitData
(
orgId
,
period
,
specialConsideration
,
Constant
.
ebitRate
);
EbitDataDto
ebitDataDto1
=
loadEbitData
(
orgId
,
period
,
specialConsideration
,
ebitRate
);
if
(
cellData
.
getData
()
!=
null
)
{
cellData
.
getData
().
setEbitData
(
ebitDataDto1
);
}
else
{
...
...
@@ -1254,7 +1259,7 @@ public class ReportServiceImpl extends BaseService {
return
cellData
;
}
}
else
if
(
operationResultDto1
.
getData
().
getEbitData
()
==
null
&&
operationResultDto1
.
getData
().
getCellData
()
!=
null
)
{
EbitDataDto
ebitDataDto1
=
loadEbitData
(
orgId
,
period
,
specialConsideration
,
Constant
.
ebitRate
);
EbitDataDto
ebitDataDto1
=
loadEbitData
(
orgId
,
period
,
specialConsideration
,
ebitRate
);
operationResultDto1
.
getData
().
setEbitData
(
ebitDataDto1
);
}
else
{
OperationResultDto
<
ReportDataDto
>
cellData
=
getCellData
(
reportId
,
getProjId
(
orgId
,
period
));
...
...
@@ -1295,7 +1300,7 @@ public class ReportServiceImpl extends BaseService {
case
40
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setEbitRate
(
ebitCellData1
.
getData
(
));
ebitDataDto
.
setEbitRate
(
Double
.
parseDouble
(
ebitCellData1
.
getData
()
));
break
;
case
41
:
if
(
ebitCellData1
.
getData
()
==
null
)
...
...
@@ -1305,7 +1310,7 @@ public class ReportServiceImpl extends BaseService {
case
42
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setSixAddTax
(
new
BigDecimal
(
ebitCellData1
.
getData
()
));
ebitDataDto
.
setSixAddTax
(
ebitCellData1
.
getData
(
));
break
;
case
43
:
if
(
ebitCellData1
.
getData
()
==
null
)
...
...
@@ -1558,11 +1563,10 @@ public class ReportServiceImpl extends BaseService {
@Resource
private
EbitCellDataMapper
ebitCellDataMapper
;
//加载Ebit数据
public
EbitDataDto
loadEbitData
(
String
orgId
,
Integer
period
,
Integer
specialConsiderations
,
String
ebitRate
)
{
double
rate
=
0.1
;
BigDecimal
spec
=
new
BigDecimal
(
0
);
double
rate
=
0.01
;
//ebitRate
if
(!
ebitRate
.
isEmpty
())
{
int
_index
=
ebitRate
.
indexOf
(
"%"
);
spec
=
new
BigDecimal
(
specialConsiderations
);
...
...
@@ -1586,12 +1590,12 @@ public class ReportServiceImpl extends BaseService {
BigDecimal
yffy
=
new
BigDecimal
(
0
);
//研发费用
BigDecimal
zcjzss
=
new
BigDecimal
(
0
);
//资产减值损失
for
(
ProfitLossStatement
profitLossStatement
:
profitLossStatements
)
{
BigDecimal
value
=
profitLossStatement
.
get
Yt
dAmt
();
BigDecimal
value
=
profitLossStatement
.
get
Perio
dAmt
();
switch
(
profitLossStatement
.
getItemName
())
{
case
"
一、营业
收入"
:
case
"
加:营业外
收入"
:
yysr
=
value
;
break
;
case
"减:营业
成本
"
:
case
"减:营业
外支出
"
:
yycb
=
value
;
case
"营业税金及附加"
:
yysjfj
=
value
;
...
...
@@ -1607,14 +1611,26 @@ public class ReportServiceImpl extends BaseService {
zcjzss
=
value
;
}
EbitDataDto
ebitDataDto
=
new
EbitDataDto
();
BigDecimal
subtract
=
yysr
.
subtract
(
yycb
).
add
(
yysjfj
).
add
(
xsfy
).
add
(
glfy
).
add
(
yffy
).
add
(
zcjzss
);
BigDecimal
subtract
=
yysr
.
subtract
(
yycb
).
subtract
(
yysjfj
).
subtract
(
xsfy
).
subtract
(
glfy
).
subtract
(
yffy
).
subtract
(
zcjzss
);
ebitDataDto
.
setEbitSubtraction
(
subtract
);
ebitDataDto
.
setSpecialFactors
(
subtract
.
add
(
spec
));
ebitDataDto
.
setEbitRate
(
String
.
valueOf
(
rate
*
100
+
"%"
)
);
ebitDataDto
.
setEbitRate
(
rate
);
ebitDataDto
.
setTransactionAmount
(
ebitDataDto
.
getSpecialFactors
().
multiply
(
new
BigDecimal
(
ebitDataDto
.
getEbitRate
())));
ebitDataDto
.
setEbitRate
(
ebitRate
);
ebitDataDto
.
setSixAddTax
(
ebitDataDto
.
getTransactionAmount
().
multiply
(
new
BigDecimal
(
0.06
)));
ebitDataDto
.
setTransactionAmount
(
ebitDataDto
.
getTransactionAmount
().
multiply
(
new
BigDecimal
(
0.06
)));
ebitDataDto
.
setTotalAmountTax
(
ebitDataDto
.
getTransactionAmount
().
multiply
(
new
BigDecimal
(
0.16
)));
/*//保存
for (int i = 37; i <= 43; i++) {
EbitCellData ebitCellData = new EbitCellData();
ebitCellData.setData(arr[i - 37]);
ebitCellData.setRow(i);
ebitCellData.setCol(3);
ebitCellData.setCreateTime(now);
ebitCellData.setOrganizationId(orgId);
ebitCellData.setPeriod(period);
ebitCellDataMapper.insert(ebitCellData);
}*/
return
ebitDataDto
;
}
return
null
;
...
...
@@ -2315,7 +2331,7 @@ public class ReportServiceImpl extends BaseService {
ebitCellData1
.
setData
(
operationResultDto
.
getData
().
getEbitData
().
getTransactionAmount
().
toString
());
ebitCellData1
.
setRow
(
i
);
case
42
:
ebitCellData1
.
setData
(
operationResultDto
.
getData
().
getEbitData
().
getSixAddTax
()
.
toString
()
);
ebitCellData1
.
setData
(
operationResultDto
.
getData
().
getEbitData
().
getSixAddTax
());
ebitCellData1
.
setRow
(
i
);
case
43
:
ebitCellData1
.
setData
(
operationResultDto
.
getData
().
getEbitData
().
getTotalAmountTax
().
toString
());
...
...
@@ -2332,9 +2348,8 @@ public class ReportServiceImpl extends BaseService {
@Resource
private
EbitSpreadDataMapper
ebitSpreadDataMapper
;
@Transactional
public
synchronized
OperationResultDto
spreadToDb
(
HttpServletRequest
request
,
Integer
period
,
String
orgId
)
{
/* try {
public
OperationResultDto
spreadToDb
(
RequestParameterDto
.
EbitParam
ebitParam
)
{
try
{
EbitSpreadDataExample
example
=
new
EbitSpreadDataExample
();
EbitSpreadDataExample
.
Criteria
criteria
=
example
.
createCriteria
();
EbitSpreadDataExample
.
Criteria
criteria1
=
criteria
.
andOrganizationIdEqualTo
(
ebitParam
.
getOrgId
()).
andPeriodEqualTo
(
ebitParam
.
getPeriod
());
...
...
@@ -2359,29 +2374,7 @@ public class ReportServiceImpl extends BaseService {
operationResultDto
.
error
();
operationResultDto
.
setResultMsg
(
"spread【json序列化字符串】保存失败"
);
return
operationResultDto
;
}*/
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
request
;
Map
<
String
,
MultipartFile
>
fileMap
=
multipartRequest
.
getFileMap
();
MultipartFile
file
=
fileMap
.
get
(
"llb.xlsx"
);
String
fileName
=
orgId
+
period
+
"利润表"
;
EbitSpreadDataExample
example
=
new
EbitSpreadDataExample
();
example
.
createCriteria
().
andPeriodEqualTo
(
period
).
andOrganizationIdEqualTo
(
orgId
);
List
<
EbitSpreadData
>
ebitSpreadData1
=
ebitSpreadDataMapper
.
selectByExample
(
example
);
if
(
ebitSpreadData1
.
size
()
!=
0
){
didiFileUploadService
.
delData
(
ebitSpreadData1
.
get
(
0
).
getFileKey
());
ebitSpreadDataMapper
.
deleteByExample
(
example
);
}
FileUpload
fileUpload
=
didiFileUploadService
.
uploadFile
(
file
,
fileName
,
"ebit利润表"
);
EbitSpreadData
ebitSpreadData
=
new
EbitSpreadData
();
ebitSpreadData
.
setPeriod
(
period
);
ebitSpreadData
.
setOrganizationId
(
orgId
);
ebitSpreadData
.
setFileKey
(
fileUpload
.
getUid
());
ebitSpreadData
.
setFileName
(
fileName
);
ebitSpreadData
.
setId
(
idService
.
nextId
());
ebitSpreadDataMapper
.
insert
(
ebitSpreadData
);
return
operationResultDto
.
success
();
}
...
...
@@ -2403,11 +2396,8 @@ public class ReportServiceImpl extends BaseService {
*
* @param requestParameterDto
*/
public
void
manyExport
(
RequestParameterDto
requestParameterDto
,
String
zipFileName
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
String
zipPath
=
this
.
getClass
().
getResource
(
"/"
).
getPath
().
substring
(
1
)
+
"zipDir"
;
String
fileName
=
null
;
FileExcelUtil
.
createFile
(
zipPath
);
/* try {
public
void
manyExport
(
RequestParameterDto
requestParameterDto
,
String
zipFileName
,
HttpServletRequest
request
,
HttpServletResponse
response
,
String
zipPath
)
throws
Exception
{
try
{
FileOutputStream
out
=
new
FileOutputStream
(
zipFileName
);
//要输出的文件名字
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
...
...
@@ -2431,9 +2421,7 @@ public class ReportServiceImpl extends BaseService {
List
<
EbitCellData
>
ebitCellDataList
=
ebitCellDataMapper
.
selectByExample
(
example
);
//获取当前期间下所有的数据
List
<
List
<
EbitCellData
>>
dataList
=
Lists
.
newArrayList
();
List
<
EbitCellData
>
orgList
=
ebitCellDataMapper
.
selectOrgType
(
requestParameterDto
.
getPeriod
());
List<EbitCellData> orgTypeList = Lists.newArrayList();
File file = null;//要生成的Excel文件
List<File> filesList = Lists.newArrayList();
List
<
EbitCellData
>
orgTypeList
=
null
;
for
(
int
i
=
0
;
i
<
orgList
.
size
();
i
++)
{
orgTypeList
=
Lists
.
newArrayList
();
for
(
EbitCellData
ebitCellData
:
ebitCellDataList
)
{
...
...
@@ -2464,73 +2452,41 @@ public class ReportServiceImpl extends BaseService {
}
}
inputStream
=
httpFileService
.
getUserTemplate
(
templatePath
);
Workbook workbook = WorkbookFactory.create(inputStream);
Sheet sheet = workbook.getSheetAt(0);
try
{
Cell
cell
=
null
;
List
<
Workbook
>
workbooksList
=
Lists
.
newArrayList
();
for
(
List
<
EbitCellData
>
ebitCellDataList1
:
dataList
)
{
Workbook
newworkbook = new XSSFWorkbook(
);
Sheet sheet
1 = new
workbook.getSheetAt(0);
Workbook
workbook
=
WorkbookFactory
.
create
(
inputStream
);
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
if
(
isSheetEmpty
(
sheet
))
throw
new
Exception
(
"模板异常"
);
for
(
EbitCellData
ebitCellData
:
ebitCellDataList1
)
{
loop1:
for
(
int
j
=
1
,
k
=
sheet
.
getLastRowNum
();
j
<
k
;
j
++)
{
if (sheet.getRow(j) == null) continue;
for
(
int
m
=
1
,
n
=
sheet
.
getRow
(
j
).
getLastCellNum
();
m
<
n
;
m
++)
{
cell
=
sheet
.
getRow
(
j
).
getCell
(
m
);
if (cell == null) continue;
if (!"".equals(getCellStringValue(cell)) && ebitCellData.getRow() == j && ebitCellData.getCol() == m) {
if
(
""
.
equals
(
getCellStringValue
(
cell
))
&&
ebitCellData
.
getRow
()
==
j
&&
ebitCellData
.
getCol
()
==
m
)
{
cell
.
setCellValue
(
ebitCellData
.
getData
());
break loop1;
}
}
}
sheet1.getRow(ebitCellData.getRow()).getCell(ebitCellData.getCol()).setCellValue(ebitCellData.getData());
}
POIUtil.cloneSheetAndStyle(workbook.getSheetAt(0), workbook.createSheet("利润表"),newworkbook);
workbooksList
.
add
(
workbook
);
//将workbook生成file文件
String
path
=
"\\\\zipDir\\\\"
+
requestParameterDto
.
getPeriod
()
+
Math
.
random
()
+
"利润表"
;
file = FileExcelUtil.generateExcelToPath(workbook, path);
if (file != null)
filesList.add(file);
FileExcelUtil
.
downloadZip
(
request
,
response
,
zipFileName
,
FileExcelUtil
.
generateExcelToPath
(
workbook
,
path
),
zipPath
);
}
FileExcelUtil.downloadZip(request, response, zipFileName, filesList, zipPath);
//将workbook转成流
/* ByteArrayOutputStream bos = new ByteArrayOutputStream();
workbook.write(bos);
byte[] barray = bos.toByteArray();
InputStream is = new ByteArrayInputStream(barray);*/
// FileOutputStream fileOut = new FileOutputStream(path);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
Exception
(
ErrorMessage
.
SystemError
);
}
}*/
EbitSpreadDataExample
example
=
new
EbitSpreadDataExample
();
example
.
createCriteria
().
andPeriodEqualTo
(
requestParameterDto
.
getPeriod
());
List
<
EbitSpreadData
>
ebitSpreadData
=
ebitSpreadDataMapper
.
selectByExample
(
example
);
List
<
File
>
fileList
=
Lists
.
newArrayList
();
if
(
ebitSpreadData
.
size
()
==
0
)
throw
new
Exception
(
"没有可导出的数据"
);
for
(
int
i
=
0
;
i
<
ebitSpreadData
.
size
();
i
++)
{
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
Arrays
.
asList
(
ebitSpreadData
.
get
(
i
).
getFileKey
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
String
path
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
()))
{
path
=
uploadDetail
.
getList
().
get
(
0
).
getViewHttpUrl
();
}
InputStream
inputStream
=
httpFileService
.
getUserTemplate
(
path
);
Workbook
workbook1
=
WorkbookFactory
.
create
(
inputStream
);
fileName
=
zipPath
+
"/"
+
requestParameterDto
.
getPeriod
()
+
".xlsx"
;
fileList
.
add
(
FileExcelUtil
.
generateExcelToPath
(
workbook1
,
fileName
));
}
String
zipPath1
=
zipPath
+
"/sizegang.zip"
;
FileExcelUtil
.
downloadZip
(
request
,
response
,
zipFileName
,
fileList
,
zipPath1
);
//将workbook转成流
/* ByteArrayOutputStream bos = new ByteArrayOutputStream();
workbook.write(bos);
byte[] barray = bos.toByteArray();6
InputStream is = new ByteArrayInputStream(barray);*/
// FileOutputStream fileOut = new FileOutputStream(path);
}
private
String
getCellStringValue
(
Cell
cell
)
{
...
...
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