| | |
| | | package com.consum.base.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhGoods; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | |
| | |
| | | if (baseWarehouse.getId() == null) { |
| | | return ResponseValue.error("仓库id为空"); |
| | | } |
| | | Long id = baseWarehouse.getId(); |
| | | LWhGoods lWhGoods = new LWhGoods(); |
| | | lWhGoods.setWarehouseId(id); |
| | | List<LWhGoods> select = lWhGoodsService.select(lWhGoods); |
| | | if (!CollectionUtils.isEmpty(select)) { |
| | | return ResponseValue.error("该仓库正在使用,不能删除"); |
| | | } |
| | | int num = baseWarehouseService.updateById(baseWarehouse); |
| | | |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("删除失败!"); |
| | |
| | | } |
| | | Long baseGoodsModelsId = warehouseQry.getBaseGoodsModelsId(); |
| | | Integer warehouseType = warehouseQry.getWarehouseType(); |
| | | Integer states = warehouseQry.getStates(); |
| | | Integer buyType = warehouseQry.getBuyType(); |
| | | |
| | | int num = lWhGoodsService.queryGoodsModelNum(warehouseType, warehouseId, baseGoodsModelsId, 1, buyType); |
| | | // 其他类型的库存查询是否也要查部门类型的库存 |
| | | List<Long> warehouseIds = new ArrayList<>(Arrays.asList(warehouseId)); |
| | | int num = lWhGoodsService.queryGoodsModelNum(warehouseType, warehouseIds, baseGoodsModelsId, 1, buyType); |
| | | return ResponseValue.success(num); |
| | | } |
| | | |
| | |
| | | Integer states = warehouseQry.getStates(); |
| | | Integer buyType = warehouseQry.getBuyType(); |
| | | |
| | | // 调拨时只查机构类型的集采仓库库存 |
| | | // 部门分发时不分机构和部门,因为调拨进来的物品也算在库存里只是类型为部门,同样检视所有仓库该型号的数量 |
| | | int num = lWhGoodsService.queryGoodsModelInWareHouseNum(warehouseType, warehouseIdList, baseGoodsModelsId, |
| | | states, buyType); |
| | | return ResponseValue.success(num); |