|
@@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
|
+import java.time.LocalDateTime;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.function.Predicate;
|
|
import java.util.function.Predicate;
|
|
@@ -114,12 +115,6 @@ public class SopUserLogsInfoController extends BaseController
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-// Predicate<SopUserLogsInfo> tagFilter = item ->
|
|
|
|
-// sopUserLogsInfo.getTagIds() == null ||
|
|
|
|
-// sopUserLogsInfo.getTagIds().isEmpty() ||
|
|
|
|
-// item.getTagIds().contains(sopUserLogsInfo.getTagIds());
|
|
|
|
-
|
|
|
|
Predicate<SopUserLogsInfo> tagFilter = item -> {
|
|
Predicate<SopUserLogsInfo> tagFilter = item -> {
|
|
String queryTagIds = sopUserLogsInfo.getTagIds();
|
|
String queryTagIds = sopUserLogsInfo.getTagIds();
|
|
String itemTagIds = item.getTagIds();
|
|
String itemTagIds = item.getTagIds();
|
|
@@ -148,25 +143,34 @@ public class SopUserLogsInfoController extends BaseController
|
|
|
|
|
|
|
|
|
|
Predicate<SopUserLogsInfo> timeFilter = item -> {
|
|
Predicate<SopUserLogsInfo> timeFilter = item -> {
|
|
- if (StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getEntryTime())) {
|
|
|
|
|
|
+
|
|
|
|
+ if (StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getInComingSTime())
|
|
|
|
+ && StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getInComingETime()) ) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
- LocalDate entryDate = LocalDate.parse(
|
|
|
|
- sopUserLogsInfo.getEntryTime(),
|
|
|
|
- DateTimeFormatter.ofPattern("yyyy-MM-dd")
|
|
|
|
|
|
+ LocalDateTime entryDate = LocalDateTime.parse(item.getInComTime(),
|
|
|
|
+ DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
|
|
|
|
+ );
|
|
|
|
+ LocalDateTime inComingSTime = LocalDateTime.parse(sopUserLogsInfo.getInComingSTime(),
|
|
|
|
+ DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
|
|
);
|
|
);
|
|
- LocalDate createDate = LocalDate.parse(
|
|
|
|
- item.getInComTime().substring(0, 10),
|
|
|
|
- DateTimeFormatter.ofPattern("yyyy-MM-dd")
|
|
|
|
|
|
+
|
|
|
|
+ LocalDateTime inComingETime = LocalDateTime.parse(sopUserLogsInfo.getInComingETime(),
|
|
|
|
+ DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
|
|
);
|
|
);
|
|
- return entryDate.equals(createDate);
|
|
|
|
|
|
+
|
|
|
|
+ return !entryDate.isBefore(inComingSTime) && !entryDate.isAfter(inComingETime);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
- if (sopUserLogsInfo.getTagIds() != null || !isRemarkEmpty || !StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getEntryTime()) ||!isLevelEmpty) {
|
|
|
|
|
|
+
|
|
|
|
+ boolean hasTimeFilter = !StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getInComingSTime())
|
|
|
|
+ && !StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getInComingETime());
|
|
|
|
+
|
|
|
|
+ if (sopUserLogsInfo.getTagIds() != null || !isRemarkEmpty || hasTimeFilter ||!isLevelEmpty) {
|
|
list = list.stream()
|
|
list = list.stream()
|
|
.filter(tagFilter.and(remarkFilter).and(timeFilter).and(levelFilter))
|
|
.filter(tagFilter.and(remarkFilter).and(timeFilter).and(levelFilter))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|