|
@@ -91,6 +91,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
* 保存风控配置
|
|
* 保存风控配置
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Result<?> saveConfig(RiskConfigParam param) {
|
|
public Result<?> saveConfig(RiskConfigParam param) {
|
|
|
List<RiskConfigListParam> configList = param.getConfigList();
|
|
List<RiskConfigListParam> configList = param.getConfigList();
|
|
|
if(CollUtil.isEmpty(param.getConfigList())){
|
|
if(CollUtil.isEmpty(param.getConfigList())){
|
|
@@ -244,6 +245,39 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
return Result.resultObjOk(configMapper.getTemplateView(templateId,channelId));
|
|
return Result.resultObjOk(configMapper.getTemplateView(templateId,channelId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 修改风控配置模版
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public Result<?> updateConfig(RiskConfigParam param) {
|
|
|
|
|
+ YtRiskTemplate old = configMapper.selectOneTemplate(param.getTemplateId());
|
|
|
|
|
+ if(Objects.isNull(old)){
|
|
|
|
|
+ return Result.resultErr(RepMessage.OBJECT_NOT_EXIST);
|
|
|
|
|
+ }
|
|
|
|
|
+ //修改配置值
|
|
|
|
|
+ List<RiskConfigListParam> configList = param.getConfigList();
|
|
|
|
|
+ StringBuilder content = new StringBuilder();
|
|
|
|
|
+ for (RiskConfigListParam listParam : configList) {
|
|
|
|
|
+ YtRiskConfig config = new YtRiskConfig();
|
|
|
|
|
+ config.setConfigId(listParam.getConfigId());
|
|
|
|
|
+ config.setConfigVal(listParam.getConfigVal());
|
|
|
|
|
+ configMapper.updateConfigVal(config);
|
|
|
|
|
+ String format = String.format(config.getFieldDesc(), config.getConfigVal());
|
|
|
|
|
+ if(StrUtil.isNotBlank(format)){
|
|
|
|
|
+ content.append(format).append(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //同步修改配置模版内容
|
|
|
|
|
+ YtRiskTemplate template = new YtRiskTemplate();
|
|
|
|
|
+ BeanUtil.copyProperties(param,template);
|
|
|
|
|
+ template.setTemplateContent(content.toString());
|
|
|
|
|
+ template.setUpdateTime(new Date());
|
|
|
|
|
+ template.setUpdateUserId(param.getChannelId());
|
|
|
|
|
+ configMapper.updateByTempId(template);
|
|
|
|
|
+ return Result.resultOk(RepMessage.MODIFY_SUCCESS);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改用户信息
|
|
* 修改用户信息
|
|
|
*/
|
|
*/
|