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
b01c2bc0
Commit
b01c2bc0
authored
May 22, 2019
by
Eddie.Wu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_mysql_chase_bug' into 'dev_mysql'
修复gift查询bug See merge request root/atms!388
parents
7dbe3ca6
3daa8c20
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
90 deletions
+93
-90
CitReportUploadService.java
...pwc/taxtech/atms/service/impl/CitReportUploadService.java
+11
-11
ReportUploadService.java
...va/pwc/taxtech/atms/service/impl/ReportUploadService.java
+11
-11
TaxDocumentServiceImpl.java
...pwc/taxtech/atms/service/impl/TaxDocumentServiceImpl.java
+61
-57
TemplateServiceImpl.java
...va/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
+10
-7
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+0
-2
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+0
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CitReportUploadService.java
View file @
b01c2bc0
...
...
@@ -25,10 +25,7 @@ import pwc.taxtech.atms.vat.entity.ReportUpload;
import
pwc.taxtech.atms.vat.entity.ReportUploadExample
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -56,13 +53,16 @@ public class CitReportUploadService extends BaseService {
example
.
createCriteria
().
andProjectIdEqualTo
(
param
.
getProjectId
()).
andPeriodEqualTo
(
param
.
getPeriod
()).
andServiceTypeEqualTo
(
EnumServiceType
.
CIT
.
getCode
());
example
.
setOrderByClause
(
" create_time DESC "
);
List
<
ReportUpload
>
dataList
=
reportUploadMapper
.
selectByExample
(
example
);
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
dataList
.
stream
()
.
map
(
o
->
o
.
getFileUploadId
()).
collect
(
Collectors
.
toList
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
Map
<
String
,
String
>
urlMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
())){
urlMap
=
uploadDetail
.
getList
().
stream
().
collect
(
Collectors
.
toMap
(
DidiFileUploadDetailResult:
:
getUid
,
didiFileUploadDetailResult
->
didiFileUploadDetailResult
.
getViewHttpUrl
()));
List
<
String
>
fileUploadUids
=
dataList
.
stream
()
.
map
(
o
->
o
.
getFileUploadId
()).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
urlMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
fileUploadUids
)){
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
fileUploadUids
);
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
())){
urlMap
=
uploadDetail
.
getList
().
stream
().
collect
(
Collectors
.
toMap
(
DidiFileUploadDetailResult:
:
getUid
,
didiFileUploadDetailResult
->
didiFileUploadDetailResult
.
getViewHttpUrl
()));
}
}
List
<
ReportUploadResult
>
resultList
=
new
ArrayList
<
ReportUploadResult
>();
for
(
ReportUpload
data:
dataList
){
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ReportUploadService.java
View file @
b01c2bc0
...
...
@@ -25,10 +25,7 @@ import pwc.taxtech.atms.vat.entity.ReportUpload;
import
pwc.taxtech.atms.vat.entity.ReportUploadExample
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -56,13 +53,16 @@ public class ReportUploadService extends BaseService {
example
.
createCriteria
().
andProjectIdEqualTo
(
param
.
getProjectId
()).
andPeriodEqualTo
(
param
.
getPeriod
()).
andServiceTypeEqualTo
(
EnumServiceType
.
VAT
.
getCode
());
example
.
setOrderByClause
(
" create_time DESC "
);
List
<
ReportUpload
>
dataList
=
reportUploadMapper
.
selectByExample
(
example
);
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
dataList
.
stream
()
.
map
(
o
->
o
.
getFileUploadId
()).
collect
(
Collectors
.
toList
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
Map
<
String
,
String
>
urlMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
())){
urlMap
=
uploadDetail
.
getList
().
stream
().
collect
(
Collectors
.
toMap
(
DidiFileUploadDetailResult:
:
getUid
,
didiFileUploadDetailResult
->
didiFileUploadDetailResult
.
getViewHttpUrl
()));
List
<
String
>
fileUploadUids
=
dataList
.
stream
()
.
map
(
o
->
o
.
getFileUploadId
()).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
urlMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
fileUploadUids
)){
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
fileUploadUids
);
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
())){
urlMap
=
uploadDetail
.
getList
().
stream
().
collect
(
Collectors
.
toMap
(
DidiFileUploadDetailResult:
:
getUid
,
didiFileUploadDetailResult
->
didiFileUploadDetailResult
.
getViewHttpUrl
()));
}
}
List
<
ReportUploadResult
>
resultList
=
new
ArrayList
<
ReportUploadResult
>();
for
(
ReportUpload
data:
dataList
){
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TaxDocumentServiceImpl.java
View file @
b01c2bc0
...
...
@@ -71,19 +71,21 @@ public class TaxDocumentServiceImpl {
public
List
<
TaxDocument
>
selectTaxDocumentList
(
TaxDocumentDto
taxDocumentDto
,
List
<
String
>
orgIds
)
{
List
<
TaxDocument
>
dataList
=
taxDocumentMapper
.
selectByExample
(
getExample
(
taxDocumentDto
,
orgIds
));
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
dataList
.
stream
()
.
map
(
o
->
o
.
getFileUploadId
()).
collect
(
Collectors
.
toList
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
Map
<
String
,
String
>
urlMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
()))
{
urlMap
=
uploadDetail
.
getList
().
stream
().
collect
(
Collectors
.
toMap
(
DidiFileUploadDetailResult:
:
getUid
,
didiFileUploadDetailResult
->
didiFileUploadDetailResult
.
getViewHttpUrl
()));
}
if
(
urlMap
!=
null
)
{
for
(
TaxDocument
data
:
dataList
)
{
data
.
setFilePositionUrl
(
urlMap
.
get
(
data
.
getFileUploadId
()));
List
<
String
>
fileUploadUids
=
dataList
.
stream
()
.
map
(
o
->
o
.
getFileUploadId
()).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
urlMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
fileUploadUids
))
{
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
dataList
.
stream
()
.
map
(
o
->
o
.
getFileUploadId
()).
collect
(
Collectors
.
toList
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
()))
{
urlMap
=
uploadDetail
.
getList
().
stream
().
collect
(
Collectors
.
toMap
(
DidiFileUploadDetailResult:
:
getUid
,
didiFileUploadDetailResult
->
didiFileUploadDetailResult
.
getViewHttpUrl
()));
}
}
for
(
TaxDocument
data
:
dataList
)
{
data
.
setFilePositionUrl
(
urlMap
.
get
(
data
.
getFileUploadId
()));
}
return
dataList
;
...
...
@@ -413,7 +415,7 @@ public class TaxDocumentServiceImpl {
}
//创建人 creator
if
(
StringUtils
.
isNotBlank
(
taxDocument
.
getCreator
()))
{
criteria
.
andCreatorEqualTo
(
taxDocument
.
getCreator
());
criteria
.
andCreatorEqualTo
(
taxDocument
.
getCreator
());
}
//设置查询可用的数据
criteria
.
andEnableEqualTo
(
"T"
);
...
...
@@ -428,7 +430,7 @@ public class TaxDocumentServiceImpl {
}
}
public
void
previewPDF
(
HttpServletResponse
response
,
String
path
)
{
public
void
previewPDF
(
HttpServletResponse
response
,
String
path
)
{
String
imageType
=
"PNG"
;
OutputStream
sos
=
null
;
try
{
...
...
@@ -446,6 +448,7 @@ public class TaxDocumentServiceImpl {
}
}
}
public
void
downloadAllFile
(
HttpServletResponse
response
,
List
<
Long
>
ids
)
{
//如果只选择了一个附件,则不打包
if
(
null
!=
ids
&&
ids
.
size
()
==
1
)
{
...
...
@@ -974,85 +977,85 @@ public class TaxDocumentServiceImpl {
//长度为3(先验证是否国际类型并校验匹配,若是国际类型档案类型索引为2(国际类型第三个为档案类型),否则索引为1为档案类型
if
(
params
.
size
()
==
3
//公司簡稱_档案类型_文件生效日期
&&
groupOfCompanyFileTypeFIleTime
.
keySet
().
contains
(
params
.
get
(
1
))
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
2
))){
//文件生效日期校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
2
)))
{
//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
//设置档案属性 档案类型 文件生效日期
taxDocument
.
setFileType
(
params
.
get
(
1
));
taxDocument
.
setFileAttr
(
groupOfCompanyFileTypeFIleTime
.
get
(
params
.
get
(
1
)));
taxDocument
.
setFileTime
(
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
2
)));
//校验是否已存在
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
4
//国际类型 公司簡稱_档案属性_档案类型_文件生效日期
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
4
//国际类型 公司簡稱_档案属性_档案类型_文件生效日期
&&
(
internationalGroupOfCompanyFileAttrFileTypeFileTime
.
keySet
().
contains
(
params
.
get
(
2
))
&&
internationalGroupOfCompanyFileAttrFileTypeFileTime
.
values
().
contains
(
params
.
get
(
1
)))
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
))){
//文件生效日期校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
)))
{
//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
//设置档案属性 档案类型
taxDocument
.
setFileAttr
(
params
.
get
(
1
));
taxDocument
.
setFileType
(
params
.
get
(
2
));
//校验是否已存在
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
4
//国际类型 公司簡稱_档案属性_档案类型_所属期间
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
4
//国际类型 公司簡稱_档案属性_档案类型_所属期间
&&
(
internationalGroupOfCompanyFileAttrFileTypeOwnTime
.
keySet
().
contains
(
params
.
get
(
2
))
&&
internationalGroupOfCompanyFileAttrFileTypeOwnTime
.
values
().
contains
(
params
.
get
(
1
)))
&&
checkOwnTime
(
params
.
get
(
3
))){
//所属期间校验
&&
checkOwnTime
(
params
.
get
(
3
)))
{
//所属期间校验
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
//设置档案属性 档案类型 所属期间
taxDocument
.
setFileAttr
(
params
.
get
(
1
));
taxDocument
.
setFileType
(
params
.
get
(
2
));
taxDocument
.
setOwnTime
(
Integer
.
valueOf
(
params
.
get
(
3
)));
//校验是否已存在
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
4
//公司簡稱_档案类型_所属期间_文件生效日期
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
4
//公司簡稱_档案类型_所属期间_文件生效日期
&&
groupOfCompanyFileTypeOwnTimeFileTime
.
keySet
().
contains
(
params
.
get
(
1
))
&&
checkOwnTime
(
params
.
get
(
2
))
//所属期间校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
))){
//文件生效日期校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
)))
{
//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
//设置档案类型 档案属性 所属期间 文件生效日期
taxDocument
.
setFileType
(
params
.
get
(
1
));
taxDocument
.
setFileAttr
(
groupOfCompanyFileTypeOwnTimeFileTime
.
get
(
params
.
get
(
1
)));
taxDocument
.
setOwnTime
(
Integer
.
valueOf
(
params
.
get
(
2
)));
taxDocument
.
setFileTime
(
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
)));
//校验是否已存在
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
4
//公司簡稱_档案类型_所属期间_到期日
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
4
//公司簡稱_档案类型_所属期间_到期日
&&
groupOfCompanyFileTypeOwnTimeEffectiveTime
.
keySet
().
contains
(
params
.
get
(
1
))
&&
checkOwnTime
(
params
.
get
(
2
))
//所属期间校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
))){
//到期日校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
)))
{
//到期日校验
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
//设置档案类型 档案属性 所属期间 到期日
taxDocument
.
setFileType
(
params
.
get
(
1
));
taxDocument
.
setFileAttr
(
groupOfCompanyFileTypeOwnTimeEffectiveTime
.
get
(
params
.
get
(
1
)));
taxDocument
.
setOwnTime
(
Integer
.
valueOf
(
params
.
get
(
2
)));
taxDocument
.
setEffectiveTime
(
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
)));
//校验是否已存在
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
5
//国际类型 公司簡稱_档案属性_档案类型_税种_所属期间
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
5
//国际类型 公司簡稱_档案属性_档案类型_税种_所属期间
&&
(
internationalGroupOfCompanyFileAttrFileTypeTaxTypeOwnTime
.
keySet
().
contains
(
params
.
get
(
2
))
&&
internationalGroupOfCompanyFileAttrFileTypeTaxTypeOwnTime
.
values
().
contains
(
params
.
get
(
1
)))
&&
taxsList
.
contains
(
params
.
get
(
3
))
//税种校验
&&
checkOwnTime
(
params
.
get
(
4
))){
//所属期间校验
&&
checkOwnTime
(
params
.
get
(
4
)))
{
//所属期间校验
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
//设置档案属性 档案类型 税种 所属期间
taxDocument
.
setFileAttr
(
params
.
get
(
1
));
taxDocument
.
setFileType
(
params
.
get
(
2
));
taxDocument
.
setTaxType
(
params
.
get
(
3
));
taxDocument
.
setOwnTime
(
Integer
.
valueOf
(
params
.
get
(
4
)));
//校验是否已存在
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
5
//公司簡稱_档案类型_税种_所属期间_文件生效日期
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
5
//公司簡稱_档案类型_税种_所属期间_文件生效日期
&&
groupOfCompanyFileTypeTaxTypeOwnTimeFileTime
.
keySet
().
contains
(
params
.
get
(
1
))
&&
taxsList
.
contains
(
params
.
get
(
2
))
//税种校验
&&
checkOwnTime
(
params
.
get
(
3
))
//所属期间校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
4
))){
//文件生效日期校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
4
)))
{
//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
//设置档案类型 档案属性 税种 所属期间 文件生效日期
taxDocument
.
setFileType
(
params
.
get
(
1
));
taxDocument
.
setFileAttr
(
groupOfCompanyFileTypeTaxTypeOwnTimeFileTime
.
get
(
params
.
get
(
1
)));
...
...
@@ -1060,13 +1063,13 @@ public class TaxDocumentServiceImpl {
taxDocument
.
setOwnTime
(
Integer
.
valueOf
(
params
.
get
(
3
)));
taxDocument
.
setFileTime
(
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
4
)));
//校验是否已存在
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
6
//公司簡稱_档案类型_所属期间_文件生效日期_实物存放地点_实物保管人
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
if
(
params
.
size
()
==
6
//公司簡稱_档案类型_所属期间_文件生效日期_实物存放地点_实物保管人
&&
groupOfCompanyFileTypeOwnTimeFileTimeStorageAreaKeeper
.
keySet
().
contains
(
params
.
get
(
1
))
&&
checkOwnTime
(
params
.
get
(
2
))
//所属期间校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
))){
//文件生效日期校验
&&
null
!=
DateUtils
.
stringToDate4yyyyMMdd
(
params
.
get
(
3
)))
{
//文件生效日期校验
//构建基础对象 设置基础值 公司简称 Id 文件名
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
TaxDocument
taxDocument
=
buildBaseTaxDocument
(
companyNameAndId
,
params
,
file
.
getName
());
//设置档案类型 档案属性 所属期间 文件生效日期 实物存放地点 实物保管人
taxDocument
.
setFileType
(
params
.
get
(
1
));
taxDocument
.
setFileAttr
(
groupOfCompanyFileTypeOwnTimeFileTimeStorageAreaKeeper
.
get
(
params
.
get
(
1
)));
...
...
@@ -1075,8 +1078,8 @@ public class TaxDocumentServiceImpl {
taxDocument
.
setStorageArea
(
params
.
get
(
4
));
taxDocument
.
setKeeper
(
params
.
get
(
5
));
//校验是否已存在
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
{
checkExistedAndInsertOrUpdate
(
successeFileNameList
,
existedFileNameList
,
file
,
taxDocument
,
filePath
);
}
else
{
errorFileNameList
.
add
(
filePath
);
}
}
...
...
@@ -1135,6 +1138,7 @@ public class TaxDocumentServiceImpl {
/**
* 获取PDF总页数
*
* @throws IOException
*/
public
int
getPDFNum
(
String
fileUrl
)
throws
IOException
{
...
...
@@ -1145,7 +1149,7 @@ public class TaxDocumentServiceImpl {
pages
=
pdDocument
.
getNumberOfPages
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
if
(
pdDocument
!=
null
)
{
pdDocument
.
close
();
...
...
@@ -1157,10 +1161,10 @@ public class TaxDocumentServiceImpl {
/**
* PDF转图片 根据页码一页一页转
*
@throws IOException
* imgType:转换后的图片类型 jpg,png
*
*
@throws IOException
imgType:转换后的图片类型 jpg,png
*/
private
void
PDFToImg
(
OutputStream
sos
,
String
fileUrl
,
int
page
,
String
imgType
)
throws
Exception
{
private
void
PDFToImg
(
OutputStream
sos
,
String
fileUrl
,
int
page
,
String
imgType
)
throws
Exception
{
PDDocument
pdDocument
=
null
;
/* dpi越大转换后越清晰,相对转换速度越慢 */
int
dpi
=
100
;
...
...
@@ -1169,12 +1173,12 @@ public class TaxDocumentServiceImpl {
PDFRenderer
renderer
=
new
PDFRenderer
(
pdDocument
);
int
pages
=
pdDocument
.
getNumberOfPages
();
if
(
page
<=
pages
&&
page
>
0
)
{
BufferedImage
image
=
renderer
.
renderImageWithDPI
(
page
-
1
,
dpi
);
BufferedImage
image
=
renderer
.
renderImageWithDPI
(
page
-
1
,
dpi
);
ImageIO
.
write
(
image
,
imgType
,
sos
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
"PDF转换异常"
);
}
finally
{
if
(
pdDocument
!=
null
)
{
...
...
@@ -1192,14 +1196,15 @@ public class TaxDocumentServiceImpl {
/**
* 根据url地址 获取输入流
*
* @param url
* @return
* @throws IOException
*/
public
InputStream
getInputStreamByUrl
(
String
url
)
throws
IOException
{
URL
httpurl
=
new
URL
(
URLDecoder
.
decode
(
url
,
"UTF-8"
));
URL
httpurl
=
new
URL
(
URLDecoder
.
decode
(
url
,
"UTF-8"
));
InputStream
is
;
HttpURLConnection
httpConn
=(
HttpURLConnection
)
httpurl
.
openConnection
();
HttpURLConnection
httpConn
=
(
HttpURLConnection
)
httpurl
.
openConnection
();
httpConn
.
setDoOutput
(
true
);
// 使用 URL 连接进行输出
httpConn
.
setDoInput
(
true
);
// 使用 URL 连接进行输入
httpConn
.
setUseCaches
(
false
);
// 忽略缓存
...
...
@@ -1209,16 +1214,15 @@ public class TaxDocumentServiceImpl {
httpConn
.
setRequestProperty
(
"Connection"
,
"Keep-Alive"
);
// 维持长连接
httpConn
.
setRequestProperty
(
"Charset"
,
"UTF-8"
);
httpConn
.
connect
();
if
(
httpConn
.
getResponseCode
()
>=
400
)
{
if
(
httpConn
.
getResponseCode
()
>=
400
)
{
is
=
httpConn
.
getErrorStream
();
}
else
{
}
else
{
is
=
httpConn
.
getInputStream
();
}
return
is
;
}
public
String
previewPDF2
(
HttpServletResponse
response
,
String
path
)
{
public
String
previewPDF2
(
HttpServletResponse
response
,
String
path
)
{
InputStream
is
=
null
;
ByteArrayOutputStream
os
=
null
;
String
dUrlData
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
View file @
b01c2bc0
...
...
@@ -100,13 +100,16 @@ public class TemplateServiceImpl extends AbstractService {
List
<
Template
>
templates
=
templateMapper
.
selectByExample
(
example
);
List
<
TemplateDto
>
templateDtos
=
new
ArrayList
<>();
//从文件上传表转换path
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
templates
.
stream
()
.
map
(
o
->
o
.
getPath
()).
collect
(
Collectors
.
toList
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
Map
<
String
,
String
>
urlMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
())){
urlMap
=
uploadDetail
.
getList
().
stream
().
collect
(
Collectors
.
toMap
(
DidiFileUploadDetailResult:
:
getUid
,
didiFileUploadDetailResult
->
didiFileUploadDetailResult
.
getViewHttpUrl
()));
List
<
String
>
fileUploadUids
=
templates
.
stream
()
.
map
(
o
->
o
.
getPath
()).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
urlMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
fileUploadUids
)){
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
fileUploadUids
);
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
())){
urlMap
=
uploadDetail
.
getList
().
stream
().
collect
(
Collectors
.
toMap
(
DidiFileUploadDetailResult:
:
getUid
,
didiFileUploadDetailResult
->
didiFileUploadDetailResult
.
getViewHttpUrl
()));
}
}
for
(
Template
template
:
templates
)
{
TemplateDto
dto
=
new
TemplateDto
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
b01c2bc0
...
...
@@ -550,7 +550,6 @@ public class ReportGeneratorImpl {
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
Arrays
.
asList
(
a
.
getPath
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
Map
<
String
,
String
>
urlMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
()))
{
path
=
uploadDetail
.
getList
().
get
(
0
).
getViewHttpUrl
();
}
...
...
@@ -634,7 +633,6 @@ public class ReportGeneratorImpl {
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
Arrays
.
asList
(
a
.
getPath
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
Map
<
String
,
String
>
urlMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
()))
{
path
=
uploadDetail
.
getList
().
get
(
0
).
getViewHttpUrl
();
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
b01c2bc0
...
...
@@ -793,7 +793,6 @@ public class ReportServiceImpl extends BaseService {
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
Arrays
.
asList
(
periodTemplate
.
getPath
()));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
Map
<
String
,
String
>
urlMap
=
null
;
is
=
httpFileService
.
getUserTemplate
(
uploadDetail
.
getList
().
get
(
0
).
getViewHttpUrl
());
Workbook
tWorkbook
=
WorkbookFactory
.
create
(
is
);
tWorkbook
=
assembleTaxWorkBook
(
template
,
tWorkbook
,
projectId
,
period
);
...
...
@@ -2671,7 +2670,6 @@ public class ReportServiceImpl extends BaseService {
DidiFileIUploadParam
fileParam
=
new
DidiFileIUploadParam
();
fileParam
.
setUuids
(
Arrays
.
asList
(
templatePath
));
PageInfo
<
DidiFileUploadDetailResult
>
uploadDetail
=
didiFileUploadService
.
queryPage
(
fileParam
);
Map
<
String
,
String
>
urlMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
uploadDetail
.
getList
()))
{
templatePath
=
uploadDetail
.
getList
().
get
(
0
).
getViewHttpUrl
();
}
...
...
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