CRM-CONTRACT: 完善 TODO

This commit is contained in:
puhui999
2024-02-03 12:29:28 +08:00
parent 1a96fb2ffc
commit 59e6f23788
16 changed files with 171 additions and 71 deletions

View File

@ -35,6 +35,22 @@ public class MoneyUtils {
return calculateRatePrice(price, rate, 0, RoundingMode.FLOOR).intValue();
}
/**
* 计算百分比金额
*
* @param price 金额(单位分)
* @param count 数量
* @param percent 折扣(单位分),列如 60.2%,则传入 6020
* @return 商品总价
*/
public static Integer calculator(Integer price, Integer count, Integer percent) {
price = price * count;
if (percent == null) {
return price;
}
return MoneyUtils.calculateRatePriceFloor(price, (double) (percent / 100));
}
/**
* 计算百分比金额
*