Commit 8ba04be1 authored by shiyu's avatar shiyu

自动刷新专场预览中状态

parent 11b699fe
......@@ -126,7 +126,7 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
specialPerformanceVo.setSpecialPerformanceId(specialPerformanceId);
specialPerformanceVo.setTitle(specialPerformance.getTitle());
specialPerformanceVo.setState(specialPerformance.getState());
specialPerformanceVo.setStateName(DistributionEnum.AuctionStateEnum.getNameByCode(specialPerformance.getState()));
specialPerformanceVo.setStateName(SpecialPerformanceEnum.StateEnum.getNameByCode(specialPerformance.getState()));
specialPerformanceVo.setStartTime(specialPerformance.getStartTime());
specialPerformanceVo.setEndTime(specialPerformance.getEndTime());
long totalViewNum = specialPerformanceConfigDao.countViewNum(specialPerformanceId);
......@@ -201,7 +201,7 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
}
Date now = new Date();
Instant startInstant = now.toInstant().plus(Duration.ofDays(1));
Date startTime = Date.from(startInstant);
Date previewStartTime = Date.from(startInstant);
supplierItemList.forEach(supplierItem -> {
SupplierItemVo supplierItemVo = new SupplierItemVo();
......@@ -227,7 +227,7 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
supplierItemVo.setState(auctionConfig.getState());
supplierItemVo.setStateName(AuctionEnum.StateEnum.getNameByCode(auctionConfig.getState()));
if (startTime.before(auctionConfig.getStartTime()) && auctionConfig.getStartTime().after(now)) {
if (previewStartTime.after(auctionConfig.getStartTime()) && auctionConfig.getStartTime().after(now)) {
supplierItemVo.setState(AuctionEnum.StateEnum.PREVIEW.getCode());
supplierItemVo.setStateName(AuctionEnum.StateEnum.PREVIEW.getDes());
} else if (auctionConfig.getStartTime().before(now) && auctionConfig.getRealEndTime().after(now)) {
......
......@@ -613,7 +613,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
DistributionOrder distributionOrder = distributionOrderDao.findByItemId(itemId);
//拍品的状态,提前一天为预览中
if (previewStartTime.before(auctionConfig.getStartTime()) && auctionConfig.getStartTime().after(now)) {
if (previewStartTime.after(auctionConfig.getStartTime()) && auctionConfig.getStartTime().after(now)) {
auctionDetailVo.setState(AuctionEnum.StateEnum.PREVIEW.getCode());
auctionDetailVo.setStateName(AuctionEnum.StateEnum.PREVIEW.getDes());
} else if (auctionConfig.getStartTime().before(now) && auctionConfig.getRealEndTime().after(now)) {
......
......@@ -172,7 +172,7 @@ public class SpecialPerformanceNoticeJob {
} else if (specialPerformance.getState().intValue() == SpecialPerformanceEnum.StateEnum.NOT_START.getCode()) {
//未开始的专场判断是否需要改为预展中,开始时间提前一天预展
//设置为预展中
if (startTime.before(specialPerformance.getStartTime()) && specialPerformance.getStartTime().after(now)) {
if (startTime.after(specialPerformance.getStartTime()) && specialPerformance.getStartTime().after(now)) {
if (specialPerformance.getState().intValue() != SpecialPerformanceEnum.StateEnum.PREVIEW.getCode()) {
specialPerformanceDao.updateState(specialPerformance.getId(), SpecialPerformanceEnum.StateEnum.PREVIEW.getCode());
}
......@@ -205,7 +205,7 @@ public class SpecialPerformanceNoticeJob {
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(itemId);
if (auctionConfig.getState().intValue() == AuctionEnum.StateEnum.WAIT_ON_SALE.getCode()) {
//待上架的拍品判断是否需要改为预展中,开始时间提前一天预展
if (startTime.before(auctionConfig.getStartTime()) && auctionConfig.getStartTime().after(now)) {
if (startTime.after(auctionConfig.getStartTime()) && auctionConfig.getStartTime().after(now)) {
if (auctionConfig.getState().intValue() != AuctionEnum.StateEnum.PREVIEW.getCode()) {
auctionConfigDao.updateState(itemId, AuctionEnum.StateEnum.PREVIEW.getCode());
}
......
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