package com.slcf.controller; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.slcf.pojo.UserBean; import com.slcf.bean.WaitCheckLogCondition; import com.slcf.pojo.WaitCheckLogBean; import com.slcf.pojo.SysLogBean; import com.slcf.service.WaitCheckLogService; import com.slcf.util.AuthorityCode; import com.slcf.service.RoleService; import com.slcf.service.SysLogService; /** * 盘点通知历史档控制器层 * @author admin * @date 2020年2月12日 */ @Controller @RequestMapping("/work") public class WaitCheckLogController { @Resource WaitCheckLogService WaitCheckLogService; @Autowired SysLogService sysLogService; @Autowired RoleService roleService; @RequestMapping("/goWaitCheckLog.action") public String goWaitCheckLogPage(HttpServletRequest request){ try { String rid = request.getSession().getAttribute("ROLEID").toString(); String authCode = roleService.getAuthListByRoleMenu(Integer.parseInt(rid), AuthorityCode.WaitCheckLogCode); request.getSession().setAttribute("AUTHCODE",authCode); // 插入日志 UserBean user = (UserBean) request.getSession().getAttribute("USER"); SysLogBean sysLog = new SysLogBean(); sysLog.setLogin_no(user.getUser_account()); sysLog.setMachine_ip(request.getRemoteAddr()); sysLog.setForm_no("goWaitCheckLog.action"); sysLog.setTts_keyname("访问:盘点通知历史档"); sysLog.setModi_user(user.getUser_account()); sysLogService.insertSysLog(sysLog); }catch (Exception e) { System.out.println(e.getMessage()); } return "waitCheckLog"; } /** * 分页查询所有 * @param pageNumber * @param pageSize * @return */ @ResponseBody @RequestMapping("/waitCheckLogList.action") public Map queryWaitCheckLogListByPages(WaitCheckLogCondition waitCheckLogCon){ Mapmap=WaitCheckLogService.queryWaitCheckLogList(waitCheckLogCon); return map; } /** * 查询所有 * @return */ @ResponseBody @RequestMapping("/getWaitCheckLog.action") public List getWaitCheckLog(){ try { return WaitCheckLogService.getWaitCheckLogList(); }catch(Exception e) { System.out.println(e.getMessage()); return null; } } }