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
d6c7359f
Commit
d6c7359f
authored
Sep 12, 2019
by
liwenbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
众邦拒绝需求
parent
66476524
Pipeline
#100
failed with stages
Changes
7
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
25 deletions
+49
-25
AssetForm.java
...m/quantgroup/asset/distribution/model/form/AssetForm.java
+17
-1
AssetAttributeServiceImpl.java
...ibution/service/asset/impl/AssetAttributeServiceImpl.java
+12
-9
AssetDistributeServiceImpl.java
...n/service/distribute/impl/AssetDistributeServiceImpl.java
+6
-6
IAidFundRouteService.java
...et/distribution/service/funding/IAidFundRouteService.java
+3
-1
AidFundRouteServiceImpl.java
...ibution/service/funding/impl/AidFundRouteServiceImpl.java
+2
-2
INotifyService.java
...oup/asset/distribution/service/notify/INotifyService.java
+3
-1
NotifyServiceImpl.java
...t/distribution/service/notify/impl/NotifyServiceImpl.java
+6
-5
No files found.
src/main/java/com/quantgroup/asset/distribution/model/form/AssetForm.java
View file @
d6c7359f
...
@@ -4,6 +4,7 @@ import java.io.Serializable;
...
@@ -4,6 +4,7 @@ import java.io.Serializable;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
import
com.quantgroup.asset.distribution.service.jpa.entity.Asset
;
import
com.quantgroup.asset.distribution.service.jpa.entity.Asset
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -62,7 +63,7 @@ public class AssetForm implements Serializable{
...
@@ -62,7 +63,7 @@ public class AssetForm implements Serializable{
* 获取通知资金系统FormMap
* 获取通知资金系统FormMap
* @return
* @return
*/
*/
public
Map
<
String
,
String
>
transToNotifyMap
()
{
public
Map
<
String
,
String
>
transToNotifyMap
(
Map
<
String
,
Object
>
data
)
{
Map
<
String
,
String
>
notifyMap
=
new
HashMap
<>();
Map
<
String
,
String
>
notifyMap
=
new
HashMap
<>();
notifyMap
.
put
(
"code"
,
this
.
code
);
notifyMap
.
put
(
"code"
,
this
.
code
);
notifyMap
.
put
(
"msg"
,
this
.
msg
);
notifyMap
.
put
(
"msg"
,
this
.
msg
);
...
@@ -76,6 +77,21 @@ public class AssetForm implements Serializable{
...
@@ -76,6 +77,21 @@ public class AssetForm implements Serializable{
notifyMap
.
put
(
"exData"
,
this
.
exData
);
notifyMap
.
put
(
"exData"
,
this
.
exData
);
notifyMap
.
put
(
"otherInformation"
,
this
.
otherInformation
);
notifyMap
.
put
(
"otherInformation"
,
this
.
otherInformation
);
notifyMap
.
put
(
"financeProducts"
,
this
.
financeProducts
);
notifyMap
.
put
(
"financeProducts"
,
this
.
financeProducts
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
// 目前通知资金方可能有3个模型分
if
(
data
.
get
(
"model_exec_data_source#fst_v6_xy_br_dhb_raw_bucket"
)
!=
null
)
{
dataMap
.
put
(
"model_exec_data_source#fst_v6_xy_br_dhb_raw_bucket"
,
data
.
get
(
"model_exec_data_source#fst_v6_xy_br_dhb_raw_bucket"
));
}
if
(
data
.
get
(
"td_rules#2022870_result"
)
!=
null
)
{
dataMap
.
put
(
"td_rules#2022870_result"
,
data
.
get
(
"td_rules#2022870_result"
));
}
if
(
data
.
get
(
"lxf_score_scale_v2"
)
!=
null
)
{
dataMap
.
put
(
"lxf_score_scale_v2"
,
data
.
get
(
"lxf_score_scale_v2"
));
}
dataMap
.
put
(
"user_loan_type"
,
data
.
get
(
"user_loan_type"
));
notifyMap
.
put
(
"dataMap"
,
JSON
.
toJSONString
(
dataMap
));
return
notifyMap
;
return
notifyMap
;
}
}
...
...
src/main/java/com/quantgroup/asset/distribution/service/asset/impl/AssetAttributeServiceImpl.java
View file @
d6c7359f
...
@@ -109,7 +109,9 @@ public class AssetAttributeServiceImpl implements IAssetAttributeService {
...
@@ -109,7 +109,9 @@ public class AssetAttributeServiceImpl implements IAssetAttributeService {
if
(
assetAttributeExtendConfigList
!=
null
&&
assetAttributeExtendConfigList
.
size
()
>
0
)
{
if
(
assetAttributeExtendConfigList
!=
null
&&
assetAttributeExtendConfigList
.
size
()
>
0
)
{
for
(
AssetAttributeExtendConfig
config
:
assetAttributeExtendConfigList
)
{
for
(
AssetAttributeExtendConfig
config
:
assetAttributeExtendConfigList
)
{
QGPreconditions
.
checkArgument
(
data
.
get
(
config
.
getAssetAttributeCode
())
!=
null
,
QGExceptionType
.
ASSET_ATTRIBUTE_IS_EMPTY
,
config
.
getAssetAttributeCode
());
// 2019-9-11定位扩展属性允许为空
// QGPreconditions.checkArgument(data.get(config.getAssetAttributeCode()) != null, QGExceptionType.ASSET_ATTRIBUTE_IS_EMPTY, config.getAssetAttributeCode());
if
(
data
.
get
(
config
.
getAssetAttributeCode
())
!=
null
)
{
AssetAttributeExtend
attributeExtend
=
new
AssetAttributeExtend
();
AssetAttributeExtend
attributeExtend
=
new
AssetAttributeExtend
();
attributeExtend
.
setAssetNo
(
asset
.
getAssetNo
());
attributeExtend
.
setAssetNo
(
asset
.
getAssetNo
());
attributeExtend
.
setAssetAttributeName
(
config
.
getAssetAttributeName
());
attributeExtend
.
setAssetAttributeName
(
config
.
getAssetAttributeName
());
...
@@ -121,4 +123,5 @@ public class AssetAttributeServiceImpl implements IAssetAttributeService {
...
@@ -121,4 +123,5 @@ public class AssetAttributeServiceImpl implements IAssetAttributeService {
}
}
}
}
}
}
}
}
}
src/main/java/com/quantgroup/asset/distribution/service/distribute/impl/AssetDistributeServiceImpl.java
View file @
d6c7359f
...
@@ -92,7 +92,7 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
...
@@ -92,7 +92,7 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
if
(
valid
)
{
if
(
valid
)
{
// 先创建记录,避免mq里消息来了就还没创建
// 先创建记录,避免mq里消息来了就还没创建
AssetDistributeRecord
assetDistributeRecord
=
assetDistributeRecordService
.
saveDistributeRecord
(
asset
,
record
,
StatusConstants
.
WAIT
,
ruleType
);
AssetDistributeRecord
assetDistributeRecord
=
assetDistributeRecordService
.
saveDistributeRecord
(
asset
,
record
,
StatusConstants
.
WAIT
,
ruleType
);
int
distributeStatus
=
beginDistribute
(
assetForm
,
asset
,
ruleType
,
assetDistributeRecord
);
int
distributeStatus
=
beginDistribute
(
assetForm
,
asset
,
ruleType
,
assetDistributeRecord
,
data
);
// 分发成功
// 分发成功
if
(
distributeStatus
==
StatusConstants
.
SUCCESS
||
distributeStatus
==
StatusConstants
.
WAIT
)
{
if
(
distributeStatus
==
StatusConstants
.
SUCCESS
||
distributeStatus
==
StatusConstants
.
WAIT
)
{
log
.
info
(
"用户执行分发节点, uuid : {}, bizNo : {}, assetNo : {}, bizChannel : {}, ruleId : {}, ruleName : {}, distributeStatus : {}"
,
log
.
info
(
"用户执行分发节点, uuid : {}, bizNo : {}, assetNo : {}, bizChannel : {}, ruleId : {}, ruleName : {}, distributeStatus : {}"
,
...
@@ -112,7 +112,7 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
...
@@ -112,7 +112,7 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
}
else
{
}
else
{
log
.
info
(
"资产分发开关关闭,直接通知资金系统, uuid : {}, bizNo : {}, assetNo : {}, bizType : {}, bizChannel : {}"
,
log
.
info
(
"资产分发开关关闭,直接通知资金系统, uuid : {}, bizNo : {}, assetNo : {}, bizType : {}, bizChannel : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
(),
assetForm
.
getBizType
(),
assetForm
.
getBizChannel
());
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
(),
assetForm
.
getBizType
(),
assetForm
.
getBizChannel
());
notifyService
.
notifyFundServer
(
assetForm
);
notifyService
.
notifyFundServer
(
assetForm
,
data
);
}
}
}
}
...
@@ -122,14 +122,14 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
...
@@ -122,14 +122,14 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
* @param ruleType
* @param ruleType
* @return 1:成功,2:失败, 3:分配中
* @return 1:成功,2:失败, 3:分配中
*/
*/
public
int
beginDistribute
(
AssetForm
assetForm
,
Asset
asset
,
int
ruleType
,
AssetDistributeRecord
assetDistributeRecord
)
{
public
int
beginDistribute
(
AssetForm
assetForm
,
Asset
asset
,
int
ruleType
,
AssetDistributeRecord
assetDistributeRecord
,
Map
<
String
,
Object
>
data
)
{
try
{
try
{
switch
(
ruleType
)
{
switch
(
ruleType
)
{
case
DistributeConstants
.
RuleType
.
FUND_ROUTE
:
case
DistributeConstants
.
RuleType
.
FUND_ROUTE
:
notifyService
.
notifyFundServer
(
assetForm
);
notifyService
.
notifyFundServer
(
assetForm
,
data
);
return
StatusConstants
.
WAIT
;
return
StatusConstants
.
WAIT
;
case
DistributeConstants
.
RuleType
.
AID_FUND_ROUTE
:
{
case
DistributeConstants
.
RuleType
.
AID_FUND_ROUTE
:
{
GlobalResponse
response
=
aidFundRouteService
.
aidFundRoute
(
assetForm
,
asset
.
getUserLoanType
());
GlobalResponse
response
=
aidFundRouteService
.
aidFundRoute
(
assetForm
,
asset
.
getUserLoanType
()
,
data
);
int
status
=
response
.
getCode
()
==
0
?
StatusConstants
.
SUCCESS
:
StatusConstants
.
FAIL
;
int
status
=
response
.
getCode
()
==
0
?
StatusConstants
.
SUCCESS
:
StatusConstants
.
FAIL
;
// 助贷资金路由目前不从mq里接受终态
// 助贷资金路由目前不从mq里接受终态
assetDistributeRecord
.
setAssetDistributeStatus
(
status
);
assetDistributeRecord
.
setAssetDistributeStatus
(
status
);
...
@@ -137,7 +137,7 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
...
@@ -137,7 +137,7 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
return
status
;
return
status
;
}
}
case
DistributeConstants
.
RuleType
.
DIVERSION
:
case
DistributeConstants
.
RuleType
.
DIVERSION
:
notifyService
.
notifyFundServer
(
assetForm
);
notifyService
.
notifyFundServer
(
assetForm
,
data
);
return
StatusConstants
.
WAIT
;
return
StatusConstants
.
WAIT
;
default
:
default
:
throw
new
QGException
(
QGExceptionType
.
UNKNOW_RULE_TYPE
,
ruleType
);
throw
new
QGException
(
QGExceptionType
.
UNKNOW_RULE_TYPE
,
ruleType
);
...
...
src/main/java/com/quantgroup/asset/distribution/service/funding/IAidFundRouteService.java
View file @
d6c7359f
package
com
.
quantgroup
.
asset
.
distribution
.
service
.
funding
;
package
com
.
quantgroup
.
asset
.
distribution
.
service
.
funding
;
import
java.util.Map
;
import
com.quantgroup.asset.distribution.model.form.AssetForm
;
import
com.quantgroup.asset.distribution.model.form.AssetForm
;
import
com.quantgroup.asset.distribution.model.response.GlobalResponse
;
import
com.quantgroup.asset.distribution.model.response.GlobalResponse
;
...
@@ -15,6 +17,6 @@ public interface IAidFundRouteService {
...
@@ -15,6 +17,6 @@ public interface IAidFundRouteService {
* @param userLoanType
* @param userLoanType
* @return
* @return
*/
*/
GlobalResponse
aidFundRoute
(
AssetForm
assetForm
,
Integer
userLoanType
);
GlobalResponse
aidFundRoute
(
AssetForm
assetForm
,
Integer
userLoanType
,
Map
<
String
,
Object
>
data
);
}
}
src/main/java/com/quantgroup/asset/distribution/service/funding/impl/AidFundRouteServiceImpl.java
View file @
d6c7359f
...
@@ -57,7 +57,7 @@ public class AidFundRouteServiceImpl implements IAidFundRouteService {
...
@@ -57,7 +57,7 @@ public class AidFundRouteServiceImpl implements IAidFundRouteService {
* @return
* @return
*/
*/
@Override
@Override
public
GlobalResponse
aidFundRoute
(
AssetForm
assetForm
,
Integer
userLoanType
)
{
public
GlobalResponse
aidFundRoute
(
AssetForm
assetForm
,
Integer
userLoanType
,
Map
<
String
,
Object
>
data
)
{
//第一步 查询所有助贷资金
//第一步 查询所有助贷资金
List
<
AidLoanFundConfig
>
aidLoanFundConfigList
=
iAidLoanFundConfigService
.
findAll
();
List
<
AidLoanFundConfig
>
aidLoanFundConfigList
=
iAidLoanFundConfigService
.
findAll
();
...
@@ -108,7 +108,7 @@ public class AidFundRouteServiceImpl implements IAidFundRouteService {
...
@@ -108,7 +108,7 @@ public class AidFundRouteServiceImpl implements IAidFundRouteService {
iAidFundRouteRecordService
.
saveAidLoanFundRouteRecord
(
aidLoanFundRouteRecord
);
iAidFundRouteRecordService
.
saveAidLoanFundRouteRecord
(
aidLoanFundRouteRecord
);
//通知资方
//通知资方
Map
<
String
,
String
>
response
=
iHttpService
.
postHasResponse
(
assetForm
.
getCallbackUrl
(),
assetForm
.
transToNotifyMap
());
Map
<
String
,
String
>
response
=
iHttpService
.
postHasResponse
(
assetForm
.
getCallbackUrl
(),
assetForm
.
transToNotifyMap
(
data
));
log
.
info
(
"助贷资金路由-通知资金系统结束,response :{}, uuid : {} , bizNo : {} , callbackUrl:{},params:{}"
,
JSON
.
toJSONString
(
response
),
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getCallbackUrl
(),
JSON
.
toJSONString
(
assetForm
));
log
.
info
(
"助贷资金路由-通知资金系统结束,response :{}, uuid : {} , bizNo : {} , callbackUrl:{},params:{}"
,
JSON
.
toJSONString
(
response
),
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getCallbackUrl
(),
JSON
.
toJSONString
(
assetForm
));
if
(
response
==
null
||
response
.
size
()==
0
||
!
"200"
.
equals
(
response
.
get
(
"statusCode"
))
||
"error"
.
equals
(
response
.
get
(
"response"
)))
{
if
(
response
==
null
||
response
.
size
()==
0
||
!
"200"
.
equals
(
response
.
get
(
"statusCode"
))
||
"error"
.
equals
(
response
.
get
(
"response"
)))
{
...
...
src/main/java/com/quantgroup/asset/distribution/service/notify/INotifyService.java
View file @
d6c7359f
package
com
.
quantgroup
.
asset
.
distribution
.
service
.
notify
;
package
com
.
quantgroup
.
asset
.
distribution
.
service
.
notify
;
import
java.util.Map
;
import
com.quantgroup.asset.distribution.model.form.AssetForm
;
import
com.quantgroup.asset.distribution.model.form.AssetForm
;
/**
/**
...
@@ -13,7 +15,7 @@ public interface INotifyService {
...
@@ -13,7 +15,7 @@ public interface INotifyService {
* 通知资金系统
* 通知资金系统
* @param assetForm
* @param assetForm
*/
*/
public
void
notifyFundServer
(
AssetForm
assetForm
);
public
void
notifyFundServer
(
AssetForm
assetForm
,
Map
<
String
,
Object
>
data
);
/**
/**
* 通知业务流系统
* 通知业务流系统
...
...
src/main/java/com/quantgroup/asset/distribution/service/notify/impl/NotifyServiceImpl.java
View file @
d6c7359f
...
@@ -34,15 +34,16 @@ public class NotifyServiceImpl implements INotifyService{
...
@@ -34,15 +34,16 @@ public class NotifyServiceImpl implements INotifyService{
private
IAlarmService
alarmService
;
private
IAlarmService
alarmService
;
@Override
@Override
public
void
notifyFundServer
(
AssetForm
assetForm
)
{
public
void
notifyFundServer
(
AssetForm
assetForm
,
Map
<
String
,
Object
>
data
)
{
if
(
isDebug
)
{
return
;
}
if
(
isDebug
)
{
return
;
}
log
.
info
(
"通知资金系统结果开始, uuid : {}, bizNo : {}, assetNo : {}, callbackUrl : {}, assetForm : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
(),
assetForm
.
getCallbackUrl
(),
JSON
.
toJSONString
(
assetForm
));
Map
<
String
,
String
>
notifyMap
=
assetForm
.
transToNotifyMap
(
data
);
log
.
info
(
"通知资金系统结果开始, uuid : {}, bizNo : {}, assetNo : {}, callbackUrl : {}, notifyForm : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
(),
assetForm
.
getCallbackUrl
(),
JSON
.
toJSONString
(
notifyMap
));
if
(
StringUtils
.
isEmpty
(
assetForm
.
getCallbackUrl
()))
{
if
(
StringUtils
.
isEmpty
(
assetForm
.
getCallbackUrl
()))
{
log
.
info
(
"通知资金系统结果失败,callbackUrl为空, uuid : {}, bizNo : {}, assetNo : {},
assetForm : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
(),
JSON
.
toJSONString
(
assetForm
));
log
.
info
(
"通知资金系统结果失败,callbackUrl为空, uuid : {}, bizNo : {}, assetNo : {},
notifyForm : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
(),
JSON
.
toJSONString
(
notifyMap
));
return
;
return
;
}
}
Map
<
String
,
String
>
response
=
httpService
.
postHasResponse
(
assetForm
.
getCallbackUrl
(),
assetForm
.
transToNotifyMap
()
);
Map
<
String
,
String
>
response
=
httpService
.
postHasResponse
(
assetForm
.
getCallbackUrl
(),
notifyMap
);
log
.
info
(
"通知资金系统结果结束, uuid : {}, bizNo : {}, assetNo : {}, callbackUrl : {},
assetForm : {}, response : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
(),
assetForm
.
getCallbackUrl
(),
JSON
.
toJSONString
(
assetForm
),
JSON
.
toJSONString
(
response
));
log
.
info
(
"通知资金系统结果结束, uuid : {}, bizNo : {}, assetNo : {}, callbackUrl : {},
notifyForm : {}, response : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
(),
assetForm
.
getCallbackUrl
(),
JSON
.
toJSONString
(
notifyMap
),
JSON
.
toJSONString
(
response
));
if
(
response
==
null
||
response
.
size
()==
0
||
!
"200"
.
equals
(
response
.
get
(
"statusCode"
))
||
"error"
.
equals
(
response
.
get
(
"response"
)))
{
if
(
response
==
null
||
response
.
size
()==
0
||
!
"200"
.
equals
(
response
.
get
(
"statusCode"
))
||
"error"
.
equals
(
response
.
get
(
"response"
)))
{
throw
new
QGException
(
QGExceptionType
.
NOTIFY_FUND_SERVER_ERROR
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
());
throw
new
QGException
(
QGExceptionType
.
NOTIFY_FUND_SERVER_ERROR
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
(),
assetForm
.
getAssetNo
());
}
}
...
...
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