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
3f21f623
Commit
3f21f623
authored
Apr 16, 2019
by
Ken you
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix validIRExcelCell bug --Ken
parent
bd8472ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
DataImportService.java
...java/pwc/taxtech/atms/service/impl/DataImportService.java
+41
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/DataImportService.java
View file @
3f21f623
...
...
@@ -1565,6 +1565,7 @@ public class DataImportService extends BaseService {
private
List
<
InvoiceRecord
>
generalIRs
(
Sheet
sheet
)
{
List
<
InvoiceRecord
>
irs
=
Lists
.
newArrayList
();
Set
<
String
>
orgsNot
=
new
HashSet
<>();
for
(
int
j
=
1
;
j
<=
sheet
.
getLastRowNum
();
j
++)
{
InvoiceRecord
ir
=
new
InvoiceRecord
();
Long
irId
=
idService
.
nextId
();
...
...
@@ -1574,6 +1575,14 @@ public class DataImportService extends BaseService {
}
ir
.
setId
(
irId
);
ir
.
setSeqNo
(
getCellIntegerValue
(
row
.
getCell
(
0
)));
//所属机构
if
(
StringUtils
.
isBlank
(
getCellStringValue
(
row
.
getCell
(
1
)))){
continue
;
}
//如果存在有错误的机构也跳过
if
(
validIRExcelCell
(
row
,
orgsNot
).
contains
(
getCellStringValue
(
row
.
getCell
(
1
)))){
continue
;
}
ir
.
setBillingBody
(
getCellStringValue
(
row
.
getCell
(
1
)));
ir
.
setCustomerCompanyName
(
getCellStringValue
(
row
.
getCell
(
2
)));
ir
.
setInvoiceType
(
getCellStringValue
(
row
.
getCell
(
3
)));
...
...
@@ -1603,6 +1612,38 @@ public class DataImportService extends BaseService {
return
irs
;
}
/**
* 导入分发-已开增值税发票记录,校验1-发票类型、开票内容、所属机构、税率、税额、开票金额任意不为空;
* 且校验2-校验发票类型的值只能包含“增值税专用发票”、“增值税普通发票”、“增值税电子发票”和“机动车发票”,
* 存在校验1或校验2不通过的机构不进行导入
* @param row
* @return
*/
private
Set
<
String
>
validIRExcelCell
(
Row
row
,
Set
<
String
>
orgsNot
){
List
<
String
>
invoiceTypes
=
Arrays
.
asList
(
new
String
[]{
"增值税专用发票"
,
"增值税普通发票"
,
"增值税电子发票"
,
"机动车发票"
});
String
orgName
=
getCellStringValue
(
row
.
getCell
(
1
));
//发票类型
if
(
StringUtils
.
isBlank
(
getCellStringValue
(
row
.
getCell
(
3
)))){
orgsNot
.
add
(
orgName
);
}
else
if
(!
invoiceTypes
.
contains
(
getCellStringValue
(
row
.
getCell
(
3
)))){
orgsNot
.
add
(
orgName
);
}
//开票内容
if
(
StringUtils
.
isBlank
(
getCellStringValue
(
row
.
getCell
(
4
)))){
orgsNot
.
add
(
orgName
);
}
//开票金额
if
(
StringUtils
.
isBlank
(
getCellStringValue
(
row
.
getCell
(
5
)))){
orgsNot
.
add
(
orgName
);
}
//税额
if
(
StringUtils
.
isBlank
(
getCellStringValue
(
row
.
getCell
(
20
)))){
orgsNot
.
add
(
orgName
);
}
return
orgsNot
;
}
private
List
<
AdjustmentTable
>
generalATs
(
Sheet
sheet
)
{
List
<
AdjustmentTable
>
ats
=
Lists
.
newArrayList
();
for
(
int
j
=
1
;
j
<=
sheet
.
getLastRowNum
();
j
++)
{
...
...
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