|
|
@@ -18,6 +18,7 @@ import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
|
import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
|
|
|
import com.jzg.commons.entity.vo.*;
|
|
|
import com.jzg.quotation.commons.client.OrgClient;
|
|
|
+import com.jzg.quotation.summary.aop.FactorMatch;
|
|
|
import com.jzg.quotation.summary.service.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.aspectj.lang.JoinPoint;
|
|
|
@@ -104,59 +105,13 @@ public class QuoteVerificationAspect {
|
|
|
costAgreementParam.setPtlAgreementId(insOrders.getAgreementId());
|
|
|
costAgreementParam.setProductId(insOrders.getProductId());
|
|
|
List<CostsListVo> costsList = orgClient.queryByAgreementIdAndProductId(costAgreementParam, baseController.getToken());
|
|
|
- List<CostsListVo> agreementProductCosts = new ArrayList<>();
|
|
|
- // 通过费用规则遍历 按优先级匹配 校验通过的费用
|
|
|
- costsList.forEach(costsListVo -> {
|
|
|
- AtomicBoolean matching = new AtomicBoolean(true);
|
|
|
- costsListVo.getPtlAgreementCostRuleList().forEach(ptlAgreementCostRule -> {
|
|
|
- //判断能源类型是 燃油/新能源
|
|
|
- if (ptlAgreementCostRule.getAttrCode().equals("NewEnergyMark")) {
|
|
|
- String energyType = EnergyTypeCode.isNewEnergy(insOrdersCarInfo.getEnergyTypeCode()) ? "1" : "0";
|
|
|
- if(!ptlAgreementCostRule.getMin().equals(energyType)) {
|
|
|
- matching.set(false);
|
|
|
- }
|
|
|
- }
|
|
|
- //判断使用性质是 营业/非营业
|
|
|
- if (ptlAgreementCostRule.getAttrCode().equals("CarNatureCode")) {
|
|
|
- String[] split = ptlAgreementCostRule.getMin().split(",");
|
|
|
- boolean isPipei = false;
|
|
|
- for(int i = 0;i < split.length; i++){
|
|
|
- if(split[i].equals(insOrdersCarInfo.getCarNatureCode())) {
|
|
|
- isPipei = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!isPipei){
|
|
|
- matching.set(false);
|
|
|
- }
|
|
|
- }
|
|
|
- //车辆种类是 客车/货车
|
|
|
- if(ptlAgreementCostRule.getAttrCode().equals("CarKindCode")) {
|
|
|
- String[] split = ptlAgreementCostRule.getMin().split(",");
|
|
|
- boolean isPipei = false;
|
|
|
- for(int i = 0;i < split.length; i++){
|
|
|
- if(split[i].equals(insOrdersCarInfo.getCarKindCode())) {
|
|
|
- isPipei = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!isPipei){
|
|
|
- matching.set(false);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- if(matching.get()){
|
|
|
- agreementProductCosts.add(costsListVo);
|
|
|
- }
|
|
|
- });
|
|
|
- // 若优先级为空 添加优先级
|
|
|
- for (int i = 0; i < agreementProductCosts.size(); i++) {
|
|
|
- if (agreementProductCosts.get(i).getPriorityLevel() == null) {
|
|
|
- agreementProductCosts.get(i).setPriorityLevel(10);
|
|
|
- }
|
|
|
- }
|
|
|
+ //先过滤 能源 车辆类型
|
|
|
+ List<CostsListVo> agreementProductCosts = this.beforeFilter(costsList,insOrdersCarInfo);
|
|
|
+ // 设置默认的优先级
|
|
|
+ agreementProductCosts = this.setPriorities(agreementProductCosts);
|
|
|
+
|
|
|
if (!agreementProductCosts.isEmpty()) {
|
|
|
- //按优先级进行排序
|
|
|
- agreementProductCosts.sort(Comparator.comparingInt(CostsListVo::getPriorityLevel));
|
|
|
- //遍历费用因子l
|
|
|
+ //遍历费用因子
|
|
|
String costId = verificationCosts(agreementProductCosts, logs, insOrdersOther, insOrdersCarInfo, insOrdersRisks,
|
|
|
insOrdersCarUserInfos, kindList, insOrdersCosts, insOrdersAccidentalDriving, insOrders);
|
|
|
if (costId != null) {
|
|
|
@@ -172,6 +127,73 @@ public class QuoteVerificationAspect {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 最开始的过滤 过滤 能源 车辆类型
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<CostsListVo> beforeFilter(List<CostsListVo> costsList, InsOrdersCarInfo insOrdersCarInfo){
|
|
|
+ List<CostsListVo> agreementProductCosts = new ArrayList<>();
|
|
|
+ costsList.forEach(costsListVo -> {
|
|
|
+ AtomicBoolean matching = new AtomicBoolean(true);
|
|
|
+ costsListVo.getPtlAgreementCostRuleList().forEach(ptlAgreementCostRule -> {
|
|
|
+ //判断能源类型是 燃油/新能源
|
|
|
+ if (ptlAgreementCostRule.getAttrCode().equals("NewEnergyMark")) {
|
|
|
+ String energyType = EnergyTypeCode.isNewEnergy(insOrdersCarInfo.getEnergyTypeCode()) ? "1" : "0";
|
|
|
+ if(!ptlAgreementCostRule.getMin().equals(energyType)) {
|
|
|
+ matching.set(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断使用性质是 营业/非营业
|
|
|
+ if (ptlAgreementCostRule.getAttrCode().equals("CarNatureCode")) {
|
|
|
+ String[] split = ptlAgreementCostRule.getMin().split(",");
|
|
|
+ boolean isPipei = false;
|
|
|
+ for(int i = 0;i < split.length; i++){
|
|
|
+ if(split[i].equals(insOrdersCarInfo.getCarNatureCode())) {
|
|
|
+ isPipei = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isPipei){
|
|
|
+ matching.set(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //车辆种类是 客车/货车
|
|
|
+ if(ptlAgreementCostRule.getAttrCode().equals("CarKindCode")) {
|
|
|
+ String[] split = ptlAgreementCostRule.getMin().split(",");
|
|
|
+ boolean isPipei = false;
|
|
|
+ for(int i = 0;i < split.length; i++){
|
|
|
+ if(split[i].equals(insOrdersCarInfo.getCarKindCode())) {
|
|
|
+ isPipei = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isPipei){
|
|
|
+ matching.set(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(matching.get()){
|
|
|
+ agreementProductCosts.add(costsListVo);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return agreementProductCosts;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置默认优先级
|
|
|
+ * @param agreementProductCosts
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<CostsListVo> setPriorities(List<CostsListVo> agreementProductCosts){
|
|
|
+ for (int i = 0; i < agreementProductCosts.size(); i++) {
|
|
|
+ if (agreementProductCosts.get(i).getPriorityLevel() == null) {
|
|
|
+ agreementProductCosts.get(i).setPriorityLevel(10);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 排序
|
|
|
+ agreementProductCosts.sort(Comparator.comparingInt(CostsListVo::getPriorityLevel));
|
|
|
+ return agreementProductCosts;
|
|
|
+ }
|
|
|
+
|
|
|
private String verificationCosts(List<CostsListVo> agreementProductCosts,StringBuilder logs,
|
|
|
InsOrdersOther insOrdersOther, InsOrdersCarInfo insOrdersCarInfo,
|
|
|
List<InsOrdersRisk> riskList, List<InsOrdersCarUserInfo> insOrdersCarUserInfos,
|
|
|
@@ -197,7 +219,7 @@ public class QuoteVerificationAspect {
|
|
|
// log.debug("费用因子备注:" + agreementProductCosts.get(i).getCostsDescription());
|
|
|
// logs.append("费用id:" + agreementProductCosts.get(i).getId() + "\n");
|
|
|
// logs.append("费用因子描述:" + agreementProductCosts.get(i).getCostsDescription() + "\n");
|
|
|
- if (judgements(agreementProductCosts.get(i).getPtlAgreementCostRuleList(),ruleAttrMappingVoList,undwrtRulesAttrList,logs)) {
|
|
|
+ if (FactorMatch.judgements(agreementProductCosts.get(i).getPtlAgreementCostRuleList(),ruleAttrMappingVoList,undwrtRulesAttrList,logs)) {
|
|
|
return agreementProductCosts.get(i).getId();
|
|
|
}
|
|
|
log.debug("当前费用因子匹配结束\n");
|
|
|
@@ -205,483 +227,6 @@ public class QuoteVerificationAspect {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 费用因子的对比
|
|
|
- */
|
|
|
- private boolean judgements(List<PtlAgreementCostRule> ptlAgreementCostRuleList,List<RuleAttrMappingVo> ruleAttrMappingVoList, List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList,StringBuilder logs) {
|
|
|
- boolean useFlag = true;
|
|
|
- for (PtlAgreementCostRule ptlAgreementProductCostsAttrLink : ptlAgreementCostRuleList) {
|
|
|
- //查找规则中的 传值属性
|
|
|
- RuleAttrMappingVo ruleAttrMappingVo = ruleAttrMappingVoList.stream()
|
|
|
- .filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLink.getAttrCode()))
|
|
|
- .findFirst()
|
|
|
- .orElse(null);
|
|
|
- //如果查找不到 传值属性 直接费用对比失败
|
|
|
- if (ruleAttrMappingVo == null) {
|
|
|
- log.debug("传入的值找不到该属性:" + ptlAgreementProductCostsAttrLink.getAttrCode());
|
|
|
- log.debug("规则匹配失败:" + ptlAgreementProductCostsAttrLink.getAttrCode());
|
|
|
-
|
|
|
- List<PtlAgreementUndwrtRulesAttr> collect = undwrtRulesAttrList.stream()
|
|
|
- .filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLink.getAttrCode()))
|
|
|
- .toList();
|
|
|
- if (!collect.isEmpty()) {
|
|
|
- logs.append("规则匹配失败:" + collect.get(0).getAttrName() + "\n");
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //查找 费用因子规则
|
|
|
- PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = undwrtRulesAttrList.stream()
|
|
|
- .filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLink.getAttrCode()))
|
|
|
- .findFirst()
|
|
|
- .get();
|
|
|
-
|
|
|
- if(!Objects.isNull(ruleAttrMappingVo.getValue())) {
|
|
|
- useFlag = attrEqual(ptlAgreementProductCostsAttrLink, ptlAgreementUndwrtRulesAttr, ruleAttrMappingVo.getValue());
|
|
|
- }else{
|
|
|
- useFlag = false;
|
|
|
- }
|
|
|
-
|
|
|
- if (!useFlag) {
|
|
|
- log.debug("检验的值:" + ptlAgreementProductCostsAttrLink.getMin());
|
|
|
- log.debug("传入的值:" + ruleAttrMappingVo.getValue());
|
|
|
- log.debug("规则匹配失败:" + ptlAgreementProductCostsAttrLink.getAttrCode());
|
|
|
-
|
|
|
-
|
|
|
- List<PtlAgreementUndwrtRulesAttr> collect = undwrtRulesAttrList.stream()
|
|
|
- .filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLink.getAttrCode()))
|
|
|
- .toList();
|
|
|
-
|
|
|
- if (ptlAgreementProductCostsAttrLink.getMin() != null) {
|
|
|
- logs.append("检验的值:" + ptlAgreementProductCostsAttrLink.getMin() + "\n");
|
|
|
- } else {
|
|
|
- logs.append("检验的值:" + ptlAgreementProductCostsAttrLink.getMax() + "\n");
|
|
|
- }
|
|
|
-
|
|
|
- logs.append("传入的值:" + ruleAttrMappingVo.getValue() + "\n");
|
|
|
-
|
|
|
- if (!collect.isEmpty()) {
|
|
|
- logs.append("<span style=\"color:red;\">规则匹配失败:" + collect.get(0).getAttrName() + "</span>\n");
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- return useFlag;
|
|
|
- }
|
|
|
- private boolean attrEqual(PtlAgreementCostRule ptlAgreementCostRule,
|
|
|
- PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr, String value) {
|
|
|
- if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("checkbox")) {
|
|
|
- return checkBoxEqual(ptlAgreementCostRule, value);
|
|
|
- } else if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("inputNumber")) {
|
|
|
- return inputNumberEqual(ptlAgreementCostRule, value);
|
|
|
- } else if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("input")) {
|
|
|
- //截取身份证号码
|
|
|
- if (ptlAgreementCostRule.getAttrCode().equals("CarOwnersIDNumber") || ptlAgreementCostRule.getAttrCode().equals("ApplicantIDNumber") ||
|
|
|
- ptlAgreementCostRule.getAttrCode().equals("InsuredIDNumber")) {
|
|
|
- value = value.substring(0, ptlAgreementCostRule.getMin().length());
|
|
|
- }
|
|
|
- return inputTextEqual(ptlAgreementCostRule, value);
|
|
|
- } else if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("select")) {
|
|
|
- //截取车牌
|
|
|
- if (ptlAgreementUndwrtRulesAttr.getAttrCode().equals("LicenseNo")) {
|
|
|
- value = value.substring(0, 2);
|
|
|
- }
|
|
|
- return selectEqual(ptlAgreementCostRule, value);
|
|
|
- } else if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("radio")) {
|
|
|
- return radioEqual(ptlAgreementCostRule, value);
|
|
|
- } else if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("datetime")){ // 时间
|
|
|
- return dateTimeEqual(ptlAgreementCostRule, value);
|
|
|
- } else if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("date")){
|
|
|
- return dateEqual(ptlAgreementCostRule, value);
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 属性为多选判断
|
|
|
- */
|
|
|
- private boolean checkBoxEqual(PtlAgreementCostRule ptlAgreementCostRule, String value) {
|
|
|
- String[] split = ptlAgreementCostRule.getMin().split(",");
|
|
|
- for (String sp : split) {
|
|
|
- if (sp.equals(value)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- private boolean checkBoxEqual(PtlAgreementUndwrtRulesAttrLink ptlAgreementUndwrtRulesAttrLink, String value) {
|
|
|
- if (!ptlAgreementUndwrtRulesAttrLink.getMin().equals(value)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 属性为数值型判断
|
|
|
- */
|
|
|
- private boolean inputNumberEqual(PtlAgreementCostRule ptlAgreementCostRule, String value) {
|
|
|
- double v = Double.parseDouble(value);
|
|
|
- //统一处理数值
|
|
|
- if ("1".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementCostRule.getMin()) <= v &&
|
|
|
- Double.parseDouble(ptlAgreementCostRule.getMax()) >= v) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("2".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementCostRule.getMin()) > v) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("3".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementCostRule.getMin()) >= v) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("4".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementCostRule.getMax()) < v) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("5".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementCostRule.getMax()) <= v) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- private boolean inputNumberEqual(PtlAgreementUndwrtRulesAttrLink ptlAgreementUndwrtRulesAttrLink, String value) {
|
|
|
- double v = Double.parseDouble(value);
|
|
|
- //统一处理数值
|
|
|
- if ("1".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementUndwrtRulesAttrLink.getMin()) <= v &&
|
|
|
- Double.parseDouble(ptlAgreementUndwrtRulesAttrLink.getMax()) >= v) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else if ("2".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementUndwrtRulesAttrLink.getMin()) > v) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else if ("3".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementUndwrtRulesAttrLink.getMin()) >= v) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else if ("4".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementUndwrtRulesAttrLink.getMax()) < v) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else if ("5".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (Double.parseDouble(ptlAgreementUndwrtRulesAttrLink.getMax()) <= v) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 属性为输入框判断
|
|
|
- */
|
|
|
- private boolean inputTextEqual(PtlAgreementCostRule ptlAgreementCostRule, String value) {
|
|
|
- //将值进行分割
|
|
|
- String[] split = ptlAgreementCostRule.getMin().split(",");
|
|
|
- AtomicBoolean returnBool = new AtomicBoolean(false);
|
|
|
-
|
|
|
- List<String> equalsMap = new ArrayList<>();
|
|
|
- //字符型评分
|
|
|
- equalsMap.add("CharacterBasedRating");
|
|
|
- //交强字符型评分
|
|
|
- equalsMap.add("JqCharacterBasedRating");
|
|
|
- //商业字符型评分
|
|
|
- equalsMap.add("SyCharacterBasedRating");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //equest 等于判断
|
|
|
- if(equalsMap.contains(ptlAgreementCostRule.getAttrCode())){
|
|
|
- boolean b = Arrays.stream(split).anyMatch(value::equals);
|
|
|
- returnBool.set(b);
|
|
|
- }else if((ptlAgreementCostRule.getAttrCode().equals("BrandandModel") || ptlAgreementCostRule.getAttrCode().equals("CarOwnerName")
|
|
|
- || ptlAgreementCostRule.getAttrCode().equals("CarOwnersAddress") || ptlAgreementCostRule.getAttrCode().equals("ApplicantAddress")
|
|
|
- || ptlAgreementCostRule.getAttrCode().equals("InsuredAddress"))
|
|
|
- && ptlAgreementCostRule.getOperator().equals("2")){
|
|
|
- //处理品牌型号 不包含的情况
|
|
|
- boolean anyMatch = Arrays.stream(split)
|
|
|
- .anyMatch(value::contains);
|
|
|
- returnBool.set(!anyMatch);
|
|
|
- }else {
|
|
|
- boolean anyMatch = Arrays.stream(split)
|
|
|
- .anyMatch(value::contains);
|
|
|
- returnBool.set(anyMatch);
|
|
|
- }
|
|
|
- return returnBool.get();
|
|
|
- }
|
|
|
-
|
|
|
- private boolean inputTextEqual(PtlAgreementUndwrtRulesAttrLink ptlAgreementUndwrtRulesAttrLink, String value) {
|
|
|
- //将值进行分割
|
|
|
- String[] split = ptlAgreementUndwrtRulesAttrLink.getMin().split(",");
|
|
|
- AtomicBoolean returnBool = new AtomicBoolean(false);
|
|
|
-
|
|
|
- List<String> equalsMap = new ArrayList<>();
|
|
|
- //字符型评分
|
|
|
- equalsMap.add("CharacterBasedRating");
|
|
|
- //交强字符型评分
|
|
|
- equalsMap.add("JqCharacterBasedRating");
|
|
|
- //商业字符型评分
|
|
|
- equalsMap.add("SyCharacterBasedRating");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //equest 等于判断
|
|
|
- if(equalsMap.contains(ptlAgreementUndwrtRulesAttrLink.getAttrCode())){
|
|
|
- boolean b = Arrays.stream(split).anyMatch(value::equals);
|
|
|
- returnBool.set(b);
|
|
|
- }else if((ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("BrandandModel") || ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("CarOwnerName")
|
|
|
- || ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("CarOwnersAddress") || ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("ApplicantAddress")
|
|
|
- || ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("InsuredAddress"))
|
|
|
- && ptlAgreementUndwrtRulesAttrLink.getOperator().equals("2")){
|
|
|
- //处理品牌型号 不包含的情况
|
|
|
- boolean anyMatch = Arrays.stream(split)
|
|
|
- .anyMatch(value::contains);
|
|
|
- returnBool.set(!anyMatch);
|
|
|
- }else {
|
|
|
- boolean anyMatch = Arrays.stream(split)
|
|
|
- .anyMatch(value::contains);
|
|
|
- returnBool.set(anyMatch);
|
|
|
- }
|
|
|
- return !returnBool.get();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 属性为下拉框判断
|
|
|
- */
|
|
|
- private boolean selectEqual(PtlAgreementCostRule ptlAgreementCostRule, String value) {
|
|
|
- if (ptlAgreementCostRule.getMin() != null && ptlAgreementCostRule.getMin().contains(value)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 属性为选择框判断
|
|
|
- *
|
|
|
- * @param ptlAgreementUndwrtRulesAttrLink
|
|
|
- * @param value
|
|
|
- * @return
|
|
|
- */
|
|
|
- private boolean selectEqual(PtlAgreementUndwrtRulesAttrLink ptlAgreementUndwrtRulesAttrLink, String value) {
|
|
|
- if (ptlAgreementUndwrtRulesAttrLink.getMin() == null) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!ptlAgreementUndwrtRulesAttrLink.getMin().contains(value)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 属性为单选框判断
|
|
|
- */
|
|
|
- private boolean radioEqual(PtlAgreementCostRule ptlAgreementCostRule, String value) {
|
|
|
- //新能源判断
|
|
|
- if ("NewEnergy".equals(ptlAgreementCostRule.getAttrCode())) {
|
|
|
- // 是否是新能源车
|
|
|
- boolean newEnergy = EnergyTypeCode.isNewEnergy(value);
|
|
|
- if (newEnergy && ptlAgreementCostRule.getMin().equals("1")) {
|
|
|
- return true;
|
|
|
- } else if (!newEnergy && ptlAgreementCostRule.getMin().equals("0")) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if (ptlAgreementCostRule.getMin().contains(value)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- private boolean radioEqual(PtlAgreementUndwrtRulesAttrLink ptlAgreementUndwrtRulesAttrLink, String value) {
|
|
|
- //新能源判断
|
|
|
- if ("NewEnergy".equals(ptlAgreementUndwrtRulesAttrLink.getAttrCode())) {
|
|
|
- // 是否是新能源车
|
|
|
- boolean newEnergy = EnergyTypeCode.isNewEnergy(value);
|
|
|
- if (newEnergy && ptlAgreementUndwrtRulesAttrLink.getMin().equals("1")) {
|
|
|
- return false;
|
|
|
- } else if (!newEnergy && ptlAgreementUndwrtRulesAttrLink.getMin().equals("0")) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else if (ptlAgreementUndwrtRulesAttrLink.getMin().contains(value)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- public boolean dateTimeEqual(PtlAgreementCostRule ptlAgreementCostRule, String value){
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- if(Objects.isNull(value) || value.equals("")){
|
|
|
- return false;
|
|
|
- }
|
|
|
- LocalDateTime v = LocalDateTime.parse(value,formatter);
|
|
|
- LocalDateTime min = null,max = null;
|
|
|
- if(!Objects.isNull(ptlAgreementCostRule.getMin())){
|
|
|
- min = LocalDateTime.parse(ptlAgreementCostRule.getMin(),formatter);
|
|
|
- }
|
|
|
- if(!Objects.isNull(ptlAgreementCostRule.getMax())){
|
|
|
- max = LocalDateTime.parse(ptlAgreementCostRule.getMax(),formatter);
|
|
|
- }
|
|
|
-
|
|
|
- //统一处理数值
|
|
|
- if ("1".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isAfter(min) && v.isBefore(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("2".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isBefore(min)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("3".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isBefore(min) || v.isEqual(min)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("4".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isAfter(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("5".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isAfter(max) || v.isEqual(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public boolean dateEqual(PtlAgreementCostRule ptlAgreementCostRule, String value){
|
|
|
-// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- if(Objects.isNull(value) || value.equals("")){
|
|
|
- return false;
|
|
|
- }
|
|
|
- LocalDateTime v = LocalDate.parse(value).atStartOfDay();
|
|
|
- LocalDateTime min = null,max = null;
|
|
|
- if(!Objects.isNull(ptlAgreementCostRule.getMin())){
|
|
|
- min = LocalDate.parse(ptlAgreementCostRule.getMin()).atStartOfDay();
|
|
|
- }
|
|
|
- if(!Objects.isNull(ptlAgreementCostRule.getMax())){
|
|
|
- max = LocalDate.parse(ptlAgreementCostRule.getMax()).atStartOfDay();
|
|
|
- }
|
|
|
-
|
|
|
- //统一处理数值
|
|
|
- if ("1".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isAfter(min) && v.isBefore(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("2".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isBefore(min)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("3".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isBefore(min) || v.isEqual(min)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("4".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isAfter(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("5".equals(ptlAgreementCostRule.getOperator())) {
|
|
|
- if (v.isAfter(max) || v.isEqual(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public boolean dateTimeEqual(PtlAgreementUndwrtRulesAttrLink ptlAgreementUndwrtRulesAttrLink, String value, InsOrders insOrders){
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- //判断险种 的起保时间
|
|
|
- if(ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("SyStartTime") || ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("JqStartTime"))
|
|
|
- {
|
|
|
- if(insOrders.getProductId().equals(ProductsType.PT_0330.getCode()) && ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("SyStartTime")){
|
|
|
- return true;
|
|
|
- }
|
|
|
- if(insOrders.getProductId().equals(ProductsType.PT_034001.getCode()) && ptlAgreementUndwrtRulesAttrLink.getAttrCode().equals("JqStartTime")){
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!Objects.isNull(value) && !value.isEmpty()) {
|
|
|
- LocalDateTime v = LocalDateTime.parse(value, formatter);
|
|
|
- LocalDateTime min = null, max = null;
|
|
|
- if (!Objects.isNull(ptlAgreementUndwrtRulesAttrLink.getMin())) {
|
|
|
- min = LocalDateTime.parse(ptlAgreementUndwrtRulesAttrLink.getMin(), formatter);
|
|
|
- }
|
|
|
- if (!Objects.isNull(ptlAgreementUndwrtRulesAttrLink.getMax())) {
|
|
|
- max = LocalDateTime.parse(ptlAgreementUndwrtRulesAttrLink.getMax(), formatter);
|
|
|
- }
|
|
|
-
|
|
|
- //统一处理数值
|
|
|
- if ("1".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isAfter(min) && v.isBefore(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("2".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isBefore(min)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("3".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isBefore(min)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("4".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isAfter(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("5".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isAfter(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public boolean dateEqual(PtlAgreementUndwrtRulesAttrLink ptlAgreementUndwrtRulesAttrLink, String value){
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
-
|
|
|
- if(!Objects.isNull(value) && !value.isEmpty()) {
|
|
|
- LocalDateTime v = LocalDate.parse(value).atStartOfDay();
|
|
|
- LocalDateTime min = null, max = null;
|
|
|
- if (!Objects.isNull(ptlAgreementUndwrtRulesAttrLink.getMin())) {
|
|
|
- min = LocalDate.parse(ptlAgreementUndwrtRulesAttrLink.getMin()).atStartOfDay();
|
|
|
- }
|
|
|
- if (!Objects.isNull(ptlAgreementUndwrtRulesAttrLink.getMax())) {
|
|
|
- max = LocalDate.parse(ptlAgreementUndwrtRulesAttrLink.getMax()).atStartOfDay();
|
|
|
- }
|
|
|
-
|
|
|
- //统一处理数值
|
|
|
- if ("1".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isAfter(min) && v.isBefore(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("2".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isBefore(min)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("3".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isBefore(min)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("4".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isAfter(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- } else if ("5".equals(ptlAgreementUndwrtRulesAttrLink.getOperator())) {
|
|
|
- if (!v.isAfter(max)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
public InsFeeOrders calcCosts(AgreementInfoVo agreementInfoVo, String costId, InsOrders insOrders, InsOrdersCosts insOrdersCosts) {
|
|
|
InsFeeOrders insFeeOrders = new InsFeeOrders();
|
|
|
insFeeOrders.setOrderNo(insOrders.getId());
|