Subversion Repositories SmartDukaan

Rev

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

Rev 29875 Rev 29932
Line 1... Line 1...
1
package com.spice.profitmandi.web.controller;
1
package com.spice.profitmandi.web.controller;
2
 
2
 
3
import java.io.File;
-
 
4
import java.io.FileInputStream;
-
 
5
import java.io.FileNotFoundException;
-
 
6
import java.io.FileOutputStream;
-
 
7
import java.io.ObjectOutputStream;
-
 
8
import java.time.LocalDate;
-
 
9
import java.time.LocalDateTime;
-
 
10
import java.time.LocalTime;
-
 
11
import java.time.YearMonth;
-
 
12
import java.time.format.DateTimeFormatter;
-
 
13
import java.util.ArrayList;
-
 
14
import java.util.Arrays;
-
 
15
import java.util.Collections;
-
 
16
import java.util.HashMap;
-
 
17
import java.util.HashSet;
-
 
18
import java.util.LinkedHashMap;
-
 
19
import java.util.List;
-
 
20
import java.util.Map;
-
 
21
import java.util.NoSuchElementException;
-
 
22
import java.util.Optional;
-
 
23
import java.util.Set;
-
 
24
import java.util.TreeMap;
-
 
25
import java.util.stream.Collectors;
-
 
26
 
-
 
27
import javax.servlet.http.HttpServletRequest;
-
 
28
import javax.transaction.Transactional;
-
 
29
 
-
 
30
import org.apache.logging.log4j.LogManager;
-
 
31
import org.apache.logging.log4j.Logger;
-
 
32
import org.json.JSONObject;
-
 
33
import org.springframework.beans.factory.annotation.Autowired;
-
 
34
import org.springframework.beans.factory.annotation.Value;
-
 
35
import org.springframework.core.io.InputStreamResource;
-
 
36
import org.springframework.http.HttpHeaders;
-
 
37
import org.springframework.http.HttpStatus;
-
 
38
import org.springframework.http.ResponseEntity;
-
 
39
import org.springframework.stereotype.Controller;
-
 
40
import org.springframework.ui.Model;
-
 
41
import org.springframework.web.bind.annotation.RequestMapping;
-
 
42
import org.springframework.web.bind.annotation.RequestMethod;
-
 
43
import org.springframework.web.bind.annotation.RequestParam;
-
 
44
 
-
 
45
import com.google.gson.Gson;
3
import com.google.gson.Gson;
46
import com.mongodb.DBObject;
4
import com.mongodb.DBObject;
47
import com.spice.profitmandi.common.enumuration.ContentType;
5
import com.spice.profitmandi.common.enumuration.ContentType;
48
import com.spice.profitmandi.common.enumuration.MessageType;
6
import com.spice.profitmandi.common.enumuration.MessageType;
49
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
7
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
50
import com.spice.profitmandi.common.model.ActivateItemModel;
-
 
51
import com.spice.profitmandi.common.model.ChartInvestmentModel;
-
 
52
import com.spice.profitmandi.common.model.ChartModel;
8
import com.spice.profitmandi.common.model.*;
53
import com.spice.profitmandi.common.model.CustomRetailer;
-
 
54
import com.spice.profitmandi.common.model.Notification;
-
 
55
import com.spice.profitmandi.common.model.OnlineDeliveredOrderSum;
-
 
56
import com.spice.profitmandi.common.model.ProfitMandiConstants;
-
 
57
import com.spice.profitmandi.common.web.util.ResponseSender;
9
import com.spice.profitmandi.common.web.util.ResponseSender;
58
import com.spice.profitmandi.dao.entity.auth.AuthUser;
10
import com.spice.profitmandi.dao.entity.auth.AuthUser;
59
import com.spice.profitmandi.dao.entity.catalog.Item;
11
import com.spice.profitmandi.dao.entity.catalog.Item;
60
import com.spice.profitmandi.dao.entity.catalog.TagListing;
12
import com.spice.profitmandi.dao.entity.catalog.TagListing;
61
import com.spice.profitmandi.dao.entity.cs.Position;
13
import com.spice.profitmandi.dao.entity.cs.Position;
62
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
14
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
63
import com.spice.profitmandi.dao.entity.dtr.Document;
15
import com.spice.profitmandi.dao.entity.dtr.Document;
64
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
16
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
65
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
-
 
66
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
-
 
67
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
-
 
68
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
17
import com.spice.profitmandi.dao.entity.fofo.*;
69
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
-
 
70
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
-
 
71
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
18
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
72
import com.spice.profitmandi.dao.entity.transaction.LineItem;
19
import com.spice.profitmandi.dao.entity.transaction.LineItem;
73
import com.spice.profitmandi.dao.entity.transaction.Order;
20
import com.spice.profitmandi.dao.entity.transaction.Order;
74
import com.spice.profitmandi.dao.enumuration.catalog.UpgradeOfferStatus;
21
import com.spice.profitmandi.dao.enumuration.catalog.UpgradeOfferStatus;
75
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
22
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
76
import com.spice.profitmandi.dao.model.ActivationBrandModel;
-
 
77
import com.spice.profitmandi.dao.model.ActivationImeiUpdationModel;
-
 
78
import com.spice.profitmandi.dao.model.ActivationItemDetailModel;
-
 
79
import com.spice.profitmandi.dao.model.ActivationYearMonthModel;
-
 
80
import com.spice.profitmandi.dao.model.BrandAmountModel;
-
 
81
import com.spice.profitmandi.dao.model.BrandWiseActivatedModel;
-
 
82
import com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel;
-
 
83
import com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel;
-
 
84
import com.spice.profitmandi.dao.model.CreateOfferRequest;
-
 
85
import com.spice.profitmandi.dao.model.InStockBrandItemModel;
-
 
86
import com.spice.profitmandi.dao.model.InStockBrandModel;
-
 
87
import com.spice.profitmandi.dao.model.ItemWiseTertiaryModel;
-
 
88
import com.spice.profitmandi.dao.model.MonthSaleModel;
-
 
89
import com.spice.profitmandi.dao.model.PartnerDetailModel;
-
 
90
import com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel;
-
 
91
import com.spice.profitmandi.dao.model.PriceDropBrandModel;
-
 
92
import com.spice.profitmandi.dao.model.PriceDropWithDetailsByYearMonthModel;
-
 
93
import com.spice.profitmandi.dao.model.PriceDropYearMonthModel;
-
 
94
import com.spice.profitmandi.dao.model.SamsungUpgradeOfferModel;
23
import com.spice.profitmandi.dao.model.SamsungUpgradeOfferModel;
95
import com.spice.profitmandi.dao.model.UpgradeOfferItemDetailModel;
-
 
96
import com.spice.profitmandi.dao.model.WarehouseBrandItemUnbilledActivatedModel;
-
 
97
import com.spice.profitmandi.dao.model.WarehouseBrandWiseItemActivatedModel;
-
 
98
import com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel;
-
 
99
import com.spice.profitmandi.dao.model.WarehouseWiseActivatedModel;
24
import com.spice.profitmandi.dao.model.*;
100
import com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel;
-
 
101
import com.spice.profitmandi.dao.model.WarehouseWiseBrandStockModel;
-
 
102
import com.spice.profitmandi.dao.model.WarehouseWiseBrandUnbilledActivatedModel;
-
 
103
import com.spice.profitmandi.dao.model.WarehouseWiseitemStockModel;
-
 
