bug更改
This commit is contained in:
+14
-1
@@ -133,17 +133,30 @@ public class AssociationWarehouseImpl extends ServiceImpl<AssociationWarehouseMa
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除关联仓库
|
||||
* 批量删除关联仓库。is_default=2(新建仓自动产生的默认仓绑定)不可删,调用方传入的 id 会被过滤。
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] associationWarehouseIds ) {
|
||||
List<AssociationWarehouse> list = new ArrayList<>();
|
||||
for (Long id : associationWarehouseIds) {
|
||||
if (id == null) {
|
||||
continue;
|
||||
}
|
||||
AssociationWarehouse row = this.getById(id);
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
if (row.getIsDefault() != null && row.getIsDefault() == 2) {
|
||||
continue;
|
||||
}
|
||||
AssociationWarehouse associationWarehouse = new AssociationWarehouse();
|
||||
associationWarehouse.setAssociationWarehouseId(id);
|
||||
associationWarehouse.setDelFlag(2);
|
||||
list.add(associationWarehouse);
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user