Subversion Repositories SmartDukaan

Rev

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

Rev 31238 Rev 32463
Line 89... Line 89...
89
		for (AuthUser authUser : authUsers) {
89
		for (AuthUser authUser : authUsers) {
90
			if (authUser.getManagerId() != 0) {
90
			if (authUser.getManagerId() != 0) {
91
				userManagerMap.put(authUser.getId(), authRepository.selectById(authUser.getManagerId()));
91
				userManagerMap.put(authUser.getId(), authRepository.selectById(authUser.getManagerId()));
92
			}
92
			}
93
		}
93
		}
-
 
94
 
94
		model.addAttribute("userManagerMap", userManagerMap);
95
		model.addAttribute("userManagerMap", userManagerMap);
95
		model.addAttribute("activeAuthUsers", activeAuthUsers);
96
		model.addAttribute("activeAuthUsers", activeAuthUsers);
96
		model.addAttribute("authUsers", authUsers);
97
		model.addAttribute("authUsers", authUsers);
97
		model.addAttribute("start", offset + 1);
98
		model.addAttribute("start", offset + 1);
98
		model.addAttribute("size", size);
99
		model.addAttribute("size", size);
Line 135... Line 136...
135
			@RequestParam(name = ProfitMandiConstants.LAST_NAME, defaultValue = "") String lastName,
136
			@RequestParam(name = ProfitMandiConstants.LAST_NAME, defaultValue = "") String lastName,
136
			@RequestParam(name = ProfitMandiConstants.EMAIL_ID, defaultValue = "") String emailId,
137
			@RequestParam(name = ProfitMandiConstants.EMAIL_ID, defaultValue = "") String emailId,
137
			@RequestParam(name = ProfitMandiConstants.MOBILE_NUMBER, defaultValue = "") String mobileNumber,
138
			@RequestParam(name = ProfitMandiConstants.MOBILE_NUMBER, defaultValue = "") String mobileNumber,
138
			@RequestParam(name = ProfitMandiConstants.GMAIL_ID, defaultValue = "") String gmailId,
139
			@RequestParam(name = ProfitMandiConstants.GMAIL_ID, defaultValue = "") String gmailId,
139
			@RequestParam(name = "employeeCode", defaultValue = "") String employeeCode,
140
			@RequestParam(name = "employeeCode", defaultValue = "") String employeeCode,
-
 
141
								 @RequestParam(name = "imageUrl", defaultValue = "") String imageUrl,
140
			@RequestParam(name = "offset", defaultValue = "0") int offset,
142
								 @RequestParam(name = "offset", defaultValue = "0") int offset,
141
			@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
143
			@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
142
			throws ProfitMandiBusinessException {
144
			throws ProfitMandiBusinessException {
143
		AuthUser authUser = null;
145
		AuthUser authUser = null;
144
		User user = null;
146
		User user = null;
145
		List<Role> roles = roleRepository.selectAll();
147
		List<Role> roles = roleRepository.selectAll();
Line 181... Line 183...
181
		authUser.setEmailId(emailId);
183
		authUser.setEmailId(emailId);
182
		authUser.setFirstName(firstName);
184
		authUser.setFirstName(firstName);
183
		authUser.setLastName(lastName);
185
		authUser.setLastName(lastName);
184
		authUser.setMobileNumber(mobileNumber);
186
		authUser.setMobileNumber(mobileNumber);
185
		authUser.setGmailId(gmailId);
187
		authUser.setGmailId(gmailId);
-
 
188
		authUser.setImageUrl(imageUrl);
186
		authUser.setEmployeeCode(employeeCode);
189
		authUser.setEmployeeCode(employeeCode);
187
		authUser.setActive(true);
190
		authUser.setActive(true);
188
 
191
 
189
		authUser.setCreatedTimestamp(LocalDateTime.now());
192
		authUser.setCreatedTimestamp(LocalDateTime.now());
190
		authService.addAuthUser(authUser);
193
		authService.addAuthUser(authUser);
Line 249... Line 252...
249
		user.setGmailId(gmailId);
252
		user.setGmailId(gmailId);
250
		authRepository.persist(user);
253
		authRepository.persist(user);
251
		model.addAttribute("response1", "true");
254
		model.addAttribute("response1", "true");
252
		return "response";
255
		return "response";
253
	}
256
	}
-
 
257
	@GetMapping(value = "/authuser/editImageUrl")
-
 
258
	public String updateAuthUserImage(Model model, @RequestParam String imageUrl ,@RequestParam String emailId)
-
 
259
		throws Exception{
-
 
260
		AuthUser user = authRepository.selectByEmailOrMobile(emailId);
-
 
261
		user.setImageUrl(imageUrl);
-
 
262
		model.addAttribute("response1", "true");
-
 
263
		return "response";
-
 
264
	}
254
 
265
 
255
	@PostMapping(value = "/authuser/remove")
266
	@PostMapping(value = "/authuser/remove")
256
	public String removeAuthUser(Model model, @RequestParam int id) throws Exception {
267
	public String removeAuthUser(Model model, @RequestParam int id) throws Exception {
257
		AuthUser user = authRepository.selectById(id);
268
		AuthUser user = authRepository.selectById(id);
258
 
269