104
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
25
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
105
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
26
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
106
import com.spice.profitmandi.dao.repository.catalog.SamsungUpgradeOfferRepository;
27
import com.spice.profitmandi.dao.repository.catalog.SamsungUpgradeOfferRepository;
107
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
28
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
108
import com.spice.profitmandi.dao.repository.cs.CsService;
29
import com.spice.profitmandi.dao.repository.cs.CsService;
109
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
30
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
110
import com.spice.profitmandi.dao.repository.cs.TicketAssignedRepository;
31
import com.spice.profitmandi.dao.repository.cs.TicketAssignedRepository;
111
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
32
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
112
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
-
 
113
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
-
 
114
import com.spice.profitmandi.dao.repository.dtr.Mongo;
33
import com.spice.profitmandi.dao.repository.dtr.*;
115
import com.spice.profitmandi.dao.repository.dtr.NotificationCampaignRepository;
-
 
116
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
-
 
117
import com.spice.profitmandi.dao.repository.fofo.ActivatedImeiRepository;
-
 
118
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
-
 
119
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
-
 
120
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
-
 
121
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
34
import com.spice.profitmandi.dao.repository.fofo.*;
122
import com.spice.profitmandi.dao.repository.fofo.HygieneDataRepository;
-
 
123
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
-
 
124
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
-
 
125
import com.spice.profitmandi.dao.repository.fofo.PendingOrderItemRepository;
-
 
126
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
-
 
127
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
-
 
128
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
35
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
129
import com.spice.profitmandi.dao.repository.inventory.SaholicInventoryCISRepository;
36
import com.spice.profitmandi.dao.repository.inventory.SaholicInventoryCISRepository;
130
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
37
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
131
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
38
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
132
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
39
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
Line 140... Line 47...
140
import com.spice.profitmandi.service.transaction.TransactionService;
47
import com.spice.profitmandi.service.transaction.TransactionService;
141
import com.spice.profitmandi.service.user.RetailerService;
48
import com.spice.profitmandi.service.user.RetailerService;
142
import com.spice.profitmandi.web.model.LoginDetails;
49
import com.spice.profitmandi.web.model.LoginDetails;
143
import com.spice.profitmandi.web.util.CookiesProcessor;
50
import com.spice.profitmandi.web.util.CookiesProcessor;
144
import com.spice.profitmandi.web.util.MVCResponseSender;
51
import com.spice.profitmandi.web.util.MVCResponseSender;
-
 
52
import org.apache.logging.log4j.LogManager;
-
 
53
import org.apache.logging.log4j.Logger;
-
 
54
import org.json.JSONObject;
-
 
55
import org.springframework.beans.factory.annotation.Autowired;
-
 
56
import org.springframework.beans.factory.annotation.Value;
-
 
57
import org.springframework.core.io.InputStreamResource;
-
 
58
import org.springframework.http.HttpHeaders;
-
 
59
import org.springframework.http.HttpStatus;
-
 
60
import org.springframework.http.ResponseEntity;
-
 
61
import org.springframework.stereotype.Controller;
-
 
62
import org.springframework.ui.Model;
-
 
63
import org.springframework.web.bind.annotation.RequestMapping;
-
 
64
import org.springframework.web.bind.annotation.RequestMethod;
-
 
65
import org.springframework.web.bind.annotation.RequestParam;
-
 
66
 
-
 
67
import javax.servlet.http.HttpServletRequest;
-
 
68
import javax.transaction.Transactional;
-
 
69
import java.io.*;
-
 
70
import java.time.LocalDate;
-
 
71
import java.time.LocalDateTime;
-
 
72
import java.time.LocalTime;
-
 
73
import java.time.YearMonth;
-
 
74
import java.time.format.DateTimeFormatter;
-
 
75
import java.util.*;
-
 
76
import java.util.stream.Collectors;
145
 
77
 
