| | |
| | | @PostMapping("/upload") |
| | | public R upload(@RequestParam("file") MultipartFile file) { |
| | | try { |
| | | List<Warehouse> warehouseList = warehouseService.list(); |
| | | Map<String, Warehouse> map = warehouseList.stream().collect(Collectors.toMap(Warehouse::getWarehouseName, warehouse -> warehouse, (k1, k2) -> k1)); |
| | | EasyExcel.read(file.getInputStream(), LocationData.class, new LocationUploadListener(locationService, map)).sheet().doRead(); |
| | | EasyExcel.read(file.getInputStream(), LocationData.class, new LocationUploadListener(locationService)).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |