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
d7cf6491
Commit
d7cf6491
authored
Nov 20, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
6e55d634
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
5 deletions
+37
-5
DataInitTest.java
...i/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
+37
-5
No files found.
atms-api/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
View file @
d7cf6491
...
...
@@ -31,6 +31,25 @@ public class DataInitTest extends CommonIT {
@Resource
private
OutputInvoiceDetailMapper
outputInvoiceDetailMapper
;
@Test
public
void
tt
(){
StandardAccount
account
=
new
StandardAccount
();
account
.
setId
(
CommonUtils
.
getUUID
());
account
.
setCode
(
"2221200103"
);
account
.
setName
(
"代扣代缴增值税"
);
account
.
setFullName
(
"应交税费-应交增值税-进项税额-代扣代缴增值税"
);
account
.
setParentCode
(
"22212001"
);
account
.
setAcctProp
(
2
);
account
.
setAcctLevel
(
4
);
account
.
setDirection
(
1
);
account
.
setIsLeaf
(
true
);
account
.
setRuleType
(
2
);
account
.
setIsActive
(
true
);
account
.
setEnglishName
(
"应交税费-应交增值税-进项税额-代扣代缴增值税"
);
account
.
setIndustryId
(
"0"
);
standardAccountMapper
.
insertSelective
(
account
);
}
@Test
public
void
initStandardAccount
()
{
try
{
...
...
@@ -93,7 +112,7 @@ public class DataInitTest extends CommonIT {
@Test
public
void
initInput
()
throws
Exception
{
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_进项主表_
乐叶_201807.xls
"
));
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_进项主表_
绿能_201809.xlsx
"
));
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
for
(
int
r
=
1
;
r
<=
sheet
.
getLastRowNum
();
r
++)
{
try
{
...
...
@@ -124,7 +143,13 @@ public class DataInitTest extends CommonIT {
invoice
.
setRZJG
(
sheet
.
getRow
(
r
).
getCell
(
32
).
getStringCellValue
());
invoice
.
setCJSJ
(
sheet
.
getRow
(
r
).
getCell
(
34
).
getStringCellValue
());
invoice
.
setLRRQ
(
sheet
.
getRow
(
r
).
getCell
(
38
).
getStringCellValue
());
inputInvoiceMapper
.
insertSelective
(
invoice
);
InputInvoiceExample
example
=
new
InputInvoiceExample
();
example
.
createCriteria
().
andFPDMEqualTo
(
invoice
.
getFPDM
()).
andFPHMEqualTo
(
invoice
.
getFPHM
());
if
(
inputInvoiceMapper
.
selectByExample
(
example
).
size
()
>
0
)
{
inputInvoiceMapper
.
updateByExampleSelective
(
invoice
,
example
);
}
else
{
inputInvoiceMapper
.
insertSelective
(
invoice
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -134,7 +159,7 @@ public class DataInitTest extends CommonIT {
@Test
public
void
initInputDetail
()
throws
Exception
{
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_进项明细_绿能_201809.xls"
));
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入
\\进销项
/导入模板_进项明细_绿能_201809.xls"
));
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
for
(
int
r
=
1
;
r
<=
sheet
.
getLastRowNum
();
r
++)
{
try
{
...
...
@@ -162,7 +187,14 @@ public class DataInitTest extends CommonIT {
// continue;
// }
// detail.setFPID();
inputInvoiceDetailMapper
.
insertSelective
(
detail
);
InputInvoiceDetailExample
example
=
new
InputInvoiceDetailExample
();
example
.
createCriteria
().
andFPDMEqualTo
(
detail
.
getFPDM
()).
andFPHMEqualTo
(
detail
.
getFPHM
());
if
(
inputInvoiceDetailMapper
.
selectByExample
(
example
).
size
()
>
0
)
{
inputInvoiceDetailMapper
.
updateByExampleSelective
(
detail
,
example
);
}
else
{
inputInvoiceDetailMapper
.
insertSelective
(
detail
);
}
// inputInvoiceDetailMapper.insertSelective(detail);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -172,7 +204,7 @@ public class DataInitTest extends CommonIT {
@Test
public
void
initOutput
()
throws
Exception
{
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_销项主表_
绿能_201809
.xlsx"
));
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_销项主表_
乐叶_201807
.xlsx"
));
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
for
(
int
r
=
1
;
r
<=
sheet
.
getLastRowNum
();
r
++)
{
try
{
...
...
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