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
91d8c821
Commit
91d8c821
authored
Mar 11, 2019
by
gary
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、dataInit fix
parent
5b802508
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
DataInitTest.java
...test/java/pwc/taxtech/atms/service/impl/DataInitTest.java
+14
-13
No files found.
atms-api/src/test/java/pwc/taxtech/atms/service/impl/DataInitTest.java
View file @
91d8c821
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
com.google.common.io.Files
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.junit.Test
;
...
...
@@ -22,6 +23,7 @@ import javax.annotation.Resource;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.lang.reflect.Field
;
import
java.math.BigDecimal
;
import
java.util.*
;
...
...
@@ -80,12 +82,11 @@ public class DataInitTest extends CommonIT {
public
void
importOrgJson
(){
String
input
=
""
;
try
{
String
filePath
=
"C:\\Users\\Gary J Li\\Documents\\PwcDoc\\DD2018\\admin文档\\初始化\\company_info.json"
;
input
=
FileUtils
.
readFileToString
(
new
File
(
filePath
)
,
"UTF-8"
);
File
targetFile
=
new
File
(
"src/main/resources/orgImport/company_info.json"
)
;
input
=
FileUtils
.
readFileToString
(
targetFile
,
"UTF-8"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
JSONObject
object
=
JSONObject
.
parseObject
(
input
);
Map
<
String
,
Object
>
orgs
=
object
.
getInnerMap
();
Map
<
String
,
Object
>
failList
=
new
HashMap
<>();
...
...
@@ -171,9 +172,9 @@ public class DataInitTest extends CommonIT {
}
equityInfos
.
forEach
(
ei
->
{
// 逐条insert 失败的记录
/*
if (equityInformationMapper.insertSelective(ei) < 1) {
if
(
equityInformationMapper
.
insertSelective
(
ei
)
<
1
)
{
failList
.
putIfAbsent
(
orgK
,
orgV
);
}
*/
}
});
}
}
else
if
(
"股东信息"
.
equals
(
infoK
)
&&
equityInfos
.
isEmpty
())
{
...
...
@@ -243,9 +244,9 @@ public class DataInitTest extends CommonIT {
}
equityInfos1
.
forEach
(
ei
->
{
// 逐条insert 失败的记录
/*
if (equityInformationMapper.insertSelective(ei) < 1) {
if
(
equityInformationMapper
.
insertSelective
(
ei
)
<
1
)
{
failList
.
putIfAbsent
(
orgK
,
orgV
);
}
*/
}
});
}
}
else
if
(
"变更记录"
.
equals
(
infoK
))
{
...
...
@@ -271,9 +272,9 @@ public class DataInitTest extends CommonIT {
});
logs
.
forEach
(
l
->
{
// 逐条insert 失败的记录
/*
if (operationLogEquityMapper.insertSelective(l) < 1) {
if
(
operationLogEquityMapper
.
insertSelective
(
l
)
<
1
)
{
failList
.
putIfAbsent
(
orgK
,
orgV
);
}
*/
}
});
}
...
...
@@ -344,7 +345,7 @@ public class DataInitTest extends CommonIT {
}
}
});
/*
if (organizationMapper.insertSelective(org) < 0) {
if
(
organizationMapper
.
insertSelective
(
org
)
<
0
)
{
failList
.
putIfAbsent
(
orgK
,
orgV
);
}
if
(
organizationExtraMapper
.
insertSelective
(
orgEx
)
<
0
)
{
...
...
@@ -352,7 +353,7 @@ public class DataInitTest extends CommonIT {
}
if
(
organizationEmployeeMapper
.
insertSelective
(
orgEmp
)
<
0
)
{
failList
.
putIfAbsent
(
orgK
,
orgV
);
}
*/
}
insertExtraList
(
orgId
);
}
});
...
...
@@ -366,7 +367,7 @@ public class DataInitTest extends CommonIT {
FileWriter
writer
;
FileWriter
writer1
;
try
{
writer
=
new
FileWriter
(
"
C:\\Users\\Gary J Li\\Documents\\PwcDoc\\DD2018\\admin文档\\初始化\\
company_info_failed.json"
);
writer
=
new
FileWriter
(
"
src/main/resources/orgImport/
company_info_failed.json"
);
writer
.
write
(
failedStr
);
writer
.
flush
();
writer
.
close
();
...
...
@@ -374,7 +375,7 @@ public class DataInitTest extends CommonIT {
e
.
printStackTrace
();
}
try
{
writer1
=
new
FileWriter
(
"
C:\\Users\\Gary J Li\\Documents\\PwcDoc\\DD2018\\admin文档\\初始化\\
company_info_msg.txt"
);
writer1
=
new
FileWriter
(
"
src/main/resources/orgImport/
company_info_msg.txt"
);
writer1
.
write
(
failMsg
.
toString
());
writer1
.
flush
();
writer1
.
close
();
...
...
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