刷新可售时间
This commit is contained in:
parent
cde4185dea
commit
bfbcb7301a
|
|
@ -201,9 +201,16 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
|||
String today = getWeekDayEnName();
|
||||
List<String> dayList = StrUtil.split(days, ",");
|
||||
LocalTime now = LocalTime.now().withNano(0);
|
||||
if (CollUtil.contains(dayList, today) && now.isAfter(startTime) && now.isBefore(endTime)) {
|
||||
boolean inDays = CollUtil.contains(dayList, today);
|
||||
if (startTime.isBefore(endTime)) {
|
||||
if (inDays && now.isAfter(startTime) && now.isBefore(endTime)) {
|
||||
return YesNoEnum.YES.value();
|
||||
}
|
||||
} else {
|
||||
if (inDays && (now.isAfter(startTime) || now.isBefore(endTime))) {
|
||||
return YesNoEnum.YES.value();
|
||||
}
|
||||
}
|
||||
return YesNoEnum.NO.value();
|
||||
}
|
||||
|
||||
|
|
@ -224,9 +231,15 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
|||
return YesNoEnum.NO.value();
|
||||
}
|
||||
LocalTime now = LocalTime.now().withNano(0);
|
||||
if (startTime.isBefore(endTime)) {
|
||||
if (now.isAfter(startTime) && now.isBefore(endTime)) {
|
||||
return YesNoEnum.YES.value();
|
||||
}
|
||||
} else {
|
||||
if (now.isAfter(startTime) || now.isBefore(endTime)) {
|
||||
return YesNoEnum.YES.value();
|
||||
}
|
||||
}
|
||||
return YesNoEnum.NO.value();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue