|
|
@@ -48,6 +48,7 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.text.DateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
@@ -2911,8 +2912,6 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
logs.append("<span style=\"color:red;\">规则匹配失败:" + collect.get(0).getAttrName() + "</span>\n");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -3070,6 +3069,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
return radioEqual(ptlAgreementProductCostsAttrLink, value);
|
|
|
} else if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("datetime")){ // 时间
|
|
|
return dateTimeEqual(ptlAgreementProductCostsAttrLink, value);
|
|
|
+ } else if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("date")){
|
|
|
+ return dateEqual(ptlAgreementProductCostsAttrLink, value);
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
@@ -3104,6 +3105,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
return radioEqual(ptlAgreementUndwrtRulesAttrLink, value);
|
|
|
} else if(ptlAgreementUndwrtRulesAttr.getAttrType().equals("datetime")){
|
|
|
return dateTimeEqual(ptlAgreementUndwrtRulesAttrLink, value, insOrders);
|
|
|
+ } else if(ptlAgreementUndwrtRulesAttr.getAttrType().equals("date")){
|
|
|
+ return dateEqual(ptlAgreementUndwrtRulesAttrLink,value);
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
@@ -3367,6 +3370,46 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public boolean dateEqual(PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink, 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(ptlAgreementProductCostsAttrLink.getMin())){
|
|
|
+ min = LocalDate.parse(ptlAgreementProductCostsAttrLink.getMin()).atStartOfDay();
|
|
|
+ }
|
|
|
+ if(!Objects.isNull(ptlAgreementProductCostsAttrLink.getMax())){
|
|
|
+ max = LocalDate.parse(ptlAgreementProductCostsAttrLink.getMax()).atStartOfDay();
|
|
|
+ }
|
|
|
+
|
|
|
+ //统一处理数值
|
|
|
+ if ("1".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
|
|
|
+ if (v.isAfter(min) && v.isBefore(max)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ } else if ("2".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
|
|
|
+ if (v.isBefore(min)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ } else if ("3".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
|
|
|
+ if (v.isBefore(min) || v.isEqual(min)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ } else if ("4".equals(ptlAgreementProductCostsAttrLink.getOperator())) {
|
|
|
+ if (v.isAfter(max)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ } else if ("5".equals(ptlAgreementProductCostsAttrLink.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");
|
|
|
//判断险种 的起保时间
|
|
|
@@ -3415,6 +3458,46 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
|
|
|
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;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取车辆新旧车信息
|
|
|
*
|