This commit is contained in:
zhaohengkun 2024-10-14 15:10:00 +08:00
parent 18f724d177
commit 8696af8903

View File

@ -196,7 +196,11 @@ public class CheckUtil {
//周几汉字转数字
timeSlotsStr = changeWeekNumber(timeSlots);
}
List<String> timeSlotStrList = Arrays.asList(timeSlotsStr.split(StrUtil.COMMA));
// 拆分字符串 并过滤掉 ""
List<String> timeSlotStrList = Arrays.stream(timeSlotsStr.split(StrUtil.COMMA))
.filter(str -> !str.isEmpty()) // 过滤掉空字符串
.collect(Collectors.toList());
//转换为int类型
List<Integer> timeSlotList = timeSlotStrList.stream().map(Integer::parseInt).collect(Collectors.toList());
if (timeSlotStrList.isEmpty() && (StringUtils.isNotEmpty(startTime) || StringUtils.isNotEmpty(endTime))) {