|
@@ -1835,26 +1835,29 @@ public class CustomerApiController {
|
|
|
|
|
|
public List<PolicyDate> dateMerge(List<PolicyDate> policyDates) {
|
|
|
List<PolicyDate> rst = new ArrayList<>();
|
|
|
- rst.add(policyDates.get(0));
|
|
|
- for (int i = 1, j = 0; i < policyDates.size(); i++) {
|
|
|
- PolicyDate ip = policyDates.get(i);
|
|
|
- PolicyDate jp = rst.get(j);
|
|
|
- int isje = ip.getStartDate().compareTo(jp.getEndDate());
|
|
|
- if (isje <= 0) {
|
|
|
-
|
|
|
- int ieje = ip.getEndDate().compareTo(jp.getEndDate());
|
|
|
- if (ieje <= 0) {
|
|
|
-
|
|
|
+ if(null!=policyDates&&policyDates.size()>0){
|
|
|
+ rst.add(policyDates.get(0));
|
|
|
+ for (int i = 1, j = 0; i < policyDates.size(); i++) {
|
|
|
+ PolicyDate ip = policyDates.get(i);
|
|
|
+ PolicyDate jp = rst.get(j);
|
|
|
+ int isje = ip.getStartDate().compareTo(jp.getEndDate());
|
|
|
+ if (isje <= 0) {
|
|
|
+
|
|
|
+ int ieje = ip.getEndDate().compareTo(jp.getEndDate());
|
|
|
+ if (ieje <= 0) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ jp.setEndDate(ip.getEndDate());
|
|
|
+ }
|
|
|
} else {
|
|
|
-
|
|
|
- jp.setEndDate(ip.getEndDate());
|
|
|
+
|
|
|
+ rst.add(ip);
|
|
|
+ j++;
|
|
|
}
|
|
|
- } else {
|
|
|
-
|
|
|
- rst.add(ip);
|
|
|
- j++;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return rst;
|
|
|
}
|
|
|
|