Commit 6513028b authored by 郑建's avatar 郑建

Merge branch 'specialUserList' into 'master'

Special user list

See merge request !13
parents c2d8a6a5 9022b1de
......@@ -68,6 +68,11 @@ public class AssetForm implements Serializable{
private String allowInstalment;
private String allowInstalmentTerms;
/**
* 特殊用户名单
*/
private String specialUserList;
public Asset transToAsset() {
Asset asset = new Asset();
......@@ -123,7 +128,7 @@ public class AssetForm implements Serializable{
}
dataMap.put("user_loan_type", data.get("user_loan_type"));
notifyMap.put("dataMap", JSON.toJSONString(dataMap));
notifyMap.put("specialUserList",specialUserList);
return notifyMap;
}
......
......@@ -22,7 +22,6 @@ import com.quantgroup.asset.distribution.service.jpa.entity.Asset;
import com.quantgroup.asset.distribution.service.niwodai.INiwodaiAssetService;
import com.quantgroup.asset.distribution.service.niwodai.INiwodaiService;
import com.quantgroup.asset.distribution.service.niwodai.vo.*;
import javafx.scene.paint.Stop;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......
package com.quantgroup.asset.distribution.service.notify.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.common.collect.ImmutableMap;
import com.quantgroup.asset.distribution.service.asset.IBizAssetOrderService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -29,6 +31,8 @@ public class NotifyServiceImpl implements INotifyService{
private Boolean isDebug;
@Value("${business.flow.url}")
private String businessFlowURL;
@Value("${rule.engine.url}")
private String ruleEngineURL;
@Autowired
private IHttpService httpService;
......@@ -53,6 +57,21 @@ public class NotifyServiceImpl implements INotifyService{
throw new QGException(QGExceptionType.NOTIFY_FUND_SERVER_ERROR, assetForm.getUuid(), assetForm.getBizNo(), assetForm.getAssetNo());
} else {
bizAssetOrderService.finishAssetOrder(assetForm);
//通知规则的引擎将白名单置为失效
if ("1".equals(assetForm.getSpecialUserList())){
notifyRuleEngine(assetForm);
}
}
}
private void notifyRuleEngine(AssetForm assetForm) {
//现在只有一个多个加个逗号隔开
String key = "specialUserList";
log.info("通知量子魔方将对应白名单置为失效开始, uuid : {}, bizNo : {}, assetNo : {}, key : {} ", assetForm.getUuid(), assetForm.getBizNo(), assetForm.getAssetNo(), key);
Map<String, String> response = httpService.postHasResponse(ruleEngineURL + "/callback/event/specialUserList", ImmutableMap.of("keys",key,"uuid",assetForm.getUuid()));
if(response==null || response.size()==0 || !"200".equals(response.get("statusCode")) || (!"0".equals(response.get("code")))) {
log.error("通知量子魔方将对应白名单置为失效失败 , uuid : {}, bizNo : {}, assetNo : {}, key : {} ,response : {}", assetForm.getUuid(), assetForm.getBizNo(), assetForm.getAssetNo(), key,JSON.toJSONString(response));
alarmService.dingtalkAlarm("Warn", "通知量子魔方使白名单失效异常", "uuid : "+ assetForm.getUuid() +"bizNo : " + assetForm.getBizNo());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment