Subversion Repositories SmartDukaan

Rev

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

Rev 25161 Rev 25408
Line 184... Line 184...
184
			@RequestParam LocalDateTime affectedDate, @RequestParam int itemId) throws Exception {
184
			@RequestParam LocalDateTime affectedDate, @RequestParam int itemId) throws Exception {
185
		Item item = itemRepository.selectById(itemId);
185
		Item item = itemRepository.selectById(itemId);
186
		ByteArrayOutputStream baos = getByteArrayOutputStream(affectedDate, item.getCatalogItemId());
186
		ByteArrayOutputStream baos = getByteArrayOutputStream(affectedDate, item.getCatalogItemId());
187
		final HttpHeaders headers = new HttpHeaders();
187
		final HttpHeaders headers = new HttpHeaders();
188
		headers.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
188
		headers.set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
189
		headers.set("Content-disposition", "inline; filename=imei-" + item.getItemDescriptionNoColor() + ".csv");
189
		headers.set("Content-disposition", "inline; filename=\"imei-" + item.getItemDescriptionNoColor() + ".csv\"");
190
		byte[] byteArray = baos.toByteArray();
190
		byte[] byteArray = baos.toByteArray();
191
		headers.setContentLength(byteArray.length);
191
		headers.setContentLength(byteArray.length);
192
		return new ResponseEntity<ByteArrayResource>(new ByteArrayResource(byteArray), headers, HttpStatus.OK);
192
		return new ResponseEntity<ByteArrayResource>(new ByteArrayResource(byteArray), headers, HttpStatus.OK);
193
	}
193
	}
194
 
194