This commit is contained in:
linfso 2025-03-16 18:43:52 +08:00
parent bf91ab29ab
commit a42263827c

View File

@ -1328,18 +1328,28 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
String calcExprStr="";
for (EmisCommissionExpression exprItem : exprList) {
log.info("计算项目表达式:" + JSONObject.toJSONString(exprItem));
String calcExp = exprItem.getCalculateExpression();
double profitMoney = 0.0D;
// 按柜内票数
if ("5".equals(quoteItem.getCalcType())) {
calcExprStr = calcExp.replaceAll("w", siteBatch.getTotalWaybillQty().toString())
.replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按柜内票数:计算公式:" + calcExprStr + ",按柜内票数:"+siteBatch.getTotalWaybillQty());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
if (exprItem.getStartWeight().doubleValue() < siteBatch.getTotalWaybillQty().doubleValue()
&& exprItem.getEndWeight().doubleValue() >= siteBatch.getTotalWaybillQty().doubleValue()
) {
log.info("计算项目表达式:" + JSONObject.toJSONString(exprItem));
String calcExp = exprItem.getCalculateExpression();
// 按柜内票数
if ("5".equals(quoteItem.getCalcType())) {
calcExprStr = calcExp.replaceAll("w", siteBatch.getTotalWaybillQty().toString())
.replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按柜内票数:计算公式:" + calcExprStr + ",按柜内票数:"+siteBatch.getTotalWaybillQty());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
}
}else{
continue;
}
// 插入参与分成人员
String empName=quoteItem.getEmpName();