Subversion Repositories SmartDukaan

Rev

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

Rev 25759 Rev 25812
Line 56... Line 56...
56
import com.spice.profitmandi.common.model.OrderCancellationModel;
56
import com.spice.profitmandi.common.model.OrderCancellationModel;
57
import com.spice.profitmandi.common.model.PdfModel;
57
import com.spice.profitmandi.common.model.PdfModel;
58
import com.spice.profitmandi.common.model.ProfitMandiConstants;
58
import com.spice.profitmandi.common.model.ProfitMandiConstants;
59
import com.spice.profitmandi.common.util.ExcelUtils;
59
import com.spice.profitmandi.common.util.ExcelUtils;
60
import com.spice.profitmandi.common.util.PdfUtils;
60
import com.spice.profitmandi.common.util.PdfUtils;
61
import com.spice.profitmandi.common.util.Utils;
-
 
62
import com.spice.profitmandi.dao.entity.catalog.Item;
61
import com.spice.profitmandi.dao.entity.catalog.Item;
63
import com.spice.profitmandi.dao.entity.catalog.TagListing;
62
import com.spice.profitmandi.dao.entity.catalog.TagListing;
64
import com.spice.profitmandi.dao.entity.catalog.TagRanking;
63
import com.spice.profitmandi.dao.entity.catalog.TagRanking;
65
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
64
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
66
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
65
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
Line 135... Line 134...
135
 
134
 
136
	@Autowired
135
	@Autowired
137
	private ItemRepository itemRepository;
136
	private ItemRepository itemRepository;
138
 
137
 
139
	@Autowired
138
	@Autowired
140
	private NotifyItemRepository notifyItemRespository;
-
 
141
 
-
 
142
	@Autowired
-
 
143
	private RetailerService retailerService;
139
	private RetailerService retailerService;
144
 
140
 
145
	@Autowired
141
	@Autowired
146
	private MVCResponseSender mvcResponseSender;
142
	private MVCResponseSender mvcResponseSender;
147
 
143
 
Line 150... Line 146...
150
 
146
 
151
	@Autowired
147
	@Autowired
152
	private OrderRepository orderRepository;
148
	private OrderRepository orderRepository;
153
 
149
 
154
	@Autowired
150
	@Autowired
155
	private UserRepository saholicUserRepository;
-
 
156
	@Autowired
-
 
157
	private NotifyItemRepository notifyItemRepository;
151
	private NotifyItemRepository notifyItemRepository;
158
 
152
 
159
	@Autowired
153
	@Autowired
160
	private NotifyColorChangeRepository notifyColorChangeRepository;
154
	private NotifyColorChangeRepository notifyColorChangeRepository;
161
 
155
 
Line 185... Line 179...
185
 
179
 
186
	@Autowired
180
	@Autowired
187
	private DeviceRepository deviceRepository;
181
	private DeviceRepository deviceRepository;
188
 
182
 
189
	@Autowired
183
	@Autowired
190
	private Mongo mongoClient;
-
 
191
 
-
 
192
	@Autowired
-
 
193
	private PushNotificationRepository pushNotificationRepository;
184
	private PushNotificationRepository pushNotificationRepository;
194
 
185
 
195
	@Autowired
186
	@Autowired
196
	private UserCampaignRepository userCampaignRepository;
187
	private UserCampaignRepository userCampaignRepository;
197
 
188
 
Line 291... Line 282...
291
			@RequestParam(name = ProfitMandiConstants.ITEM_ID) int itemId, Model model)
282
			@RequestParam(name = ProfitMandiConstants.ITEM_ID) int itemId, Model model)
292
			throws ProfitMandiBusinessException {
283
			throws ProfitMandiBusinessException {
293
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
284
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
294
		CustomCurrentInventorySnapshot customCurrentInventorySnapshot = inventoryService.checkItemAvailability(itemId,
285
		CustomCurrentInventorySnapshot customCurrentInventorySnapshot = inventoryService.checkItemAvailability(itemId,
295
				loginDetails.getFofoId());
286
				loginDetails.getFofoId());
-
 
287
		/*
296
		/*customCurrentInventorySnapshot
288
		 * customCurrentInventorySnapshot
297
				.setIconUrl(Utils.getIconUrl(customCurrentInventorySnapshot.getCatalogItemId(), host, port, webapp));*/
289
		 * .setIconUrl(Utils.getIconUrl(customCurrentInventorySnapshot.getCatalogItemId(
-
 
290
		 * ), host, port, webapp));
-
 
291
		 */
298
		model.addAttribute("currentInventorySnapshot", new Gson().toJson(customCurrentInventorySnapshot));
292
		model.addAttribute("currentInventorySnapshot", new Gson().toJson(customCurrentInventorySnapshot));
299
		return "current-item-availability";
293
		return "current-item-availability";
300
 
294
 
301
	}
295
	}
