From 39f62fa03a2463652e971edfabab56313db6af10 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期六, 28 六月 2025 10:20:34 +0800
Subject: [PATCH] 涉密->工控

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentFaultInfoServiceImpl.java |  258 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 157 insertions(+), 101 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentFaultInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentFaultInfoServiceImpl.java
index 189a144..fc76c70 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentFaultInfoServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentFaultInfoServiceImpl.java
@@ -1,8 +1,12 @@
 package org.jeecg.modules.mdc.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.lang.StringUtils;
-import org.jeecg.modules.mdc.entity.*;
+import org.jeecg.modules.mdc.entity.Equipment;
+import org.jeecg.modules.mdc.entity.MdcEquipmentFaultInfo;
+import org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection;
+import org.jeecg.modules.mdc.entity.MdcSystemParameters;
 import org.jeecg.modules.mdc.mapper.MdcEquipmentFaultInfoMapper;
 import org.jeecg.modules.mdc.service.IEquipmentService;
 import org.jeecg.modules.mdc.service.IMdcEquipmentFaultInfoService;
@@ -10,18 +14,14 @@
 import org.jeecg.modules.mdc.service.IMdcSystemParametersService;
 import org.jeecg.modules.mdc.util.DateUtils;
 import org.jeecg.modules.mdc.vo.EquFaultRecord;
+import org.jeecg.modules.mdc.vo.TimeInterval;
 import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.time.Instant;
-import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.time.ZoneId;
 import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -47,12 +47,31 @@
     @Override
     @Transactional(rollbackFor = {Exception.class})
     public void runningAllEquFaultStatistical(String dateTime) {
-        String validDate = LocalDate.now().minusDays(1).toString().replaceAll("-", "");
+        Date initDate = null;
+
         if (StringUtils.isNotBlank(dateTime)) {
-            validDate = DateUtils.format(DateUtils.toDate(dateTime, DateUtils.STRDATE), DateUtils.STRDATE);
+            initDate = DateUtils.toDate(dateTime, DateUtils.STRDATE);
+        } else {
+            // 鍙栨渶鍚庣殑缁熻鏃堕棿
+            String date = this.baseMapper.getMaxStaticsData();
+            if (date != null) {
+                initDate = DateUtils.toDate(date, DateUtils.STRDATE);
+            } else {
+                // 鍒濇鍙栧�� 鍙栨渶鏃╂椂闂磋褰�
+                MdcEquipmentRunningSection equipmentRunningSection = mdcEquipmentRunningSectionService.getFirstRecord();
+                if (equipmentRunningSection != null) {
+                    initDate = equipmentRunningSection.getStartTime();
+                }
+            }
+        }
+        Date endDate = DateUtils.addDays(DateUtils.getNow(), -1);
+        List<String> dateList = DateUtils.getDatesStringList2(initDate, endDate);
+
+        if (dateList.isEmpty()) {
+            return;
         }
         try {
-            this.remove(new LambdaQueryWrapper<MdcEquipmentFaultInfo>().eq(MdcEquipmentFaultInfo::getTheDate, validDate));
+            this.remove(new LambdaQueryWrapper<MdcEquipmentFaultInfo>().in(MdcEquipmentFaultInfo::getTheDate, dateList));
         } catch (Exception e) {
             log.error("鍙傛暟鏍煎紡涓嶅", e);
         }
@@ -62,13 +81,6 @@
             return;
         }
 
-        Map<String, MdcEquipmentFaultInfo> map = new HashMap<>();
-        String finalValidDate = validDate;
-        equipmentList.forEach(equipment -> {
-            MdcEquipmentFaultInfo mdcEquipmentFaultInfo = new MdcEquipmentFaultInfo(equipment.getEquipmentid(), finalValidDate);
-            map.put(equipment.getEquipmentid(), mdcEquipmentFaultInfo);
-        });
-
         String planTime = "00:00:00";
         MdcSystemParameters mdcSystemParameters = mdcSystemParametersService.getOne(new LambdaQueryWrapper<MdcSystemParameters>().eq(MdcSystemParameters::getCode, "equip_log_statis_time"));
         if (mdcSystemParameters != null) {
@@ -76,27 +88,98 @@
         }
 
         List<String> equipmentIdList = equipmentList.stream().map(Equipment::getEquipmentid).collect(Collectors.toList());
