|
|
@@ -81,7 +81,7 @@ public class CollectionService {
|
|
|
List<Collection> collections = collectionRepo
|
|
|
.findByScheduleSaleTrueAndOnShelfFalseAndStartTimeBeforeAndDelFalse(LocalDateTime.now());
|
|
|
for (Collection collection : collections) {
|
|
|
- onShelfTask(collection);
|
|
|
+// onShelfTask(collection);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -133,7 +133,7 @@ public class CollectionService {
|
|
|
record.setSale(0);
|
|
|
record.setVipQuota(record.getTotalQuota());
|
|
|
record.setSubscribeStatus(SubscribeStatus.NOT_STARTED);
|
|
|
- if (record.isScheduleSale()) {
|
|
|
+ if (record.isHasSubscribe()) {
|
|
|
if (record.getStartTime() == null) {
|
|
|
throw new BusinessException("请填写定时发布时间");
|
|
|
}
|
|
|
@@ -144,7 +144,7 @@ public class CollectionService {
|
|
|
}
|
|
|
}
|
|
|
record = collectionRepo.save(record);
|
|
|
- onShelfTask(record);
|
|
|
+// onShelfTask(record);
|
|
|
redisTemplate.opsForValue().set(RedisKeys.COLLECTION_STOCK + record.getId(), record.getStock());
|
|
|
redisTemplate.opsForValue().set(RedisKeys.COLLECTION_SALE + record.getId(), record.getSale());
|
|
|
return record;
|
|
|
@@ -152,7 +152,7 @@ public class CollectionService {
|
|
|
|
|
|
public Collection update(Collection record) {
|
|
|
collectionRepo.update(record.getId(), record.isOnShelf(), record.isSalable(),
|
|
|
- record.getStartTime(), record.isScheduleSale(), record.getSort(),
|
|
|
+ record.getStartTime(), record.isHasSubscribe(), record.getSort(),
|
|
|
record.getDetail(), JSON.toJSONString(record.getPrivileges()),
|
|
|
JSON.toJSONString(record.getProperties()), JSON.toJSONString(record.getModel3d()),
|
|
|
record.getMaxCount(), record.getCountId(), record.isScanCode(), record.isNoSoldOut(),
|
|
|
@@ -164,7 +164,7 @@ public class CollectionService {
|
|
|
.getEndTime(), record.getPublishTime(), record.getPurchaseTime());
|
|
|
|
|
|
record = collectionRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
|
|
|
- onShelfTask(record);
|
|
|
+// onShelfTask(record);
|
|
|
return record;
|
|
|
}
|
|
|
|
|
|
@@ -175,7 +175,7 @@ public class CollectionService {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- if (record.isScheduleSale()) {
|
|
|
+ if (record.isHasSubscribe()) {
|
|
|
if (record.getStartTime().minusSeconds(2).isAfter(LocalDateTime.now())) {
|
|
|
Date date = Date.from(record.getStartTime().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
ScheduledFuture<?> future = taskScheduler.schedule(() -> {
|