Subversion Repositories SmartDukaan

Rev

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

Rev 27628 Rev 27632
Line 46... Line 46...
46
import com.mongodb.DBObject;
46
import com.mongodb.DBObject;
47
import com.spice.profitmandi.common.enumuration.ContentType;
47
import com.spice.profitmandi.common.enumuration.ContentType;
48
import com.spice.profitmandi.common.enumuration.MessageType;
48
import com.spice.profitmandi.common.enumuration.MessageType;
49
import com.spice.profitmandi.common.enumuration.ReporticoProject;
49
import com.spice.profitmandi.common.enumuration.ReporticoProject;
50
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
50
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
-
 
51
import com.spice.profitmandi.common.model.ActivateItemModel;
51
import com.spice.profitmandi.common.model.BrandStockPrice;
52
import com.spice.profitmandi.common.model.BrandStockPrice;
52
import com.spice.profitmandi.common.model.ChartModel;
53
import com.spice.profitmandi.common.model.ChartModel;
53
import com.spice.profitmandi.common.model.CustomRetailer;
54
import com.spice.profitmandi.common.model.CustomRetailer;
54
import com.spice.profitmandi.common.model.DataModel;
55
import com.spice.profitmandi.common.model.DataModel;
55
import com.spice.profitmandi.common.model.DatasetModel;
56
import com.spice.profitmandi.common.model.DatasetModel;
Line 64... Line 65...
64
import com.spice.profitmandi.dao.entity.auth.Menu;
65
import com.spice.profitmandi.dao.entity.auth.Menu;
65
import com.spice.profitmandi.dao.entity.catalog.Item;
66
import com.spice.profitmandi.dao.entity.catalog.Item;
66
import com.spice.profitmandi.dao.entity.catalog.Offer;
67
import com.spice.profitmandi.dao.entity.catalog.Offer;
67
import com.spice.profitmandi.dao.entity.catalog.OfferPartner;
68
import com.spice.profitmandi.dao.entity.catalog.OfferPartner;
68
import com.spice.profitmandi.dao.entity.catalog.Offermargin;
69
import com.spice.profitmandi.dao.entity.catalog.Offermargin;
-
 
70
import com.spice.profitmandi.dao.entity.catalog.TagListing;
69
import com.spice.profitmandi.dao.entity.cs.Position;
71
import com.spice.profitmandi.dao.entity.cs.Position;
70
import com.spice.profitmandi.dao.entity.dtr.Document;
72
import com.spice.profitmandi.dao.entity.dtr.Document;
71
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
73
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
72
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
74
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
-
 
75
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
73
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
76
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
74
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
77
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
75
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
78
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
76
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
79
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
77
import com.spice.profitmandi.dao.entity.transaction.Order;
80
import com.spice.profitmandi.dao.entity.transaction.Order;
Line 98... Line 101...
98
import com.spice.profitmandi.dao.repository.auth.MenuRepository;
101
import com.spice.profitmandi.dao.repository.auth.MenuRepository;
99
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
102
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
100
import com.spice.profitmandi.dao.repository.catalog.OfferMarginRepository;
103
import com.spice.profitmandi.dao.repository.catalog.OfferMarginRepository;
101
import com.spice.profitmandi.dao.repository.catalog.OfferPartnerRepository;
104
import com.spice.profitmandi.dao.repository.catalog.OfferPartnerRepository;
102
import com.spice.profitmandi.dao.repository.catalog.OfferRepository;
105
import com.spice.profitmandi.dao.repository.catalog.OfferRepository;
-
 
106
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
103
import com.spice.profitmandi.dao.repository.cs.CsService;
107
import com.spice.profitmandi.dao.repository.cs.CsService;
104
import com.spice.profitmandi.dao.repository.cs.PartnersPositionRepository;
108
import com.spice.profitmandi.dao.repository.cs.PartnersPositionRepository;
105
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
109
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
106
import com.spice.profitmandi.dao.repository.cs.TicketCategoryRepository;
110
import com.spice.profitmandi.dao.repository.cs.TicketCategoryRepository;
107
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
111
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
Line 274... Line 278...
274
	private ReporticoCacheTableRepository reporticoCacheTableRepository;
278
	private ReporticoCacheTableRepository reporticoCacheTableRepository;
275
 
279
 
276
	@Autowired
280
	@Autowired
277
	private TransactionService transactionService;
281
	private TransactionService transactionService;
278
 
282
 
-
 
283
	@Autowired
-
 
284
	private TagListingRepository tagListingRepository;
-
 
285
 
279
	private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
286
	private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
280
 
287
 
281
	@RequestMapping(value = "/12dashboard34", method = RequestMethod.GET)
288
	@RequestMapping(value = "/12dashboard34", method = RequestMethod.GET)
282
	public String dashboard1(HttpServletRequest request, Model model, @RequestParam int fofoId) throws Exception {
289
	public String dashboard1(HttpServletRequest request, Model model, @RequestParam int fofoId) throws Exception {
283
		boolean isAdmin = false;
290
		boolean isAdmin = false;
Line 1065... Line 1072...
1065
		if (partnerStats != null) {
1072
		if (partnerStats != null) {
1066
			for (Entry<Integer, List<FofoStore>> warehouse : warehousePartnerMap.entrySet()) {
1073
			for (Entry<Integer, List<FofoStore>> warehouse : warehousePartnerMap.entrySet()) {
1067
				List<Integer> fofoIds = warehouse.getValue().stream().map(x -> x.getId()).collect(Collectors.toList());
1074
				List<Integer> fofoIds = warehouse.getValue().stream().map(x -> x.getId()).collect(Collectors.toList());
1068
				List<PartnerDetailModel> partnerDetails = fofoIds.stream().map(x -> partnerStats.get(x))
1075
				List<PartnerDetailModel> partnerDetails = fofoIds.stream().map(x -> partnerStats.get(x))
1069
						.collect(Collectors.toList());
1076
						.collect(Collectors.toList());
1070
				LOGGER.info("partnerDetails" + partnerDetails);
1077
				LOGGER.info("partnerDetails1" + partnerDetails);
1071
 
1078
 
1072
				PartnerDetailModel partnerDetailModel = partnerStatsService.getAggregateStats(partnerDetails);
1079
				PartnerDetailModel partnerDetailModel = partnerStatsService.getAggregateStats(partnerDetails);
1073
 
1080
 
1074
				warehouseIdAndallValues.put(warehouse.getKey(), partnerDetailModel);
1081
				warehouseIdAndallValues.put(warehouse.getKey(), partnerDetailModel);
1075
			}
1082
			}
Line 1463... Line 1470...
1463
			if (L2L1Mapping.keySet().contains(authUserId)) {
1470
			if (L2L1Mapping.keySet().contains(authUserId)) {
1464
				List<Integer> fofoIds = pp.get(authUserId);
1471
				List<Integer> fofoIds = pp.get(authUserId);
1465
				unmappedPartners.removeAll(fofoIds);
1472
				unmappedPartners.removeAll(fofoIds);
1466
				List<PartnerDetailModel> partnerDetails = fofoIds.stream().map(x -> partnerStats.get(x))
1473
				List<PartnerDetailModel> partnerDetails = fofoIds.stream().map(x -> partnerStats.get(x))
1467
						.collect(Collectors.toList());
1474
						.collect(Collectors.toList());
1468
				LOGGER.info("authUserId {}, partnerDetails {}" + authUserId, partnerDetails);
1475
				LOGGER.info("authUserId {}, partnerDetails2 {}" + authUserId, partnerDetails);
1469
				PartnerDetailModel partnerDetailModel = partnerStatsService.getAggregateStats(partnerDetails);
1476
				PartnerDetailModel partnerDetailModel = partnerStatsService.getAggregateStats(partnerDetails);
1470
				authIdAndallValues.put(authUserId, partnerDetailModel);
1477
				authIdAndallValues.put(authUserId, partnerDetailModel);
1471
			}
1478
			}
1472
		}
1479
		}
1473
		List<PartnerDetailModel> unmappedPartnerDetails = unmappedPartners.stream().map(x -> partnerStats.get(x))
1480
		List<PartnerDetailModel> unmappedPartnerDetails = unmappedPartners.stream().map(x -> partnerStats.get(x))