bug更改

This commit is contained in:
秦鸿展
2026-04-22 15:21:36 +08:00
parent 1cb6b79a52
commit 882aa8740e
4 changed files with 23 additions and 42 deletions
@@ -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);
}