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
ab380ea0
Commit
ab380ea0
authored
May 07, 2020
by
liwenbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
你我贷增加前筛限制
parent
9ea2e679
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
19 deletions
+76
-19
NiWoDaiController.java
...roup/asset/distribution/controller/NiWoDaiController.java
+1
-6
AssetAttributeServiceImpl.java
...ibution/service/asset/impl/AssetAttributeServiceImpl.java
+39
-5
IAidFundAssetService.java
...et/distribution/service/funding/IAidFundAssetService.java
+1
-1
AidFundAssetServiceImpl.java
...ibution/service/funding/impl/AidFundAssetServiceImpl.java
+2
-2
AidFundRouteServiceImpl.java
...ibution/service/funding/impl/AidFundRouteServiceImpl.java
+1
-1
INiwodaiAssetService.java
...et/distribution/service/niwodai/INiwodaiAssetService.java
+1
-1
NiwodaiAssetServiceImpl.java
...ibution/service/niwodai/impl/NiwodaiAssetServiceImpl.java
+31
-3
No files found.
src/main/java/com/quantgroup/asset/distribution/controller/NiWoDaiController.java
View file @
ab380ea0
...
...
@@ -126,9 +126,4 @@ public class NiWoDaiController {
}
return
true
;
}
public
static
void
main
(
String
[]
args
)
throws
FileNotFoundException
{
System
.
out
.
println
(
ResourceUtils
.
getURL
(
"classpath:"
).
getPath
());
}
}
}
\ No newline at end of file
src/main/java/com/quantgroup/asset/distribution/service/asset/impl/AssetAttributeServiceImpl.java
View file @
ab380ea0
...
...
@@ -62,7 +62,10 @@ public class AssetAttributeServiceImpl implements IAssetAttributeService {
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
// 决策特征Key
Set
<
String
>
decKeys
=
new
HashSet
<>();
// 自有属性
Set
<
String
>
propertyKeys
=
new
HashSet
<>();
// 必填特征...慎用,会花钱的
Set
<
String
>
necessaryKeys
=
new
HashSet
<>();
decKeys
.
add
(
AssetAttributeConstants
.
USER_LOAN_TYPE
);
if
(
assetAttributeExtendConfigList
!=
null
&&
assetAttributeExtendConfigList
.
size
()
>
0
)
{
for
(
AssetAttributeExtendConfig
config
:
assetAttributeExtendConfigList
)
{
...
...
@@ -71,39 +74,70 @@ public class AssetAttributeServiceImpl implements IAssetAttributeService {
}
else
if
(
config
.
getAssetAttributeType
()
==
2
)
{
// 自有属性,amount和term
propertyKeys
.
add
(
config
.
getAssetAttributeCode
());
}
else
if
(
config
.
getAssetAttributeType
()
==
3
)
{
// 决策必填特征
necessaryKeys
.
add
(
config
.
getAssetAttributeCode
());
}
}
}
// 请求决策特征
Map
<
String
,
Object
>
decAttributeValue
=
getDecAttributeValue
(
decKeys
,
assetForm
);
data
.
putAll
(
decAttributeValue
);
// 必填特征, 慎用....
Map
<
String
,
Object
>
necAttributeValue
=
getDecNecAttributeValue
(
necessaryKeys
,
assetForm
,
data
);
data
.
putAll
(
necAttributeValue
);
// 自有属性
Map
<
String
,
Object
>
propertyValue
=
getPropertyAttributeValue
(
propertyKeys
,
assetForm
);
data
.
putAll
(
propertyValue
);
log
.
info
(
"用户所有资产扩展属性获取完成, uuid : {}, assetNo : {}, bizNo : {}, bizType : {}, 耗时 : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getAssetNo
(),
assetForm
.
getBizNo
(),
assetForm
.
getBizType
(),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
return
data
;
}
/**
* 获取必填特征
* @param necessaryKeys
* @param assetForm
* @param data
* @return
*/
public
Map
<
String
,
Object
>
getDecNecAttributeValue
(
Set
<
String
>
necessaryKeys
,
AssetForm
assetForm
,
Map
<
String
,
Object
>
data
)
{
return
getDecFeatureValueCommon
(
necessaryKeys
,
assetForm
,
1
);
}
/**
* 获取所有决策特征属性值
* @param decKeys
* @param assetForm
* @return
*/
public
Map
<
String
,
Object
>
getDecAttributeValue
(
Set
<
String
>
decKeys
,
AssetForm
assetForm
)
{
if
(
CollectionUtils
.
isEmpty
(
decKeys
))
{
return
MapUtils
.
EMPTY_MAP
;
}
return
getDecFeatureValueCommon
(
decKeys
,
assetForm
,
0
);
}
/**
*
* @param keys
* @param assetForm
* @param type
* @return
*/
public
Map
<
String
,
Object
>
getDecFeatureValueCommon
(
Set
<
String
>
keys
,
AssetForm
assetForm
,
int
type
)
{
if
(
CollectionUtils
.
isEmpty
(
keys
))
{
return
MapUtils
.
EMPTY_MAP
;
}
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
String
result
=
httpService
.
post
(
ruleEngineURL
+
"/feature/get"
,
new
HashMap
<
String
,
String
>(){{
put
(
"uuid"
,
assetForm
.
getUuid
());
put
(
"bizChannel"
,
assetForm
.
getBizChannel
());
put
(
"bizNo"
,
assetForm
.
getBizNo
());
put
(
"bizType"
,
assetForm
.
getBizType
());
put
(
"keys"
,
StringUtils
.
join
(
decK
eys
,
","
));
put
(
"keys"
,
StringUtils
.
join
(
k
eys
,
","
));
put
(
"method"
,
"0"
);
put
(
"type"
,
type
+
""
);
}});
JSONObject
resultJSON
=
null
;
QGPreconditions
.
checkArgument
(
StringUtils
.
isNotEmpty
(
result
)
&&
(
resultJSON
=
JSON
.
parseObject
(
result
)).
getInteger
(
"code"
)
==
0
,
QGExceptionType
.
GET_DEC_ATTRIBUTE_VALUE_ERROR
,
assetForm
.
getUuid
(),
JSON
.
toJSONString
(
decK
eys
));
QGPreconditions
.
checkArgument
(
StringUtils
.
isNotEmpty
(
result
)
&&
(
resultJSON
=
JSON
.
parseObject
(
result
)).
getInteger
(
"code"
)
==
0
,
QGExceptionType
.
GET_DEC_ATTRIBUTE_VALUE_ERROR
,
assetForm
.
getUuid
(),
JSON
.
toJSONString
(
k
eys
));
Map
<
String
,
Object
>
data
=
resultJSON
.
getJSONObject
(
"body"
);
log
.
info
(
"决策特征属性获取完成, uuid : {}, assetNo : {}, bizChannel : {}, bizNo : {}, bizType : {},
data : {}, 耗时 : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getAssetNo
(),
assetForm
.
getBizChannel
(),
assetForm
.
getBizNo
(),
assetForm
.
getBizType
()
,
JSON
.
toJSONString
(
data
),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"决策特征属性获取完成, uuid : {}, assetNo : {}, bizChannel : {}, bizNo : {}, bizType : {},
type : {}, data : {}, 耗时 : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getAssetNo
(),
assetForm
.
getBizChannel
(),
assetForm
.
getBizNo
(),
assetForm
.
getBizType
(),
type
,
JSON
.
toJSONString
(
data
),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
return
data
;
}
...
...
src/main/java/com/quantgroup/asset/distribution/service/funding/IAidFundAssetService.java
View file @
ab380ea0
...
...
@@ -17,7 +17,7 @@ public interface IAidFundAssetService {
* @param assetForm
* @return
*/
public
boolean
preAudit
(
AssetForm
assetForm
,
String
fundId
);
public
boolean
preAudit
(
AssetForm
assetForm
,
String
fundId
,
Map
<
String
,
Object
>
data
);
/**
* 进件审核
...
...
src/main/java/com/quantgroup/asset/distribution/service/funding/impl/AidFundAssetServiceImpl.java
View file @
ab380ea0
...
...
@@ -26,10 +26,10 @@ public class AidFundAssetServiceImpl implements IAidFundAssetService {
private
INiwodaiAssetService
niwodaiAssetService
;
@Override
public
boolean
preAudit
(
AssetForm
assetForm
,
String
fundId
)
{
public
boolean
preAudit
(
AssetForm
assetForm
,
String
fundId
,
Map
<
String
,
Object
>
data
)
{
switch
(
fundId
)
{
case
AidFundConstants
.
FundId
.
NIWODAI
:
{
return
niwodaiAssetService
.
preAudit
(
assetForm
.
getUuid
()).
getPass
().
booleanValue
();
return
niwodaiAssetService
.
preAudit
(
assetForm
.
getUuid
()
,
data
).
getPass
().
booleanValue
();
}
default
:
throw
new
QGException
(
QGExceptionType
.
UNKNOW_AID_FUND_ID
);
...
...
src/main/java/com/quantgroup/asset/distribution/service/funding/impl/AidFundRouteServiceImpl.java
View file @
ab380ea0
...
...
@@ -115,7 +115,7 @@ public class AidFundRouteServiceImpl implements IAidFundRouteService {
if
(
status
==
AidFundStatus
.
Route
.
PRE_PASS
)
{
accessResult
=
true
;
}
else
{
accessResult
=
aidFundAssetService
.
preAudit
(
assetForm
,
aidLoanFundConfig
.
getFundId
());
accessResult
=
aidFundAssetService
.
preAudit
(
assetForm
,
aidLoanFundConfig
.
getFundId
()
,
data
);
// 保存主贷资金路由记录
aidLoanFundRouteRecord
=
new
AidLoanFundRouteRecord
();
aidLoanFundRouteRecord
.
setAidFundRouteStatus
(
accessResult
?
AidFundStatus
.
Route
.
PRE_PASS
:
AidFundStatus
.
Route
.
PRE_REJECT
);
//1-准入成功 2-准入失败 3-进件完成
...
...
src/main/java/com/quantgroup/asset/distribution/service/niwodai/INiwodaiAssetService.java
View file @
ab380ea0
...
...
@@ -13,7 +13,7 @@ public interface INiwodaiAssetService {
NiwodaiIncomingResultResponseVO
incomingResult
(
String
orderId
);
NiwodaiDataImportCheckResponseVO
preAudit
(
String
uuid
);
NiwodaiDataImportCheckResponseVO
preAudit
(
String
uuid
,
Map
<
String
,
Object
>
data
);
NiwodaiIncomingResponseVO
incoming
(
AssetForm
assetForm
,
Map
<
String
,
Object
>
data
,
Asset
asset
);
...
...
src/main/java/com/quantgroup/asset/distribution/service/niwodai/impl/NiwodaiAssetServiceImpl.java
View file @
ab380ea0
...
...
@@ -72,16 +72,35 @@ public class NiwodaiAssetServiceImpl implements INiwodaiAssetService {
}
@Override
public
NiwodaiDataImportCheckResponseVO
preAudit
(
String
uuid
)
{
public
NiwodaiDataImportCheckResponseVO
preAudit
(
String
uuid
,
Map
<
String
,
Object
>
data
)
{
NiwodaiDataImportCheckRequestVO
requestVO
=
new
NiwodaiDataImportCheckRequestVO
();
UserSysResult
<
UserInfo
>
userInfoByUuid
=
userSdkService
.
findUserInfoByUuid
(
uuid
);
if
(!
userInfoByUuid
.
isSuccess
()){
log
.
error
(
"你我贷准入检查获取用户中心信息失败 uuid : {}"
,
uuid
);
throw
new
QGException
(
QGExceptionType
.
GET_USER_INFO_ERROR
);
}
// 因为渠道限制不一样,死条件先在代码里写死
String
phoneNo
=
userInfoByUuid
.
getData
().
getPhoneNo
();
if
(
phoneNo
.
startsWith
(
"170"
)
||
phoneNo
.
startsWith
(
"171"
))
{
log
.
info
(
"你我贷准入检查, 用户手机号段过滤, uuid : {}, phone : {}"
,
uuid
,
phoneNo
);
log
.
info
(
"你我贷准入检查, 用户手机号段过滤, uuid : {}, phone : {}"
,
uuid
,
getPhoneNoMask
(
phoneNo
));
return
NiwodaiDataImportCheckResponseVO
.
createPassFalse
();
}
// 年龄过滤, 23>= age <= 50 通过,其余拒绝
Integer
age
=
(
Integer
)
data
.
get
(
"user_age"
);
if
(
age
==
null
||
age
.
intValue
()
<
23
||
age
.
intValue
()
>
50
)
{
log
.
info
(
"你我贷准入检查, 用户年龄过滤, uuid : {}, age : {}"
,
uuid
,
age
);
return
NiwodaiDataImportCheckResponseVO
.
createPassFalse
();
}
// 用户归属地过滤,西藏、新疆、福建过滤
String
province
=
(
String
)
data
.
get
(
"user_province_code"
);
if
(
StringUtils
.
isEmpty
(
province
)
||
province
.
startsWith
(
"-999999"
)
||
"54"
.
equals
(
province
.
trim
())
||
"65"
.
equals
(
province
.
trim
())
||
"35"
.
equals
(
province
.
trim
()))
{
log
.
info
(
"你我贷准入检查, 用户归属地过滤, uuid : {}, province : {}"
,
uuid
,
province
);
return
NiwodaiDataImportCheckResponseVO
.
createPassFalse
();
}
// 黑名单过滤
Integer
countBlackList
=
(
Integer
)
data
.
get
(
"filter_user_info_in_black"
);
if
(
countBlackList
==
null
||
countBlackList
.
intValue
()
>
0
)
{
log
.
info
(
"你我贷准入检查, 用户黑名单过滤, uuid : {}, countBlackList : {}"
,
uuid
,
countBlackList
);
return
NiwodaiDataImportCheckResponseVO
.
createPassFalse
();
}
requestVO
.
setPhone
(
getPhoneNoMask
(
phoneNo
));
...
...
@@ -473,5 +492,14 @@ public class NiwodaiAssetServiceImpl implements INiwodaiAssetService {
return
riskData
;
}
public
static
void
main
(
String
[]
args
)
{
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
Integer
age
=
(
Integer
)
data
.
get
(
"user_age"
);
System
.
out
.
println
(
age
);
if
(
age
==
null
||
age
.
intValue
()
<
22
||
age
.
intValue
()
>
50
)
{
System
.
out
.
println
(
"不要"
);
}
else
{
System
.
out
.
println
(
"要"
);
}
}
}
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