This commit is contained in:
linfso 2025-07-14 18:56:22 +08:00
parent 3f0d6cde0b
commit a57eb921d4

View File

@ -1070,14 +1070,26 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按票计算:计算公式:" + calcExprStr + ",票数:1");
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", new BigDecimal("1"));
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
// 重量计算
else if ("2".equals(quoteItem.getCalcType())) {
if( isValueInExprScope(waybill.getBillWeight().doubleValue(),exprItem) ) {
calcExprStr = getCalcFeeExpStr(waybill.getBillWeight(), exprItem);
log.info("按重量计算:计算公式:" + calcExprStr + ",重量:"+waybill.getBillWeight().stripTrailingZeros().toPlainString());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", waybill.getBillWeight());
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
@ -1088,7 +1100,14 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
if( isValueInExprScope(waybill.getTotalVolume().doubleValue(),exprItem) ) {
calcExprStr = getCalcFeeExpStr(waybill.getTotalVolume(), exprItem);
log.info("按体积计算:计算公式:" + calcExprStr + ",体积:"+waybill.getTotalVolume().stripTrailingZeros().toPlainString());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", waybill.getTotalVolume());
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
}
@ -1099,7 +1118,14 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按包裹数:计算公式:" + calcExprStr + ",包裹数:"+1);
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", new BigDecimal("1"));
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
// 插入提成
@ -1186,7 +1212,13 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按票计算:计算公式:" + calcExprStr + ",票数:1");
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", new BigDecimal("1"));
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
// 重量计算
else if ("2".equals(quoteItem.getCalcType())) {
@ -1195,12 +1227,17 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
calcExprStr = getCalcFeeExpStr(waybill.getBillWeight(), exprItem);
log.info("按重量计算:计算公式:" + calcExprStr + ",重量:"+waybill.getBillWeight().stripTrailingZeros().toPlainString());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", waybill.getBillWeight());
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
}
// 体积计算
else if ("3".equals(quoteItem.getCalcType())) {
@ -1209,7 +1246,14 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
calcExprStr = getCalcFeeExpStr(waybill.getTotalVolume(), exprItem);
log.info("按体积计算:计算公式:" + calcExprStr + ",体积:"+waybill.getTotalVolume().stripTrailingZeros().toPlainString());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", waybill.getTotalVolume());
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
}
@ -1220,7 +1264,14 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按包裹数:计算公式:" + calcExprStr + ",包裹数:"+1);
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", new BigDecimal("1"));
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
// 插入提成
@ -1321,7 +1372,14 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按票计算:计算公式:" + calcExprStr + ",票数:1");
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", new BigDecimal("1"));
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
// 重量计算
else if ("2".equals(quoteItem.getCalcType())) {
@ -1330,7 +1388,13 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按重量计算:计算公式:" + calcExprStr + ",重量:"+waybill.getBillWeight().stripTrailingZeros().toPlainString());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", waybill.getBillWeight());
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
// 体积计算
@ -1339,7 +1403,14 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按体积计算:计算公式:" + calcExprStr + ",体积:"+waybill.getTotalVolume().stripTrailingZeros().toPlainString());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", waybill.getTotalVolume());
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
// 包裹数
else if ("4".equals(quoteItem.getCalcType())) {
@ -1348,7 +1419,13 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按包裹数:计算公式:" + calcExprStr + ",包裹数:"+1);
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", new BigDecimal("1"));
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
// 插入提成
@ -1453,7 +1530,14 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements
.replaceAll("s", exprItem.getInitialWeight().toString())
.replaceAll("d", exprItem.getAdditionalWeight().toString());
log.info("按柜内票数:计算公式:" + calcExprStr + ",按柜内票数:"+siteBatch.getTotalWaybillQty());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExprStr).toString());
Map<String, Object> env = new HashMap<>();
env.put("w", new BigDecimal(siteBatch.getTotalWaybillQty().toString()));
env.put("s", exprItem.getInitialWeight());
env.put("d", exprItem.getAdditionalWeight());
profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString());
}
}else{
continue;