demand: TMS系统 - 提成管理 - 销售计提比例配置 - 销售支持及占比允许为空

committer: heyu
This commit is contained in:
aike 2025-11-05 11:34:19 +08:00
parent 2c6efb973c
commit ff2cbd8a5a

View File

@ -109,9 +109,17 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
*/
@Override
public boolean checkRatioValid(EmisSalesCommissionRatio entity) {
java.math.BigDecimal sum = entity.getSalesExecutiveRatio()
.add(entity.getSalesmenRatio())
.add(entity.getSalesSupportRatio());
return sum.compareTo(new java.math.BigDecimal("100.00")) <= 0;
BigDecimal executiveRatio = entity.getSalesExecutiveRatio() != null
? entity.getSalesExecutiveRatio()
: BigDecimal.ZERO;
BigDecimal salesmenRatio = entity.getSalesmenRatio() != null
? entity.getSalesmenRatio()
: BigDecimal.ZERO;
BigDecimal supportRatio = entity.getSalesSupportRatio() != null
? entity.getSalesSupportRatio()
: BigDecimal.ZERO;
BigDecimal sum = executiveRatio.add(salesmenRatio).add(supportRatio);
return sum.compareTo(new BigDecimal("100.00")) <= 0;
}
}