|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.jzg.commons.entity.dto.AgreementRulesAddParam;
|
|
import com.jzg.commons.entity.dto.AgreementRulesAddParam;
|
|
|
import com.jzg.commons.entity.dto.AgreementRulesEditParam;
|
|
import com.jzg.commons.entity.dto.AgreementRulesEditParam;
|
|
|
import com.jzg.commons.entity.dto.CostAgreementParam;
|
|
import com.jzg.commons.entity.dto.CostAgreementParam;
|
|
|
|
|
+import com.jzg.commons.entity.dto.RulesGroupParam;
|
|
|
import com.jzg.commons.entity.po.PtlAgreementUndwrtRules;
|
|
import com.jzg.commons.entity.po.PtlAgreementUndwrtRules;
|
|
|
import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
|
|
import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
|
|
|
import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
|
|
import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
|
|
@@ -31,6 +32,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneId;
|
|
import java.time.ZoneId;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Comparator;
|
|
|
|
|
+import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
@@ -93,12 +96,49 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
rulesVo.setCostVoList(costVos);
|
|
rulesVo.setCostVoList(costVos);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // 相同parentId的规则合并为一条,ruleDescription以","拼接
|
|
|
|
|
+ rulesVos = mergeByParentId(rulesVos);
|
|
|
}
|
|
}
|
|
|
return rulesVos;
|
|
return rulesVos;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 承保规则新增
|
|
|
|
|
|
|
+ * 将相同parentId的规则合并为一条,ruleDescription以","拼接
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<AgreementRulesVo> mergeByParentId(List<AgreementRulesVo> rulesVos) {
|
|
|
|
|
+ List<AgreementRulesVo> result = new ArrayList<>();
|
|
|
|
|
+ Map<String, List<AgreementRulesVo>> groupMap = new LinkedHashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+ for (AgreementRulesVo vo : rulesVos) {
|
|
|
|
|
+ String parentId = vo.getParentId();
|
|
|
|
|
+ if (parentId != null && !parentId.isEmpty()) {
|
|
|
|
|
+ groupMap.computeIfAbsent(parentId, k -> new ArrayList<>()).add(vo);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ result.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (List<AgreementRulesVo> group : groupMap.values()) {
|
|
|
|
|
+ if (group.size() == 1) {
|
|
|
|
|
+ result.add(group.get(0));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ AgreementRulesVo merged = group.get(0);
|
|
|
|
|
+ String joinedDesc = group.stream()
|
|
|
|
|
+ .map(AgreementRulesVo::getRuleDescription)
|
|
|
|
|
+ .filter(desc -> desc != null && !desc.isEmpty())
|
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
|
+ merged.setRuleDescription(joinedDesc);
|
|
|
|
|
+ result.add(merged);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ result.sort(Comparator.comparing(AgreementRulesVo::getOrderNum,
|
|
|
|
|
+ Comparator.nullsLast(Comparator.naturalOrder())));
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 承保规则新增(支持批量多条规则属性集合)
|
|
|
*
|
|
*
|
|
|
* @param param 要添加的承保规则
|
|
* @param param 要添加的承保规则
|
|
|
* @return boolean 添加是否成功
|
|
* @return boolean 添加是否成功
|
|
@@ -107,29 +147,46 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean rulesAdd(AgreementRulesAddParam param) {
|
|
public boolean rulesAdd(AgreementRulesAddParam param) {
|
|
|
log.info("添加承保规则:承保明细param=[{}]", JSONUtil.toJsonStr(param));
|
|
log.info("添加承保规则:承保明细param=[{}]", JSONUtil.toJsonStr(param));
|
|
|
|
|
+
|
|
|
// 根据协议id获取最大的序号
|
|
// 根据协议id获取最大的序号
|
|
|
LambdaQueryWrapper<PtlAgreementUndwrtRules> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PtlAgreementUndwrtRules> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(PtlAgreementUndwrtRules::getAgreementId, param.getAgreementId())
|
|
queryWrapper.eq(PtlAgreementUndwrtRules::getAgreementId, param.getAgreementId())
|
|
|
.eq(PtlAgreementUndwrtRules::getIsDelete, 0);
|
|
.eq(PtlAgreementUndwrtRules::getIsDelete, 0);
|
|
|
queryWrapper.orderByDesc(PtlAgreementUndwrtRules::getOrderNum);
|
|
queryWrapper.orderByDesc(PtlAgreementUndwrtRules::getOrderNum);
|
|
|
- queryWrapper.last("LIMIT 1"); // 只取一个结果
|
|
|
|
|
|
|
+ queryWrapper.last("LIMIT 1");
|
|
|
PtlAgreementUndwrtRules maxRules = baseMapper.selectOne(queryWrapper);
|
|
PtlAgreementUndwrtRules maxRules = baseMapper.selectOne(queryWrapper);
|
|
|
- PtlAgreementUndwrtRules rules = new PtlAgreementUndwrtRules();
|
|
|
|
|
- rules.setId(IdGenerate.nextId());
|
|
|
|
|
- rules.setOrderNum(Objects.nonNull(maxRules) ? maxRules.getOrderNum() + 1 : 1);
|
|
|
|
|
- rules.setStartTime(param.getStartTime());
|
|
|
|
|
- rules.setEndTime(param.getEndTime());
|
|
|
|
|
- rules.setAgreementId(param.getAgreementId());
|
|
|
|
|
|
|
+ int startOrderNum = Objects.nonNull(maxRules) ? maxRules.getOrderNum() + 1 : 1;
|
|
|
|
|
|
|
|
- //遍历承保规则属性
|
|
|
|
|
List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
|
|
List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
|
|
|
|
|
+
|
|
|
|
|
+ // 批量模式:存在 rulesGroups 时
|
|
|
|
|
+ if (CollUtil.isNotEmpty(param.getRulesGroups())) {
|
|
|
|
|
+ String parentId = IdGenerate.nextId();
|
|
|
|
|
+ List<RulesGroupParam> groups = param.getRulesGroups();
|
|
|
|
|
+ for (int i = 0; i < groups.size(); i++) {
|
|
|
|
|
+ RulesGroupParam group = groups.get(i);
|
|
|
|
|
+ PtlAgreementUndwrtRules rules = buildRulesRecord(param, parentId, startOrderNum + i);
|
|
|
|
|
+
|
|
|
|
|
+ List<PtlAgreementUndwrtRulesAttrLink> andAttrLinks = processAndAttrs(group.getRulesAttrList(), undwrtRulesAttrList, rules.getId());
|
|
|
|
|
+
|
|
|
|
|
+ if (CollUtil.isNotEmpty(andAttrLinks)) {
|
|
|
|
|
+ agreementUndwrtRulesAttrLinkMapper.insert(andAttrLinks);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ rules.setRuleDescription(buildDesc(andAttrLinks, undwrtRulesAttrList));
|
|
|
|
|
+ baseMapper.insert(rules);
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 兼容旧的单条规则模式
|
|
|
|
|
+ PtlAgreementUndwrtRules rules = buildRulesRecord(param, null, startOrderNum);
|
|
|
List<PtlAgreementUndwrtRulesAttrLink> rulesAttrList = param.getRulesAttrList();
|
|
List<PtlAgreementUndwrtRulesAttrLink> rulesAttrList = param.getRulesAttrList();
|
|
|
List<PtlAgreementUndwrtRulesAttrLink> costsAttrLink = new ArrayList<>();
|
|
List<PtlAgreementUndwrtRulesAttrLink> costsAttrLink = new ArrayList<>();
|
|
|
rulesAttrList.forEach(attr -> {
|
|
rulesAttrList.forEach(attr -> {
|
|
|
-
|
|
|
|
|
- //判断空值
|
|
|
|
|
if(Objects.isNull(attr.getMin()) && Objects.isNull(attr.getMax()) && Objects.isNull(attr.getMinArray())){
|
|
if(Objects.isNull(attr.getMin()) && Objects.isNull(attr.getMax()) && Objects.isNull(attr.getMinArray())){
|
|
|
- PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = undwrtRulesAttrList.stream().filter(x -> x.getAttrCode().equals(attr.getAttrCode())).findFirst().orElse(null);
|
|
|
|
|
|
|
+ PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = undwrtRulesAttrList.stream()
|
|
|
|
|
+ .filter(x -> x.getAttrCode().equals(attr.getAttrCode())).findFirst().orElse(null);
|
|
|
throw new SystemException(ptlAgreementUndwrtRulesAttr.getAttrName() + "规则不能为空,请修改");
|
|
throw new SystemException(ptlAgreementUndwrtRulesAttr.getAttrName() + "规则不能为空,请修改");
|
|
|
}
|
|
}
|
|
|
if (null != attr.getMin() || null != attr.getMax()) {
|
|
if (null != attr.getMin() || null != attr.getMax()) {
|
|
@@ -139,15 +196,98 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
agreementUndwrtRulesAttrLinkMapper.insert(costsAttrLink);
|
|
agreementUndwrtRulesAttrLinkMapper.insert(costsAttrLink);
|
|
|
- //获取费用属性
|
|
|
|
|
rules.setRuleDescription(buildDesc(costsAttrLink, undwrtRulesAttrList));
|
|
rules.setRuleDescription(buildDesc(costsAttrLink, undwrtRulesAttrList));
|
|
|
baseMapper.insert(rules);
|
|
baseMapper.insert(rules);
|
|
|
baseMapper.updateById(rules);
|
|
baseMapper.updateById(rules);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 构建规则的公共字段
|
|
|
|
|
+ */
|
|
|
|
|
+ private PtlAgreementUndwrtRules buildRulesRecord(AgreementRulesAddParam param, String parentId, int orderNum) {
|
|
|
|
|
+ PtlAgreementUndwrtRules rules = new PtlAgreementUndwrtRules();
|
|
|
|
|
+ rules.setId(IdGenerate.nextId());
|
|
|
|
|
+ rules.setOrderNum(orderNum);
|
|
|
|
|
+ rules.setStartTime(param.getStartTime());
|
|
|
|
|
+ rules.setEndTime(param.getEndTime());
|
|
|
|
|
+ rules.setAgreementId(param.getAgreementId());
|
|
|
|
|
+ rules.setParentId(parentId);
|
|
|
|
|
+ return rules;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理并且规则属性
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<PtlAgreementUndwrtRulesAttrLink> processAndAttrs(List<PtlAgreementUndwrtRulesAttrLink> attrs,
|
|
|
|
|
+ List<PtlAgreementUndwrtRulesAttr> attrMetaList,
|
|
|
|
|
+ String rulesId) {
|
|
|
|
|
+ List<PtlAgreementUndwrtRulesAttrLink> result = new ArrayList<>();
|
|
|
|
|
+ if (CollUtil.isEmpty(attrs)) {
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+ attrs.forEach(attr -> {
|
|
|
|
|
+ if (Objects.isNull(attr.getMin()) && Objects.isNull(attr.getMax()) && Objects.isNull(attr.getMinArray())) {
|
|
|
|
|
+ PtlAgreementUndwrtRulesAttr meta = attrMetaList.stream()
|
|
|
|
|
+ .filter(x -> x.getAttrCode().equals(attr.getAttrCode())).findFirst().orElse(null);
|
|
|
|
|
+ throw new SystemException(meta.getAttrName() + "规则不能为空,请修改");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (null != attr.getMin() || null != attr.getMax()) {
|
|
|
|
|
+ attr.setRulesId(rulesId);
|
|
|
|
|
+ attr.setId(null);
|
|
|
|
|
+ result.add(attr);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean rulesEdit(AgreementRulesEditParam param) {
|
|
public boolean rulesEdit(AgreementRulesEditParam param) {
|
|
|
|
|
+ log.info("修改承保规则:承保明细param=[{}]", JSONUtil.toJsonStr(param));
|
|
|
|
|
+
|
|
|
|
|
+ List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
|
|
|
|
|
+
|
|
|
|
|
+ // 批量模式:存在 rulesGroups 时
|
|
|
|
|
+ if (CollUtil.isNotEmpty(param.getRulesGroups())) {
|
|
|
|
|
+ String parentId = param.getParentId();
|
|
|
|
|
+ if (parentId == null || parentId.isEmpty()) {
|
|
|
|
|
+ throw new SystemException("批量模式下父规则ID不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 删除旧的所有子规则及其关联属性
|
|
|
|
|
+ List<AgreementRulesVo> oldRules = baseMapper.queryListByParentId(parentId);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(oldRules)) {
|
|
|
|
|
+ for (AgreementRulesVo oldRule : oldRules) {
|
|
|
|
|
+ agreementUndwrtRulesAttrLinkService.remove(new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttrLink>()
|
|
|
|
|
+ .eq(PtlAgreementUndwrtRulesAttrLink::getRulesId, oldRule.getId()));
|
|
|
|
|
+ baseMapper.deleteById(oldRule.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 重新创建子规则
|
|
|
|
|
+ List<RulesGroupParam> groups = param.getRulesGroups();
|
|
|
|
|
+ for (int i = 0; i < groups.size(); i++) {
|
|
|
|
|
+ RulesGroupParam group = groups.get(i);
|
|
|
|
|
+ PtlAgreementUndwrtRules rules = new PtlAgreementUndwrtRules();
|
|
|
|
|
+ rules.setId(IdGenerate.nextId());
|
|
|
|
|
+ rules.setOrderNum(i + 1);
|
|
|
|
|
+ rules.setStartTime(param.getStartTime());
|
|
|
|
|
+ rules.setEndTime(param.getEndTime());
|
|
|
|
|
+ rules.setAgreementId(param.getAgreementId());
|
|
|
|
|
+ rules.setParentId(parentId);
|
|
|
|
|
+
|
|
|
|
|
+ List<PtlAgreementUndwrtRulesAttrLink> andAttrLinks = processAndAttrs(group.getRulesAttrList(), undwrtRulesAttrList, rules.getId());
|
|
|
|
|
+ if (CollUtil.isNotEmpty(andAttrLinks)) {
|
|
|
|
|
+ agreementUndwrtRulesAttrLinkMapper.insert(andAttrLinks);
|
|
|
|
|
+ }
|
|
|
|
|
+ rules.setRuleDescription(buildDesc(andAttrLinks, undwrtRulesAttrList));
|
|
|
|
|
+ baseMapper.insert(rules);
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 兼容旧的单条规则模式
|
|
|
PtlAgreementUndwrtRules rules = new PtlAgreementUndwrtRules();
|
|
PtlAgreementUndwrtRules rules = new PtlAgreementUndwrtRules();
|
|
|
BeanUtils.copyProperties(param, rules);
|
|
BeanUtils.copyProperties(param, rules);
|
|
|
|
|
|
|
@@ -155,7 +295,7 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
agreementUndwrtRulesAttrLinkService.remove(new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttrLink>()
|
|
agreementUndwrtRulesAttrLinkService.remove(new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttrLink>()
|
|
|
.eq(PtlAgreementUndwrtRulesAttrLink::getRulesId, param.getId()));
|
|
.eq(PtlAgreementUndwrtRulesAttrLink::getRulesId, param.getId()));
|
|
|
|
|
|
|
|
- List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
|
|
|
|
|
|
|
+ List<PtlAgreementUndwrtRulesAttr> attrList = undwrtRulesAttrList;
|
|
|
//再添加属性值
|
|
//再添加属性值
|
|
|
List<PtlAgreementUndwrtRulesAttrLink> costsAttrLinks = param.getRulesAttrList();
|
|
List<PtlAgreementUndwrtRulesAttrLink> costsAttrLinks = param.getRulesAttrList();
|
|
|
List<PtlAgreementUndwrtRulesAttrLink> costsAttrLink = new ArrayList<>();
|
|
List<PtlAgreementUndwrtRulesAttrLink> costsAttrLink = new ArrayList<>();
|
|
@@ -194,16 +334,42 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
PtlAgreementUndwrtRules rules = baseMapper.selectById(ruleId);
|
|
PtlAgreementUndwrtRules rules = baseMapper.selectById(ruleId);
|
|
|
AgreementRulesVo rulesVo = new AgreementRulesVo();
|
|
AgreementRulesVo rulesVo = new AgreementRulesVo();
|
|
|
BeanUtils.copyProperties(rules, rulesVo);
|
|
BeanUtils.copyProperties(rules, rulesVo);
|
|
|
- List<PtlAgreementUndwrtRulesAttrLink> linkList = agreementUndwrtRulesAttrLinkService.queryLinkList(ruleId);
|
|
|
|
|
- // 获取费用因子属性
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 获取费用因子属性(公共逻辑,仅查询一次)
|
|
|
List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
|
|
List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
|
|
|
Map<String, PtlAgreementUndwrtRulesAttr> attrMap = attrList.stream()
|
|
Map<String, PtlAgreementUndwrtRulesAttr> attrMap = attrList.stream()
|
|
|
.collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
|
|
.collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
|
|
|
|
|
+
|
|
|
|
|
+ // 如果存在parentId,查询该parentId下的所有子规则并组装groups
|
|
|
|
|
+ if (rules.getParentId() != null && !rules.getParentId().isEmpty()) {
|
|
|
|
|
+ List<AgreementRulesVo> childRules = baseMapper.queryListByParentId(rules.getParentId());
|
|
|
|
|
+ List<RulesGroupParam> groups = new ArrayList<>();
|
|
|
|
|
+ for (AgreementRulesVo child : childRules) {
|
|
|
|
|
+ List<PtlAgreementUndwrtRulesAttrLink> linkList = agreementUndwrtRulesAttrLinkService.queryLinkList(child.getId());
|
|
|
|
|
+ RulesGroupParam group = new RulesGroupParam();
|
|
|
|
|
+ group.setRulesAttrList(linkList);
|
|
|
|
|
+ group.setCostsAttrLinks(enrichAttrLinks(linkList, attrMap));
|
|
|
|
|
+ groups.add(group);
|
|
|
|
|
+ }
|
|
|
|
|
+ rulesVo.setRulesGroups(groups);
|
|
|
|
|
+ return rulesVo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 单条规则模式
|
|
|
|
|
+ List<PtlAgreementUndwrtRulesAttrLink> linkList = agreementUndwrtRulesAttrLinkService.queryLinkList(ruleId);
|
|
|
|
|
+ rulesVo.setCostsAttrLinks(enrichAttrLinks(linkList, attrMap));
|
|
|
|
|
+ return rulesVo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 将属性链接丰富为完整的属性对象
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<PtlAgreementUndwrtRulesAttr> enrichAttrLinks(List<PtlAgreementUndwrtRulesAttrLink> linkList,
|
|
|
|
|
+ Map<String, PtlAgreementUndwrtRulesAttr> attrMap) {
|
|
|
List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
|
|
List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
|
|
|
linkList.forEach(link -> {
|
|
linkList.forEach(link -> {
|
|
|
- if(attrMap.containsKey(link.getAttrCode())) {
|
|
|
|
|
- PtlAgreementUndwrtRulesAttr attr= attrMap.get(link.getAttrCode());
|
|
|
|
|
- //处理多选和下拉
|
|
|
|
|
|
|
+ if (attrMap.containsKey(link.getAttrCode())) {
|
|
|
|
|
+ PtlAgreementUndwrtRulesAttr attr = attrMap.get(link.getAttrCode());
|
|
|
if ("checkbox".equals(attr.getAttrType()) || "select".equals(attr.getAttrType()) || "inputTag".equals(attr.getAttrType())) {
|
|
if ("checkbox".equals(attr.getAttrType()) || "select".equals(attr.getAttrType()) || "inputTag".equals(attr.getAttrType())) {
|
|
|
if (null != link.getMin()) {
|
|
if (null != link.getMin()) {
|
|
|
attr.setId(link.getId());
|
|
attr.setId(link.getId());
|
|
@@ -211,7 +377,7 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
attr.setMax(link.getMax());
|
|
attr.setMax(link.getMax());
|
|
|
attr.setOperator(link.getOperator());
|
|
attr.setOperator(link.getOperator());
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
attr.setId(link.getId());
|
|
attr.setId(link.getId());
|
|
|
attr.setMin(link.getMin());
|
|
attr.setMin(link.getMin());
|
|
|
attr.setMax(link.getMax());
|
|
attr.setMax(link.getMax());
|
|
@@ -219,10 +385,14 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
}
|
|
}
|
|
|
newAttrList.add(attr);
|
|
newAttrList.add(attr);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
- rulesVo.setCostsAttrLinks(newAttrList);
|
|
|
|
|
- return rulesVo;
|
|
|
|
|
|
|
+ return newAttrList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<AgreementRulesVo> queryListByParentId(String parentId) {
|
|
|
|
|
+ log.info("根据父ID查询协议承保规则列表。 parentId=[{}]", parentId);
|
|
|
|
|
+ return baseMapper.queryListByParentId(parentId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|