1.每个机构只能创建一个仓库
2.去除默认机构默认仓库
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("categoryId", categoryId); |
| | | |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getBaseWareHouseList(agencyId, null, (short)1); |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getBaseWareHouseList(agencyId, (short)1); |
| | | if (CollectionUtils.isEmpty(baseWarehouseList)) { |
| | | return ResponseValue.error("机构无仓库!"); |
| | | |
| | |
| | | if (StringUtils.isEmpty(param.getWarehouseName())) { |
| | | return ResponseValue.error("仓库名称为空"); |
| | | } |
| | | // TODO 加权限 省级管理员录入所有仓库信息 |
| | | Long agencyId = param.getAgencyId(); |
| | | BaseWarehouse baseWarehouse = new BaseWarehouse(); |
| | | baseWarehouse.setAgencyId(agencyId); |
| | | List<BaseWarehouse> select = baseWarehouseService.select(baseWarehouse); |
| | | if (!CollectionUtils.isEmpty(select)) { |
| | | return ResponseValue.error("该机构已有仓库不能继续新增!"); |
| | | } |
| | | |
| | | int result = baseWarehouseService.add(param); |
| | | if (result > 0) { |
| | |
| | | if (agencyId == null) { |
| | | return ResponseValue.success(new ArrayList<>()); |
| | | } |
| | | List<BaseWarehouse> list = baseWarehouseService.getBaseWareHouseList(agencyId, null, null); |
| | | List<BaseWarehouse> list = baseWarehouseService.getBaseWareHouseList(agencyId, null); |
| | | if (list == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | | } |
| | |
| | | warehouseQry = param2; |
| | | |
| | | Long agencyId = warehouseQry.getAgencyId(); |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getBaseWareHouseList(agencyId, null, (short)1); |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getBaseWareHouseList(agencyId, (short)1); |
| | | List<Long> warehouseIdList = baseWarehouseList.stream().map(BaseWarehouse::getId).collect(Collectors.toList()); |
| | | |
| | | Long baseGoodsModelsId = warehouseQry.getBaseGoodsModelsId(); |
| | |
| | | FinSysTenantUser sysTenantUser = this.getSysInfo(); |
| | | String agencyId = sysTenantUser.getTenantId(); |
| | | List<BaseWarehouse> baseWarehouseList = |
| | | baseWarehouseService.getBaseWareHouseList(Long.valueOf(agencyId), null, (short)1); |
| | | baseWarehouseService.getBaseWareHouseList(Long.valueOf(agencyId), (short)1); |
| | | Set<Long> wareHouseIds = baseWarehouseList.stream().map(BaseWarehouse::getId).collect(Collectors.toSet()); |
| | | // 通过调拨单中的型号id查询出该型号物品所在的仓库位置 |
| | | List<GoodsInfoDTO> goodsInfoDTOS = lWhGoodsService.queryGoodsInfo(baseModelIds, wareHouseIds); |
| | |
| | | FinSysTenantUser sysTenantUser = this.getSysInfo(); |
| | | String agencyId = sysTenantUser.getTenantId(); |
| | | List<BaseWarehouse> baseWarehouseList = |
| | | baseWarehouseService.getBaseWareHouseList(Long.valueOf(agencyId), null, (short)1); |
| | | baseWarehouseService.getBaseWareHouseList(Long.valueOf(agencyId), (short)1); |
| | | Set<Long> wareHouseIds = baseWarehouseList.stream().map(BaseWarehouse::getId).collect(Collectors.toSet()); |
| | | |
| | | // 通过调拨单中的型号id查询出该型号物品所在的仓库位置 |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/27 |
| | | */ |
| | | List<BaseWarehouse> getBaseWareHouseList(Long agencyId, Short isDefault, Short states); |
| | | List<BaseWarehouse> getBaseWareHouseList(Long agencyId, Short states); |
| | | |
| | | /** |
| | | * 根据机构id查询默认仓库 |
| | |
| | | * @Date 2023/10/27 |
| | | */ |
| | | @Override |
| | | public List<BaseWarehouse> getBaseWareHouseList(Long agencyId, Short isDefault, Short states) { |
| | | public List<BaseWarehouse> getBaseWareHouseList(Long agencyId, Short states) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_warehouse WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | |
| | | if (agencyId != null) { |
| | | sql.append(" and AGENCY_ID =:AGENCY_ID "); |
| | | paramts.put("AGENCY_ID", agencyId); |
| | | } |
| | | // 是否为默认仓库 |
| | | if (isDefault != null) { |
| | | sql.append(" and IS_DEFAULT =:isDefault "); |
| | | paramts.put("isDefault", isDefault); |
| | | } |
| | | // 状态 |
| | | if (states != null) { |
| | |
| | | // 根据物品型号查询物品库存 |
| | | // 调拨申请时没有仓库id 查询上级机构的所有仓库 |
| | | List<BaseWarehouse> baseWareHouseList = |
| | | baseWarehouseService.getBaseWareHouseList(outAgencyId, null, (short)1); |
| | | baseWarehouseService.getBaseWareHouseList(outAgencyId, (short)1); |
| | | List<Long> warehouseIdList = |
| | | baseWareHouseList.stream().map(BaseWarehouse::getId).collect(Collectors.toList()); |
| | | int goodsNum = lWhGoodsService.queryGoodsModelNum(WareHouseType.TENANT.getValue(), warehouseIdList, |