给商品excel导入增加校验:校验条码是否是正整数
This commit is contained in:
@@ -496,6 +496,16 @@ public class MaterialService {
|
||||
String wholesaleDecimal = ExcelUtils.getContent(src, i, 13); //销售价
|
||||
String lowDecimal = ExcelUtils.getContent(src, i, 14); //最低售价
|
||||
String enabled = ExcelUtils.getContent(src, i, 15); //状态
|
||||
//校验基础条码是否是正整数
|
||||
if(!StringUtil.isPositiveInteger(barCode)) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_NOT_INTEGER_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_BARCODE_NOT_INTEGER_MSG, barCode));
|
||||
}
|
||||
//校验副条码是否是正整数
|
||||
if(StringUtil.isNotEmpty(manyBarCode) && !StringUtil.isPositiveInteger(manyBarCode)) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_NOT_INTEGER_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_BARCODE_NOT_INTEGER_MSG, manyBarCode));
|
||||
}
|
||||
//校验条码是否存在
|
||||
List<MaterialVo4Unit> basicMaterialList = getMaterialByBarCode(barCode);
|
||||
if(basicMaterialList!=null && basicMaterialList.size()>0) {
|
||||
|
||||
Reference in New Issue
Block a user