302
 
296
 
Line 473... Line 467...
473
 
467
 
474
		return "feature";
468
		return "feature";
475
 
469
 
476
	}
470
	}
477
 
471
 
478
	/*
-
 
479
	 * @RequestMapping(value = "/getPaginatedfeature", method = RequestMethod.GET)
-
 
480
	 * public String getPaginatedFeaturePanel(HttpServletRequest request,
-
 
481
	 * 
-
 
482
	 * @RequestParam(name = "offset", defaultValue = "0") int offset,
-
 
483
	 * 
-
 
484
	 * @RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
-
 
485
	 * throws ProfitMandiBusinessException {
-
 
486
	 * LOGGER.info("requested offset=[{}], limit = [{}]", offset, limit);
-
 
487
	 * List<TagRanking> tagRanking = null;
-
 
488
	 * 
-
 
489
	 * 
-
 
490
	 * long size = 0; tagRanking = tagRankingRepository.selectAllTagRanking(offset,
-
 
491
	 * limit); if (!tagRanking.isEmpty()) {
-
 
492
	 * 
-
 
493
	 * model.addAttribute("tagRanking", tagRanking); model.addAttribute("start",
-
 
494
	 * offset + 1); model.addAttribute("size", size); model.addAttribute("url",
-
 
495
	 * "/getPaginatedfeature");
-
 
496
	 * 
-
 
497
	 * } else { model.addAttribute("tagRanking", tagRanking); } return
-
 
498
	 * "feature-paginated"; }
-
 
499
	 */
-
 
500
	@RequestMapping(value = "/itemfeature", method = RequestMethod.POST)
472
	@RequestMapping(value = "/itemfeature", method = RequestMethod.POST)
501
	public String Itemfeature(HttpServletRequest request, @RequestBody ItemFeatureDataModel itemFeatureDatatModel,
473
	public String Itemfeature(HttpServletRequest request, @RequestBody ItemFeatureDataModel itemFeatureDatatModel,
502
			Model model) throws Exception {
474
			Model model) throws Exception {
503
		TagRanking tagRanking = tagRankingRepository.selectBycatalogItemId(itemFeatureDatatModel.getCatalogItemId());
475
		TagRanking tagRanking = tagRankingRepository.selectBycatalogItemId(itemFeatureDatatModel.getCatalogItemId());
504
		LOGGER.info("tagRanking" + tagRanking);
476
		LOGGER.info("tagRanking" + tagRanking);
Line 603... Line 575...
603
				Order orderdetail = orderRepository.selectById(notifyOrder.getOrderId());
575
				Order orderdetail = orderRepository.selectById(notifyOrder.getOrderId());
604
				if (!orderdetail.getStatus().equals(OrderStatus.SUBMITTED_FOR_PROCESSING)) {
576
				if (!orderdetail.getStatus().equals(OrderStatus.SUBMITTED_FOR_PROCESSING)) {
605
					notifyOrder.setStatus(NotifyStatus.rejected);
577
					notifyOrder.setStatus(NotifyStatus.rejected);
606
				}
578
				}
607
			}
579
			}
608
			/*
-
 
609
			 * for (NotifyOrder notifyOrder : notify) { List<NotifyItem> notifyItems =
-
 
610
			 * notifyItemRepository.selectByNotifyId(notifyOrder.getNotifyId());
-
 
611
			 * Iterator<NotifyItem> notifyItemsIterator = notifyItems.iterator();
-
 
612
			 * 
-
 
613
			 * while (notifyItemsIterator.hasNext()) { NotifyItem notifyItem =
-
 
614
			 * notifyItemsIterator.next(); if
-
 
615
			 * (LocalDateTime.now().isAfter(notifyItem.getResponseTime())) {
-
 
616
			 * notifyItemsIterator.remove(); } } if (notifyItems.size() == 0) { if
-
 
617
			 * (NotifyStatus.pending == notifyOrder.getStatus()) {
-
 
618
			 * notifyOrder.setStatus(NotifyStatus.rejected); } }
-
 
619
			 * 
-
 
620
			 * }
-
 
621
			 */
-
 
622
 
580
 
623
			Map<Integer, Optional<NotifyOrder>> notifyOrders = notifyOrderRespository.selectByorderIds(orderIds)
581
			Map<Integer, Optional<NotifyOrder>> notifyOrders = notifyOrderRespository.selectByorderIds(orderIds)
624
					.stream().collect(Collectors.groupingBy(NotifyOrder::getOrderId,
582
					.stream().collect(Collectors.groupingBy(NotifyOrder::getOrderId,
625
							Collectors.maxBy((x1, x2) -> x1.getId() - x2.getId())));
583
							Collectors.maxBy((x1, x2) -> x1.getId() - x2.getId())));
626
 
584