| Line 48... |
Line 48... |
| 48 |
|
48 |
|
| 49 |
@Autowired
|
49 |
@Autowired
|
| 50 |
WarehouseInventoryItemRepository warehouseInventoryItemRepository;
|
50 |
WarehouseInventoryItemRepository warehouseInventoryItemRepository;
|
| 51 |
|
51 |
|
| 52 |
@RequestMapping(value = "/brand-pcm", method = RequestMethod.GET)
|
52 |
@RequestMapping(value = "/brand-pcm", method = RequestMethod.GET)
|
| 53 |
public String executeDailRechargeGeneration(Model model) {
|
53 |
public String brandPcm(Model model) {
|
| 54 |
Map<Integer, LocalDate> samsungPCMMap = samsungPCMRepository.selectAll().stream().collect(Collectors.toMap(x -> x.getFofoId(), x -> x.getPcmDate()));
|
54 |
Map<Integer, LocalDate> samsungPCMMap = samsungPCMRepository.selectAll().stream().collect(Collectors.toMap(x -> x.getFofoId(), x -> x.getPcmDate()));
|
| 55 |
model.addAttribute("samsungPCMMap", samsungPCMMap);
|
55 |
model.addAttribute("samsungPCMMap", samsungPCMMap);
|
| 56 |
model.addAttribute("retailerMap", retailerService.getAllFofoRetailers());
|
56 |
model.addAttribute("retailerMap", retailerService.getAllFofoRetailers());
|
| 57 |
return "manage-pcm";
|
57 |
return "manage-pcm";
|
| 58 |
}
|
58 |
}
|
| 59 |
|
59 |
|
| 60 |
@RequestMapping(value = "/brand-pcm", method = RequestMethod.POST)
|
60 |
@RequestMapping(value = "/brand-pcm", method = RequestMethod.POST)
|
| 61 |
public String executeDailRechargeGeneration(Model model, @RequestBody BrandPcmDateModel brandPcmDateModel) throws Exception {
|
61 |
public String addBrandPCM(Model model, @RequestBody BrandPcmDateModel brandPcmDateModel) throws Exception {
|
| 62 |
|
62 |
|
| 63 |
SamsungPCM samsungPCM = new SamsungPCM();
|
63 |
SamsungPCM samsungPCM = new SamsungPCM();
|
| 64 |
samsungPCM.setFofoId(brandPcmDateModel.getFofoId());
|
64 |
samsungPCM.setFofoId(brandPcmDateModel.getFofoId());
|
| 65 |
samsungPCM.setPcmDate(brandPcmDateModel.getPcmDate());
|
65 |
samsungPCM.setPcmDate(brandPcmDateModel.getPcmDate());
|
| 66 |
samsungPCMRepository.persist(samsungPCM);
|
66 |
samsungPCMRepository.persist(samsungPCM);
|
| Line 68... |
Line 68... |
| 68 |
model.addAttribute("response1", true);
|
68 |
model.addAttribute("response1", true);
|
| 69 |
return "response";
|
69 |
return "response";
|
| 70 |
}
|
70 |
}
|
| 71 |
|
71 |
|
| 72 |
@RequestMapping(value = "/brand-pcm/download", method = RequestMethod.GET)
|
72 |
@RequestMapping(value = "/brand-pcm/download", method = RequestMethod.GET)
|
| 73 |
public ResponseEntity<InputStreamResource> executeDailRechargeGeneration(@RequestParam int fofoId) throws Exception {
|
73 |
public ResponseEntity<InputStreamResource> downloadBrandPCM(@RequestParam int fofoId) throws Exception {
|
| 74 |
|
74 |
|
| 75 |
FofoStore fs = fofoStoreRepository.selectByRetailerId(fofoId);
|
75 |
FofoStore fs = fofoStoreRepository.selectByRetailerId(fofoId);
|
| 76 |
|
76 |
|
| 77 |
List<BilledImeiModel> billedImeiModels = warehouseInventoryItemRepository.findStockByFofoIdBrandToRebill(fofoId, "Samsung");
|
77 |
List<BilledImeiModel> billedImeiModels = warehouseInventoryItemRepository.findStockByFofoIdBrandToRebill(fofoId, "Samsung");
|
| 78 |
List<List<?>> rows = billedImeiModels.stream().map(x -> Arrays.asList(x.getFofoId(), x.getStoreCode(), x.getStoreName(), x.getStoreCity(), x.getBrand(), x.getModelName(), x.getModelNumber(), x.getColor(), x.getSerialNumber(),
|
78 |
List<List<?>> rows = billedImeiModels.stream().map(x -> Arrays.asList(x.getFofoId(), x.getStoreCode(), x.getStoreName(), x.getStoreCity(), x.getBrand(), x.getModelName(), x.getModelNumber(), x.getColor(), x.getSerialNumber(),
|