Subversion Repositories SmartDukaan

Rev

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

Rev 25180 Rev 25182
Line 145... Line 145...
145
		long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= 10)
145
		long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= 10)
146
				.collect(Collectors.counting());
146
				.collect(Collectors.counting());
147
		investments.put("today", investment.getTotalInvestment());
147
		investments.put("today", investment.getTotalInvestment());
148
		investments.put("investment", investment);
148
		investments.put("investment", investment);
149
		investments.put("inStock", investment.getInStockAmount());
149
		investments.put("inStock", investment.getInStockAmount());
150
		investments.put("minimum", investment.getMinInvestment());
150
		investments.put("minimum", investment.getMinInvestmentString());
151
		investments.put("short", investment.getShortPercentage());
151
		investments.put("short", investment.getShortPercentage());
152
		investments.put("okDays", okInvestmentDays);
152
		investments.put("okDays", okInvestmentDays);
153
		return investments;
153
		return investments;
154
	}
154
	}
155
 
155
 
Line 195... Line 195...
195
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
195
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
196
		boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
196
		boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
197
		model.addAttribute("isAdmin", isAdmin);
197
		model.addAttribute("isAdmin", isAdmin);
198
 
198
 
199
		FofoStore fofoStore = null;
199
		FofoStore fofoStore = null;
200
		if (isAdmin) {
200
		if (!isAdmin) {
201
			return "dashboard1";
201
			return "dashboard1";
202
		} else {
202
		} else {
203
			try {
203
			try {
204
				fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
204
				fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
205
				model.addAttribute("fofoStore", fofoStore);
205
				model.addAttribute("fofoStore", fofoStore);
Line 218... Line 218...
218
			} catch (ProfitMandiBusinessException e) {
218
			} catch (ProfitMandiBusinessException e) {
219
				LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
219
				LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
220
 
220
 
221
			}
221
			}
222
		}
222
		}
-
 
223
		model.addAttribute("monthDays", LocalDate.now().lengthOfMonth());
223
		return "dashboard1";
224
		return "dashboard1";
224
	}
225
	}
225
 
226
 
226
	// This method is currently hardcoded to faciliate watches sold as gift.
227
	// This method is currently hardcoded to faciliate watches sold as gift.
227
	private boolean hasGift(int fofoId) {
228
	private boolean hasGift(int fofoId) {