|
|
@@ -165,11 +165,16 @@ public class VipService {
|
|
|
BigDecimal intervals = new BigDecimal(ChronoUnit.DAYS.between(user.getCreatedAt(), LocalDateTime.now()));
|
|
|
|
|
|
try {
|
|
|
- if (intervals.compareTo(period) < 1 && product.getCurrentPrice().compareTo(newUserMax) < 1) {
|
|
|
- vipAsyncService.autoTrade(chosenVip, product);
|
|
|
- }
|
|
|
- if (period.compareTo(intervals) < 1 && oldUserMin.compareTo(product.getCurrentPrice()) < 1) {
|
|
|
- vipAsyncService.autoTrade(chosenVip, product);
|
|
|
+ if (intervals.compareTo(period) < 1) {
|
|
|
+ //new
|
|
|
+ if (product.getCurrentPrice().compareTo(newUserMax) < 1) {
|
|
|
+ vipAsyncService.autoTrade(chosenVip, product);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //old
|
|
|
+ if (oldUserMin.compareTo(product.getCurrentPrice()) < 1) {
|
|
|
+ vipAsyncService.autoTrade(chosenVip, product);
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("🚚 auto trade error", e);
|