Subversion Repositories SmartDukaan

Rev

Rev 36464 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36464 Rev 36468
Line 310... Line 310...
310
            Set<Integer> catalogIds = vendorCatalogPricings.stream().map(x -> x.getCatalogId()).collect(Collectors.toSet());
310
            Set<Integer> catalogIds = vendorCatalogPricings.stream().map(x -> x.getCatalogId()).collect(Collectors.toSet());
311
            itemMap = itemRepository.selectAllByCatalogIds(catalogIds).stream().collect(Collectors.groupingBy(x -> x.getCatalogItemId()));
311
            itemMap = itemRepository.selectAllByCatalogIds(catalogIds).stream().collect(Collectors.groupingBy(x -> x.getCatalogItemId()));
312
        }
312
        }
313
 
313
 
314
        for (VendorPriceCircularModel vcp : vendorCatalogPricings) {
314
        for (VendorPriceCircularModel vcp : vendorCatalogPricings) {
-
 
315
            Supplier supplier = supplierMap.get(vcp.getVendorId());
-
 
316
            List<Item> items = itemMap.get(vcp.getCatalogId());
-
 
317
            if (supplier == null || supplier.isInternal() || items == null || items.isEmpty()) {
-
 
318
                continue;
315
 
319
            }
316
            rows.add(Arrays.asList(vcp.getCatalogId(), supplierMap.get(vcp.getVendorId()).getName(), itemMap.get(vcp.getCatalogId()).get(0).getItemDescriptionNoColor(), vcp.getTransferPrice(), vcp.getDealerPrice(), vcp.getMop(),
320
            rows.add(Arrays.asList(vcp.getCatalogId(), supplier.getName(), items.get(0).getItemDescriptionNoColor(), vcp.getTransferPrice(), vcp.getDealerPrice(), vcp.getMop(),
317
                    FormattingUtils.formatDate(vcp.getEffectedOn())));
321
                    FormattingUtils.formatDate(vcp.getEffectedOn())));
318
 
-
 
319
        }
322
        }
320
        org.apache.commons.io.output.ByteArrayOutputStream baos = FileUtil
323
        org.apache.commons.io.output.ByteArrayOutputStream baos = FileUtil
321
                .getCSVByteStream(Arrays.asList("Catalog Id", "Vendor Name", "Model name", "TP", "DP", "MOP",
324
                .getCSVByteStream(Arrays.asList("Catalog Id", "Vendor Name", "Model name", "TP", "DP", "MOP",
322
                        "Effected On"), rows);
325
                        "Effected On"), rows);
323
 
326