diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMonthpayAccountController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMonthpayAccountController.java index 140b80454..e92b0c106 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMonthpayAccountController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisMonthpayAccountController.java @@ -74,7 +74,7 @@ public class EmisMonthpayAccountController extends EmisBaseController * @param emisCustomerUser * @return */ - @JacksonFilter(include= {"customerCode","custNo","custName","payee","salesmen","payeeName","salesmenName"},value= EmisCustomerUser.class,type= JacksonFilter.JscksonFilterType.RESPONSE) + @JacksonFilter(include= {"customerCode","custNo","custName","payee","salesmen","payeeName","salesmenName","status"},value= EmisCustomerUser.class,type= JacksonFilter.JscksonFilterType.RESPONSE) @GetMapping("/listAllSimple") public TableDataInfo listAllSimple(EmisCustomerUser emisCustomerUser) { diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisRegionController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisRegionController.java index 62af5a2ce..2a4f7e4ef 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisRegionController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisRegionController.java @@ -64,7 +64,7 @@ public class EmisRegionController extends EmisBaseController } // @PreAuthorize("@ss.hasPermi('emis:emisRegion:list')") - @JacksonFilter(include= {"id","regionCode","regionName","regionNameEn","parentCode"},value= EmisRegion.class,type= JacksonFilter.JscksonFilterType.RESPONSE) + @JacksonFilter(include= {"id","regionCode","regionName","regionNameEn","parentCode","countryCode"},value= EmisRegion.class,type= JacksonFilter.JscksonFilterType.RESPONSE) @GetMapping("/listSimple") public TableDataInfo listSimple(EmisRegion emisRegion) { 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-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillAjustApplyController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillAjustApplyController.java index 949ef3acb..859d9b958 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillAjustApplyController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillAjustApplyController.java @@ -306,6 +306,7 @@ public class EmisWaybillAjustApplyController extends EmisBaseController EmisWaybillAjustApply emisWaybillAjustApply = new EmisWaybillAjustApply(); emisWaybillAjustApply.setId(id); emisWaybillAjustApply.setDestConfirmNote(spr.getDestConfirmNote()); + emisWaybillAjustApply.setCenterConfirmNote(spr.getCenterConfirmNote()); emisWaybillAjustApplyService.auditCenterNoPass(emisWaybillAjustApply); }catch (Exception ex){ diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisCommissionQuote.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisCommissionQuote.java index 91f8d4d80..54405e46c 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisCommissionQuote.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisCommissionQuote.java @@ -59,6 +59,8 @@ public class EmisCommissionQuote extends BaseEntity private String feeType; /* 计算类型 票,重量 emis_commission_type */ private String calcType; + /* 重量计算方式,1:按照结算重量计算计提,2:按照实际重量计算计提 */ + private String calcWeightType; /* 岗位类型:emis_commission_post */ private String postType; /* 快递类型:emis_biz_shipping_method */ diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java index 59a0d41e4..63c531b98 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java @@ -2619,8 +2619,14 @@ public class EmisBaseService { order.put("kdgs", "TANEX"); - // 获取起始网点 - EmisSite sendSite = getSiteByCode(waybill.getSendSiteCode()); + // 获取始发网点 + if (StringUtils.isBlank(waybill.getStartSiteCode())) { + waybill.setStartSiteCode(waybill.getSendSiteCode()); + } + if(StringUtils.isBlank(waybill.getStartSiteName())){ + waybill.setStartSiteName(waybill.getSendSiteName()); + } + EmisSite startSite = getSiteByCode(waybill.getStartSiteCode()); // 计算三段码 目的网点2字码+目的地名称 String destSite2Code = ""; @@ -2636,7 +2642,7 @@ public class EmisBaseService { destName=destination.getDestName(); } - String package3dm=sendSite.getSiteName()+'-'+destName; + String package3dm=startSite.getSiteName()+'-'+destName; String packageWJC=destSite2Code; String pdfInfo="["+package3dm+"]["+packageWJC+"]"; order.put("pdfInfo", pdfInfo); @@ -2756,8 +2762,8 @@ public class EmisBaseService { extData.put("k7",WaybillHelper.removeUnSeeChar(k7)); - extData.put("k8",WaybillHelper.removeUnSeeChar(sendSite.getSiteNameEn())); - extData.put("k10",WaybillHelper.removeUnSeeChar(waybill.getSendSiteName())); + extData.put("k8",WaybillHelper.removeUnSeeChar(startSite.getSiteNameEn())); + extData.put("k10",WaybillHelper.removeUnSeeChar(waybill.getStartSiteName())); extData.put("k9",WaybillHelper.removeUnSeeChar(destSite.getSiteNameEn())); extData.put("k11",WaybillHelper.removeUnSeeChar(destSite.getSiteName())); diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/IEmisWaybillService.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/IEmisWaybillService.java index f2e9e2fad..5988b5ab6 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/IEmisWaybillService.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/IEmisWaybillService.java @@ -146,6 +146,10 @@ public interface IEmisWaybillService extends IDataAuditService public int realSubmitOrder(EmisWaybill emisWaybill) throws EmisBizError; + + public void checkCountry(EmisWaybill emisWaybill) throws EmisBizError; + + /** * OMS下单 * @param emisWaybill 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..ed7745dea 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 calcWeightType = quoteItem.getCalcWeightType(); + BigDecimal usedWeight = ("1".equals(calcWeightType)) + ? 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 calcWeightType = quoteItem.getCalcWeightType(); + BigDecimal usedWeight = ("1".equals(calcWeightType)) + ? 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 calcWeightType = quoteItem.getCalcWeightType(); + BigDecimal usedWeight = ("1".equals(calcWeightType)) + ? 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 calcWeightType = quoteItem.getCalcWeightType(); + BigDecimal usedWeight = ("1".equals(calcWeightType)) + ? 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 calcWeightType = quoteItem.getCalcWeightType(); + BigDecimal usedWeight = ("1".equals(calcWeightType)) + ? 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 calcWeightType = quoteItem.getCalcWeightType(); + BigDecimal usedWeight = ("1".equals(calcWeightType)) + ? 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 calcWeightType = quoteItem.getCalcWeightType(); + BigDecimal usedWeight = ("1".equals(calcWeightType)) + ? 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/java/com/xdadan/erp/emis/service/impl/EmisTmsScanRecordServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsScanRecordServiceImpl.java index 535e26516..4f64543d6 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsScanRecordServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsScanRecordServiceImpl.java @@ -2095,8 +2095,8 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm // } // } - emisTmsScanRecord.setScanSite(emisWaybill.getSendSiteName()); - emisTmsScanRecord.setScanSiteCode(emisWaybill.getSendSiteCode()); + emisTmsScanRecord.setScanSite(emisWaybill.getStartSiteName()); + emisTmsScanRecord.setScanSiteCode(emisWaybill.getStartSiteCode()); String dispatchOrSendManCode = MapUtils.getString(scanDataItem,"dispatchOrSendManCode",null); diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchServiceImpl.java index acc1ee1d8..20f9dbc88 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchServiceImpl.java @@ -148,13 +148,25 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi public void checkSiteBatch(EmisTmsSiteBatch oldSiteBatch, String billCode) throws EmisBizError { EmisWaybill emisWaybill = emisWaybillMapper.selectEmisWaybillByBillCode(billCode); - if (Objects.nonNull(emisWaybill) && StringUtil.isNotBlank(emisWaybill.getVirtualRemark())) { - throw new EmisBizError(EmisBizErrorType.FAIL, billCode + "已绑定虚拟单,无法录入批次"); - } + checkVirtual(billCode, emisWaybill); checkTransPlanRule(oldSiteBatch, emisWaybill); checkUnique(oldSiteBatch, billCode); } + private static void checkVirtual(String billCode, EmisWaybill emisWaybill) throws EmisBizError { + if (Objects.isNull(emisWaybill)) { + return; + } + if ("0086".equals(emisWaybill.getSendCountry())) { + if (StringUtil.isNotBlank(emisWaybill.getVirtualRemark())) { + throw new EmisBizError(EmisBizErrorType.FAIL, billCode + "已绑定虚拟单,无法录入批次"); + } + } + if ("0086".equals(emisWaybill.getReceiveCountry()) && "1".equals(emisWaybill.getBlVirtual())) { + throw new EmisBizError(EmisBizErrorType.FAIL, billCode + "返货虚拟单,无法录入批次"); + } + } + private void checkTransPlanRule(EmisTmsSiteBatch oldSiteBatch, EmisWaybill emisWaybill) throws EmisBizError { EmisTransPlanRule emisTransPlanRule = new EmisTransPlanRule(); emisTransPlanRule.setStartSiteCode(oldSiteBatch.getStartSiteCode()); diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillAjustApplyServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillAjustApplyServiceImpl.java index f8a1f271e..f7d3de756 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillAjustApplyServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillAjustApplyServiceImpl.java @@ -134,6 +134,8 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements // 检查月结客户首次签约日期,首次签约之前开的不允许修改 checkFirstSigningDay(emisWaybillOld, getEmisWaybillNewFromJson(emisWaybillAjustApply)); + emisWaybillService.checkCountry(getEmisWaybillNewFromJson(emisWaybillAjustApply)); + // 检查月结/现金客户额度 // bug:1657 调整后逻辑:单证部同事 员工表标识“单证专属”岗位登记的网点费用申请,不用判断 现金额度和月结客户额度 boolean isDZZS=checkIsDZZS(emisWaybillAjustApply.getApplyManCode()); diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java index 1a1fc12ff..6945c5faf 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java @@ -3287,13 +3287,17 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb } } - private void checkCountry(EmisWaybill emisWaybillSave) throws EmisBizError { + public void checkCountry(EmisWaybill emisWaybillSave) throws EmisBizError { EmisTransLine emisTransLine = new EmisTransLine(); emisTransLine.setLineCode(emisWaybillSave.getTransLineType()); List emisTransLines = emisTransLineMapper.selectEmisTransLineList(emisTransLine); - if(CollectionUtil.isEmpty(emisTransLines)){ + EmisSite siteByCode = getSiteByCode(emisWaybillSave.getStartSiteCode()); + if(CollectionUtil.isEmpty(emisTransLines)||Objects.isNull(siteByCode)){ return; } + if(!siteByCode.getCountryCode().equals(emisTransLines.get(0).getFromCountry())){ + throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "始发网点与所选线路不匹配" ); + } if(emisWaybillSave.getSendCountry().equals(emisTransLines.get(0).getFromCountry())){ return; } @@ -3511,6 +3515,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb checkFeeWaybill.setTotalVolume(emisWaybillSave.getTotalVolume()); checkFeeWaybill.setSendSiteCode(emisWaybillSave.getSendSiteCode()); + checkFeeWaybill.setStartSiteCode(emisWaybillSave.getStartSiteCode()); checkFeeWaybill.setDispatchUnderlingSiteCode(emisWaybillSave.getDispatchUnderlingSiteCode()); checkFeeWaybill.setCustomsClear(emisWaybillSave.getCustomsClear()); checkFeeWaybill.setCustomsEclaration(emisWaybillSave.getCustomsEclaration()); @@ -3899,9 +3904,13 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb emisWaybill.setSendDate(new Date()); } + if (StringUtils.isBlank(emisWaybill.getStartSiteCode())) { + emisWaybill.setStartSiteCode(emisWaybill.getSendSiteCode()); + } + // bug: 1704 按照运单号开单日期去报价表抓取对应的报价进行计算 List emisQuotePriceList=getValidQuotePriceList(emisWaybill.getTransLineType(),emisWaybill.getProductType(), - emisWaybill.getSendSiteCode(),emisWaybill.getDispatchUnderlingSiteCode(), + emisWaybill.getStartSiteCode(),emisWaybill.getDispatchUnderlingSiteCode(), emisWaybill.getCalcFeeType(),emisWaybill.getCustomerCode(),emisWaybill.getCustNo(),emisWaybill.getSendDate() ); diff --git a/emis-biz/src/main/resources/mapper/EmisCommissionQuoteMapper.xml b/emis-biz/src/main/resources/mapper/EmisCommissionQuoteMapper.xml index 23935e561..4259208fa 100644 --- a/emis-biz/src/main/resources/mapper/EmisCommissionQuoteMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisCommissionQuoteMapper.xml @@ -16,6 +16,7 @@ + @@ -37,7 +38,7 @@ - select quote_id, quote_code, quote_name, trans_line_code, send_site_code, next_site_code, prod_code, from_country, country, fee_type, calc_type, post_type, trans_type, bl_open, emp_code, emp_name, start_date, end_date, priority_level, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_commission_quote + select quote_id, quote_code, quote_name, trans_line_code, send_site_code, next_site_code, prod_code, from_country, country, fee_type, calc_type, calc_weight_type, post_type, trans_type, bl_open, emp_code, emp_name, start_date, end_date, priority_level, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_commission_quote @@ -159,6 +163,7 @@ country, fee_type, calc_type, + calc_weight_type, post_type, trans_type, bl_open, @@ -189,6 +194,7 @@ #{country}, #{feeType}, #{calcType}, + #{calcWeightType}, #{postType}, #{transType}, #{blOpen}, @@ -224,6 +230,7 @@ fee_type = #{feeType}, calc_type = #{calcType}, + calc_weight_type = #{calcWeightType}, post_type = #{postType}, trans_type = #{transType}, bl_open = #{blOpen}, @@ -281,6 +288,7 @@ and fee_type=#{feeType} and bl_open=#{blOpen} and calc_type=#{calcType} + and calc_weight_type=#{calcWeightType} and post_type=#{postType} and ( trans_type = #{transType} diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index 14cbdf288..babd0ad05 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -814,6 +814,7 @@ and ( a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode} and ( a.take_piece_employee_code=#{params.privEmpCode} or (a.pickup_method in('1','3') and a.operate_employee_code is null ) @@ -1110,7 +1111,7 @@ and ( - a.send_site_code=#{params.privSiteCode} + a.send_site_code=#{params.privSiteCode} or a.start_site_code=#{params.privSiteCode} ) @@ -1299,7 +1300,8 @@ and payment_remark like concat('%', #{paymentRemark}, '%') and order_remark like concat('%', #{orderRemark}, '%') - and FIND_IN_SET(`send_site_code`,#{sendSiteCode}) + and (FIND_IN_SET(`send_site_code`,#{sendSiteCode}) or FIND_IN_SET(`start_site_code`,#{sendSiteCode})) + and a.remark like concat('%', #{remark}, '%') and a.create_by= #{createBy} @@ -1420,7 +1422,8 @@ select line_code from emis_trans_line etl where etl.trans_type=1 ) and bl_sign!='1' and waybill_status!='40' - and a.send_site_code=#{params.privSiteCode} and a.current_site_code=#{params.privSiteCode} + and (a.send_site_code=#{params.privSiteCode} or a.start_site_code=#{params.privSiteCode}) + and a.current_site_code=#{params.privSiteCode} @@ -1450,6 +1453,7 @@ a.send_site_code=#{params.privSiteCode} or a.dispatch_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode} or EXISTS (select 1 from emis_tms_scan_record etsr where a.bill_code=etsr.main_bill_code and etsr.scan_site_code=#{params.privSiteCode}) @@ -1512,6 +1516,7 @@ a.send_site_code=#{params.privSiteCode} or a.dispatch_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode} or EXISTS (select 1 from emis_tms_scan_record etsr where a.bill_code=etsr.main_bill_code and etsr.scan_site_code=#{params.privSiteCode}) @@ -1844,6 +1849,7 @@ and ( a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode} or a.dispatch_site_code=#{params.privSiteCode} or EXISTS (select 1 from emis_tms_scan_record etsr where a.bill_code=etsr.main_bill_code and etsr.scan_site_code=#{params.privSiteCode}) @@ -1929,6 +1935,7 @@ and ( a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode} or a.dispatch_underling_site_code=#{params.privSiteCode} ) @@ -1979,6 +1986,7 @@ and ( a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode} or a.dispatch_underling_site_code=#{params.privSiteCode} ) @@ -2293,7 +2301,8 @@ select line_code from emis_trans_line etl where etl.trans_type=1 ) and bl_sign!='1' and waybill_status!='40' - and a.send_site_code=#{params.privSiteCode} and a.current_site_code=#{params.privSiteCode} + and (a.send_site_code=#{params.privSiteCode} or a.start_site_code=#{params.privSiteCode}) + and a.current_site_code=#{params.privSiteCode} @@ -2309,6 +2318,7 @@ and ( a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode} or a.dispatch_site_code=#{params.privSiteCode} @@ -2500,6 +2510,7 @@ and ( a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode} or a.dispatch_site_code=#{params.privSiteCode} or @@ -2557,7 +2568,8 @@ and a.order_status in('0','3') and ( - a.send_site_code=#{params.privSiteCode} + (a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode}) and ( a.take_piece_employee_code=#{params.privEmpCode} or (a.pickup_method in('1','3') and a.operate_employee_code is null ) @@ -2579,7 +2591,8 @@ and a.waybill_status!='0' and a.order_status!='2' - and a.send_site_code=#{params.privSiteCode} + and (a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode}) and ( a.operate_employee_code=#{params.privEmpCode} or a.take_piece_employee_code=#{params.privEmpCode} @@ -2599,7 +2612,8 @@ where a.del_flag='0' and a.order_status='2' - and a.send_site_code=#{params.privSiteCode} + and (a.send_site_code=#{params.privSiteCode} + or a.start_site_code=#{params.privSiteCode}) and ( a.operate_employee_code=#{params.privEmpCode} or a.take_piece_employee_code=#{params.privEmpCode} @@ -2619,7 +2633,7 @@ where a.del_flag='0' and a.order_status in('0','3') - and a.send_site_code=#{params.privSiteCode} + and (a.send_site_code=#{params.privSiteCode} or a.start_site_code=#{params.privSiteCode}) and exists ( select 1 from emis_waybill_change_to ewcto where a.bill_code=ewcto.bill_code and ewcto.change_from=#{params.privEmpCode} ) @@ -2637,7 +2651,7 @@ where a.del_flag='0' and a.waybill_status='40' - and a.send_site_code=#{params.privSiteCode} + and (a.send_site_code=#{params.privSiteCode} or a.start_site_code=#{params.privSiteCode}) and ( a.operate_employee_code=#{params.privEmpCode} or a.take_piece_employee_code=#{params.privEmpCode} @@ -2657,7 +2671,7 @@ where a.del_flag='0' and a.bl_sign='1' - and a.send_site_code=#{params.privSiteCode} + and (a.send_site_code=#{params.privSiteCode} or a.start_site_code=#{params.privSiteCode}) and ( a.operate_employee_code=#{params.privEmpCode} or a.take_piece_employee_code=#{params.privEmpCode}