Commit 90836f1b authored by 技术部-韩成龙's avatar 技术部-韩成龙

用户标签和等级枚举修改

parent 58f69cb1
......@@ -9,14 +9,14 @@ import lombok.Getter;
*/
@Getter
public enum UserLevel {
LEVEL1("LEVEL1","等级1"),
LEVEL2("LEVEL2","等级2"),
LEVEL3("LEVEL3","等级3"),
LEVEL4("LEVEL4","等级4"),
LEVEL5("LEVEL5","等级5"),
LEVEL6("LEVEL6","等级6"),
LEVEL7("LEVEL7","等级7"),
NO_LEVEL("NO_LEVEL","无等级");
LEVEL1("level1","等级1"),
LEVEL2("level2","等级2"),
LEVEL3("level3","等级3"),
LEVEL4("level4","等级4"),
LEVEL5("level5","等级5"),
LEVEL6("level6","等级6"),
LEVEL7("level7","等级7"),
NO_LEVEL("no_level","无等级");
private String value;
......
......@@ -9,6 +9,9 @@ import lombok.Getter;
*/
@Getter
public enum UserTag {
/**
* 用户标签
*/
INITIAL_APPLICATION("INITIAL_APPLICATION","首申"),
REAPPLICATION("REAPPLICATION","复申"),
RE_LOAN("RE_LOAN","复贷"),
......@@ -24,4 +27,14 @@ public enum UserTag {
this.value = value;
this.desc = desc;
}
public static UserTag getByOrder(Integer order) {
UserTag[] values = UserTag.values();
for (UserTag value : values) {
if (order.intValue() == value.ordinal()) {
return value;
}
}
return null;
}
}
......@@ -9,6 +9,7 @@ import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;
import com.quantgroup.asset.distribution.constant.AssetAttributeConstants;
import com.quantgroup.asset.distribution.constant.CommonConstants;
import com.quantgroup.asset.distribution.enums.route.UserTag;
import com.quantgroup.asset.distribution.exception.QGException;
import com.quantgroup.asset.distribution.exception.QGExceptionType;
import com.quantgroup.asset.distribution.model.form.AssetForm;
......@@ -246,7 +247,8 @@ public class CoreFilter {
//如果配置不为空,则匹配参数是否符合
if (StringUtils.isNotBlank(channelRuleEntity.getUserLevel())
&& (StringUtils.isEmpty(auditResponce.getCreditLevel()) || !channelRuleEntity.getUserLevel().contains(auditResponce.getCreditLevel()))) {
&& (StringUtils.isEmpty(auditResponce.getCreditLevel())
|| !StringUtils.containsIgnoreCase(channelRuleEntity.getUserLevel(), auditResponce.getCreditLevel()))) {
log.error("CreditLevel不符 userLevel:{}", auditResponce.getCreditLevel());
return Boolean.FALSE;
}
......@@ -266,7 +268,8 @@ public class CoreFilter {
return Boolean.FALSE;
}
String userTag = String.valueOf(data.get(AssetAttributeConstants.USER_LOAN_TYPE_V4));
if (!ruleUserTag.contains(userTag)) {
UserTag userTagEnum = UserTag.getByOrder(Integer.valueOf(userTag));
if (userTagEnum == null || !ruleUserTag.contains(userTagEnum.getValue())) {
log.error("UserTag不符, 特征userTag:{},配置userTag:{}", userTag, ruleUserTag);
return Boolean.FALSE;
}
......
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