| | |
| | | @Autowired |
| | | private HzWarehouseMapper warehouseMapper; |
| | | |
| | | |
| | | @Override |
| | | public CommonPage selectHazmatList(HzHazmat hzHazmat) { |
| | | if(hzHazmat.getWarehouseId()==null||hzHazmat.getBasicId()==null){ |
| | |
| | | if(!hazmatList.isEmpty()) { |
| | | List<Long> warehouseIds = hazmatList.stream().map(HzHazmatWarehouseVO::getWarehouseId).collect(Collectors.toList()); |
| | | List<Long> basicIds = hazmatList.stream().map(HzHazmatWarehouseVO::getBasicId).collect(Collectors.toList()); |
| | | List<Integer> cupboardIds = hazmatList.stream().map(HzHazmatWarehouseVO::getCupboardId).collect(Collectors.toList()); |
| | | List<HzHazmatBasic> hazmatBasicList = hazmatBasicMapper.selectHazmatBasicListByIds(basicIds); |
| | | List<HzWarehouse> warehouseList = warehouseMapper.selectWarehouseListByIds(warehouseIds); |
| | | List<HzWarehouseCupboard> hzWarehouseCupboards = warehouseMapper.selectByCupboardIds(cupboardIds); |
| | | |
| | | Map<Long,HzHazmatBasic> hazmatBasicMap=hazmatBasicList.stream().collect(Collectors.toMap(HzHazmatBasic::getId, item->item)); |
| | | Map<Long,HzWarehouse> warehouseMap=warehouseList.stream().collect(Collectors.toMap(HzWarehouse::getId, item->item)); |
| | | Map<Integer, HzWarehouseCupboard> cupboardMap = hzWarehouseCupboards.stream().collect(Collectors.toMap(HzWarehouseCupboard::getId, item -> item)); |
| | | for(HzHazmatWarehouseVO hazmatWarehouseVO:hazmatList){ |
| | | HzHazmatBasic hazmatBasic=hazmatBasicMap.get(hazmatWarehouseVO.getBasicId()); |
| | | HzWarehouse warehouse=warehouseMap.get(hazmatWarehouseVO.getWarehouseId()); |
| | | HzWarehouseCupboard hzWarehouseCupboard = cupboardMap.get(hazmatWarehouseVO.getCupboardId()); |
| | | if(hazmatBasic!=null){ |
| | | hazmatWarehouseVO.setHazmatBasic(hazmatBasic); |
| | | } |
| | | if(warehouse!=null){ |
| | | hazmatWarehouseVO.setWarehouseName(warehouse.getName()); |
| | | } |
| | | if (hzWarehouseCupboard != null){ |
| | | hazmatWarehouseVO.setCupboardName(hzWarehouseCupboard.getCupboardName()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | IdTableNameHandler.removeCurrentId(); |
| | |
| | | } |
| | | checkUserAllowed(hazmat,currentUser); |
| | | //获取变动前仓库库存 |
| | | int count = baseMapper.selectHazmatCountOfWarehouse(hazmat.getWarehouseId(), hazmat.getBasicId(), currentUser.getCompanyId()); |
| | | int count = baseMapper.selectHazmatCountOfWarehouse(hazmat.getWarehouseId(), hazmat.getBasicId(), currentUser.getCompanyId(),hazmat.getCupboardId()); |
| | | |
| | | //生成流向 |
| | | BigDecimal remaining=hazmat.getRemaining(); |
| | |
| | | } |
| | | checkUserAllowed(dbhazmat,currentUser); |
| | | //获取变动前仓库库存 |
| | | int count = baseMapper.selectHazmatCountOfWarehouse(dbhazmat.getWarehouseId(), dbhazmat.getBasicId(), currentUser.getCompanyId()); |
| | | int count = baseMapper.selectHazmatCountOfWarehouse(dbhazmat.getWarehouseId(), dbhazmat.getBasicId(), currentUser.getCompanyId(),dbhazmat.getCupboardId()); |
| | | hazmat.setState(HazmatStatusEnum.USEWAREHOUSEIN.getCode()); |
| | | hazmat.setUpdateBy(currentUser.getUsername()); |
| | | updateById(hazmat); |
| | |
| | | } |
| | | checkUserAllowed(hazmat,currentUser); |
| | | //获取变动前仓库库存 |
| | | int count = baseMapper.selectHazmatCountOfWarehouse(hazmat.getWarehouseId(), hazmat.getBasicId(), currentUser.getCompanyId()); |
| | | int count = baseMapper.selectHazmatCountOfWarehouse(hazmat.getWarehouseId(), hazmat.getBasicId(), currentUser.getCompanyId(),hazmat.getCupboardId()); |
| | | hazmat.setState(HazmatStatusEnum.DISCARD.getCode()); |
| | | hazmat.setUpdateBy(currentUser.getUsername()); |
| | | updateById(hazmat); |