demand:TMS系统-运单录入限制:寄件国家和目的国家需要和所选线路一致

committer: heyu
This commit is contained in:
aike 2025-05-28 10:52:56 +08:00
parent db4e658ec1
commit 31259ec806

View File

@ -1451,6 +1451,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 检查是否已锁单
checkDBBillIsLock(emisWaybillOld);
// 校验寄件国家是否匹配线路
checkCountry(emisWaybillSave);
emisWaybillSave.setId(emisWaybillOld.getId());
// 把历史发货日期带过来用于重新计算预估到到时间
@ -3023,6 +3026,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
throw new EmisBizError(EmisBizErrorType.FAIL, "单号与子单号相同,请换单号");
}
// 校验寄件国家是否匹配线路
checkCountry(emisWaybillSave);
// 子单号做扣减
if ("1".equals(emisWaybillSave.getBlGenSubbill())) {
Integer subBillCount = emisElectronicSitePagService.getTotalAvailablePagCount(emisWaybillSave.getSendSiteCode(), "T7080", "1002");
@ -3208,6 +3214,19 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
}
}
private void checkCountry(EmisWaybill emisWaybillSave) throws EmisBizError {
EmisTransLine emisTransLine = new EmisTransLine();
emisTransLine.setLineCode(emisWaybillSave.getTransLineType());
List<EmisTransLine> emisTransLines = emisTransLineMapper.selectEmisTransLineList(emisTransLine);
if(CollectionUtil.isEmpty(emisTransLines)){
return;
}
if(emisWaybillSave.getSendCountry().equals(emisTransLines.get(0).getFromCountry())){
return;
}
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "寄件国家与所选线路不匹配" );
}
public int bindSalesmen(String empCode,String customerCode) throws EmisBizError {