-        String startTime = DateUtils.format(DateUtils.setTimeForDay(DateUtils.toDate(validDate, DateUtils.STRDATE), planTime), DateUtils.STR_DATE_TIME_SMALL);
-        Date start = DateUtils.toDate(startTime, DateUtils.STR_DATE_TIME_SMALL);
-        String endTime = DateUtils.format(DateUtils.addDays(DateUtils.toDate(startTime, DateUtils.STR_DATE_TIME_SMALL), 1), DateUtils.STR_DATE_TIME_SMALL);
-        Date end = DateUtils.toDate(endTime, DateUtils.STR_DATE_TIME_SMALL);
-        //鏌ヨ鏁呴殰璁板綍
-        List<EquFaultRecord> equFaultRecordList = this.baseMapper.findFaultRecord(equipmentIdList, startTime, endTime);
-        if (equFaultRecordList != null && !equFaultRecordList.isEmpty()) {
-            // 淇暣鏃堕棿
-            Map<String, List<EquFaultRecord>> equFaultRecordMap = equFaultRecordList.stream().collect(Collectors.groupingBy(EquFaultRecord::getEquipmentId));
-            equFaultRecordMap.forEach((key, value) -> {
-                if (map.containsKey(key)) {
-                    MdcEquipmentFaultInfo equFaultRecords = map.get(key);
-                    long faultLong = calculateTotalFaultDuration(value, start, end);
-                    equFaultRecords.setFaultLong((int) faultLong);
-                    if (faultLong != 0) {
-                        equFaultRecords.setFaultRate(new BigDecimal(faultLong).divide(new BigDecimal("86400"), 2, RoundingMode.HALF_UP));
-                    }
 
-                    // 璁$畻鍘婚櫎鏁呴殰鏃堕暱鐨勫姞宸ユ椂闂�
-                    // step.1 鏌ヨ鍔犲伐鏃堕棿
-                    List<MdcEquipmentRunningSection> mdcEquipmentRunningSections = mdcEquipmentRunningSectionService.selectRunningData(key, start, end);
+        for (String validDate : dateList) {
+            Map<String, MdcEquipmentFaultInfo> map = new HashMap<>();
+            String finalValidDate = validDate;
+            equipmentList.forEach(equipment -> {
+                MdcEquipmentFaultInfo mdcEquipmentFaultInfo = new MdcEquipmentFaultInfo(equipment.getEquipmentid(), finalValidDate);
+                map.put(equipment.getEquipmentid(), mdcEquipmentFaultInfo);
+            });
+
+            String startTime = DateUtils.format(DateUtils.setTimeForDay(DateUtils.toDate(validDate, DateUtils.STRDATE), planTime), DateUtils.STR_DATE_TIME_SMALL);
+            Date start = DateUtils.toDate(startTime, DateUtils.STR_DATE_TIME_SMALL);
+            String endTime = DateUtils.format(DateUtils.addDays(DateUtils.toDate(startTime, DateUtils.STR_DATE_TIME_SMALL), 1), DateUtils.STR_DATE_TIME_SMALL);
+            Date end = DateUtils.toDate(endTime, DateUtils.STR_DATE_TIME_SMALL);
+            //鏌ヨ鏁呴殰璁板綍
+            List<EquFaultRecord> equFaultRecordList = this.baseMapper.findFaultRecord(equipmentIdList, startTime, endTime);
+            if (equFaultRecordList != null && !equFaultRecordList.isEmpty()) {
+                // 淇暣鏃堕棿
+                Map<String, List<EquFaultRecord>> equFaultRecordMap = equFaultRecordList.stream().collect(Collectors.groupingBy(EquFaultRecord::getEquipmentId));
+                map.forEach((key, value1) -> {
+                    MdcEquipmentFaultInfo equFaultRecords = value1;
+                    if (equFaultRecordMap.containsKey(key)) {
+                        List<EquFaultRecord> value = equFaultRecordMap.get(key);
+                        long faultLong = calculateTotalFaultDuration(value, start, end);
+                        equFaultRecords.setFaultLong((int) faultLong);
+                        if (faultLong != 0) {
+                            equFaultRecords.setFaultRate(new BigDecimal(faultLong).divide(new BigDecimal("864"), 2, RoundingMode.HALF_UP));
+                        }
+                        // 璁$畻鍘婚櫎鏁呴殰鏃堕暱鐨勫姞宸ユ椂闂�
+                        // step.1 鏌ヨ鍔犲伐鏃堕棿
+                        List<MdcEquipmentRunningSection> mdcEquipmentRunningSections = mdcEquipmentRunningSectionService.listEquipmentRunningSectionRun(key, start.getTime(), end.getTime());
+                        if (mdcEquipmentRunningSections != null && !mdcEquipmentRunningSections.isEmpty()) {
+                            // 鏃堕棿淇
+                            if (mdcEquipmentRunningSections.get(0).getStartTime().before(start)) {
+                                mdcEquipmentRunningSections.get(0).setStartTime(start);
+                            }
+                            if (mdcEquipmentRunningSections.size() > 1) {
+                                if (mdcEquipmentRunningSections.get(mdcEquipmentRunningSections.size() - 1).getEndTime().after(end)) {
+                                    mdcEquipmentRunningSections.get(mdcEquipmentRunningSections.size() - 1).setEndTime(end);
+                                }
+                            } else {
+                                if (mdcEquipmentRunningSections.get(0).getEndTime().after(end)) {
+                                    mdcEquipmentRunningSections.get(0).setEndTime(end);
+                                }
+                            }
+                            List<MdcEquipmentRunningSection> collect = mdcEquipmentRunningSections.stream().filter(mdcEquipmentRunningSection -> mdcEquipmentRunningSection.getStatus() == 3).collect(Collectors.toList());
+                            if (!collect.isEmpty()) {
+                                // step.2 璁$畻鍘婚櫎鏁呴殰鏃堕暱鐨勫姞宸ユ椂闂�
+                                long processingTime = calculateProcessingTimeWithoutFaults(collect, value, start, end);
+                                equFaultRecords.setRemoveFaultRunLong((int) processingTime);
+                                if (faultLong != 0 && faultLong != 86400) {
+                                    // 璁$畻鍘婚櫎鏁呴殰鏃堕暱鐨勫埄鐢ㄧ巼
+                                    BigDecimal removeFaultRate = new BigDecimal(processingTime).divide(new BigDecimal("864").subtract(new BigDecimal(faultLong)), 2, RoundingMode.HALF_UP);
+                                    equFaultRecords.setRemoveFaultRate(removeFaultRate);
+                                }
+                            }
+                        }
+                    } else {
+                        List<MdcEquipmentRunningSection> mdcEquipmentRunningSections = mdcEquipmentRunningSectionService.listEquipmentRunningSectionRun(key, start.getTime(), end.getTime());
+                        if (mdcEquipmentRunningSections != null && !mdcEquipmentRunningSections.isEmpty()) {
+                            // 鏃堕棿淇
+                            if (mdcEquipmentRunningSections.get(0).getStartTime().before(start)) {
+                                mdcEquipmentRunningSections.get(0).setStartTime(start);
+                            }
+                            if (mdcEquipmentRunningSections.size() > 1) {
+                                if (mdcEquipmentRunningSections.get(mdcEquipmentRunningSections.size() - 1).getEndTime().after(end)) {
+                                    mdcEquipmentRunningSections.get(mdcEquipmentRunningSections.size() - 1).setEndTime(end);
+                                }
+                            } else {
+                                if (mdcEquipmentRunningSections.get(0).getEndTime().after(end)) {
+                                    mdcEquipmentRunningSections.get(0).setEndTime(end);
+                                }
+                            }
+                            List<MdcEquipmentRunningSection> collect = mdcEquipmentRunningSections.stream().filter(mdcEquipmentRunningSection -> mdcEquipmentRunningSection.getStatus() == 3).collect(Collectors.toList());
+
+                            if (!collect.isEmpty()) {
+                                long totalProcessingTime = 0;
+                                for (MdcEquipmentRunningSection mdcEquipmentRunningSection : collect) {
+                                    totalProcessingTime += ChronoUnit.SECONDS.between(DateUtils.convertToLocalDateTime(mdcEquipmentRunningSection.getStartTime()), DateUtils.convertToLocalDateTime(mdcEquipmentRunningSection.getEndTime()));
+                                }
+                                equFaultRecords.setRemoveFaultRunLong((int) totalProcessingTime);
+                                // 璁$畻鍘婚櫎鏁呴殰鏃堕暱鐨勫埄鐢ㄧ巼
+                                BigDecimal removeFaultRate = new BigDecimal(totalProcessingTime).divide(new BigDecimal("864"), 2, RoundingMode.HALF_UP);
+                                equFaultRecords.setRemoveFaultRate(removeFaultRate);
+                            }
+                        }
+                    }
+                    map.put(key, equFaultRecords);
+                });
+            } else {
+                map.forEach((key, value1) -> {
+                    MdcEquipmentFaultInfo equFaultRecords = value1;
+                    List<MdcEquipmentRunningSection> mdcEquipmentRunningSections = mdcEquipmentRunningSectionService.listEquipmentRunningSectionRun(key, start.getTime(), end.getTime());
                     if (mdcEquipmentRunningSections != null && !mdcEquipmentRunningSections.isEmpty()) {
                         // 鏃堕棿淇
                         if (mdcEquipmentRunningSections.get(0).getStartTime().before(start)) {
@@ -111,27 +194,31 @@
                                 mdcEquipmentRunningSections.get(0).setEndTime(end);
                             }
                         }
-                        // step.2 璁$畻鍘婚櫎鏁呴殰鏃堕暱鐨勫姞宸ユ椂闂�
-                        long processingTime = calculateProcessingTimeWithoutFaults(mdcEquipmentRunningSections, value, start, end);
-                        equFaultRecords.setRemoveFaultRunLong((int) processingTime);
-                        if (faultLong != 0) {
+                        List<MdcEquipmentRunningSection> collect = mdcEquipmentRunningSections.stream().filter(mdcEquipmentRunningSection -> mdcEquipmentRunningSection.getStatus() == 3).collect(Collectors.toList());
+
+                        if (!collect.isEmpty()) {
+                            long totalProcessingTime = 0;
+                            for (MdcEquipmentRunningSection mdcEquipmentRunningSection : collect) {
+                                totalProcessingTime += ChronoUnit.SECONDS.between(DateUtils.convertToLocalDateTime(mdcEquipmentRunningSection.getStartTime()), DateUtils.convertToLocalDateTime(mdcEquipmentRunningSection.getEndTime()));
+                            }
+                            equFaultRecords.setRemoveFaultRunLong((int) totalProcessingTime);
                             // 璁$畻鍘婚櫎鏁呴殰鏃堕暱鐨勫埄鐢ㄧ巼
-                            BigDecimal removeFaultRate = new BigDecimal(processingTime).divide(new BigDecimal("86400").subtract(new BigDecimal(faultLong)), 2, RoundingMode.HALF_UP);
+                            BigDecimal removeFaultRate = new BigDecimal(totalProcessingTime).divide(new BigDecimal("864"), 2, RoundingMode.HALF_UP);
                             equFaultRecords.setRemoveFaultRate(removeFaultRate);
                         }
                     }
                     map.put(key, equFaultRecords);
-                }
-            });
-        }
-        if (!map.isEmpty()) {
-            this.saveBatch(new ArrayList<>(map.values()));
+                });
+            }
+            if (!map.isEmpty()) {
+                this.saveBatch(new ArrayList<>(map.values()));
+            }
         }
     }
 
     public static long calculateTotalFaultDuration(List<EquFaultRecord> records, Date startTime, Date endTime) {
-        LocalDateTime start = convertToLocalDateTime(startTime);
-        LocalDateTime end = convertToLocalDateTime(endTime);
+        LocalDateTime start = DateUtils.convertToLocalDateTime(startTime);
+        LocalDateTime end = DateUtils.convertToLocalDateTime(endTime);
 
         // 淇璁板綍鏃堕棿
         List<EquFaultRecord> correctedRecords = correctRecordTimes(records, start, end);
@@ -144,16 +231,16 @@
 
         // 璁$畻鎬绘椂闀匡紙绉掞級
         return mergedIntervals.stream()
-                .mapToLong(interval -> ChronoUnit.SECONDS.between(interval.start, interval.end))
+                .mapToLong(interval -> ChronoUnit.SECONDS.between(interval.getStart(), interval.getEnd()))
                 .sum();
     }
 
     private static List<EquFaultRecord> correctRecordTimes(List<EquFaultRecord> records, LocalDateTime startTime, LocalDateTime endTime) {
         return records.stream()
                 .map(record -> {
-                    LocalDateTime recordStart = convertToLocalDateTime(record.getStartTime());
+                    LocalDateTime recordStart = DateUtils.convertToLocalDateTime(record.getStartTime());
                     LocalDateTime recordEnd = record.getEndTime() != null ?
-                            convertToLocalDateTime(record.getEndTime()) : null;
+                            DateUtils.convertToLocalDateTime(record.getEndTime()) : null;
 
                     // 淇寮�濮嬫椂闂�
                     LocalDateTime correctedStart = recordStart.isBefore(startTime) ?
@@ -166,8 +253,8 @@
                     // 鍒涘缓淇鍚庣殑璁板綍
                     return new EquFaultRecord(
                             record.getEquipmentId(),
-                            convertToDate(correctedStart),
-                            convertToDate(correctedEnd)
+                            DateUtils.convertToDate(correctedStart),
+                            DateUtils.convertToDate(correctedEnd)
                     );
                 })
                 .collect(Collectors.toList());
@@ -176,8 +263,8 @@
     private static List<TimeInterval> mergeIntervals(List<EquFaultRecord> records) {
         List<TimeInterval> intervals = records.stream()
                 .map(record -> new TimeInterval(
-                        convertToLocalDateTime(record.getStartTime()),
-                        convertToLocalDateTime(record.getEndTime())))
+                        DateUtils.convertToLocalDateTime(record.getStartTime()),
+                        DateUtils.convertToLocalDateTime(record.getEndTime())))
                 .collect(Collectors.toList());
 
         if (intervals.isEmpty()) {
@@ -189,9 +276,9 @@
 
         for (int i = 1; i < intervals.size(); i++) {
             TimeInterval next = intervals.get(i);
-            if (next.start.isBefore(current.end) || next.start.equals(current.end)) {
+            if (next.getStart().isBefore(current.getEnd()) || next.getStart().equals(current.getEnd())) {
                 // 鏈夐噸鍙狅紝鍚堝苟鍖洪棿
-                current.end = current.end.isAfter(next.end) ? current.end : next.end;
+                current.setEnd(current.getEnd().isAfter(next.getEnd()) ? current.getEnd() : next.getEnd());
             } else {
                 // 鏃犻噸鍙狅紝娣诲姞褰撳墠鍖洪棿骞舵洿鏂板綋鍓嶅尯闂�
                 merged.add(current);
@@ -203,33 +290,6 @@
         return merged;
     }
 
-    // Date涓嶭ocalDateTime浜掔浉杞崲鐨勫伐鍏锋柟娉�
-    private static LocalDateTime convertToLocalDateTime(Date date) {
-        if (date == null) {
-            return null;
-        }
-        return Instant.ofEpochMilli(date.getTime())
-                .atZone(ZoneId.systemDefault())
-                .toLocalDateTime();
-    }
-
-    private static Date convertToDate(LocalDateTime localDateTime) {
-        if (localDateTime == null) {
-            return null;
-        }
-        return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
-    }
-
-    static class TimeInterval {
-        LocalDateTime start;
-        LocalDateTime end;
-
-        public TimeInterval(LocalDateTime start, LocalDateTime end) {
-            this.start = start;
-            this.end = end;
-        }
-    }
-
     // 璁$畻鍘婚櫎鏁呴殰鏃堕暱鍚庣殑鍔犲伐鏃堕棿
     private long calculateProcessingTimeWithoutFaults(
             List<MdcEquipmentRunningSection> runningSections,
@@ -238,23 +298,19 @@
             Date endTime) {
 
         // 杞崲涓篖ocalDateTime杩涜澶勭悊
-        LocalDateTime start = convertToLocalDateTime(startTime);
-        LocalDateTime end = convertToLocalDateTime(endTime);
+        LocalDateTime start = DateUtils.convertToLocalDateTime(startTime);
+        LocalDateTime end = DateUtils.convertToLocalDateTime(endTime);
 
-        // 灏嗘晠闅滆褰曡浆鎹负鏃堕棿鍖洪棿骞跺悎骞堕噸鍙犻儴鍒�
-//        List<TimeInterval> faultIntervals = faultRecords.stream()
-//                .map(record -> new TimeInterval(
-//                        convertToLocalDateTime(record.getStartTime()),
-//                        convertToLocalDateTime(record.getEndTime())))
-//                .collect(Collectors.toList());
-        List<TimeInterval> mergedFaultIntervals = mergeIntervals(faultRecords);
+        // 淇璁板綍鏃堕棿
+        List<EquFaultRecord> correctedRecords = correctRecordTimes(faultRecords, start, end);
+        List<TimeInterval> mergedFaultIntervals = mergeIntervals(correctedRecords);
 
         long totalProcessingTime = 0;
 
         // 閬嶅巻姣忎釜鍔犲伐鍖洪棿锛屾帓闄ゆ晠闅滄椂闂�
         for (MdcEquipmentRunningSection section : runningSections) {
-            LocalDateTime sectionStart = convertToLocalDateTime(section.getStartTime());
-            LocalDateTime sectionEnd = convertToLocalDateTime(section.getEndTime());
+            LocalDateTime sectionStart = DateUtils.convertToLocalDateTime(section.getStartTime());
+            LocalDateTime sectionEnd = DateUtils.convertToLocalDateTime(section.getEndTime());
 
             // 鎺掗櫎鏁呴殰鏃堕棿鍚庣殑鏈夋晥鍔犲伐鏃堕棿
             List<TimeInterval> validIntervals = excludeFaultsFromSection(
@@ -263,7 +319,7 @@
 
             // 绱姞鏈夋晥鍔犲伐鏃堕棿锛堢锛�
             for (TimeInterval interval : validIntervals) {
-                totalProcessingTime += ChronoUnit.SECONDS.between(interval.start, interval.end);
+                totalProcessingTime += ChronoUnit.SECONDS.between(interval.getStart(), interval.getEnd());
             }
         }
 
@@ -301,7 +357,7 @@
 
     // 鍒ゆ柇涓や釜鏃堕棿鍖洪棿鏄惁閲嶅彔
     private boolean isOverlapping(TimeInterval a, TimeInterval b) {
-        return a.start.isBefore(b.end) && b.start.isBefore(a.end);
+        return a.getStart().isBefore(b.getEnd()) && b.getStart().isBefore(a.getEnd());
     }
 
     // 鍒嗗壊鍖洪棿锛堟墸闄ら噸鍙犻儴鍒嗭級
@@ -311,13 +367,13 @@
             List<TimeInterval> result) {
 
         // 閲嶅彔鍓嶇殑閮ㄥ垎
-        if (valid.start.isBefore(fault.start)) {
-            result.add(new TimeInterval(valid.start, fault.start));
+        if (valid.getStart().isBefore(fault.getStart())) {
+            result.add(new TimeInterval(valid.getStart(), fault.getStart()));
         }
 
         // 閲嶅彔鍚庣殑閮ㄥ垎
-        if (valid.end.isAfter(fault.end)) {
-            result.add(new TimeInterval(fault.end, valid.end));
+        if (valid.getEnd().isAfter(fault.getEnd())) {
+            result.add(new TimeInterval(fault.getEnd(), valid.getEnd()));
         }
     }
 

--
Gitblit v1.9.3