-
类说明 :
*/
@Controller
@RequestMapping(“”)
public class HomeController
{
@Autowired
ProjectService projectService;
@Autowired
InstructionMapper instructionMapper;
@RequestMapping(“homeTitle”)
public ModelAndView homeTitle()
{
ModelAndView mav = new ModelAndView();
mav.setViewName(“top”);
return mav;
}
@RequestMapping(“homeLeft”)
public ModelAndView homeLeft(HttpSession httpSession)
{
ModelAndView mav = new ModelAndView();
User user = (User) httpSession.getAttribute(“user”);
if(user.isAdmin())//销售经理
{
System.out.println(“此人是销售经理”);
mav.setViewName(“home/adminLeft”);
}
else//普通员工
{
System.out.println(“此人是销售员工”);
mav.setViewName(“home/staffLeft”);
}
return mav;
}
@RequestMapping(“homeMain”)
public ModelAndView homeMain()
{
ModelAndView mav = new ModelAndView();
mav.setViewName(“home/mainFrame/culture”);
return mav;
}
@RequestMapping(“staffDocumentary”)
public ModelAndView staffDocumentary(HttpSession httpSession)
{
ModelAndView mav = new ModelAndView();
mav.setViewName(“home/mainFrame/staffDocumentary”);
User user = (User) httpSession.getAttribute(“user”);
List list = projectService.searchByName(user.getName());
mav.addObject(“list”, list);
return mav;
}
@RequestMapping(“instructions”)
public ModelAndView instructions(HttpSession httpSession)
{
ModelAndView mav = new ModelAndView();
mav.setViewName(“home/mainFrame/instructions”);
List list = instructionMapper.list(((User)httpSession.getAttribute(“user”)).getName());
mav.addObject(“list”, list);
return mav;
}
@RequestMapping(“adminDocumentary”)
public ModelAndView adminDocumentary()
{