Showing
1 changed file
with
21 additions
and
20 deletions
@@ -409,33 +409,34 @@ public class ProductIndexLogicService { | @@ -409,33 +409,34 @@ public class ProductIndexLogicService { | ||
409 | 409 | ||
410 | /** | 410 | /** |
411 | * isNew 标签逻辑 | 411 | * isNew 标签逻辑 |
412 | - * @param FirstShelveTime | ||
413 | - * @param MarketPrice | ||
414 | - * @param SalesPrice | ||
415 | * @return | 412 | * @return |
416 | */ | 413 | */ |
417 | - public boolean isNew(Integer FirstShelveTime,BigDecimal MarketPrice,BigDecimal SalesPrice){ | ||
418 | - if (FirstShelveTime > 0) { | ||
419 | - try { | ||
420 | - long dateCount = Integer.MAX_VALUE; | ||
421 | - if (FirstShelveTime > 0) { | ||
422 | - dateCount = DateUtil.daysBetween(new Date(FirstShelveTime * 1000L),new Date()); | ||
423 | - } | ||
424 | - if (dateCount <= 7) { | ||
425 | - if (MarketPrice != null&&SalesPrice != null) { | ||
426 | - //计算折扣 | ||
427 | - Double discount = MathUtils.getDevideValue(SalesPrice, MarketPrice, 2, RoundingMode.DOWN); | ||
428 | - if (discount >= 0.88) { | ||
429 | - return true; | 414 | + public boolean isNew(Integer firstShelveTime,BigDecimal marketPrice,BigDecimal salesPrice){ |
415 | + try { | ||
416 | + if (firstShelveTime > 0) { | ||
417 | + try { | ||
418 | + long dateCount = Integer.MAX_VALUE; | ||
419 | + if (firstShelveTime > 0) { | ||
420 | + dateCount = DateUtil.daysBetween(new Date(firstShelveTime * 1000L),new Date()); | ||
421 | + } | ||
422 | + if (dateCount <= 7) { | ||
423 | + if (marketPrice != null&&salesPrice != null) { | ||
424 | + //计算折扣 | ||
425 | + Double discount = MathUtils.getDevideValue(salesPrice, marketPrice, 2, RoundingMode.DOWN); | ||
426 | + if (discount >= 0.88) { | ||
427 | + return true; | ||
428 | + } | ||
430 | } | 429 | } |
431 | } | 430 | } |
431 | + return false; | ||
432 | + } catch (Exception e) { | ||
433 | + logger.error(e.getMessage(), e); | ||
432 | } | 434 | } |
433 | - return false; | ||
434 | - } catch (Exception e) { | ||
435 | - logger.error(e.getMessage(), e); | ||
436 | } | 435 | } |
436 | + return false; | ||
437 | + } catch (Exception e) { | ||
438 | + return false; | ||
437 | } | 439 | } |
438 | - return false; | ||
439 | } | 440 | } |
440 | 441 | ||
441 | 442 |
-
Please register or login to post a comment