记得上下班打卡 | git大法好,push需谨慎

Commit b91c1c87 authored by jiangxiulong's avatar jiangxiulong

本地演出 时间的搜索

parent 3854da74
......@@ -29,6 +29,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
......@@ -86,6 +87,21 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
}
if (days > 0) {
isRecommend = 0;
HashMap toDayTime = DateUtil.oneDayStartEnd();
String nowTimeTStr = (String) toDayTime.get("startStr");
String timeStart = info.getTimeStart();
// 今天的0点到几天后的0点
Calendar cal = Calendar.getInstance();
cal.setTime((Date) toDayTime.get("start"));
Date beforeDayEnd = DateUtil.getBeforeDayBegin(cal, days);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String daysLaterStr = sdf.format(beforeDayEnd);
if (-1 == DateUtil.compareStrDay(timeStart, nowTimeTStr) || -1 == DateUtil.compareStrDay(daysLaterStr, timeStart)) {
isShow = false;
}
}
if (isShow) {
performancesIds.add(info.getPerformancesId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment