| Line 8... |
Line 8... |
| 8 |
import java.net.URISyntaxException;
|
8 |
import java.net.URISyntaxException;
|
| 9 |
import java.time.LocalDateTime;
|
9 |
import java.time.LocalDateTime;
|
| 10 |
import java.time.format.DateTimeFormatter;
|
10 |
import java.time.format.DateTimeFormatter;
|
| 11 |
import java.util.ArrayList;
|
11 |
import java.util.ArrayList;
|
| 12 |
import java.util.Arrays;
|
12 |
import java.util.Arrays;
|
| - |
|
13 |
import java.util.Collection;
|
| 13 |
import java.util.HashMap;
|
14 |
import java.util.HashMap;
|
| 14 |
import java.util.HashSet;
|
15 |
import java.util.HashSet;
|
| 15 |
import java.util.Iterator;
|
16 |
import java.util.Iterator;
|
| 16 |
import java.util.List;
|
17 |
import java.util.List;
|
| 17 |
import java.util.Map;
|
18 |
import java.util.Map;
|
| Line 48... |
Line 49... |
| 48 |
import org.springframework.web.bind.annotation.RequestMethod;
|
49 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 49 |
import org.springframework.web.bind.annotation.RequestParam;
|
50 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 50 |
import org.springframework.web.bind.annotation.RequestPart;
|
51 |
import org.springframework.web.bind.annotation.RequestPart;
|
| 51 |
import org.springframework.web.multipart.MultipartFile;
|
52 |
import org.springframework.web.multipart.MultipartFile;
|
| 52 |
|
53 |
|
| 53 |
import com.google.common.collect.Lists;
|
- |
|
| 54 |
import com.google.gson.Gson;
|
54 |
import com.google.gson.Gson;
|
| 55 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
55 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
| 56 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
56 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 57 |
import com.spice.profitmandi.common.model.CustomCurrentInventorySnapshot;
|
57 |
import com.spice.profitmandi.common.model.CustomCurrentInventorySnapshot;
|
| 58 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
58 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| Line 463... |
Line 463... |
| 463 |
@RequestMapping(value = "/aging-report", method = RequestMethod.GET)
|
463 |
@RequestMapping(value = "/aging-report", method = RequestMethod.GET)
|
| 464 |
public ResponseEntity<?> downloadInventoryItemAgingByInterval(HttpServletRequest request) throws ProfitMandiBusinessException {
|
464 |
public ResponseEntity<?> downloadInventoryItemAgingByInterval(HttpServletRequest request) throws ProfitMandiBusinessException {
|
| 465 |
|
465 |
|
| 466 |
List<Integer> intervals = Arrays.asList(5,15,30,45);
|
466 |
List<Integer> intervals = Arrays.asList(5,15,30,45);
|
| 467 |
List<InventoryItemAgingModel> inventoryItemAgingModels = inventoryService.getItemAgingByInterval(intervals)
|
467 |
List<InventoryItemAgingModel> inventoryItemAgingModels = inventoryService.getItemAgingByInterval(intervals)
|
| 468 |
.values().stream().flatMap(x->x.stream()).collect(Collectors.toList());
|
468 |
.values().stream().flatMap(Collection::stream).collect(Collectors.toList());
|
| 469 |
|
- |
|
| - |
|
469 |
LOGGER.info("Fofo Id {}", inventoryItemAgingModels.get(0).getFofoId());
|
| 470 |
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
470 |
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
| 471 |
ExcelUtils.writeInventoryItemAgingModels(inventoryItemAgingModels, intervals, byteArrayOutputStream);
|
471 |
ExcelUtils.writeInventoryItemAgingModels(inventoryItemAgingModels, intervals, byteArrayOutputStream);
|
| 472 |
|
472 |
|
| 473 |
final HttpHeaders headers = new HttpHeaders();
|
473 |
final HttpHeaders headers = new HttpHeaders();
|
| 474 |
// private static final String CONTENT_TYPE_XLSX =
|
474 |
// private static final String CONTENT_TYPE_XLSX =
|