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
df6963f3
Commit
df6963f3
authored
Jul 22, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] ImportInputInvoiceData impl
parent
42dd42e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
InputVATInvoiceDto.java
.../java/pwc/taxtech/atms/dto/vatdto/InputVATInvoiceDto.java
+22
-0
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+28
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/InputVATInvoiceDto.java
View file @
df6963f3
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
pwc.taxtech.atms.constant.enums.EnumInvoiceType
;
import
pwc.taxtech.atms.vat.entity.InputVATInvoice
;
import
java.math.BigDecimal
;
import
java.util.Date
;
...
...
@@ -137,4 +138,25 @@ public class InputVATInvoiceDto extends InputVATInvoiceBaseDto {
public
String
getInvoiceTypeName
()
{
return
EnumInvoiceType
.
values
()[
this
.
invoiceType
].
getName
();
}
public
InputVATInvoice
extractInvoice
(){
InputVATInvoice
invoice
=
new
InputVATInvoice
();
invoice
.
setID
(
getID
());
invoice
.
setPeriodID
(
getPeriodID
());
invoice
.
setInvoiceCode
(
getInvoiceCode
());
invoice
.
setInvoiceNumber
(
getInvoiceNumber
());
invoice
.
setInvoiceDate
(
getInvoiceDate
());
invoice
.
setSellerTaxNumber
(
getSellerTaxNumber
());
invoice
.
setAmount
(
getAmount
());
invoice
.
setTaxAmount
(
getTaxAmount
());
invoice
.
setInvoiceType
(
getInvoiceType
());
invoice
.
setCertificationResult
(
getCertificationResult
());
invoice
.
setCertificationDate
(
getCertificationDate
());
invoice
.
setCreatorID
(
getCreatorID
());
invoice
.
setCreateTime
(
getCreateTime
());
// invoice.setStatus(getStatus());
// invoice.setPartAccntedPeriod(getPartAccntedPeriod());
// invoice.setAccntedPeriod(getAccntedPeriod());
return
invoice
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/InputInvoiceDataImportServiceImpl.java
View file @
df6963f3
...
...
@@ -117,8 +117,34 @@ public class InputInvoiceDataImportServiceImpl extends VatAbstractService {
return
new
OperationResultDto
(
true
);
}
public
OperationResultDto
ImportInputInvoiceData
(
List
<
InputVATInvoiceDto
>
inputInvoiceList
,
int
importType
,
String
id
)
{
return
null
;
public
OperationResultDto
ImportInputInvoiceData
(
List
<
InputVATInvoiceDto
>
inputInvoiceDtoList
,
int
importType
,
String
userID
)
{
if
(
inputInvoiceDtoList
.
size
()
>
0
)
{
int
period
=
inputInvoiceDtoList
.
get
(
0
).
getPeriodID
();
inputInvoiceDtoList
.
forEach
(
item
->
{
item
.
setID
(
UUID
.
randomUUID
().
toString
());
if
(
item
.
getCertificationDate
().
equals
(
new
Date
(
0
)))
{
item
.
setCertificationDate
(
null
);
}
item
.
setCreatorID
(
userID
);
item
.
setCreateTime
(
new
Date
());
});
//如果是覆盖导入,则先删除该期间的数据,再进行数据导入
if
(
importType
==
EnumTbImportType
.
CoverImport
.
getCode
())
{
ClearTableData
(
period
,
_tableName
,
EnumValidationType
.
InputVoice
.
getCode
());
}
// DealWithTheDuplicateData(inputInvoiceDtoList);//todo:[validation] to be continue (neo)
//导入之前转换为与数据库字段一致的dto
//将进项发票数据转换为datatable
inputInvoiceDtoList
.
forEach
(
m
->
inputVATInvoiceMapper
.
insert
(
m
.
extractInvoice
()));
//验证发票信息,包括重复验证和错误验证
// ValidateInputInvoiceInfo(period, userID);//todo:[validation] to be continue (neo)
}
return
new
OperationResultDto
(
true
);
}
private
void
ClearTableData
(
int
period
,
String
tableName
,
int
importTypeId
)
{
...
...
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