Subversion Repositories SmartDukaan

Rev

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

Rev 28377 Rev 28617
Line 76... Line 76...
76
	// "thirtyMinsTimeOutCacheManager")
76
	// "thirtyMinsTimeOutCacheManager")
77
	public Map<Integer, PartnerDetailModel> getAllPartnerStats() throws ProfitMandiBusinessException {
77
	public Map<Integer, PartnerDetailModel> getAllPartnerStats() throws ProfitMandiBusinessException {
78
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
78
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
79
		Map<Integer, Double> lmtdSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(
79
		Map<Integer, Double> lmtdSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(
80
				curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), 0, false);
80
				curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), 0, false);
81
		
81
 
82
		Map<Integer, Double> mtdSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(curDate.withDayOfMonth(1),
82
		Map<Integer, Double> mtdSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(curDate.withDayOfMonth(1),
83
				curDate.with(LocalTime.MAX), 0, false);
83
				curDate.with(LocalTime.MAX), 0, false);
84
 
84
 
85
		Map<Integer, Double> lmsSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(
85
		Map<Integer, Double> lmsSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(
86
				curDate.withDayOfMonth(1).minusMonths(1), curDate.withDayOfMonth(1), 0, false);
86
				curDate.withDayOfMonth(1).minusMonths(1), curDate.withDayOfMonth(1), 0, false);
Line 154... Line 154...
154
					investmentMaintainedDaysMap.get(fofoId) == null ? 0 : investmentMaintainedDaysMap.get(fofoId));
154
					investmentMaintainedDaysMap.get(fofoId) == null ? 0 : investmentMaintainedDaysMap.get(fofoId));
155
			pm.setPartnerType(partnerType);
155
			pm.setPartnerType(partnerType);
156
			if (authuserEsclationTypeMap.get(EscalationType.L1) != null) {
156
			if (authuserEsclationTypeMap.get(EscalationType.L1) != null) {
157
				pm.setAuthUser(authuserEsclationTypeMap.get(EscalationType.L1).getName());
157
				pm.setAuthUser(authuserEsclationTypeMap.get(EscalationType.L1).getName());
158
			} else if (authuserEsclationTypeMap.get(EscalationType.L2) != null) {
158
			} else if (authuserEsclationTypeMap.get(EscalationType.L2) != null) {
159
					pm.setAuthUser(authuserEsclationTypeMap.get(EscalationType.L2).getName());
159
				pm.setAuthUser(authuserEsclationTypeMap.get(EscalationType.L2).getName());
160
			} else if (authuserEsclationTypeMap.get(EscalationType.L3) != null) {
160
			} else if (authuserEsclationTypeMap.get(EscalationType.L3) != null) {
161
				pm.setAuthUser(authuserEsclationTypeMap.get(EscalationType.L3).getName());
161
				pm.setAuthUser(authuserEsclationTypeMap.get(EscalationType.L3).getName());
162
			} else if (authuserEsclationTypeMap.get(EscalationType.L4) != null) {
162
			} else if (authuserEsclationTypeMap.get(EscalationType.L4) != null) {
163
				pm.setAuthUser(authuserEsclationTypeMap.get(EscalationType.L4).getName());
163
				pm.setAuthUser(authuserEsclationTypeMap.get(EscalationType.L4).getName());
164
			} else {
164
			} else {
Line 199... Line 199...
199
					totalmtdAmount += partnerDetailModel.getMtd();
199
					totalmtdAmount += partnerDetailModel.getMtd();
200
					totalTicketCount += partnerDetailModel.getTicket();
200
					totalTicketCount += partnerDetailModel.getTicket();
201
					totalTodayTertiary += partnerDetailModel.getTodayTertiary();
201
					totalTodayTertiary += partnerDetailModel.getTodayTertiary();
202
					currentHygieneCount += partnerDetailModel.getHygiene();
202
					currentHygieneCount += partnerDetailModel.getHygiene();
203
					currentTotalHygieneCount += partnerDetailModel.getTotalHygiene();
203
					currentTotalHygieneCount += partnerDetailModel.getTotalHygiene();
-
 
204
					if (pdi != null) {
204
					aggregateInvestment.setActivatedStockAmount(
205
						aggregateInvestment.setActivatedStockAmount(
205
							aggregateInvestment.getActivatedStockAmount() + pdi.getActivatedStockAmount());
206
								aggregateInvestment.getActivatedStockAmount() + pdi.getActivatedStockAmount());
206
					aggregateInvestment
207
						aggregateInvestment.setGrnPendingAmount(
207
							.setGrnPendingAmount(aggregateInvestment.getGrnPendingAmount() + pdi.getGrnPendingAmount());
208
								aggregateInvestment.getGrnPendingAmount() + pdi.getGrnPendingAmount());
208
					aggregateInvestment
209
						aggregateInvestment
209
							.setInStockAmount(aggregateInvestment.getInStockAmount() + pdi.getInStockAmount());
210
								.setInStockAmount(aggregateInvestment.getInStockAmount() + pdi.getInStockAmount());
210
					aggregateInvestment.setReturnInTransitAmount(
211
						aggregateInvestment.setReturnInTransitAmount(
211
							aggregateInvestment.getReturnInTransitAmount() + pdi.getReturnInTransitAmount());
212
								aggregateInvestment.getReturnInTransitAmount() + pdi.getReturnInTransitAmount());
212
					aggregateInvestment.setSalesAmount(aggregateInvestment.getSalesAmount() + pdi.getSalesAmount());
213
						aggregateInvestment.setSalesAmount(aggregateInvestment.getSalesAmount() + pdi.getSalesAmount());
213
					aggregateInvestment
214
						aggregateInvestment
214
							.setUnbilledAmount(aggregateInvestment.getUnbilledAmount() + pdi.getUnbilledAmount());
215
								.setUnbilledAmount(aggregateInvestment.getUnbilledAmount() + pdi.getUnbilledAmount());
-
 
216
						aggregateInvestment
215
					aggregateInvestment.setWalletAmount(aggregateInvestment.getWalletAmount() + pdi.getWalletAmount());
217
								.setWalletAmount(aggregateInvestment.getWalletAmount() + pdi.getWalletAmount());
-
 
218
					}
216
				}
219
				}
217
 
220
 
218
				pdm.setHygiene(currentHygieneCount);
221
				pdm.setHygiene(currentHygieneCount);
219
				pdm.setTotalHygiene(currentTotalHygieneCount);
222
				pdm.setTotalHygiene(currentTotalHygieneCount);
220
				pdm.setLms((int) totallmsAmount);
223
				pdm.setLms((int) totallmsAmount);