Authored by mali

寄存列表 价格 取整

... ... @@ -154,7 +154,7 @@ public class DepositServiceImpl implements DepositService {
bo.setPic(ImageUrlAssist.getAllProductPicUrl(goods.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
BuyerOrder buyerOrder = buyerGoodsMap.get(buyerGoodsMap.get(depo.getOrderCode()));
if (buyerOrder != null) {
bo.setPrice(buyerOrder.getAmount().toString());
bo.setPrice(String.valueOf(buyerOrder.getAmount().intValue()));
}
bo.setDepositStatusName(getBackStatusName(depo.getStatus()));
bo.setDepositCode(depo.getDepositCode());
... ... @@ -617,7 +617,7 @@ public class DepositServiceImpl implements DepositService {
bo.setPic(ImageUrlAssist.getAllProductPicUrl(goods.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
BuyerOrder buyerOrder = buyerGoodsMap.get(depo.getOrderCode());
if (buyerOrder != null) {
bo.setPrice(buyerOrder.getAmount().toString());
bo.setPrice(String.valueOf(buyerOrder.getAmount().intValue()));
}
bo.setSizeName(goods.getSizeName());
bo.setOrderStatusName(getOrderStatusName(depo.getOrderStatus()));
... ... @@ -628,7 +628,7 @@ public class DepositServiceImpl implements DepositService {
bo.setStorageId(depo.getStorageId());
BigDecimal least = leastMap.get(depo.getStorageId());
bo.setFlashMinPrice(least == null ? "" : least.toString());
bo.setFlashMinPrice(least == null ? "" : String.valueOf(least.intValue()));
bo.setDepositCode(depo.getDepositCode());
}
... ...
... ... @@ -79,5 +79,12 @@ public class MathUtils {
}
double val = 10D;
System.out.println(val + " -> 折扣 " + calDiscount((int)val));
System.out.println(String.valueOf(new BigDecimal(19).intValue()));
}
public static String convert2PercentROUND(BigDecimal rate, int newScale, int round) {
return rate.multiply(new BigDecimal(100)).setScale(newScale, round) + "%";
}
}
... ...