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
21a9d2de
Commit
21a9d2de
authored
Mar 22, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge 档案管理
parent
b07b6e3a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
42 deletions
+40
-42
FileTypesController.java
...java/pwc/taxtech/atms/controller/FileTypesController.java
+2
-2
OperationLogFileTypeController.java
...xtech/atms/controller/OperationLogFileTypeController.java
+2
-2
OperationLogTaxDocController.java
...taxtech/atms/controller/OperationLogTaxDocController.java
+2
-2
TaxDocumentController.java
...va/pwc/taxtech/atms/controller/TaxDocumentController.java
+19
-22
TaxDocumentServiceImpl.java
...pwc/taxtech/atms/service/impl/TaxDocumentServiceImpl.java
+15
-14
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/FileTypesController.java
View file @
21a9d2de
...
...
@@ -13,7 +13,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.OutputStream
;
import
java.util.HashMap
;
import
java.util.
Linked
HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -92,7 +92,7 @@ public class FileTypesController {
@ResponseBody
public
void
exportExcelFile
(
HttpServletResponse
response
){
try
{
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
headers
=
new
LinkedHashMap
<
>();
headers
.
put
(
"id"
,
"id"
);
headers
.
put
(
"file_attr"
,
"档案属性"
);
headers
.
put
(
"file_type"
,
"档案类型"
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/OperationLogFileTypeController.java
View file @
21a9d2de
...
...
@@ -12,7 +12,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.OutputStream
;
import
java.util.HashMap
;
import
java.util.
Linked
HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -93,7 +93,7 @@ public class OperationLogFileTypeController {
public
void
exportExcelFile
(
HttpServletResponse
response
){
// public ReturnData selectListForLog(@RequestBody OperationLogFileType operationLogFileType){
try
{
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
headers
=
new
LinkedHashMap
<
>();
headers
.
put
(
"id"
,
"id"
);
// headers.put("operation_content", "操作内容");
// headers.put("module_name", "模块名称");
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/OperationLogTaxDocController.java
View file @
21a9d2de
...
...
@@ -13,7 +13,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.OutputStream
;
import
java.util.HashMap
;
import
java.util.
Linked
HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -74,7 +74,7 @@ public class OperationLogTaxDocController {
// public void exportExcelFile(HttpServletResponse response, @RequestBody OperationLogTaxDocument operationLogTaxDocument) {
public
void
exportExcelFile
(
HttpServletResponse
response
)
{
try
{
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
headers
=
new
LinkedHashMap
<
>();
headers
.
put
(
"id"
,
"id"
);
// headers.put("operation_content", "操作内容");
// headers.put("module_name", "模块名称");
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/TaxDocumentController.java
View file @
21a9d2de
...
...
@@ -30,10 +30,7 @@ import java.net.HttpURLConnection;
import
java.net.URL
;
import
java.net.URLDecoder
;
import
java.text.SimpleDateFormat
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.*
;
@Controller
@RequestMapping
(
"/api/v1/taxDoc"
)
...
...
@@ -88,24 +85,24 @@ public class TaxDocumentController {
@ResponseBody
public
void
exportExcelFile
(
HttpServletResponse
response
,
@RequestBody
TaxDocumentDto
taxDocumentDto
)
{
try
{
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
"
id"
,
"id
"
);
headers
.
put
(
"
file_a
ttr"
,
"档案属性"
);
headers
.
put
(
"
file_t
ype"
,
"档案类型"
);
headers
.
put
(
"
file_n
ame"
,
"档案名称"
);
headers
.
put
(
"
business_l
ine"
,
"业务线"
);
headers
.
put
(
"
company_n
ame"
,
"公司名称"
);
headers
.
put
(
"
tax_t
ype"
,
"税种"
);
headers
.
put
(
"
file_t
ime"
,
"文件生效日期"
);
headers
.
put
(
"
effective_t
ime"
,
"有效日期"
);
headers
.
put
(
"
c
reator"
,
"创建人"
);
headers
.
put
(
"
create_t
ime"
,
"创建时间"
);
headers
.
put
(
"
upload_t
ime"
,
"上传日期"
);
headers
.
put
(
"
storage_a
rea"
,
"实物存放地点"
);
headers
.
put
(
"
k
eeper"
,
"保管人"
);
headers
.
put
(
"
r
emark"
,
"档案备注"
);
headers
.
put
(
"
file_position_u
rl"
,
"文件存储的位置"
);
headers
.
put
(
"
own_t
ime"
,
"所属期间"
);
Map
<
String
,
String
>
headers
=
new
LinkedHashMap
<
>();
headers
.
put
(
"
Id"
,
"序号
"
);
headers
.
put
(
"
FileA
ttr"
,
"档案属性"
);
headers
.
put
(
"
FileT
ype"
,
"档案类型"
);
headers
.
put
(
"
FileN
ame"
,
"档案名称"
);
headers
.
put
(
"
BusinessL
ine"
,
"业务线"
);
headers
.
put
(
"
CompanyN
ame"
,
"公司名称"
);
headers
.
put
(
"
TaxT
ype"
,
"税种"
);
headers
.
put
(
"
FileT
ime"
,
"文件生效日期"
);
headers
.
put
(
"
EffectiveT
ime"
,
"有效日期"
);
headers
.
put
(
"
C
reator"
,
"创建人"
);
headers
.
put
(
"
CreateT
ime"
,
"创建时间"
);
headers
.
put
(
"
UploadT
ime"
,
"上传日期"
);
headers
.
put
(
"
StorageA
rea"
,
"实物存放地点"
);
headers
.
put
(
"
K
eeper"
,
"保管人"
);
headers
.
put
(
"
R
emark"
,
"档案备注"
);
headers
.
put
(
"
FilePositionU
rl"
,
"文件存储的位置"
);
headers
.
put
(
"
OwnT
ime"
,
"所属期间"
);
List
<
TaxDocument
>
TaxDocument
=
taxDocumentService
.
selectTaxDocumentList
(
taxDocumentDto
);
response
.
setContentType
(
"multipart/form-data"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;fileName="
+
new
String
(
"taxDocument.xlsx"
.
getBytes
(
"GB2312"
),
"ISO-8859-1"
));
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TaxDocumentServiceImpl.java
View file @
21a9d2de
...
...
@@ -28,10 +28,7 @@ import java.net.HttpURLConnection;
import
java.net.URL
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
...
...
@@ -350,7 +347,7 @@ public class TaxDocumentServiceImpl {
}
public
void
downloadAllFile
(
HttpServletResponse
response
,
List
<
Long
>
ids
)
{
//如果只选择了一个附件,则不打包
if
(
null
!=
ids
&&
ids
.
size
()==
1
)
{
if
(
null
!=
ids
&&
ids
.
size
()
==
1
)
{
TaxDocumentExample
example
=
new
TaxDocumentExample
();
TaxDocumentExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andIdIn
(
ids
);
...
...
@@ -360,8 +357,10 @@ public class TaxDocumentServiceImpl {
if
(
StringUtils
.
isBlank
(
urlPath
))
{
throw
new
RuntimeException
(
"文件url为空,id为:"
+
taxDocument
.
getId
());
}
//文件名称(带后缀)
String
fileName
=
StringUtils
.
isBlank
(
taxDocument
.
getFileOriginalName
())
?
"未知文件(请修改后缀名).xlsx"
:
taxDocument
.
getFileOriginalName
();
//文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String
fileName
=
StringUtils
.
isBlank
(
taxDocument
.
getFileName
())
?
"未知文件(请修改后缀名).xlsx"
:
UUID
.
randomUUID
().
toString
().
substring
(
0
,
6
)
+
"_"
+
taxDocument
.
getFileOriginalName
();
//设置输出流信息
try
{
response
.
setContentType
(
"multipart/form-data"
);
...
...
@@ -399,27 +398,27 @@ public class TaxDocumentServiceImpl {
out
.
write
(
buffer
,
0
,
len
);
}
}
catch
(
IOException
e
)
{
log
.
error
(
"单个附件下载异常:"
+
e
.
getMessage
());
log
.
error
(
"单个附件下载异常:"
+
e
.
getMessage
());
}
finally
{
if
(
null
!=
out
){
if
(
null
!=
out
)
{
try
{
out
.
close
();
}
catch
(
IOException
e
)
{
log
.
error
(
"关闭输出流错误:"
+
e
.
getMessage
());
log
.
error
(
"关闭输出流错误:"
+
e
.
getMessage
());
}
}
if
(
null
!=
is
)
{
try
{
is
.
close
();
}
catch
(
IOException
e
)
{
log
.
error
(
"关闭输入流错误:"
+
e
.
getMessage
());
log
.
error
(
"关闭输入流错误:"
+
e
.
getMessage
());
}
}
if
(
null
!=
in
)
{
try
{
in
.
close
();
}
catch
(
IOException
e
)
{
log
.
error
(
"关闭缓存输入流错误:"
+
e
.
getMessage
());
log
.
error
(
"关闭缓存输入流错误:"
+
e
.
getMessage
());
}
}
}
...
...
@@ -485,8 +484,10 @@ public class TaxDocumentServiceImpl {
if
(
StringUtils
.
isBlank
(
urlPath
))
{
throw
new
RuntimeException
(
"文件url为空,id为:"
+
item
.
getId
());
}
//文件名称(带后缀)
String
fileName
=
StringUtils
.
isBlank
(
item
.
getFileOriginalName
())
?
"未知文件(请修改后缀名).xlsx"
:
item
.
getFileOriginalName
();
//文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String
fileName
=
StringUtils
.
isBlank
(
item
.
getFileName
())
?
"未知文件(请修改后缀名).xlsx"
:
UUID
.
randomUUID
().
toString
().
substring
(
0
,
6
)
+
"_"
+
item
.
getFileName
();
InputStream
is
=
null
;
BufferedInputStream
in
=
null
;
byte
[]
buffer
=
new
byte
[
1024
];
...
...
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