修复周日均价查询bug

This commit is contained in:
2025-04-27 14:21:51 +08:00
parent cfa40a96bf
commit 971a05e29e
3 changed files with 19 additions and 2 deletions
@@ -1527,7 +1527,12 @@ public class DistrictStatServiceImpl implements DistrictStatService {
@Override
public int findLatestDistrictAvgPrice2B(DistrictKey districtKey, Date weekend) {
if (weekend == null) {
weekend = DateUtil.getFirstDayOfWeek(new Date());
Date now = DateUtil.truncateDay(new Date());
if(!DateUtil.isSunday(now)){
weekend = DateUtil.getFirstDayOfWeek(now);
}else{
weekend = now;
}
}
String cacheKey = districtKey.getCity() + "_" + districtKey.getRegion() + "_" + districtKey.getName() + "_2B_" + DateUtil.formatToYYMMDD(weekend);
Object obj = CacheUtils.getValue(this.getClass(), cacheKey);