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
6912bec4
Commit
6912bec4
authored
Nov 07, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
5d365403
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
5 deletions
+58
-5
DataInitTest.java
...i/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
+20
-5
pom.xml
atms-dao/pom.xml
+8
-0
MyBatisGeneratorTest.java
.../test/java/pwc/taxtech/atms/gen/MyBatisGeneratorTest.java
+30
-0
No files found.
atms-api/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
View file @
6912bec4
...
...
@@ -16,9 +16,12 @@ public class DataInitTest extends CommonIT {
@Test
public
void
initStandardAccount
()
{
try
{
List
<
String
>
lines
=
FileUtils
.
readLines
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\隆基科目
整理
.csv"
),
StandardCharsets
.
UTF_8
);
List
<
String
>
lines
=
FileUtils
.
readLines
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\隆基科目
表(最终版)_1106
.csv"
),
StandardCharsets
.
UTF_8
);
lines
.
remove
(
0
);
String
[]
parent
=
null
;
String
[]
parent1
=
null
;
String
[]
parent2
=
null
;
String
[]
parent3
=
null
;
String
[]
parent4
=
null
;
for
(
String
line
:
lines
)
{
if
(
StringUtils
.
isBlank
(
line
))
{
continue
;
...
...
@@ -32,10 +35,18 @@ public class DataInitTest extends CommonIT {
account
.
setName
(
StringUtils
.
isBlank
(
name
)
?
cols
[
7
]
:
name
);
if
(
StringUtils
.
isNotBlank
(
cols
[
0
]))
{
parent
=
cols
;
}
else
{
account
.
setParentCode
(
parent
[
6
]);
parent1
=
cols
;
}
else
if
(
StringUtils
.
isNotBlank
(
cols
[
1
]))
{
parent2
=
cols
;
account
.
setParentCode
(
parent1
[
6
]);
}
else
if
(
StringUtils
.
isNotBlank
(
cols
[
2
]))
{
parent3
=
cols
;
account
.
setParentCode
(
parent2
[
6
]);
}
else
if
(
StringUtils
.
isNotBlank
(
cols
[
3
]))
{
parent4
=
cols
;
account
.
setParentCode
(
parent3
[
6
]);
}
account
.
setFullName
(
cols
[
7
]);
account
.
setAcctProp
(
Integer
.
valueOf
(
cols
[
9
]));
int
acctLevel
=
1
;
...
...
@@ -61,4 +72,8 @@ public class DataInitTest extends CommonIT {
e
.
printStackTrace
();
}
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
CommonUtils
.
getUUID
());
}
}
atms-dao/pom.xml
View file @
6912bec4
...
...
@@ -40,5 +40,13 @@
<artifactId>
jackson-databind
</artifactId>
<version>
2.9.4
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core -->
<dependency>
<groupId>
org.mybatis.generator
</groupId>
<artifactId>
mybatis-generator-core
</artifactId>
<version>
1.3.7
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
atms-dao/src/test/java/pwc/taxtech/atms/gen/MyBatisGeneratorTest.java
0 → 100644
View file @
6912bec4
package
pwc
.
taxtech
.
atms
.
gen
;
import
org.mybatis.generator.api.MyBatisGenerator
;
import
org.mybatis.generator.config.Configuration
;
import
org.mybatis.generator.config.xml.ConfigurationParser
;
import
org.mybatis.generator.internal.DefaultShellCallback
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
MyBatisGeneratorTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
try
{
List
<
String
>
warnings
=
new
ArrayList
<>();
boolean
overwrite
=
true
;
//配置文件
// File configFile = new File(MyBatisGeneratorTest.class.getClassLoader().getResource("generatorConfig.xml").getPath());
File
configFile
=
new
File
(
MyBatisGeneratorTest
.
class
.
getClassLoader
().
getResource
(
"generatorConfig-invoice.xml"
).
getPath
());
ConfigurationParser
cp
=
new
ConfigurationParser
(
warnings
);
Configuration
config
=
cp
.
parseConfiguration
(
configFile
);
DefaultShellCallback
callback
=
new
DefaultShellCallback
(
overwrite
);
MyBatisGenerator
myBatisGenerator
=
new
MyBatisGenerator
(
config
,
callback
,
warnings
);
myBatisGenerator
.
generate
(
null
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
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