|
|
|
@ -620,28 +620,33 @@ public class BomManagementServiceImpl extends ServiceImpl<BomManagementMapper, B |
|
|
|
Date existingEffPhaseInDate = existingBomHeader.getEffPhaseInDate(); |
|
|
|
Date existingEffPhaseOutDate = existingBomHeader.getEffPhaseOutDate(); |
|
|
|
|
|
|
|
// 检查日期是否为null |
|
|
|
if (newEffPhaseInDate == null || newEffPhaseOutDate == null || existingEffPhaseInDate == null || existingEffPhaseOutDate == null) { |
|
|
|
continue; // 跳过此次循环迭代 |
|
|
|
} |
|
|
|
|
|
|
|
// 如果新对象的开始时间在现有对象的时间范围内,则重叠 |
|
|
|
if (newEffPhaseInDate != null && newEffPhaseInDate.after(existingEffPhaseInDate) && newEffPhaseInDate.before(existingEffPhaseOutDate)) { |
|
|
|
if (newEffPhaseInDate.after(existingEffPhaseInDate) && newEffPhaseInDate.before(existingEffPhaseOutDate)) { |
|
|
|
b = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
// 如果新对象的结束时间在现有对象的时间范围内,则重叠 |
|
|
|
else if (newEffPhaseOutDate != null && newEffPhaseOutDate.after(existingEffPhaseInDate) && newEffPhaseOutDate.before(existingEffPhaseOutDate)) { |
|
|
|
else if (newEffPhaseOutDate.after(existingEffPhaseInDate) && newEffPhaseOutDate.before(existingEffPhaseOutDate)) { |
|
|
|
b = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
// 如果现有对象的开始时间在新对象的时间范围内,则重叠 |
|
|
|
else if (existingEffPhaseInDate != null && existingEffPhaseInDate.after(newEffPhaseInDate) && existingEffPhaseInDate.before(newEffPhaseOutDate)) { |
|
|
|
else if (existingEffPhaseInDate.after(newEffPhaseInDate) && existingEffPhaseInDate.before(newEffPhaseOutDate)) { |
|
|
|
b = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
// 如果现有对象的结束时间在新对象的时间范围内,则重叠 |
|
|
|
else if (existingEffPhaseOutDate != null && existingEffPhaseOutDate.after(newEffPhaseInDate) && existingEffPhaseOutDate.before(newEffPhaseOutDate)) { |
|
|
|
else if (existingEffPhaseOutDate.after(newEffPhaseInDate) && existingEffPhaseOutDate.before(newEffPhaseOutDate)) { |
|
|
|
b = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
// 如果两个时间段完全相同,则重叠 |
|
|
|
else if (newEffPhaseInDate != null && newEffPhaseInDate.equals(existingEffPhaseInDate) && newEffPhaseOutDate.equals(existingEffPhaseOutDate)) { |
|
|
|
else if (newEffPhaseInDate.equals(existingEffPhaseInDate) && newEffPhaseOutDate.equals(existingEffPhaseOutDate)) { |
|
|
|
b = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
|