demand: TMS系统 - 运单批量录入 - 运单号含有特殊符号 不允许导入保存成功

committer: heyu
This commit is contained in:
aike 2025-08-08 10:42:21 +08:00
parent f51ddc3cf5
commit b62afa654a

View File

@ -484,11 +484,16 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
public int draftSubmitOrder(EmisWaybill emisWaybillSave) throws EmisBizError {
// 如果没有单号就生成单号,如果有单号需要判断是否重复
if( !StringUtils.isEmpty(emisWaybillSave.getBillCode()) ) {
if (!StringUtils.isEmpty(emisWaybillSave.getBillCode())) {
String billCode=WaybillHelper.formatQueryValue(emisWaybillSave.getBillCode());
String billCode = WaybillHelper.formatQueryValue(emisWaybillSave.getBillCode());
emisWaybillSave.setBillCode(billCode);
// 校验运单号不能包含特殊字符
if (billCode.matches(".*[^a-zA-Z0-9\\-].*")) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "运单号不能包含特殊字符");
}
boolean isExists = this.checkWaybillIsExists(emisWaybillSave.getBillCode());
if (isExists) {
throw new EmisBizError(EmisBizErrorType.EXISTS, "运单号重复");