| Line 241... |
Line 241... |
| 241 |
catalogListingModel.setItemDescription(item.getItemDescriptionNoColor());
|
241 |
catalogListingModel.setItemDescription(item.getItemDescriptionNoColor());
|
| 242 |
catalogListingModel.setAllocatedQuantity(catalogStockAllocationQuantity);
|
242 |
catalogListingModel.setAllocatedQuantity(catalogStockAllocationQuantity);
|
| 243 |
catalogListingModel.setInTransitQuantity(catalogInTransit);
|
243 |
catalogListingModel.setInTransitQuantity(catalogInTransit);
|
| 244 |
catalogListingModel
|
244 |
catalogListingModel
|
| 245 |
.setToBeOrdered(catalogStockAllocationQuantity - catalogInTransit - catalogInStock);
|
245 |
.setToBeOrdered(catalogStockAllocationQuantity - catalogInTransit - catalogInStock);
|
| - |
|
246 |
catalogListingModel.setStockInHand(catalogInStock);
|
| 246 |
catalogListingModel.setBrand(item.getBrand());
|
247 |
catalogListingModel.setBrand(item.getBrand());
|
| 247 |
catalogListingModel.setModelName(item.getModelName());
|
248 |
catalogListingModel.setModelName(item.getModelName());
|
| 248 |
catalogListingModel.setModelNumber(item.getModelNumber());
|
249 |
catalogListingModel.setModelNumber(item.getModelNumber());
|
| 249 |
catalogListingModel.setCategoryId(item.getCategoryId());
|
250 |
catalogListingModel.setCategoryId(item.getCategoryId());
|
| 250 |
catalogListingMap.put(key, catalogListingModel);
|
251 |
catalogListingMap.put(key, catalogListingModel);
|
| Line 252... |
Line 253... |
| 252 |
}
|
253 |
}
|
| 253 |
List<List<Object>> listOfRows = new ArrayList<>();
|
254 |
List<List<Object>> listOfRows = new ArrayList<>();
|
| 254 |
for (CatalogListingModel clm : catalogListingMap.values()) {
|
255 |
for (CatalogListingModel clm : catalogListingMap.values()) {
|
| 255 |
CustomRetailer cr = customRetailersMap.get(clm.getFofoId());
|
256 |
CustomRetailer cr = customRetailersMap.get(clm.getFofoId());
|
| 256 |
listOfRows
|
257 |
listOfRows
|
| 257 |
.add(Arrays.asList(cr.getPartnerId(), cr.getBusinessName(), clm.getBrand(), clm.getCatalogId(),
|
258 |
.add(Arrays.asList(cr.getPartnerId(), cr.getBusinessName(), clm.getCatalogId(), clm.getBrand(),
|
| 258 |
clm.getItemDescription(), clm.getDp(), clm.getMop(), clm.getAllocatedQuantity(),
|
259 |
clm.getModelName(), clm.getModelNumber(), clm.getDp(), clm.getMop(), clm.getAllocatedQuantity(),
|
| 259 |
clm.getInTransitQuantity(), clm.getStockInHand(), clm.getToBeOrdered()));
|
260 |
clm.getInTransitQuantity(), clm.getStockInHand(), clm.getToBeOrdered()));
|
| 260 |
}
|
261 |
}
|
| 261 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(Arrays.asList("StoreId", "StoreName", "Catalog Id",
|
262 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(Arrays.asList("StoreId", "StoreName", "Catalog Id",
|
| 262 |
"Brand", "Model", "DP", "MOP", "Allocated Quantity", "In Transit", "Stock In hand", "Shortage"),
|
263 |
// "Brand", "Model Name", "Model Number", "DP", "MOP", "Allocated Quantity", "In Transit", "Stock In hand", "Shortage"),
|
| 263 |
listOfRows);
|
264 |
listOfRows);
|
| 264 |
HttpHeaders headers = new HttpHeaders();
|
265 |
HttpHeaders headers = new HttpHeaders();
|
| 265 |
headers.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
266 |
headers.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
| 266 |
headers.set("Content-disposition", "inline; filename=retailer-allocation.csv");
|
267 |
headers.set("Content-disposition", "inline; filename=retailer-allocation.csv");
|
| 267 |
return new ResponseEntity<ByteArrayResource>(new ByteArrayResource(baos.toByteArray()), headers,
|
268 |
return new ResponseEntity<ByteArrayResource>(new ByteArrayResource(baos.toByteArray()), headers,
|