|
@@ -38,24 +38,24 @@ public class SubscribeTask {
|
|
|
LocalDateTime endTime = startTime.plusSeconds(5);
|
|
LocalDateTime endTime = startTime.plusSeconds(5);
|
|
|
//根据开始时间和结束时间去数据库把这两个时间段中 符合的预约发布时间中获取藏品
|
|
//根据开始时间和结束时间去数据库把这两个时间段中 符合的预约发布时间中获取藏品
|
|
|
List<Collection> ongoingList = collectionRepo
|
|
List<Collection> ongoingList = collectionRepo
|
|
|
- .findAllByStartTimeGreaterThanAndStartTimeGreaterThanEqual(startTime, endTime);
|
|
|
|
|
|
|
+ .findAllByStartTimeGreaterThanAndStartTimeEquals(startTime, endTime);
|
|
|
//预约发布时间判断
|
|
//预约发布时间判断
|
|
|
if (!Collections.isEmpty(ongoingList)) {
|
|
if (!Collections.isEmpty(ongoingList)) {
|
|
|
for (Collection collection : ongoingList) {
|
|
for (Collection collection : ongoingList) {
|
|
|
if (collection.getStartTime().isAfter(startTime) && collection.getStartTime().isAfter(endTime)) {
|
|
if (collection.getStartTime().isAfter(startTime) && collection.getStartTime().isAfter(endTime)) {
|
|
|
int i = collectionRepo.updateSubscribeStatus(collection.getId(), SubscribeStatus.ONGOING);
|
|
int i = collectionRepo.updateSubscribeStatus(collection.getId(), SubscribeStatus.ONGOING);
|
|
|
- System.out.println("影响的行数为: " + i);
|
|
|
|
|
|
|
+ log.info("发布预约时间状态更改的行数为: " + i);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//预约结束时间判断
|
|
//预约结束时间判断
|
|
|
List<Collection> subscribeEndingList = collectionRepo
|
|
List<Collection> subscribeEndingList = collectionRepo
|
|
|
- .findAllByEndTimeGreaterThanAndEndTimeGreaterThanEqual(startTime, endTime);
|
|
|
|
|
|
|
+ .findAllByEndTimeGreaterThanAndEndTimeEquals(startTime, endTime);
|
|
|
if (!Collections.isEmpty(subscribeEndingList)) {
|
|
if (!Collections.isEmpty(subscribeEndingList)) {
|
|
|
for (Collection collection : subscribeEndingList) {
|
|
for (Collection collection : subscribeEndingList) {
|
|
|
if (collection.getEndTime().isAfter(startTime) && collection.getEndTime().isAfter(endTime)) {
|
|
if (collection.getEndTime().isAfter(startTime) && collection.getEndTime().isAfter(endTime)) {
|
|
|
int i = collectionRepo.updateSubscribeStatus(collection.getId(), SubscribeStatus.SUBSCRIBE_ENDING);
|
|
int i = collectionRepo.updateSubscribeStatus(collection.getId(), SubscribeStatus.SUBSCRIBE_ENDING);
|
|
|
- System.out.println("影响的行数为: " + i);
|
|
|
|
|
|
|
+ log.info("预约结束时间状态更改的行数为: " + i);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -83,23 +83,23 @@ public class SubscribeTask {
|
|
|
}
|
|
}
|
|
|
//购买资格公布时间
|
|
//购买资格公布时间
|
|
|
List<Collection> announcingList = collectionRepo
|
|
List<Collection> announcingList = collectionRepo
|
|
|
- .findAllByPublishTimeGreaterThanAndPublishTimeGreaterThanEqual(startTime, endTime);
|
|
|
|
|
|
|
+ .findAllByPublishTimeGreaterThanAndPublishTimeEquals(startTime, endTime);
|
|
|
if (!Collections.isEmpty(announcingList)) {
|
|
if (!Collections.isEmpty(announcingList)) {
|
|
|
for (Collection collection : announcingList) {
|
|
for (Collection collection : announcingList) {
|
|
|
if (collection.getPublishTime().isAfter(startTime) && collection.getPublishTime().isAfter(endTime)) {
|
|
if (collection.getPublishTime().isAfter(startTime) && collection.getPublishTime().isAfter(endTime)) {
|
|
|
int i = collectionRepo.updateSubscribeStatus(collection.getId(), SubscribeStatus.ANNOUNCING);
|
|
int i = collectionRepo.updateSubscribeStatus(collection.getId(), SubscribeStatus.ANNOUNCING);
|
|
|
- System.out.println("影响的行数为: " + i);
|
|
|
|
|
|
|
+ log.info("购买资格公布时间状态更改的行数为: " + i);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//购买时间
|
|
//购买时间
|
|
|
List<Collection> onSaleList = collectionRepo
|
|
List<Collection> onSaleList = collectionRepo
|
|
|
- .findAllByPurchaseTimeGreaterThanAndPurchaseTimeGreaterThanEqual(startTime, endTime);
|
|
|
|
|
|
|
+ .findAllByPurchaseTimeGreaterThanAndPurchaseTimeEquals(startTime, endTime);
|
|
|
if (!Collections.isEmpty(onSaleList)) {
|
|
if (!Collections.isEmpty(onSaleList)) {
|
|
|
for (Collection collection : onSaleList) {
|
|
for (Collection collection : onSaleList) {
|
|
|
if (collection.getPurchaseTime().isAfter(startTime) && collection.getPurchaseTime().isAfter(endTime)) {
|
|
if (collection.getPurchaseTime().isAfter(startTime) && collection.getPurchaseTime().isAfter(endTime)) {
|
|
|
int i = collectionRepo.updateSubscribeStatus(collection.getId(), SubscribeStatus.ON_SALE);
|
|
int i = collectionRepo.updateSubscribeStatus(collection.getId(), SubscribeStatus.ON_SALE);
|
|
|
- System.out.println("影响的行数为: " + i);
|
|
|
|
|
|
|
+ log.info("购买时间状态更改的行数为: " + i);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|