Browse Source

fix:修复仓库编码重复的问题

dev
pref_mail@163.com 2 months ago
parent
commit
b5469d0cc1
  1. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java

@ -227,11 +227,10 @@ public class BasicdataWarehouseController extends BladeController {
List<BasicdataWarehouseEntity> warehouseList = warehouseService.list(); List<BasicdataWarehouseEntity> warehouseList = warehouseService.list();
List<BasicdataWarehouseEntity> names = warehouseList.stream().filter(warehouseEntity -> warehouseEntity.getName().equals(warehouseWarehouse.getName())).collect(Collectors.toList()); List<BasicdataWarehouseEntity> names = warehouseList.stream().filter(warehouseEntity -> warehouseEntity.getName().equals(warehouseWarehouse.getName())).collect(Collectors.toList());
List<BasicdataWarehouseEntity> codes = warehouseList.stream().filter(warehouseEntity -> warehouseEntity.getCode().equals(warehouseWarehouse.getCode())).collect(Collectors.toList()); List<BasicdataWarehouseEntity> codes = warehouseList.stream().filter(warehouseEntity -> warehouseEntity.getWarehouseCode().equals(warehouseWarehouse.getWarehouseCode())).collect(Collectors.toList());
if(!names.isEmpty()){ if(!names.isEmpty()){
throw new CustomerException("仓库名称重复,请重新输入"); throw new CustomerException("仓库名称重复,请重新输入");
} }
if(!codes.isEmpty()){ if(!codes.isEmpty()){
throw new CustomerException("仓库编号重复,请重新输入"); throw new CustomerException("仓库编号重复,请重新输入");
} }

Loading…
Cancel
Save