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
5b4cc79a
Commit
5b4cc79a
authored
Nov 14, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
d8e5872d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
14 deletions
+62
-14
TemplateGroupServiceImpl.java
...c/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
+4
-0
DataInitTest.java
...i/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
+58
-14
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
View file @
5b4cc79a
...
...
@@ -533,6 +533,10 @@ public class TemplateGroupServiceImpl extends AbstractService {
if
(
null
==
cell
)
{
return
false
;
}
CellType
cellType
=
cell
.
getCellTypeEnum
();
if
(!
CellType
.
STRING
.
equals
(
cellType
))
{
return
false
;
}
String
v
=
cell
.
getStringCellValue
();
if
(
StringUtils
.
isBlank
(
v
))
{
return
false
;
...
...
atms-api/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
View file @
5b4cc79a
...
...
@@ -2,6 +2,7 @@ package pwc.taxtech.atms.common;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.usermodel.*
;
import
org.junit.Test
;
...
...
@@ -9,9 +10,9 @@ import pwc.taxtech.atms.CommonIT;
import
pwc.taxtech.atms.entity.StandardAccount
;
import
pwc.taxtech.atms.invoice.InputInvoiceDetailMapper
;
import
pwc.taxtech.atms.invoice.InputInvoiceMapper
;
import
pwc.taxtech.atms.
vat.entity.InputInvoice
;
import
pwc.taxtech.atms.
vat.entity.InputInvoiceDetail
;
import
pwc.taxtech.atms.vat.entity.
InputInvoiceExample
;
import
pwc.taxtech.atms.
invoice.OutputInvoiceDetailMapper
;
import
pwc.taxtech.atms.
invoice.OutputInvoiceMapper
;
import
pwc.taxtech.atms.vat.entity.
*
;
import
javax.annotation.Resource
;
import
java.io.File
;
...
...
@@ -25,6 +26,10 @@ public class DataInitTest extends CommonIT {
private
InputInvoiceMapper
inputInvoiceMapper
;
@Resource
private
InputInvoiceDetailMapper
inputInvoiceDetailMapper
;
@Resource
private
OutputInvoiceMapper
outputInvoiceMapper
;
@Resource
private
OutputInvoiceDetailMapper
outputInvoiceDetailMapper
;
@Test
public
void
initStandardAccount
()
{
...
...
@@ -165,10 +170,50 @@ public class DataInitTest extends CommonIT {
System
.
out
.
println
(
"end"
);
}
@Test
public
void
initOutput
()
throws
Exception
{
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_销项主表_绿能_201809(1).xlsx"
));
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
for
(
int
r
=
1
;
r
<=
sheet
.
getLastRowNum
();
r
++)
{
try
{
for
(
int
c
=
0
;
c
<=
sheet
.
getRow
(
r
).
getLastCellNum
();
c
++)
{
Cell
cell
=
sheet
.
getRow
(
r
).
getCell
(
c
);
if
(
null
!=
cell
)
{
cell
.
setCellType
(
CellType
.
STRING
);
}
}
OutputInvoice
outputInvoice
=
new
OutputInvoice
();
outputInvoice
.
setID
(
CommonUtils
.
getUUID
());
outputInvoice
.
setFPQQLSH
(
CommonUtils
.
getUUID
());
outputInvoice
.
setFPDM
(
sheet
.
getRow
(
r
).
getCell
(
2
).
getStringCellValue
());
outputInvoice
.
setFPHM
(
sheet
.
getRow
(
r
).
getCell
(
3
).
getStringCellValue
());
outputInvoice
.
setKPRQ
(
sheet
.
getRow
(
r
).
getCell
(
4
).
getStringCellValue
());
String
s
=
"000"
+
sheet
.
getRow
(
r
).
getCell
(
5
).
getStringCellValue
();
outputInvoice
.
setFPLXDM
(
s
.
substring
(
s
.
length
()
-
3
,
s
.
length
()));
outputInvoice
.
setGFMC
(
sheet
.
getRow
(
r
).
getCell
(
9
).
getStringCellValue
());
outputInvoice
.
setGFSH
(
sheet
.
getRow
(
r
).
getCell
(
10
).
getStringCellValue
());
outputInvoice
.
setXFSH
(
sheet
.
getRow
(
r
).
getCell
(
13
).
getStringCellValue
());
outputInvoice
.
setXFMC
(
sheet
.
getRow
(
r
).
getCell
(
14
).
getStringCellValue
());
outputInvoice
.
setFPLX
(
sheet
.
getRow
(
r
).
getCell
(
23
).
getStringCellValue
());
outputInvoice
.
setKPZT
(
sheet
.
getRow
(
r
).
getCell
(
24
).
getStringCellValue
());
outputInvoice
.
setFPZT
(
sheet
.
getRow
(
r
).
getCell
(
25
).
getStringCellValue
());
outputInvoice
.
setHJJE
(
sheet
.
getRow
(
r
).
getCell
(
33
).
getStringCellValue
());
outputInvoice
.
setHJSE
(
sheet
.
getRow
(
r
).
getCell
(
34
).
getStringCellValue
());
outputInvoice
.
setJSHJ
(
sheet
.
getRow
(
r
).
getCell
(
35
).
getStringCellValue
());
outputInvoice
.
setSLV
(
sheet
.
getRow
(
r
).
getCell
(
42
).
getStringCellValue
());
outputInvoice
.
setHTBH
(
sheet
.
getRow
(
r
).
getCell
(
54
).
getStringCellValue
());
outputInvoiceMapper
.
insertSelective
(
outputInvoice
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
System
.
out
.
println
(
"end"
);
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
CommonUtils
.
getUUID
());
try
{
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(1).xlsx
"
));
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
for
(
int
r
=
1
;
r
<=
sheet
.
getLastRowNum
();
r
++)
{
for
(
int
c
=
0
;
c
<=
sheet
.
getRow
(
r
).
getLastCellNum
();
c
++)
{
...
...
@@ -177,17 +222,16 @@ public class DataInitTest extends CommonIT {
cell
.
setCellType
(
CellType
.
STRING
);
}
}
InputInvoiceDetail
detail
=
new
In
putInvoiceDetail
();
OutputInvoiceDetail
detail
=
new
Out
putInvoiceDetail
();
detail
.
setID
(
CommonUtils
.
getUUID
());
detail
.
setFPDM
(
sheet
.
getRow
(
r
).
getCell
(
1
).
getStringCellValue
());
detail
.
setFPHM
(
sheet
.
getRow
(
r
).
getCell
(
2
).
getStringCellValue
());
detail
.
setSPMC
(
sheet
.
getRow
(
r
).
getCell
(
3
).
getStringCellValue
());
detail
.
setDW
(
sheet
.
getRow
(
r
).
getCell
(
5
).
getStringCellValue
());
detail
.
setDJ
(
sheet
.
getRow
(
r
).
getCell
(
6
).
getStringCellValue
());
detail
.
setSPSL
(
sheet
.
getRow
(
r
).
getCell
(
7
).
getStringCellValue
());
detail
.
setJE
(
sheet
.
getRow
(
r
).
getCell
(
8
).
getStringCellValue
());
detail
.
setSLV
(
String
.
valueOf
(
Math
.
round
(
Double
.
valueOf
(
sheet
.
getRow
(
r
).
getCell
(
9
).
getStringCellValue
()))));
detail
.
setSE
(
sheet
.
getRow
(
r
).
getCell
(
10
).
getStringCellValue
());
detail
.
setSPMC
(
sheet
.
getRow
(
r
).
getCell
(
2
).
getStringCellValue
());
detail
.
setDW
(
sheet
.
getRow
(
r
).
getCell
(
4
).
getStringCellValue
());
detail
.
setDJ
(
sheet
.
getRow
(
r
).
getCell
(
5
).
getStringCellValue
());
detail
.
setSL
(
sheet
.
getRow
(
r
).
getCell
(
6
).
getStringCellValue
());
detail
.
setJE
(
sheet
.
getRow
(
r
).
getCell
(
7
).
getStringCellValue
());
detail
.
setSLV
(
sheet
.
getRow
(
r
).
getCell
(
8
).
getStringCellValue
());
detail
.
setSE
(
sheet
.
getRow
(
r
).
getCell
(
9
).
getStringCellValue
());
detail
.
setMXXH
(
NumberUtils
.
createBigDecimal
(
sheet
.
getRow
(
r
).
getCell
(
10
).
getStringCellValue
()));
}
sheet
.
getFirstRowNum
();
...
...
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