Subversion Repositories SmartDukaan

Rev

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

Rev 25377 Rev 25383
Line 604... Line 604...
604
				retailerIds.add(order.getRetailerId());
604
				retailerIds.add(order.getRetailerId());
605
				orderIds.add(order.getId());
605
				orderIds.add(order.getId());
606
 
606
 
607
			}
607
			}
608
 
608
 
-
 
609
			/*
609
			/*List<NotifyOrder> notify = notifyOrderRespository.selectByorderIds(orderIds);
610
			 * List<NotifyOrder> notify = notifyOrderRespository.selectByorderIds(orderIds);
610
			for (NotifyOrder notifyOrder : notify) {
611
			 * for (NotifyOrder notifyOrder : notify) { List<NotifyItem> notifyItems =
611
				List<NotifyItem> notifyItems = notifyItemRepository.selectByNotifyId(notifyOrder.getNotifyId());
612
			 * notifyItemRepository.selectByNotifyId(notifyOrder.getNotifyId());
612
				Iterator<NotifyItem> notifyItemsIterator = notifyItems.iterator();
613
			 * Iterator<NotifyItem> notifyItemsIterator = notifyItems.iterator();
613
 
614
			 * 
614
				while (notifyItemsIterator.hasNext()) {
615
			 * while (notifyItemsIterator.hasNext()) { NotifyItem notifyItem =
615
					NotifyItem notifyItem = notifyItemsIterator.next();
616
			 * notifyItemsIterator.next(); if
616
					if (LocalDateTime.now().isAfter(notifyItem.getResponseTime())) {
617
			 * (LocalDateTime.now().isAfter(notifyItem.getResponseTime())) {
617
						notifyItemsIterator.remove();
-
 
618
					}
-
 
619
				}
-
 
620
				if (notifyItems.size() == 0) {
618
			 * notifyItemsIterator.remove(); } } if (notifyItems.size() == 0) { if
621
					if (NotifyStatus.pending == notifyOrder.getStatus()) {
619
			 * (NotifyStatus.pending == notifyOrder.getStatus()) {
622
						notifyOrder.setStatus(NotifyStatus.rejected);
620
			 * notifyOrder.setStatus(NotifyStatus.rejected); } }
623
					}
621
			 * 
624
				}
622
			 * }
625
 
-
 
626
			}*/
623
			 */
627
 
624
 
628
			Map<Integer, Optional<NotifyOrder>> notifyOrders = notifyOrderRespository.selectByorderIds(orderIds)
625
			Map<Integer, Optional<NotifyOrder>> notifyOrders = notifyOrderRespository.selectByorderIds(orderIds)
629
					.stream().collect(Collectors.groupingBy(NotifyOrder::getOrderId,
626
					.stream().collect(Collectors.groupingBy(NotifyOrder::getOrderId,
630
							Collectors.maxBy((x1, x2) -> x1.getId() - x2.getId())));
627
							Collectors.maxBy((x1, x2) -> x1.getId() - x2.getId())));
631
 
628
 
Line 696... Line 693...
696
		return "response";
693
		return "response";
697
	}
694
	}
698
 
695
 
699
	private void sendCancellationNotificationToPartner(Order order, String reason) throws Exception {
696
	private void sendCancellationNotificationToPartner(Order order, String reason) throws Exception {
700
		Item item = itemRepository.selectById(order.getLineItem().getItemId());
697
		Item item = itemRepository.selectById(order.getLineItem().getItemId());
701
		
698
 
702
		SimpleCampaignParams scp = new SimpleCampaignParams();
699
		SimpleCampaignParams scp = new SimpleCampaignParams();
703
		scp.setTitle(String.format("Order %s %d(Pcs) cancelled", item.getItemDescription(),
700
		scp.setTitle(String.format("Order %s %d(Pcs) cancelled", item.getItemDescription(),
704
				order.getLineItem().getQuantity()));
701
				order.getLineItem().getQuantity()));
705
		scp.setMessage(reason);
702
		scp.setMessage(reason);
706
		scp.setType("url");
703
		scp.setType("url");
Line 846... Line 843...
846
			uc.setPushTimestamp(LocalDateTime.now());
843
			uc.setPushTimestamp(LocalDateTime.now());
847
			userCampaignRepository.persist(uc);
844
			userCampaignRepository.persist(uc);
848
			List<Device> devices = deviceRepository.selectByUserIdAndModifiedTimestamp(userId,
845
			List<Device> devices = deviceRepository.selectByUserIdAndModifiedTimestamp(userId,
849
					LocalDateTime.now().minusMonths(3), LocalDateTime.now());
846
					LocalDateTime.now().minusMonths(3), LocalDateTime.now());
850
			pushNotification(nc.getId(), devices);
847
			pushNotification(nc.getId(), devices);
851
			
848
 
852
		}
849
		}
853
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
850
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
854
		return "response";
851
		return "response";
855
	}
852
	}
856
 
853
 
Line 964... Line 961...
964
	@RequestMapping(value = "/getContentUploader", method = RequestMethod.GET)
961
	@RequestMapping(value = "/getContentUploader", method = RequestMethod.GET)
965
	public String contentUploader(HttpServletRequest request) throws Exception {
962
	public String contentUploader(HttpServletRequest request) throws Exception {
966
		return "content-upload";
963
		return "content-upload";
967
	}
964
	}
968
 
965
 
969
	/*@RequestMapping(value = "/fileUpload", method = RequestMethod.POST)
-
 
970
	public String updateContents(HttpServletRequest request, @RequestParam("file") MultipartFile multipartFile)
-
 
971
			throws Throwable {
-
 
972
 
-
 
973
		try (XSSFWorkbook myWorkBook = new XSSFWorkbook(multipartFile.getInputStream())) {
-
 
974
 
-
 
975
			myWorkBook.setMissingCellPolicy(MissingCellPolicy.RETURN_BLANK_AS_NULL);
-
 
976
			// Return first sheet from the XLSX workbook
-
 
977
			XSSFSheet mySheet = myWorkBook.getSheetAt(0);
-
 
978
			LOGGER.info("row" + mySheet.getLastRowNum());
-
 
979
 
-
 
980
			for (int rowNumber = 0; rowNumber <= mySheet.getLastRowNum(); rowNumber++) {
-
 
981
				XSSFRow row = mySheet.getRow(rowNumber);
-
 
982
				LOGGER.info("row1" + row.getCell(0).getStringCellValue());
-
 
983
			}
-
 
984
		} catch (Exception e) {
-
 
985
			e.printStackTrace();
-
 
986
		}
-
 
987
		LOGGER.info("multipart" + multipartFile);
-
 
988
		return "response";
-
 
989
	}*/
-
 
990
}
966
}
991
967