库位失效

main
HUOJIN\92525 2025-01-24 10:19:44 +08:00
parent a1cbf2cb50
commit 59a31fd5f4
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ public class DefaultLocationManager extends DefaultBaseManager implements
public void deleteAll(List<Long> locationIds) {
String errMsg = "";
for (Long id : locationIds) {
Long count = Long.valueOf(String.valueOf(commonDao.findByNamedQueryUniqueResult("getInventoryLogCountByLocationId", new String[] {"locationId"}, new Long[] {id})));
String hql="select COUNT(inv.id) from Inventory inv where inv.location.id="+id+" and inv.quantity=0";
Long count = (Long) commonDao.findByQuery(hql).get(0);
Location location = commonDao.load(Location.class, id);
if (count == 0) {
location.setDisabled(true);