This commit is contained in:
linfso 2024-11-14 08:22:19 +08:00
parent ce746544ae
commit 6fa5aaa967

View File

@ -735,6 +735,10 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
} }
// 重量计算 // 重量计算
else if ("2".equals(quoteItem.getCalcType())) { else if ("2".equals(quoteItem.getCalcType())) {
if (exprItem.getStartWeight().doubleValue() < waybill.getSettlementWeight().doubleValue()
&& exprItem.getEndWeight().doubleValue() >= waybill.getSettlementWeight().doubleValue()
) {
calcExprStr = calcExp.replaceAll("w", waybill.getSettlementWeight().toString()) calcExprStr = calcExp.replaceAll("w", waybill.getSettlementWeight().toString())
.replaceAll("s", exprItem.getInitialWeight().toString()) .replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString()); .replaceAll("d", exprItem.getAdditionalWeight().toString());
@ -743,13 +747,23 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString()); profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
} }
}
// 体积计算 // 体积计算
else if ("3".equals(quoteItem.getCalcType())) { else if ("3".equals(quoteItem.getCalcType())) {
calcExprStr = calcExp.replaceAll("w", waybill.getSettlementWeight().toString())
if (exprItem.getStartWeight().doubleValue() < waybill.getTotalVolume().doubleValue()
&& exprItem.getEndWeight().doubleValue() >= waybill.getTotalVolume().doubleValue()
) {
calcExprStr = calcExp.replaceAll("w", waybill.getTotalVolume().toString())
.replaceAll("s", exprItem.getInitialWeight().toString()) .replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString()); .replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按体积计算:计算公式:" + calcExprStr + ",体积:"+waybill.getTotalVolume().toString()); log.info("按体积计算:计算公式:" + calcExprStr + ",体积:"+waybill.getTotalVolume().toString());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString()); profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
}
} }
// 包裹数 // 包裹数
else if ("4".equals(quoteItem.getCalcType())) { else if ("4".equals(quoteItem.getCalcType())) {
@ -787,12 +801,12 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
} }
}else{ }else{
log.error("网点客服未配置表达式"); log.error("销售员提成未配置表达式");
} }
} }
}else{ }else{
log.error("网点客服无报价"); log.error("销售员提成无报价");
} }
} }