|
@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
|
|
+import jodd.util.StringUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -900,21 +901,22 @@ public class JobTicketServiceImpl extends ServiceImpl<JobTicketMapper, JobTicket
|
|
|
if (!myAgentVOS.isEmpty()) {
|
|
if (!myAgentVOS.isEmpty()) {
|
|
|
String finalStartTime = startTime;
|
|
String finalStartTime = startTime;
|
|
|
String finalEndTime = endTime;
|
|
String finalEndTime = endTime;
|
|
|
- myAgentVOS.stream()
|
|
|
|
|
|
|
+ List<MyAgentVO> collect = myAgentVOS.stream()
|
|
|
// ① 过滤无效时间和超出范围的数据
|
|
// ① 过滤无效时间和超出范围的数据
|
|
|
.filter(vo -> {
|
|
.filter(vo -> {
|
|
|
LocalDateTime stepTime = parseTime(vo.getStepUpdateTime());
|
|
LocalDateTime stepTime = parseTime(vo.getStepUpdateTime());
|
|
|
- return stepTime != null && !stepTime.isBefore(parseTime(finalStartTime)) && !stepTime.isAfter(parseTime(finalEndTime));
|
|
|
|
|
|
|
+ return stepTime != null
|
|
|
|
|
+ && (StringUtil.isBlank(finalStartTime) || !stepTime.isBefore(parseTime(finalStartTime)))
|
|
|
|
|
+ && (StringUtil.isBlank(finalEndTime) || !stepTime.isAfter(parseTime(finalEndTime)));
|
|
|
})
|
|
})
|
|
|
// ② 按时间倒序排序
|
|
// ② 按时间倒序排序
|
|
|
.sorted((v1, v2) -> {
|
|
.sorted((v1, v2) -> {
|
|
|
LocalDateTime t1 = parseTime(v1.getStepUpdateTime());
|
|
LocalDateTime t1 = parseTime(v1.getStepUpdateTime());
|
|
|
LocalDateTime t2 = parseTime(v2.getStepUpdateTime());
|
|
LocalDateTime t2 = parseTime(v2.getStepUpdateTime());
|
|
|
return t2.compareTo(t1); // 降序
|
|
return t2.compareTo(t1); // 降序
|
|
|
- })
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ }).toList();
|
|
|
|
|
+ return collect;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return myAgentVOS;
|
|
return myAgentVOS;
|
|
|
}
|
|
}
|
|
|
|
|
|