Subversion Repositories SmartDukaan

Rev

Rev 30562 | Rev 30957 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30562 Rev 30638
Line 416... Line 416...
416
														Model model) throws ProfitMandiBusinessException, Exception {
416
														Model model) throws ProfitMandiBusinessException, Exception {
417
 
417
 
418
		PriceDrop priceDrop = priceDropRepository.selectById(priceDropId);
418
		PriceDrop priceDrop = priceDropRepository.selectById(priceDropId);
419
		Map<String, PriceDropIMEI> priceDropIMEIsMap = priceDropIMEIRepository.selectByPriceDropId(priceDropId).stream()
419
		Map<String, PriceDropIMEI> priceDropIMEIsMap = priceDropIMEIRepository.selectByPriceDropId(priceDropId).stream()
420
				.collect(Collectors.toMap(x -> x.getImei(), x -> x));
420
				.collect(Collectors.toMap(x -> x.getImei(), x -> x));
421
 
-
 
-
 
421
		LOGGER.info("PriceDropImeis {}, priceDropId {}", priceDropIMEIsMap, priceDropId);
422
		Item item = itemRepository.selectAllByCatalogItemId(priceDrop.getCatalogItemId()).get(0);
422
		Item item = itemRepository.selectAllByCatalogItemId(priceDrop.getCatalogItemId()).get(0);
423
		final HttpHeaders headers = new HttpHeaders();
423
		final HttpHeaders headers = new HttpHeaders();
424
		headers.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
424
		headers.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
425
		headers.set("Content-disposition",
425
		headers.set("Content-disposition",
426
				"inline; filename=pricedrop-" + item.getItemDescriptionNoColor().replaceAll("\\s?,\\s?", " ") + "-"
426
				"inline; filename=pricedrop-" + item.getItemDescriptionNoColor().replaceAll("\\s?,\\s?", " ") + "-"
Line 430... Line 430...
430
			priceDropService.priceDropStatus(priceDrop.getId());
430
			priceDropService.priceDropStatus(priceDrop.getId());
431
			baos = FileUtil.getCSVByteStream(Arrays.asList("IMEI Number", "Store Name", "Store Code", "Item ID", "Brand",
431
			baos = FileUtil.getCSVByteStream(Arrays.asList("IMEI Number", "Store Name", "Store Code", "Item ID", "Brand",
432
					"Model Name", "Model Number", "Color", "Status", "Rejection Reason", "Last Scanned", "Vendor Name",
432
					"Model Name", "Model Number", "Color", "Status", "Rejection Reason", "Last Scanned", "Vendor Name",
433
					"Grn On", "Activation Timestamp", "Activation Added On"), new ArrayList<>());
433
					"Grn On", "Activation Timestamp", "Activation Added On"), new ArrayList<>());
434
		} else {
434
		} else {
-
 
435
 
-
 
436
			LOGGER.info("In else block");
435
			baos = getByteArrayOutputStream(priceDrop.getAffectedOn(), priceDrop.getCatalogItemId(),
437
			baos = getByteArrayOutputStream(priceDrop.getAffectedOn(), priceDrop.getCatalogItemId(),
436
					priceDropIMEIsMap);
438
					priceDropIMEIsMap);
437
		}
439
		}
438
		byte[] byteArray = baos.toByteArray();
440
		byte[] byteArray = baos.toByteArray();
439
		headers.setContentLength(byteArray.length);
441
		headers.setContentLength(byteArray.length);