146
@Controller
78
@Controller
147
@Transactional(rollbackOn = Throwable.class)
79
@Transactional(rollbackOn = Throwable.class)
148
public class DashboardController {
80
public class DashboardController {
149
 
81
 
Line 187... Line 119...
187
	@Autowired
119
	@Autowired
188
	private AdminUser adminUser;
120
	private AdminUser adminUser;
189
 
121
 
190
	@Autowired
122
	@Autowired
191
	private RoleManager roleManager;
123
	private RoleManager roleManager;
192
	
124
 
193
 
125
 
194
	@Autowired
126
	@Autowired
195
	private FofoStoreRepository fofoStoreRepository;
127
	private FofoStoreRepository fofoStoreRepository;
196
 
128
 
197
	@Autowired
129
	@Autowired
Line 395... Line 327...
395
		ArrayList<in.shop2020.model.v1.order.OrderStatus> orderStatus = new ArrayList<>();
327
		ArrayList<in.shop2020.model.v1.order.OrderStatus> orderStatus = new ArrayList<>();
396
 
328
 
397
		orderStatus.add(in.shop2020.model.v1.order.OrderStatus.SUBMITTED_FOR_PROCESSING);
329
		orderStatus.add(in.shop2020.model.v1.order.OrderStatus.SUBMITTED_FOR_PROCESSING);
398
		orderStatus.add(in.shop2020.model.v1.order.OrderStatus.BILLED);
330
		orderStatus.add(in.shop2020.model.v1.order.OrderStatus.BILLED);
399
		orderStatus.add(in.shop2020.model.v1.order.OrderStatus.SHIPPED_FROM_WH);
331
		orderStatus.add(in.shop2020.model.v1.order.OrderStatus.SHIPPED_FROM_WH);
-
 
332
		orderStatus.add(in.shop2020.model.v1.order.OrderStatus.DELIVERY_SUCCESS);
400
 
333
 
401
		List<Order> order = orderRepository.selectOrders(fofoId, orderStatus);
334
		List<Order> order = orderRepository.selectGrnTimestampNull(fofoId, orderStatus);
402
		List<Integer> submittedOrderIds = order.stream()
335
		List<LineItem> submittedLineItemIds = order.stream()
403
				.filter(x -> x.getStatus() == in.shop2020.model.v1.order.OrderStatus.SUBMITTED_FOR_PROCESSING)
336
				.filter(x -> x.getStatus() == in.shop2020.model.v1.order.OrderStatus.SUBMITTED_FOR_PROCESSING)
404
				.map(x -> x.getId()).collect(Collectors.toList());
337
				.map(x -> x.getLineItem()).collect(Collectors.toList());
405
		List<Integer> billedOrderIds = order.stream()
338
		List<LineItem> billedOrderIds = order.stream()
406
				.filter(x -> x.getStatus() == in.shop2020.model.v1.order.OrderStatus.BILLED).map(x -> x.getId())
339
				.filter(x -> x.getStatus() == in.shop2020.model.v1.order.OrderStatus.BILLED).map(x -> x.getLineItem())
407
				.collect(Collectors.toList());
340
				.collect(Collectors.toList());
408
		List<Integer> shippedOrderIds = order.stream()
341
		List<LineItem> shippedOrderIds = order.stream()
409
				.filter(x -> x.getStatus() == in.shop2020.model.v1.order.OrderStatus.SHIPPED_FROM_WH)
342
				.filter(x -> x.getStatus() == in.shop2020.model.v1.order.OrderStatus.SHIPPED_FROM_WH)
410
				.map(x -> x.getId()).collect(Collectors.toList());
343
				.map(x -> x.getLineItem()).collect(Collectors.toList());
-
 
344
		List<LineItem> grnPendingLineItemIds = order.stream()
-
 
345
				.filter(x -> x.getStatus() == in.shop2020.model.v1.order.OrderStatus.DELIVERY_SUCCESS)
-
 
346
				.map(x -> x.getLineItem()).collect(Collectors.toList());
411
 
347
 
412
		LOGGER.info("billedOrderIds {}", billedOrderIds);
348
		LOGGER.info("billedOrderIds {}", billedOrderIds);
413
		LOGGER.info("shippedOrderIds {}", shippedOrderIds);
349
		LOGGER.info("shippedOrderIds {}", shippedOrderIds);
414
 
350
 
415
		List<Order> grnPendingOrder = orderRepository.selectPendingGrnOrders(fofoId);
-
 
416
		List<Integer> grnOrderIds = grnPendingOrder.stream().map(x -> x.getId()).collect(Collectors.toList());
-
 
417
		model.addAttribute("grnOrderIds", grnOrderIds);
-
 
418
		if (!grnOrderIds.isEmpty()) {
-
 
419
 
-
 
420
			List<LineItem> grnPendingLineItem = lineItemRepository.selectLineItem(grnOrderIds);
-
 
421
			Map<Integer, LineItem> grnPendingLineMap = grnPendingLineItem.stream()
-
 
422
					.collect(Collectors.toMap(x -> x.getOrderId(), x -> x));
-
 
423
 
-
 
424
			long grnPendingCount = grnPendingLineMap.entrySet().stream().filter(x -> x.getKey() > 0).count();
351
		long grnPendingCount = grnPendingLineItemIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
425
			long grnPendingValue = grnPendingLineMap.entrySet().stream()
352
		long grnPendingValue = grnPendingLineItemIds.stream()
426
					.mapToLong(x -> x.getValue().getTotalPrice().longValue()).sum();
353
				.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
427
			model.addAttribute("grnPendingCount", grnPendingCount);
354
		model.addAttribute("grnPendingCount", grnPendingCount);
428
			model.addAttribute("grnPendingValue", grnPendingValue);
355
		model.addAttribute("grnPendingValue", grnPendingValue);
429
 
-
 
430
		}
-
 
431
 
-
 
432
		if (!submittedOrderIds.isEmpty()) {
-
 
433
 
356
 
434
			List<LineItem> submittedLineItem = lineItemRepository.selectLineItem(submittedOrderIds);
-
 
435
			Map<Integer, LineItem> submittedLineItemMap = submittedLineItem.stream()
-
 
436
					.collect(Collectors.toMap(x -> x.getOrderId(), x -> x));
-
 
437
			LOGGER.info("submittedLineItemMap {}", submittedLineItemMap);
-
 
438
 
357
 
439
			long submittedCount = submittedLineItemMap.entrySet().stream().filter(x -> x.getKey() > 0).count();
358
		long submittedCount = submittedLineItemIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
440
			long submittedValue = submittedLineItemMap.entrySet().stream()
359
		long submittedValue = submittedLineItemIds.stream()
441
					.mapToLong(x -> x.getValue().getTotalPrice().longValue()).sum();
360
				.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
442
			model.addAttribute("submittedCount", submittedCount);
361
		model.addAttribute("submittedCount", submittedCount);
443
			model.addAttribute("submittedValue", submittedValue);
362
		model.addAttribute("submittedValue", submittedValue);
444
			LOGGER.info("submittedCount {}", submittedCount);
-
 
445
		}
-
 
446
		if (!billedOrderIds.isEmpty()) {
-
 
447
			List<LineItem> billedLineItem = lineItemRepository.selectLineItem(billedOrderIds);
-
 
448
			Map<Integer, LineItem> billedLineItemMap = billedLineItem.stream()
-
 
449
					.collect(Collectors.toMap(x -> x.getOrderId(), x -> x));
-
 
450
			LOGGER.info("billedLineItemMap {}", billedLineItemMap);
-
 
451
			long billedCount = billedLineItemMap.entrySet().stream().filter(x -> x.getKey() > 0).count();
-
 
452
			model.addAttribute("billedCount", billedCount);
-
 
453
			LOGGER.info("billedCount {}", billedCount);
-
 
454
 
363
 
455
			long billedValue = billedLineItemMap.entrySet().stream()
364
		long billedCount = billedOrderIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
456
					.mapToLong(x -> x.getValue().getTotalPrice().longValue()).sum();
365
		long billedValue = billedOrderIds.stream().collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
457
			model.addAttribute("billedValue", billedValue);
366
		model.addAttribute("billedValue", billedValue);
458
		}
-
 
459
 
-
 
460
		if (!shippedOrderIds.isEmpty()) {
-
 
461
			List<LineItem> shippedLineItem = lineItemRepository.selectLineItem(shippedOrderIds);
-
 
462
			Map<Integer, LineItem> shippedLineItemMap = shippedLineItem.stream()
-
 
463
					.collect(Collectors.toMap(x -> x.getOrderId(), x -> x));
367
		model.addAttribute("billedCount", billedCount);
464
			LOGGER.info("shippedLineItemMap {}", shippedLineItemMap);
368
		LOGGER.info("billedCount {}", billedCount);
465
 
369
 
466
			long shippedCount = shippedLineItemMap.entrySet().stream().filter(x -> x.getKey() > 0).count();
370
		long shippedCount = shippedOrderIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
467
			model.addAttribute("shippedCount", shippedCount);
371
		model.addAttribute("shippedCount", shippedCount);
468
			LOGGER.info("shippedCount {}", shippedCount);
372
		LOGGER.info("shippedCount {}", shippedCount);
469
 
-
 
470
			long shippedValue = shippedLineItemMap.entrySet().stream()
373
		long shippedValue = shippedOrderIds.stream()
471
					.mapToLong(x -> x.getValue().getTotalPrice().longValue()).sum();
374
				.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
472
			model.addAttribute("shippedValue", shippedValue);
375
		model.addAttribute("shippedValue", shippedValue);
473
		}
-
 
474
 
376
 
475
		model.addAttribute("countOrder", countOrder);
377
		model.addAttribute("countOrder", countOrder);
476
		model.addAttribute("onlineDeliveredOrderSum", onlineDeliveredOrderSum.getSellingPrice());
378
		model.addAttribute("onlineDeliveredOrderSum", onlineDeliveredOrderSum.getSellingPrice());
477
		boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
379
		boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
478
		model.addAttribute("isAdmin", isAdmin);
380
		model.addAttribute("isAdmin", isAdmin);
Line 580... Line 482...
580
	@RequestMapping(value = "/getGrnPendingOrderStatus", method = RequestMethod.GET)
482
	@RequestMapping(value = "/getGrnPendingOrderStatus", method = RequestMethod.GET)
581
	public String getGrnPendingOrderStatus(HttpServletRequest request, Model model) throws Exception {
483
	public String getGrnPendingOrderStatus(HttpServletRequest request, Model model) throws Exception {
582
 
484
 
583
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
485
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
584
		int fofoId = loginDetails.getFofoId();
486
		int fofoId = loginDetails.getFofoId();
585
		ArrayList<in.shop2020.model.v1.order.OrderStatus> orderStatus = new ArrayList<>();
-
 
586
 
-
 
587
		List<Order> order = orderRepository.selectPendingGrnOrders(fofoId);
487
		List<Order> order = orderRepository.selectGrnTimestampNull(fofoId, Arrays.asList(in.shop2020.model.v1.order.OrderStatus.DELIVERY_SUCCESS));
588
		List<Integer> orderIds = order.stream().map(x -> x.getId()).collect(Collectors.toList());
-
 
589
		model.addAttribute("grnOrderIds", orderIds);
-
 
590
 
488
 
591
		if (!orderIds.isEmpty()) {
489
		List<LineItem> grnPendingLineItemIds = order.stream()
-
 
490
				.filter(x -> x.getStatus() == in.shop2020.model.v1.order.OrderStatus.DELIVERY_SUCCESS)
-
 
491
				.map(x -> x.getLineItem()).collect(Collectors.toList());
592
 
492
 
593
			List<LineItem> grnPendingLineItem = lineItemRepository.selectLineItem(orderIds);
-
 
594
			Map<Integer, LineItem> grnPendingLineMap = grnPendingLineItem.stream()
493
		Map<Integer, LineItem> grnPendingLineMap = grnPendingLineItemIds.stream()
595
					.collect(Collectors.toMap(x -> x.getOrderId(), x -> x));
494
				.collect(Collectors.toMap(x -> x.getOrderId(), x -> x));
596
			LOGGER.info("grnPendingLineMap {}", grnPendingLineMap);
495
		LOGGER.info("grnPendingLineMap {}", grnPendingLineMap);
597
			model.addAttribute("grnPendingLineMap", grnPendingLineMap);
496
		model.addAttribute("grnPendingLineMap", grnPendingLineMap);
598
			Map<Integer, Order> orderMap = order.stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
497
		Map<Integer, Order> orderMap = order.stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
599
 
-
 
600
			model.addAttribute("orderMap", orderMap);
-
 
601
 
-
 
602
		}
-
 
603
 
498
 
-
 
499
		model.addAttribute("orderMap", orderMap);
604
		return "purchase-grn-order-status";
500
		return "purchase-grn-order-status";
605
	}
501
	}
606
 
502
 
607
	@RequestMapping(value = "/getPendingOrderStatus", method = RequestMethod.GET)
503
	@RequestMapping(value = "/getPendingOrderStatus", method = RequestMethod.GET)
608
	public String getPendingOrderStatus(HttpServletRequest request, Model model) throws Exception {
504
	public String getPendingOrderStatus(HttpServletRequest request, Model model) throws Exception {
Line 683... Line 579...
683
		return "purchase-shipped-order-status";
579
		return "purchase-shipped-order-status";
684
	}
580
	}
685
 
581
 
686
	@RequestMapping(value = "/getMonthsInvestment", method = RequestMethod.GET)
582
	@RequestMapping(value = "/getMonthsInvestment", method = RequestMethod.GET)
687
	public String getMonthsInvestment(HttpServletRequest request,
583
	public String getMonthsInvestment(HttpServletRequest request,
688
			@RequestParam(name = "month", required = true, defaultValue = "0") int month, Model model)
584
									  @RequestParam(name = "month", required = true, defaultValue = "0") int month, Model model)
689
			throws Exception {
585
			throws Exception {
690
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
586
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
691
		int fofoId = loginDetails.getFofoId();
587
		int fofoId = loginDetails.getFofoId();
692
		Map<String, Object> investment = fofoUser.getInvestmentsMonths(fofoId, month);
588
		Map<String, Object> investment = fofoUser.getInvestmentsMonths(fofoId, month);
693
 
589
 
Line 773... Line 669...
773
		return "bar_chart";
669
		return "bar_chart";
774
	}
670
	}
775
 
671
 
776
	@RequestMapping(value = "/getPriceDropDetails", method = RequestMethod.GET)
672
	@RequestMapping(value = "/getPriceDropDetails", method = RequestMethod.GET)
777
	public String getPriceDropDetails(HttpServletRequest request,
673
	public String getPriceDropDetails(HttpServletRequest request,
778
			@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
674
									  @RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
779
			@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
675
									  @RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
780
			@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
676
									  @RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
781
			throws Exception {
677
			throws Exception {
782
 
678
 
783
		LOGGER.info("params" + fofoId + brand + yearMonth);
679
		LOGGER.info("params" + fofoId + brand + yearMonth);
784
 
680
 
785
		List<PriceDropWithDetailsByYearMonthModel> priceDropdetailsList = priceDropRepository
681
		List<PriceDropWithDetailsByYearMonthModel> priceDropdetailsList = priceDropRepository
Line 792... Line 688...
792
		return "price-drop-details";
688
		return "price-drop-details";
793
	}
689
	}
794
 
690
 
795
	@RequestMapping(value = "/getPriceDropDetailSixMonths", method = RequestMethod.GET)
691
	@RequestMapping(value = "/getPriceDropDetailSixMonths", method = RequestMethod.GET)
796
	public String getPriceDropDetailSixMonths(HttpServletRequest request,
692
	public String getPriceDropDetailSixMonths(HttpServletRequest request,
797
			@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
693
											  @RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
798
			@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
694
											  @RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
799
			throws Exception {
695
			throws Exception {
800
 
696
 
801
		LOGGER.info("params" + fofoId + brand);
697
		LOGGER.info("params" + fofoId + brand);
802
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
698
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
803
		LocalDateTime startfMonthSixMonth = curDate.withDayOfMonth(1).minusMonths(12);
699
		LocalDateTime startfMonthSixMonth = curDate.withDayOfMonth(1).minusMonths(12);
Line 999... Line 895...
999
		return "activation-tabular";
895
		return "activation-tabular";
1000
	}
896
	}
1001
 
897
 
1002
	@RequestMapping(value = "/getMonthlyActivationItemDetail", method = RequestMethod.GET)
898
	@RequestMapping(value = "/getMonthlyActivationItemDetail", method = RequestMethod.GET)
1003
	public String getMonthlyActivationItemDetail(HttpServletRequest request,
899
	public String getMonthlyActivationItemDetail(HttpServletRequest request,
1004
			@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
900
												 @RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
1005
			@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
901
												 @RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
1006
			@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
902
												 @RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
1007
			throws Exception {
903
			throws Exception {
1008
 
904
 
1009
		LOGGER.info("params" + fofoId + brand + yearMonth);
905
		LOGGER.info("params" + fofoId + brand + yearMonth);
1010
 
906
 
1011
		List<ActivationItemDetailModel> activationItemDetails = schemeInOutRepository
907
		List<ActivationItemDetailModel> activationItemDetails = schemeInOutRepository
Line 1036... Line 932...
1036
		return "activation-pending-item-details";
932
		return "activation-pending-item-details";
1037
	}
933
	}
1038
 
934
 
1039
	@RequestMapping(value = "/getMonthlyActivationBeforeSixMonthsItemDetail", method = RequestMethod.GET)
935
	@RequestMapping(value = "/getMonthlyActivationBeforeSixMonthsItemDetail", method = RequestMethod.GET)
1040
	public String getMonthlyActivationItemDetail(HttpServletRequest request,
936
	public String getMonthlyActivationItemDetail(HttpServletRequest request,
1041
			@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
937
												 @RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
1042
			@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
938
												 @RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
1043
			throws Exception {
939
			throws Exception {
1044
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
940
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1045
 
941
 
1046
		LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
942
		LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
1047
 
943
 
Line 1148... Line 1044...
1148
 
1044
 
1149
	}
1045
	}
1150
 
1046
 
1151
	@RequestMapping(value = "/getMonthlyUpgradeOfferItemDetail", method = RequestMethod.GET)
1047
	@RequestMapping(value = "/getMonthlyUpgradeOfferItemDetail", method = RequestMethod.GET)
1152
	public String getMonthlyUpgradeOfferItemDetail(HttpServletRequest request,
1048
	public String getMonthlyUpgradeOfferItemDetail(HttpServletRequest request,
1153
			@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
1049
												   @RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
1154
			@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
1050
												   @RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
1155
			@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
1051
												   @RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
1156
			throws Exception {
1052
			throws Exception {
1157
 
1053
 
1158
		LOGGER.info("params" + fofoId + brand + yearMonth);
1054
		LOGGER.info("params" + fofoId + brand + yearMonth);
1159
		List<UpgradeOfferItemDetailModel> offerItems = samsungUpgradeOfferRepository
1055
		List<UpgradeOfferItemDetailModel> offerItems = samsungUpgradeOfferRepository
1160
				.selectUpgradeOfferItemDetails(fofoId, UpgradeOfferStatus.approved, brand, yearMonth);
1056
				.selectUpgradeOfferItemDetails(fofoId, UpgradeOfferStatus.approved, brand, yearMonth);
Line 1164... Line 1060...
1164
		return "upgrade-offer-item-detail";
1060
		return "upgrade-offer-item-detail";
1165
	}
1061
	}
1166
 
1062
 
1167
	@RequestMapping(value = "/getUpgradeOfferBeforeSixMonthItemDetail", method = RequestMethod.GET)
1063
	@RequestMapping(value = "/getUpgradeOfferBeforeSixMonthItemDetail", method = RequestMethod.GET)
1168
	public String getUpgradeOfferBeforeSixMonthItemDetail(HttpServletRequest request,
1064
	public String getUpgradeOfferBeforeSixMonthItemDetail(HttpServletRequest request,
1169
			@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
1065
														  @RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
1170
			@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
1066
														  @RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
1171
			throws Exception {
1067
			throws Exception {
1172
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1068
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1173
 
1069
 
1174
		LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
1070
		LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
1175
 
1071
 
Line 1253... Line 1149...
1253
		return "auth_user_partner_detail";
1149
		return "auth_user_partner_detail";
1254
	}
1150
	}
1255
 
1151
 
1256
	@RequestMapping(value = "/getWarehouseWiseBrandStock", method = RequestMethod.GET)
1152
	@RequestMapping(value = "/getWarehouseWiseBrandStock", method = RequestMethod.GET)
1257
	public String getWarehouseWiseBrandStock(HttpServletRequest request, Model model,
1153
	public String getWarehouseWiseBrandStock(HttpServletRequest request, Model model,
1258
			@RequestParam List<Integer> warehouseId) throws Exception {
1154
											 @RequestParam List<Integer> warehouseId) throws Exception {
1259
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1155
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1260
		String email = loginDetails.getEmailId();
1156
		String email = loginDetails.getEmailId();
1261
		Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
1157
		Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
1262
		Set<Integer> authfofoIds = storeGuyMap.get(email);
1158
		Set<Integer> authfofoIds = storeGuyMap.get(email);
1263
		AuthUser authUser = authRepository.selectByEmailOrMobile(email);
1159
		AuthUser authUser = authRepository.selectByEmailOrMobile(email);
Line 1327... Line 1223...
1327
		return "response";
1223
		return "response";
1328
	}
1224
	}
1329
 
1225
 
1330
	@RequestMapping(value = "/getWarehouseWiseBrandAndCategory", method = RequestMethod.GET)
1226
	@RequestMapping(value = "/getWarehouseWiseBrandAndCategory", method = RequestMethod.GET)
1331
	public String getWarehouseWiseBrandAndCategory(HttpServletRequest request, Model model,
1227
	public String getWarehouseWiseBrandAndCategory(HttpServletRequest request, Model model,
1332
			@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
1228
												   @RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
1333
			throws Exception {
1229
			throws Exception {
1334
 
1230
 
1335
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1231
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1336
		List<String> listbrands = saholicInventoryCISRepository.selectAllBrand();
1232
		List<String> listbrands = saholicInventoryCISRepository.selectAllBrand();
1337
		List<String> listCategory = saholicInventoryCISRepository.selectAllSubCategory();
1233
		List<String> listCategory = saholicInventoryCISRepository.selectAllSubCategory();
Line 1347... Line 1243...
1347
		return "warehouse_brand_item_stock";
1243
		return "warehouse_brand_item_stock";
1348
	}
1244
	}
1349
 
1245
 
1350
	@RequestMapping(value = "/getWarehouseWiseItemStock", method = RequestMethod.GET)
1246
	@RequestMapping(value = "/getWarehouseWiseItemStock", method = RequestMethod.GET)
1351
	public String getWarehouseWiseItemStock(HttpServletRequest request, Model model,
1247
	public String getWarehouseWiseItemStock(HttpServletRequest request, Model model,
1352
			@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
1248
											@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
1353
			throws Exception {
1249
			throws Exception {
1354
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1250
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1355
		if (warehouseId.contains(0)) {
1251
		if (warehouseId.contains(0)) {
1356
			warehouseId.addAll(warehouseMap.keySet());
1252
			warehouseId.addAll(warehouseMap.keySet());
1357
		}
1253
		}
Line 1418... Line 1314...
1418
		return "warehousewise_brand_partners_sale";
1314
		return "warehousewise_brand_partners_sale";
1419
	}
1315
	}
1420
 
1316
 
1421
	@RequestMapping(value = "/getWarehouseWiseAccesoriesBrandPartnerSale", method = RequestMethod.GET)
1317
	@RequestMapping(value = "/getWarehouseWiseAccesoriesBrandPartnerSale", method = RequestMethod.GET)
1422
	public String getWarehouseWiseAccesoriesBrandPartnerSale(HttpServletRequest request, Model model,
1318
	public String getWarehouseWiseAccesoriesBrandPartnerSale(HttpServletRequest request, Model model,
1423
			@RequestParam String brand) throws Exception {
1319
															 @RequestParam String brand) throws Exception {
1424
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1320
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1425
		String email = loginDetails.getEmailId();
1321
		String email = loginDetails.getEmailId();
1426
		Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
1322
		Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
1427
		Set<Integer> authfofoIds = storeGuyMap.get(email);
1323
		Set<Integer> authfofoIds = storeGuyMap.get(email);
1428
 
1324
 
Line 1447... Line 1343...
1447
		return "warehousewise_accessoriesbrand_sale";
1343
		return "warehousewise_accessoriesbrand_sale";
1448
	}
1344
	}
1449
 
1345
 
1450
	@RequestMapping(value = "/getWarehouseBrandWiseItemSale", method = RequestMethod.GET)
1346
	@RequestMapping(value = "/getWarehouseBrandWiseItemSale", method = RequestMethod.GET)
1451
	public String getWarehouseBrandWiseItemSale(HttpServletRequest request, Model model,
1347
	public String getWarehouseBrandWiseItemSale(HttpServletRequest request, Model model,
1452
			@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
1348
												@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
1453
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1349
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1454
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1350
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1455
		String email = loginDetails.getEmailId();
1351
		String email = loginDetails.getEmailId();
1456
		Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
1352
		Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
1457
		Set<Integer> authfofoIds = storeGuyMap.get(email);
1353
		Set<Integer> authfofoIds = storeGuyMap.get(email);
Line 1491... Line 1387...
1491
		return "warehouse_partner_itemwise_sale";
1387
		return "warehouse_partner_itemwise_sale";
1492
	}
1388
	}
1493
 
1389
 
1494
	@RequestMapping(value = "/getWarehouseAccesoriesBrandWiseItemSale", method = RequestMethod.GET)
1390
	@RequestMapping(value = "/getWarehouseAccesoriesBrandWiseItemSale", method = RequestMethod.GET)
1495
	public String getWarehouseAccesoriesBrandWiseItemSale(HttpServletRequest request, Model model,
1391
	public String getWarehouseAccesoriesBrandWiseItemSale(HttpServletRequest request, Model model,
1496
			@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
1392
														  @RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
1497
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1393
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1498
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1394
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1499
		String email = loginDetails.getEmailId();
1395
		String email = loginDetails.getEmailId();
1500
		Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
1396
		Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
1501
		Set<Integer> authfofoIds = storeGuyMap.get(email);
1397
		Set<Integer> authfofoIds = storeGuyMap.get(email);
Line 1512... Line 1408...
1512
		return "contact-us";
1408
		return "contact-us";
1513
	}
1409
	}
1514
 
1410
 
1515
	@RequestMapping(value = "/notifications", method = RequestMethod.GET)
1411
	@RequestMapping(value = "/notifications", method = RequestMethod.GET)
1516
	public String getNotificationsWithType(HttpServletRequest request,
1412
	public String getNotificationsWithType(HttpServletRequest request,
1517
			@RequestParam(required = false) MessageType messageType,
1413
										   @RequestParam(required = false) MessageType messageType,
1518
			@RequestParam(name = "offset", defaultValue = "0") int offset,
1414
										   @RequestParam(name = "offset", defaultValue = "0") int offset,
1519
			@RequestParam(name = "limit", defaultValue = "20") int limit, Model model) throws Exception {
1415
										   @RequestParam(name = "limit", defaultValue = "20") int limit, Model model) throws Exception {
1520
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1416
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1521
		int userId = 0;
1417
		int userId = 0;
1522
		boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
1418
		boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
1523
		if (isAdmin) {
1419
		if (isAdmin) {
1524
			userId = loginDetails.getFofoId();
1420
			userId = loginDetails.getFofoId();
Line 1538... Line 1434...
1538
		return "notification-template";
1434
		return "notification-template";
1539
	}
1435
	}
1540
 
1436
 
1541
	@RequestMapping(value = "/notifyDocument/documentId", method = RequestMethod.GET)
1437
	@RequestMapping(value = "/notifyDocument/documentId", method = RequestMethod.GET)
1542
	public ResponseEntity<?> retailerDocumentById(HttpServletRequest request,
1438
	public ResponseEntity<?> retailerDocumentById(HttpServletRequest request,
1543
			@RequestParam(name = ProfitMandiConstants.DOCUMENT_ID) int documentId, @RequestParam int cid)
1439
												  @RequestParam(name = ProfitMandiConstants.DOCUMENT_ID) int documentId, @RequestParam int cid)
1544
			throws ProfitMandiBusinessException {
1440
			throws ProfitMandiBusinessException {
1545
		Document document = documentRepository.selectById(documentId);
1441
		Document document = documentRepository.selectById(documentId);
1546
		NotificationCampaign nc = notificationCampaignRepository.selectById(cid);
1442
		NotificationCampaign nc = notificationCampaignRepository.selectById(cid);
1547
		if (nc.getDocumentId() == null) {
1443
		if (nc.getDocumentId() == null) {
1548
			throw new ProfitMandiBusinessException("cid", nc.getId(), "not available");
1444
			throw new ProfitMandiBusinessException("cid", nc.getId(), "not available");
Line 1592... Line 1488...
1592
		return new ResponseEntity<InputStreamResource>(inputStreamResource, headers, HttpStatus.OK);
1488
		return new ResponseEntity<InputStreamResource>(inputStreamResource, headers, HttpStatus.OK);
1593
	}
1489
	}
1594
 
1490
 
1595
	@RequestMapping(value = "/getItemWiseTertiary", method = RequestMethod.GET)
1491
	@RequestMapping(value = "/getItemWiseTertiary", method = RequestMethod.GET)
1596
	public String getItemWiseTertiary(HttpServletRequest request,
1492
	public String getItemWiseTertiary(HttpServletRequest request,
1597
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
1493
									  @RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
1598
			throws ProfitMandiBusinessException {
1494
			throws ProfitMandiBusinessException {
1599
		List<ItemWiseTertiaryModel> itemWiseTertiary = fofoOrderRepository.SelectItemWiseTertiary(fofoId);
1495
		List<ItemWiseTertiaryModel> itemWiseTertiary = fofoOrderRepository.SelectItemWiseTertiary(fofoId);
1600
 
1496
 
1601
		LOGGER.info("itemWiseTertiary" + itemWiseTertiary);
1497
		LOGGER.info("itemWiseTertiary" + itemWiseTertiary);
1602
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1498
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
Line 1605... Line 1501...
1605
		return "item-wise-tertiary";
1501
		return "item-wise-tertiary";
1606
	}
1502
	}
1607
 
1503
 
1608
	@RequestMapping(value = "/getItemWiseIndent", method = RequestMethod.GET)
1504
	@RequestMapping(value = "/getItemWiseIndent", method = RequestMethod.GET)
1609
	public String getItemWiseIndent(HttpServletRequest request,
1505
	public String getItemWiseIndent(HttpServletRequest request,
1610
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
1506
									@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
1611
			throws ProfitMandiBusinessException {
1507
			throws ProfitMandiBusinessException {
1612
 
1508
 
1613
		List<Order> unbilledOrders = transactionService.getInTransitOrders(fofoId);
1509
		List<Order> unbilledOrders = transactionService.getInTransitOrders(fofoId);
1614
		model.addAttribute("unbilledOrders", unbilledOrders);
1510
		model.addAttribute("unbilledOrders", unbilledOrders);
1615
 
1511
 
1616
		return "item-wise-indent";
1512
		return "item-wise-indent";
1617
	}
1513
	}
1618
 
1514
 
1619
	@RequestMapping(value = "/getPartnerInvestment", method = RequestMethod.GET)
1515
	@RequestMapping(value = "/getPartnerInvestment", method = RequestMethod.GET)
1620
	public String getPartnerInvestment(HttpServletRequest request,
1516
	public String getPartnerInvestment(HttpServletRequest request,
1621
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1517
									   @RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1622
		Map<Integer, PartnerDetailModel> partnerStats = adminUser.getPartnersStatDataFromFile();
1518
		Map<Integer, PartnerDetailModel> partnerStats = adminUser.getPartnersStatDataFromFile();
1623
		PartnerDetailModel partnerDetailModel = partnerStats.get(fofoId);
1519
		PartnerDetailModel partnerDetailModel = partnerStats.get(fofoId);
1624
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1520
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1625
		model.addAttribute("partnerDetailModel", partnerDetailModel);
1521
		model.addAttribute("partnerDetailModel", partnerDetailModel);
1626
		model.addAttribute("customRetailer", customRetailer);
1522
		model.addAttribute("customRetailer", customRetailer);
1627
		return "partner-investment";
1523
		return "partner-investment";
1628
	}
1524
	}
1629
 
1525
 
1630
	@RequestMapping(value = "/getPartnerPendingIndentItem", method = RequestMethod.GET)
1526
	@RequestMapping(value = "/getPartnerPendingIndentItem", method = RequestMethod.GET)
1631
	public String getPartnerPendingIndentItem(HttpServletRequest request, @RequestParam int warehouseId,
1527
	public String getPartnerPendingIndentItem(HttpServletRequest request, @RequestParam int warehouseId,
1632
			@RequestParam int itemId, Model model) throws ProfitMandiBusinessException {
1528
											  @RequestParam int itemId, Model model) throws ProfitMandiBusinessException {
1633
		List<PartnerPendingIndentItemModel> partnerPendingIndent = fofoStoreRepository
1529
		List<PartnerPendingIndentItemModel> partnerPendingIndent = fofoStoreRepository
1634
				.selectPartnerPendingIndentItem(itemId, warehouseId);
1530
				.selectPartnerPendingIndentItem(itemId, warehouseId);
1635
 
1531
 
1636
		model.addAttribute("partnerPendingIndent", partnerPendingIndent);
1532
		model.addAttribute("partnerPendingIndent", partnerPendingIndent);
1637
		return "partner-pending-indent-item";
1533
		return "partner-pending-indent-item";
1638
	}
1534
	}
1639
 
1535
 
1640
	@RequestMapping(value = "/getPatnerActivateStock", method = RequestMethod.GET)
1536
	@RequestMapping(value = "/getPatnerActivateStock", method = RequestMethod.GET)
1641
	public String getPartnerActivateStockItem(HttpServletRequest request,
1537
	public String getPartnerActivateStockItem(HttpServletRequest request,
1642
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1538
											  @RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1643
		List<ActivateItemModel> activateStocks = new ArrayList<>();
1539
		List<ActivateItemModel> activateStocks = new ArrayList<>();
1644
		List<InventoryItem> inventoryItems = inventoryItemRepository.selectByActivatedNotSold(fofoId);
1540
		List<InventoryItem> inventoryItems = inventoryItemRepository.selectByActivatedNotSold(fofoId);
1645
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1541
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1646
 
1542
 
1647
		for (InventoryItem inventoryItem : inventoryItems) {
1543
		for (InventoryItem inventoryItem : inventoryItems) {
Line 1661... Line 1557...
1661
		return "partner-activate-stock";
1557
		return "partner-activate-stock";
1662
	}
1558
	}
1663
 
1559
 
1664
	@RequestMapping(value = "/getPatnerBrandWiseMTDSale", method = RequestMethod.GET)
1560
	@RequestMapping(value = "/getPatnerBrandWiseMTDSale", method = RequestMethod.GET)
1665
	public String getPatnerBrandWiseMTDSale(HttpServletRequest request,
1561
	public String getPatnerBrandWiseMTDSale(HttpServletRequest request,
1666
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1562
											@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1667
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1563
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1668
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1564
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1669
		Map<String, Double> brandMtdAmount = fofoOrderItemRepository
1565
		Map<String, Double> brandMtdAmount = fofoOrderItemRepository
1670
				.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
1566
				.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
1671
		Map<String, Long> brandMtdQty = fofoOrderItemRepository.selectSumQuantityGroupByBrand(curDate.withDayOfMonth(1),
1567
		Map<String, Long> brandMtdQty = fofoOrderItemRepository.selectSumQuantityGroupByBrand(curDate.withDayOfMonth(1),
Line 1685... Line 1581...
1685
		return "partner-brand-mtd-sale";
1581
		return "partner-brand-mtd-sale";
1686
	}
1582
	}
1687
 
1583
 
1688
	@RequestMapping(value = "/getPatnerBrandWiseLMTDSale", method = RequestMethod.GET)
1584
	@RequestMapping(value = "/getPatnerBrandWiseLMTDSale", method = RequestMethod.GET)
1689
	public String getPatnerBrandWiseLMTDSale(HttpServletRequest request,
1585
	public String getPatnerBrandWiseLMTDSale(HttpServletRequest request,
1690
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1586
											 @RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1691
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1587
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1692
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1588
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1693
		Map<String, Double> brandLMtdAmount = fofoOrderItemRepository.selectSumAmountGroupByBrand(
1589
		Map<String, Double> brandLMtdAmount = fofoOrderItemRepository.selectSumAmountGroupByBrand(
1694
				curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), fofoId);
1590
				curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), fofoId);
1695
		Map<String, Long> brandLmtdQty = fofoOrderItemRepository.selectSumQuantityGroupByBrand(
1591
		Map<String, Long> brandLmtdQty = fofoOrderItemRepository.selectSumQuantityGroupByBrand(
Line 1711... Line 1607...
1711
		return "partner-brand-lmtd-sale";
1607
		return "partner-brand-lmtd-sale";
1712
	}
1608
	}
1713
 
1609
 
1714
	@RequestMapping(value = "/getPatnerBrandWiseLMSSale", method = RequestMethod.GET)
1610
	@RequestMapping(value = "/getPatnerBrandWiseLMSSale", method = RequestMethod.GET)
1715
	public String getPatnerBrandWiseLMSSale(HttpServletRequest request,
1611
	public String getPatnerBrandWiseLMSSale(HttpServletRequest request,
1716
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1612
											@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1717
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1613
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1718
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1614
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1719
		int lengthOfMonth = YearMonth.from(curDate.minusMonths(1)).lengthOfMonth();
1615
		int lengthOfMonth = YearMonth.from(curDate.minusMonths(1)).lengthOfMonth();
1720
 
1616
 
1721
		Map<String, Double> brandLMSAmount = fofoOrderItemRepository.selectSumAmountGroupByBrand(
1617
		Map<String, Double> brandLMSAmount = fofoOrderItemRepository.selectSumAmountGroupByBrand(
Line 1738... Line 1634...
1738
		return "partner-brand-lms-sale";
1634
		return "partner-brand-lms-sale";
1739
	}
1635
	}
1740
 
1636
 
1741
	@RequestMapping(value = "/getPatnerInStock", method = RequestMethod.GET)
1637
	@RequestMapping(value = "/getPatnerInStock", method = RequestMethod.GET)
1742
	public String getPatnerInStock(HttpServletRequest request,
1638
	public String getPatnerInStock(HttpServletRequest request,
1743
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1639
								   @RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1744
 
1640
 
1745
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1641
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1746
 
1642
 
1747
		List<InStockBrandModel> mobileStocks = currentInventorySnapshotRepository
1643
		List<InStockBrandModel> mobileStocks = currentInventorySnapshotRepository
1748
				.selectSumInStockMobileGroupByBrand(fofoId);
1644
				.selectSumInStockMobileGroupByBrand(fofoId);
Line 1762... Line 1658...
1762
		return "partner-instock-item";
1658
		return "partner-instock-item";
1763
	}
1659
	}
1764
 
1660
 
1765
	@RequestMapping(value = "/getOpenTicketByFofoId", method = RequestMethod.GET)
1661
	@RequestMapping(value = "/getOpenTicketByFofoId", method = RequestMethod.GET)
1766
	public String getOpenTicketByFofoId(HttpServletRequest request,
1662
	public String getOpenTicketByFofoId(HttpServletRequest request,
1767
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1663
										@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
1768
		Map<Integer, AuthUser> ticketIdAuthUser = new HashMap<>();
1664
		Map<Integer, AuthUser> ticketIdAuthUser = new HashMap<>();
1769
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1665
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1770
		List<Integer> ticketIds = ticketRepository.selectAllOpenTicketByRetailer(fofoId).stream().map(x -> x.getId())
1666
		List<Integer> ticketIds = ticketRepository.selectAllOpenTicketByRetailer(fofoId).stream().map(x -> x.getId())
1771
				.collect(Collectors.toList());
1667
				.collect(Collectors.toList());
1772
		List<TicketAssigned> ticketAssigns = ticketAssignedRepository.selectByTicketIds(ticketIds);
1668
		List<TicketAssigned> ticketAssigns = ticketAssignedRepository.selectByTicketIds(ticketIds);
Line 1781... Line 1677...
1781
		return "open-ticket";
1677
		return "open-ticket";
1782
	}
1678
	}
1783
 
1679
 
1784
	@RequestMapping(value = "/getPartnerSecondarySale", method = RequestMethod.GET)
1680
	@RequestMapping(value = "/getPartnerSecondarySale", method = RequestMethod.GET)
1785
	public String getPartnerSecondarySale(HttpServletRequest request,
1681
	public String getPartnerSecondarySale(HttpServletRequest request,
1786
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, @RequestParam String timeValue, Model model)
1682
										  @RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, @RequestParam String timeValue, Model model)
1787
			throws Exception {
1683
			throws Exception {
1788
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1684
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
1789
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1685
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
1790
		int lengthOfMonth = YearMonth.from(curDate.minusMonths(1)).lengthOfMonth();
1686
		int lengthOfMonth = YearMonth.from(curDate.minusMonths(1)).lengthOfMonth();
1791
		LocalDateTime startDate = null;
1687
		LocalDateTime startDate = null;
Line 1914... Line 1810...
1914
		return "accessories-brand-wise-report";
1810
		return "accessories-brand-wise-report";
1915
	}
1811
	}
1916
 
1812
 
1917
	@RequestMapping(value = "/getMobileLMSGraph", method = RequestMethod.GET)
1813
	@RequestMapping(value = "/getMobileLMSGraph", method = RequestMethod.GET)
1918
	public String getMobileLMSGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
1814
	public String getMobileLMSGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
1919
			@RequestParam(required = false) LocalDate date, @RequestParam List<Integer> fofoIds, Model model)
1815
									@RequestParam(required = false) LocalDate date, @RequestParam List<Integer> fofoIds, Model model)
1920
			throws Exception {
1816
			throws Exception {
1921
		Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
1817
		Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
1922
				.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
1818
				.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
1923
						FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
1819
						FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
1924
 
1820
 
Line 1937... Line 1833...
1937
		return "brand-wise-mobile-lms-chart";
1833
		return "brand-wise-mobile-lms-chart";
1938
	}
1834
	}
1939
 
1835
 
1940
	@RequestMapping(value = "/getMobileLMSFilter", method = RequestMethod.GET)
1836
	@RequestMapping(value = "/getMobileLMSFilter", method = RequestMethod.GET)
1941
	public String getMobileLMSFilter(HttpServletRequest request,
1837
	public String getMobileLMSFilter(HttpServletRequest request,
1942
			@RequestParam(required = false, defaultValue = "0") int warehouseId,
1838
									 @RequestParam(required = false, defaultValue = "0") int warehouseId,
1943
			@RequestParam(required = false) LocalDate date, Model model) throws Exception {
1839
									 @RequestParam(required = false) LocalDate date, Model model) throws Exception {
1944
 
1840
 
1945
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1841
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1946
		String email = loginDetails.getEmailId();
1842
		String email = loginDetails.getEmailId();
1947
		Map<String, Object> map = adminUser.getFilter(warehouseId, email, date);
1843
		Map<String, Object> map = adminUser.getFilter(warehouseId, email, date);
1948
		model.addAttribute("warehouseId", warehouseId);
1844
		model.addAttribute("warehouseId", warehouseId);
Line 1951... Line 1847...
1951
		return "chart-filter-lms";
1847
		return "chart-filter-lms";
1952
	}
1848
	}
1953
 
1849
 
1954
	@RequestMapping(value = "/getMobileLMPFilter", method = RequestMethod.GET)
1850
	@RequestMapping(value = "/getMobileLMPFilter", method = RequestMethod.GET)
1955
	public String getMobileLMPFilter(HttpServletRequest request,
1851
	public String getMobileLMPFilter(HttpServletRequest request,
1956
			@RequestParam(required = false, defaultValue = "0") int warehouseId,
1852
									 @RequestParam(required = false, defaultValue = "0") int warehouseId,
1957
			@RequestParam(required = false) LocalDate date, Model model) throws Exception {
1853
									 @RequestParam(required = false) LocalDate date, Model model) throws Exception {
1958
 
1854
 
1959
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1855
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1960
		String email = loginDetails.getEmailId();
1856
		String email = loginDetails.getEmailId();
1961
		Map<String, Object> map = adminUser.getFilter(warehouseId, email, date);
1857
		Map<String, Object> map = adminUser.getFilter(warehouseId, email, date);
1962
		model.addAttribute("warehouseId", warehouseId);
1858
		model.addAttribute("warehouseId", warehouseId);
Line 1965... Line 1861...
1965
		return "chart-filter-lmp";
1861
		return "chart-filter-lmp";
1966
	}
1862
	}
1967
 
1863
 
1968
	@RequestMapping(value = "/getMobileLMPGraph", method = RequestMethod.GET)
1864
	@RequestMapping(value = "/getMobileLMPGraph", method = RequestMethod.GET)
1969
	public String getMobileLMPGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
1865
	public String getMobileLMPGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
1970
			@RequestParam(required = false) LocalDate date, @RequestParam List<Integer> fofoIds, Model model)
1866
									@RequestParam(required = false) LocalDate date, @RequestParam List<Integer> fofoIds, Model model)
1971
			throws Exception {
1867
			throws Exception {
1972
		Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
1868
		Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
1973
				.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
1869
				.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
1974
						FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
1870
						FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
1975
 
1871
 
Line 2019... Line 1915...
2019
		return "activation-brandwise-report";
1915
		return "activation-brandwise-report";
2020
	}
1916
	}
2021
 
1917
 
2022
	@RequestMapping(value = "/getWarehouseBrandWiseItemActivatedModel", method = RequestMethod.GET)
1918
	@RequestMapping(value = "/getWarehouseBrandWiseItemActivatedModel", method = RequestMethod.GET)
2023
	public String getWarehouseBrandWiseItemActivatedModel(HttpServletRequest request, Model model,
1919
	public String getWarehouseBrandWiseItemActivatedModel(HttpServletRequest request, Model model,
2024
			@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
1920
														  @RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
2025
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1921
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
2026
		List<Integer> fofoIds = getFofoIds(loginDetails);
1922
		List<Integer> fofoIds = getFofoIds(loginDetails);
2027
 
1923
 
2028
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
1924
		Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
2029
		List<WarehouseBrandWiseItemActivatedModel> activatedItems = activatedImeiRepository
1925
		List<WarehouseBrandWiseItemActivatedModel> activatedItems = activatedImeiRepository