Authored by wangnan

bug

... ... @@ -409,33 +409,34 @@ public class ProductIndexLogicService {
/**
* isNew 标签逻辑
* @param FirstShelveTime
* @param MarketPrice
* @param SalesPrice
* @return
*/
public boolean isNew(Integer FirstShelveTime,BigDecimal MarketPrice,BigDecimal SalesPrice){
if (FirstShelveTime > 0) {
try {
long dateCount = Integer.MAX_VALUE;
if (FirstShelveTime > 0) {
dateCount = DateUtil.daysBetween(new Date(FirstShelveTime * 1000L),new Date());
}
if (dateCount <= 7) {
if (MarketPrice != null&&SalesPrice != null) {
//计算折扣
Double discount = MathUtils.getDevideValue(SalesPrice, MarketPrice, 2, RoundingMode.DOWN);
if (discount >= 0.88) {
return true;
public boolean isNew(Integer firstShelveTime,BigDecimal marketPrice,BigDecimal salesPrice){
try {
if (firstShelveTime > 0) {
try {
long dateCount = Integer.MAX_VALUE;
if (firstShelveTime > 0) {
dateCount = DateUtil.daysBetween(new Date(firstShelveTime * 1000L),new Date());
}
if (dateCount <= 7) {
if (marketPrice != null&&salesPrice != null) {
//计算折扣
Double discount = MathUtils.getDevideValue(salesPrice, marketPrice, 2, RoundingMode.DOWN);
if (discount >= 0.88) {
return true;
}
}
}
return false;
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return false;
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return false;
} catch (Exception e) {
return false;
}
return false;
}
... ...