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
3a96d22f
Commit
3a96d22f
authored
Mar 15, 2019
by
zhkwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql
parents
ef91da76
5710dcc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
27 deletions
+32
-27
OrgSyncJob.java
...ain/java/pwc/taxtech/atms/common/schedule/OrgSyncJob.java
+32
-27
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/schedule/OrgSyncJob.java
View file @
3a96d22f
...
...
@@ -48,34 +48,39 @@ public class OrgSyncJob extends QuartzJobBean {
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"token"
,
token
);
headers
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
headers
.
put
(
"Idap"
,
"eddie.wu_v"
);
int
pageSize
=
1
;
try
{
// todo 这里要加分页查询的参数
String
response
=
HttpUtil
.
get
(
orgSyncUrl
,
headers
);
DDSyncOrgInfo
ddSyncOrgInfo
=
JSONObject
.
parseObject
(
response
,
DDSyncOrgInfo
.
class
);
List
<
OrgSyncData
>
orgSyncDatas
=
ddSyncOrgInfo
.
getData
();
orgSyncDatas
.
forEach
(
osd
->
{
OrganizationExample
example
=
new
OrganizationExample
();
example
.
createCriteria
().
andNameEqualTo
(
osd
.
getNameCN
());
Organization
o
=
new
Organization
();
o
.
setClientCode
(
osd
.
getCode
());
o
.
setCode
(
osd
.
getCode
());
o
.
setEnterpriseAccountCode
(
String
.
valueOf
(
osd
.
getSobId
()));
o
.
setEnterpriseAccountName
(
osd
.
getSobName
());
o
.
setCurrencyCode
(
osd
.
getCurrencyCode
());
o
.
setLegalEntity
(
osd
.
getLegalEntity
());
o
.
setLegalPersonName
(
osd
.
getLegalRepresentative
());
o
.
setAddress
(
osd
.
getAddress
());
o
.
setCreateTime
(
osd
.
getGmtCreate
());
o
.
setUpdateTime
(
osd
.
getGmtModified
());
o
.
setPsCode
(
osd
.
getPsCode
());
RegionExample
regionExample
=
new
RegionExample
();
regionExample
.
createCriteria
().
andShortNameEqualTo
(
osd
.
getCompanyLocation
());
List
<
Region
>
regions
=
regionMapper
.
selectByExample
(
regionExample
);
if
(
regions
.
size
()
>
0
)
{
o
.
setRegionId
(
regions
.
get
(
0
).
getId
());
}
organizationMapper
.
updateByExampleSelective
(
o
,
example
);
});
for
(
int
i
=
1
;
i
<=
pageSize
;
i
++)
{
String
response
=
HttpUtil
.
get
(
orgSyncUrl
+
"?currentPage="
+
i
,
headers
);
DDSyncOrgInfo
ddSyncOrgInfo
=
JSONObject
.
parseObject
(
response
,
DDSyncOrgInfo
.
class
);
pageSize
=
ddSyncOrgInfo
.
getPageSize
();
List
<
OrgSyncData
>
orgSyncDatas
=
ddSyncOrgInfo
.
getData
();
orgSyncDatas
.
forEach
(
osd
->
{
OrganizationExample
example
=
new
OrganizationExample
();
example
.
createCriteria
().
andNameEqualTo
(
osd
.
getNameCN
());
Organization
o
=
new
Organization
();
o
.
setClientCode
(
osd
.
getCode
());
o
.
setCode
(
osd
.
getCode
());
o
.
setEnterpriseAccountCode
(
String
.
valueOf
(
osd
.
getSobId
()));
o
.
setEnterpriseAccountName
(
osd
.
getSobName
());
o
.
setCurrencyCode
(
osd
.
getCurrencyCode
());
o
.
setLegalEntity
(
osd
.
getLegalEntity
());
o
.
setLegalPersonName
(
osd
.
getLegalRepresentative
());
o
.
setAddress
(
osd
.
getAddress
());
o
.
setCreateTime
(
osd
.
getGmtCreate
());
o
.
setUpdateTime
(
osd
.
getGmtModified
());
o
.
setPsCode
(
osd
.
getPsCode
());
RegionExample
regionExample
=
new
RegionExample
();
regionExample
.
createCriteria
().
andShortNameEqualTo
(
osd
.
getCompanyLocation
());
List
<
Region
>
regions
=
regionMapper
.
selectByExample
(
regionExample
);
if
(
regions
.
size
()
>
0
)
{
o
.
setRegionId
(
regions
.
get
(
0
).
getId
());
}
organizationMapper
.
updateByExampleSelective
(
o
,
example
);
});
}
}
catch
(
Exception
e
)
{
logger
.
error
(
String
.
format
(
"机构信息同步异常:[%s]"
,
e
.
getMessage
()),
e
);
}
...
...
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