Subversion Repositories SmartDukaan

Rev

Rev 35458 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35458 Rev 37405
Line 43... Line 43...
43
public class FofoController {
43
public class FofoController {
44
	
44
	
45
	private static final Logger LOGGER = LogManager.getLogger(FofoController.class);
45
	private static final Logger LOGGER = LogManager.getLogger(FofoController.class);
46
 
46
 
47
	@Autowired
47
	@Autowired
-
 
48
	private com.spice.profitmandi.dao.repository.inventory.StateRepository stateRepository;
-
 
49
 
-
 
50
	@Autowired
48
	private Mongo mongoClient;
51
	private Mongo mongoClient;
49
 
52
 
50
	@Autowired
53
	@Autowired
51
	AuthRepository authRepository;
54
	AuthRepository authRepository;
52
	@Autowired
55
	@Autowired
Line 83... Line 86...
83
	@RequestMapping(value = "/fofo/{fofoId}/edit", method = RequestMethod.GET)
86
	@RequestMapping(value = "/fofo/{fofoId}/edit", method = RequestMethod.GET)
84
	public String editFofoForm(HttpServletRequest request, @PathVariable(name = "fofoId") int fofoId, Model model) throws Exception{
87
	public String editFofoForm(HttpServletRequest request, @PathVariable(name = "fofoId") int fofoId, Model model) throws Exception{
85
		FofoForm ff = mongoClient.getFofoForm(fofoId);
88
		FofoForm ff = mongoClient.getFofoForm(fofoId);
86
		model.addAttribute("fofoForm", mongoClient.getFofoFormJsonStringByFofoId(fofoId));
89
		model.addAttribute("fofoForm", mongoClient.getFofoFormJsonStringByFofoId(fofoId));
87
		model.addAttribute("email", ff.getRegisteredEmail1());
90
		model.addAttribute("email", ff.getRegisteredEmail1());
-
 
91
		model.addAttribute("stateNames", this.stateNames());
88
		return "fofo-form";
92
		return "fofo-form";
89
	}
93
	}
90
 
94
 
91
	@RequestMapping(value = "/loadFranchiseeAccount")
95
	@RequestMapping(value = "/loadFranchiseeAccount")
92
	public String loadFranchiseeAccount(HttpServletRequest request, Model model) throws ProfitMandiBusinessException, MessagingException, IOException {
96
	public String loadFranchiseeAccount(HttpServletRequest request, Model model) throws ProfitMandiBusinessException, MessagingException, IOException {
Line 207... Line 211...
207
		return responseSender.ok(true);
211
		return responseSender.ok(true);
208
	}
212
	}
209
 
213
 
210
 
214
 
211
 
215
 
-
 
216
 
-
 
217
	/** State list for the form dropdowns, from inventory.statemaster - never hardcoded in the view. */
-
 
218
	private java.util.List<String> stateNames() {
-
 
219
		return stateRepository.selectAll().stream().map(com.spice.profitmandi.dao.entity.inventory.State::getName)
-
 
220
				.sorted().collect(java.util.stream.Collectors.toList());
-
 
221
	}
212
}
222
}