Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
asset-distribution
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
asset-distribution
Commits
99598b8a
Commit
99598b8a
authored
Mar 23, 2020
by
zhengjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
你我贷
parent
e5131dee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
25 deletions
+26
-25
NiwodaiAssetServiceImpl.java
...ibution/service/niwodai/impl/NiwodaiAssetServiceImpl.java
+8
-8
NiwodaiServiceImpl.java
...distribution/service/niwodai/impl/NiwodaiServiceImpl.java
+18
-17
No files found.
src/main/java/com/quantgroup/asset/distribution/service/niwodai/impl/NiwodaiAssetServiceImpl.java
View file @
99598b8a
...
@@ -52,27 +52,27 @@ public class NiwodaiAssetServiceImpl implements INiwodaiAssetService {
...
@@ -52,27 +52,27 @@ public class NiwodaiAssetServiceImpl implements INiwodaiAssetService {
}
}
OCRIdCardRow
ocrIdCardRow
=
list
.
get
(
0
);
OCRIdCardRow
ocrIdCardRow
=
list
.
get
(
0
);
UserSysResult
<
UserInfo
>
userInfoByUuid
=
userSdkService
.
findUserInfoByUuid
(
uuid
);
UserSysResult
<
UserInfo
>
userInfoByUuid
=
userSdkService
.
findUserInfoByUuid
(
uuid
);
IdCardA
idCardA
=
JSON
.
parseObject
(
ocrIdCardRow
.
getIdCardContentA
(),
IdCardA
.
class
);
IdCardA
idCardFront
=
JSON
.
parseObject
(
ocrIdCardRow
.
getIdCardContentA
(),
IdCardA
.
class
);
IdCardB
idCardB
=
JSON
.
parseObject
(
ocrIdCardRow
.
getIdCardContentB
(),
IdCardB
.
class
);
IdCardB
idCardBack
=
JSON
.
parseObject
(
ocrIdCardRow
.
getIdCardContentB
(),
IdCardB
.
class
);
Map
<
String
,
String
>
addressMap
=
AddressResolutionUtil
.
addressResolution
(
idCardFront
.
getAddress
());
NiwodaiIncomingRequestVO
vo
=
new
NiwodaiIncomingRequestVO
();
NiwodaiIncomingRequestVO
vo
=
new
NiwodaiIncomingRequestVO
();
vo
.
setOrderId
(
orderId
);
vo
.
setOrderId
(
orderId
);
NiwodaiCostant
.
UserInfo
userInfo
=
new
NiwodaiCostant
.
UserInfo
();
NiwodaiCostant
.
UserInfo
userInfo
=
new
NiwodaiCostant
.
UserInfo
();
userInfo
.
setRealName
(
idCard
A
.
getName
());
userInfo
.
setRealName
(
idCard
Front
.
getName
());
userInfo
.
setIdcardNumber
(
idCard
A
.
getCitizen_id
());
userInfo
.
setIdcardNumber
(
idCard
Front
.
getCitizen_id
());
userInfo
.
setPhone
(
userInfoByUuid
.
getData
().
getPhoneNo
());
userInfo
.
setPhone
(
userInfoByUuid
.
getData
().
getPhoneNo
());
userInfo
.
setMaritalStatus
(
NiwodaiCostant
.
MaritalStatus
.
UNMARRIED
.
name
());
userInfo
.
setMaritalStatus
(
NiwodaiCostant
.
MaritalStatus
.
UNMARRIED
.
name
());
userInfo
.
setGender
(
"男"
.
equals
(
idCard
A
.
getGender
())
?
NiwodaiCostant
.
Gender
.
MALE
.
name
()
:
NiwodaiCostant
.
Gender
.
FEMALE
.
name
());
userInfo
.
setGender
(
"男"
.
equals
(
idCard
Front
.
getGender
())
?
NiwodaiCostant
.
Gender
.
MALE
.
name
()
:
NiwodaiCostant
.
Gender
.
FEMALE
.
name
());
userInfo
.
setEducation
(
NiwodaiCostant
.
EducationalBackground
.
JUNIOR_SCHOOL_AND_BELOW
.
name
());
userInfo
.
setEducation
(
NiwodaiCostant
.
EducationalBackground
.
JUNIOR_SCHOOL_AND_BELOW
.
name
());
userInfo
.
setOccupation
(
NiwodaiCostant
.
Occupation
.
WORKER
.
name
());
userInfo
.
setOccupation
(
NiwodaiCostant
.
Occupation
.
WORKER
.
name
());
userInfo
.
setIdcardValidity
(
idCardB
.
getValid_date_end
());
userInfo
.
setIdcardValidity
(
idCardB
ack
.
getValid_date_end
());
userInfo
.
setIdcardFront
(
ocrIdCardRow
.
getIdCardBaseContentA
());
userInfo
.
setIdcardFront
(
ocrIdCardRow
.
getIdCardBaseContentA
());
userInfo
.
setIdcardBack
(
ocrIdCardRow
.
getIdCardBaseContentB
());
userInfo
.
setIdcardBack
(
ocrIdCardRow
.
getIdCardBaseContentB
());
userInfo
.
setBioPhoto
(
ocrIdCardRow
.
getLivePhotoContent
());
userInfo
.
setBioPhoto
(
ocrIdCardRow
.
getLivePhotoContent
());
userInfo
.
setImageType
(
"BASE64"
);
userInfo
.
setImageType
(
"BASE64"
);
Map
<
String
,
String
>
addressMap
=
AddressResolutionUtil
.
addressResolution
(
userInfo
.
getAddress
());
userInfo
.
setProvince
(
addressMap
.
get
(
"province"
));
userInfo
.
setProvince
(
addressMap
.
get
(
"province"
));
userInfo
.
setCity
(
addressMap
.
get
(
"city"
));
userInfo
.
setCity
(
addressMap
.
get
(
"city"
));
userInfo
.
setAddress
(
idCard
A
.
getAddress
());
userInfo
.
setAddress
(
idCard
Front
.
getAddress
());
userInfo
.
setIndustry
(
NiwodaiCostant
.
Industry
.
ENTERTAINMENT
.
name
());
userInfo
.
setIndustry
(
NiwodaiCostant
.
Industry
.
ENTERTAINMENT
.
name
());
userInfo
.
setIncome
(
NiwodaiCostant
.
Income
.
FOUR
.
name
());
userInfo
.
setIncome
(
NiwodaiCostant
.
Income
.
FOUR
.
name
());
userInfo
.
setIncomeType
(
NiwodaiCostant
.
IncomeType
.
SALARY
.
name
());
userInfo
.
setIncomeType
(
NiwodaiCostant
.
IncomeType
.
SALARY
.
name
());
...
...
src/main/java/com/quantgroup/asset/distribution/service/niwodai/impl/NiwodaiServiceImpl.java
View file @
99598b8a
...
@@ -11,6 +11,7 @@ import com.quantgroup.asset.distribution.service.redis.IRedisService;
...
@@ -11,6 +11,7 @@ import com.quantgroup.asset.distribution.service.redis.IRedisService;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Base64
;
import
java.util.Base64
;
...
@@ -23,20 +24,20 @@ import static com.quantgroup.asset.distribution.exception.QGExceptionType.COMMON
...
@@ -23,20 +24,20 @@ import static com.quantgroup.asset.distribution.exception.QGExceptionType.COMMON
@Slf4j
@Slf4j
@Service
@Service
public
class
NiwodaiServiceImpl
implements
INiwodaiService
{
public
class
NiwodaiServiceImpl
implements
INiwodaiService
{
@Value
(
"${niwodai.url.authDomain}"
)
final
static
String
domain
=
"https://api.preprod.geerong.com:8443/test"
;
private
String
domain
;
@Value
(
"${niwodai.url.dataDomain}"
)
final
static
String
domain2
=
"https://api.preprod.geerong.com:8443/al/test/asset"
;
private
String
domain2
;
@Value
(
"${niwodai.url.dataCheck}"
)
final
static
String
dataImportCheckUrl
=
domain2
+
"/std/v1/entry"
;
private
String
dataImportCheckUrl
;
@Value
(
"${niwodai.url.auth}"
)
final
static
String
authUrl
=
domain
+
"/oauth/token"
;
private
String
authUrl
;
@Value
(
"${niwodai.url.incoming}"
)
final
static
String
incomingUrl
=
domain2
+
"/std/v1/apply"
;
private
String
incomingUrl
;
@Value
(
"${niwodai.client.id}"
)
final
static
String
clientId
=
"36c36b1e-5e60-4ef9-811c-6714fbf88d90"
;
private
String
clientId
;
@Value
(
"${niwodai.client.secret}"
)
final
static
String
clientSecret
=
"3W8uCiQk7aM1Vxwgaltt2A0tDqN8YYoKnz62pj8rKxw0usZYN6fQRL8wB7Eq3XKy"
;
private
String
clientSecret
;
@Autowired
@Autowired
IRedisService
<
String
>
iRedisService
;
IRedisService
<
String
>
iRedisService
;
...
@@ -50,7 +51,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
...
@@ -50,7 +51,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
log
.
error
(
"你我贷准入检查时获取token失败,requestVO : {}"
,
JSON
.
toJSONString
(
requestVO
));
log
.
error
(
"你我贷准入检查时获取token失败,requestVO : {}"
,
JSON
.
toJSONString
(
requestVO
));
throw
new
QGException
(
"你我贷准入检查时获取token失败"
,
COMMON_THIRD_PARTY_TIMEOUT
);
throw
new
QGException
(
"你我贷准入检查时获取token失败"
,
COMMON_THIRD_PARTY_TIMEOUT
);
}
}
String
result
=
iHttpService
.
postNiwodaiJson
(
dataImportCheckUrl
,
commonHeader
(
token
),
JSON
.
toJSONString
(
requestVO
),
true
);
String
result
=
iHttpService
.
postNiwodaiJson
(
d
omain2
+
d
ataImportCheckUrl
,
commonHeader
(
token
),
JSON
.
toJSONString
(
requestVO
),
true
);
if
(
StringUtils
.
isNotEmpty
(
result
))
{
if
(
StringUtils
.
isNotEmpty
(
result
))
{
return
JSON
.
parseObject
(
result
,
NiwodaiDataImportCheckResponseVO
.
class
);
return
JSON
.
parseObject
(
result
,
NiwodaiDataImportCheckResponseVO
.
class
);
}
}
...
@@ -64,7 +65,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
...
@@ -64,7 +65,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
log
.
error
(
"你我贷进件时获取token失败,requestVO : {}"
,
JSON
.
toJSONString
(
requestVO
));
log
.
error
(
"你我贷进件时获取token失败,requestVO : {}"
,
JSON
.
toJSONString
(
requestVO
));
throw
new
QGException
(
"你我贷进件时获取token失败"
,
COMMON_THIRD_PARTY_TIMEOUT
);
throw
new
QGException
(
"你我贷进件时获取token失败"
,
COMMON_THIRD_PARTY_TIMEOUT
);
}
}
String
result
=
iHttpService
.
postNiwodaiJson
(
incomingUrl
,
commonHeader
(
token
),
JSON
.
toJSONString
(
requestVO
),
true
);
String
result
=
iHttpService
.
postNiwodaiJson
(
domain2
+
incomingUrl
,
commonHeader
(
token
),
JSON
.
toJSONString
(
requestVO
),
true
);
if
(
StringUtils
.
isNotEmpty
(
result
))
{
if
(
StringUtils
.
isNotEmpty
(
result
))
{
return
JSON
.
parseObject
(
result
,
NiwodaiIncomingResponseVO
.
class
);
return
JSON
.
parseObject
(
result
,
NiwodaiIncomingResponseVO
.
class
);
}
}
...
@@ -93,7 +94,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
...
@@ -93,7 +94,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
parameters
.
put
(
"grant_type"
,
"client_credentials"
);
parameters
.
put
(
"grant_type"
,
"client_credentials"
);
String
result
=
null
;
String
result
=
null
;
try
{
try
{
result
=
iHttpService
.
postNiwodai
(
authUrl
,
header
,
parameters
,
true
);
result
=
iHttpService
.
postNiwodai
(
domain
+
authUrl
,
header
,
parameters
,
true
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
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