diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisTransProductController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisTransProductController.java index 3d5d9d5f1..5135907d7 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisTransProductController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisTransProductController.java @@ -54,7 +54,7 @@ public class EmisTransProductController extends EmisBaseController /** * 查询运输产品类型列表 */ - @PreAuthorize("@ss.hasPermi('emis:emisTransProduct:list')") +// @PreAuthorize("@ss.hasPermi('emis:emisTransProduct:list')") @GetMapping("/list") public TableDataInfo list(EmisTransProduct emisTransProduct) { diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisCommissionProfitServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisCommissionProfitServiceImpl.java index b3e126c16..c14a4034d 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisCommissionProfitServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisCommissionProfitServiceImpl.java @@ -11,10 +11,7 @@ package com.xdadan.erp.emis.service.impl; import java.math.BigDecimal; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -546,14 +543,19 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements } // 重量计算 else if ("2".equals(quoteItem.getCalcType())) { - if( isValueInExprScope(waybill.getBillWeight().doubleValue(),exprItem) ){ - calcExprStr = getCalcFeeExpStr(waybill.getBillWeight(),exprItem); - log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + waybill.getBillWeight().stripTrailingZeros().toPlainString()); + String transType = waybill.getTransType(); + BigDecimal usedWeight = ("1".equals(transType) || "2".equals(transType)) + ? waybill.getSettlementWeight() + : waybill.getBillWeight(); + if (isValueInExprScope(usedWeight != null ? usedWeight.doubleValue() : 0.0, exprItem)) { + calcExprStr = getCalcFeeExpStr(usedWeight, exprItem); + log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + + (usedWeight != null ? usedWeight.stripTrailingZeros().toPlainString() : "0")); Map env = new HashMap<>(); - env.put("w", waybill.getBillWeight()); + env.put("w", usedWeight); env.put("s", exprItem.getInitialWeight()); env.put("d", exprItem.getAdditionalWeight()); - profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString()); + profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp, env).toString()); } } @@ -680,14 +682,19 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements } // 重量计算 else if ("2".equals(quoteItem.getCalcType())) { - if( isValueInExprScope(waybill.getBillWeight().doubleValue(),exprItem) ) { - calcExprStr = getCalcFeeExpStr(waybill.getBillWeight(),exprItem); - log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + waybill.getBillWeight().stripTrailingZeros().toPlainString()); + String transType = waybill.getTransType(); + BigDecimal usedWeight = ("1".equals(transType) || "2".equals(transType)) + ? waybill.getSettlementWeight() + : waybill.getBillWeight(); + if (isValueInExprScope(usedWeight != null ? usedWeight.doubleValue() : 0.0, exprItem)) { + calcExprStr = getCalcFeeExpStr(usedWeight, exprItem); + log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + + (usedWeight != null ? usedWeight.stripTrailingZeros().toPlainString() : "0")); Map env = new HashMap<>(); - env.put("w", waybill.getBillWeight()); + env.put("w", usedWeight); env.put("s", exprItem.getInitialWeight()); env.put("d", exprItem.getAdditionalWeight()); - profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString()); + profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp, env).toString()); } } @@ -823,15 +830,19 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements } // 重量计算-结算重量 else if ("2".equals(quoteItem.getCalcType())) { - - if( isValueInExprScope(waybill.getBillWeight().doubleValue(),exprItem) ) { - calcExprStr = getCalcFeeExpStr(waybill.getBillWeight(),exprItem); - log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + waybill.getBillWeight().stripTrailingZeros().toPlainString()); + String transType = waybill.getTransType(); + BigDecimal usedWeight = ("1".equals(transType) || "2".equals(transType)) + ? waybill.getSettlementWeight() + : waybill.getBillWeight(); + if (isValueInExprScope(usedWeight != null ? usedWeight.doubleValue() : 0.0, exprItem)) { + calcExprStr = getCalcFeeExpStr(usedWeight, exprItem); + log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + + (usedWeight != null ? usedWeight.stripTrailingZeros().toPlainString() : "0")); Map env = new HashMap<>(); - env.put("w", waybill.getBillWeight()); + env.put("w", usedWeight); env.put("s", exprItem.getInitialWeight()); env.put("d", exprItem.getAdditionalWeight()); - profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString()); + profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp, env).toString()); } } @@ -975,16 +986,20 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements } // 重量计算 else if ("2".equals(quoteItem.getCalcType())) { - - if( isValueInExprScope(waybill.getBillWeight().doubleValue(),exprItem) ) { - calcExprStr = getCalcFeeExpStr(waybill.getBillWeight(), exprItem); - log.info("按重量计算:计算公式:" + calcExprStr + ",重量:"+waybill.getBillWeight().stripTrailingZeros().toPlainString()); + String transType = waybill.getTransType(); + BigDecimal usedWeight = ("1".equals(transType) || "2".equals(transType)) + ? waybill.getSettlementWeight() + : waybill.getBillWeight(); + if (isValueInExprScope(usedWeight != null ? usedWeight.doubleValue() : 0.0, exprItem)) { + calcExprStr = getCalcFeeExpStr(usedWeight, exprItem); + log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + + waybill.getBillWeight().stripTrailingZeros().toPlainString()); Map env = new HashMap<>(); - env.put("w", waybill.getBillWeight()); + env.put("w", usedWeight); env.put("s", exprItem.getInitialWeight()); env.put("d", exprItem.getAdditionalWeight()); - profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString()); + profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp, env).toString()); } } @@ -1121,16 +1136,21 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements } // 重量计算 else if ("2".equals(quoteItem.getCalcType())) { - if( isValueInExprScope(waybill.getBillWeight().doubleValue(),exprItem) ) { - calcExprStr = getCalcFeeExpStr(waybill.getBillWeight(), exprItem); - log.info("按重量计算:计算公式:" + calcExprStr + ",重量:"+waybill.getBillWeight().stripTrailingZeros().toPlainString()); + String transType = waybill.getTransType(); + BigDecimal usedWeight = ("1".equals(transType) || "2".equals(transType)) + ? waybill.getSettlementWeight() + : waybill.getBillWeight(); + if (isValueInExprScope(usedWeight != null ? usedWeight.doubleValue() : 0.0, exprItem)) { + calcExprStr = getCalcFeeExpStr(usedWeight, exprItem); + log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + + waybill.getBillWeight().stripTrailingZeros().toPlainString()); Map env = new HashMap<>(); - env.put("w", waybill.getBillWeight()); + env.put("w", usedWeight); env.put("s", exprItem.getInitialWeight()); env.put("d", exprItem.getAdditionalWeight()); - profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString()); + profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp, env).toString()); } @@ -1263,18 +1283,22 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements } // 重量计算 else if ("2".equals(quoteItem.getCalcType())) { + String transType = waybill.getTransType(); + BigDecimal usedWeight = ("1".equals(transType) || "2".equals(transType)) + ? waybill.getSettlementWeight() + : waybill.getBillWeight(); + if (isValueInExprScope(usedWeight != null ? usedWeight.doubleValue() : 0.0, exprItem)) { + calcExprStr = getCalcFeeExpStr(usedWeight, exprItem); - if( isValueInExprScope(waybill.getBillWeight().doubleValue(),exprItem) ) { - calcExprStr = getCalcFeeExpStr(waybill.getBillWeight(), exprItem); - - log.info("按重量计算:计算公式:" + calcExprStr + ",重量:"+waybill.getBillWeight().stripTrailingZeros().toPlainString()); + log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + + waybill.getBillWeight().stripTrailingZeros().toPlainString()); Map env = new HashMap<>(); - env.put("w", waybill.getBillWeight()); + env.put("w", usedWeight); env.put("s", exprItem.getInitialWeight()); env.put("d", exprItem.getAdditionalWeight()); - profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString()); + profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp, env).toString()); } @@ -1424,18 +1448,25 @@ public class EmisCommissionProfitServiceImpl extends EmisBaseService implements } // 重量计算 else if ("2".equals(quoteItem.getCalcType())) { - calcExprStr = calcExp.replaceAll("w", waybill.getBillWeight().stripTrailingZeros().toPlainString()) + String transType = waybill.getTransType(); + BigDecimal usedWeight = ("1".equals(transType) || "2".equals(transType)) + ? waybill.getSettlementWeight() + : waybill.getBillWeight(); + calcExprStr = calcExp + .replaceAll("w", + usedWeight != null ? usedWeight.stripTrailingZeros().toPlainString() : "0") .replaceAll("s", exprItem.getInitialWeight().toString()) .replaceAll("d", exprItem.getAdditionalWeight().toString()); - log.info("按重量计算:计算公式:" + calcExprStr + ",重量:"+waybill.getBillWeight().stripTrailingZeros().toPlainString()); + log.info("按重量计算:计算公式:" + calcExprStr + ",重量:" + + waybill.getBillWeight().stripTrailingZeros().toPlainString()); Map env = new HashMap<>(); - env.put("w", waybill.getBillWeight()); + env.put("w", usedWeight); env.put("s", exprItem.getInitialWeight()); env.put("d", exprItem.getAdditionalWeight()); - profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp,env).toString()); + profitMoney = Double.valueOf(AviatorEvaluator.execute(calcExp, env).toString()); } // 体积计算 diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index 4b7bdcb26..c1e9e1053 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -1300,7 +1300,7 @@ and payment_remark like concat('%', #{paymentRemark}, '%') and order_remark like concat('%', #{orderRemark}, '%') - and (a.send_site_code=#{params.privSiteCode} or a.start_site_code=#{params.privSiteCode}) + and (a.send_site_code=#{sendSiteCode} or a.start_site_code=#{sendSiteCode}) and a.remark like concat('%', #{remark}, '%')