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.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.slcf.pojo.UserBean; import com.slcf.pojo.WorkMastLogBean; import com.slcf.bean.WorkDetailLogCondition; import com.slcf.bean.WorkMastLogCondition; import com.slcf.pojo.SysLogBean; import com.slcf.service.WorkFileLogService; import com.slcf.util.AuthorityCode; import com.slcf.service.RoleService; import com.slcf.service.SysLogService; /** * 工作历史档控制器层 * @author admin * @date 2018年11月23日 */ @Controller @RequestMapping("/work") public class WorkFileLogController { @Resource WorkFileLogService workFileLogService; @Autowired SysLogService sysLogService; @Autowired RoleService roleService; @RequestMapping("/goWorkFileLog.action") public String goWorkFileLogPage(HttpServletRequest request){ try { String rid = request.getSession().getAttribute("ROLEID").toString(); String authCode = roleService.getAuthListByRoleMenu(Integer.parseInt(rid), AuthorityCode.WorkFileLogCode); 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("goWorkFileLog.action"); sysLog.setTts_keyname("访问:工作历史档"); sysLog.setModi_user(user.getUser_account()); sysLogService.insertSysLog(sysLog); }catch (Exception e) { System.out.println(e.getMessage()); } return "workFileLog"; } /** * 分页查询主档 * @param pageNumber * @param pageSize * @return */ @ResponseBody @RequestMapping("/workMastLogList.action") public Map queryWorkMastLogListByPages(WorkMastLogCondition workMastLogCon){ Mapmap=workFileLogService.queryWorkMastLogList(workMastLogCon); return map; } /** * 分页查询明细 * @param pageNumber * @param pageSize * @return */ @ResponseBody @RequestMapping("/workDetailLogList.action") public Map queryWorkDetailLogListByPages(WorkDetailLogCondition workDetailLogCon){ if(workDetailLogCon.getWrk_no()==null || "".equals(workDetailLogCon.getWrk_no())) { return null; // locationCon.setLoc_no("1"); } Mapmap=workFileLogService.queryWorkDetailLogList(workDetailLogCon); return map; } /** * 根据id查询信息 * @param id * @return */ @ResponseBody @RequestMapping("/queryWorkMastLogById.action") public WorkMastLogBean queryWorkMastLogById(@RequestParam("did")int id){ WorkMastLogBean workMast = new WorkMastLogBean(); try { workMast = workFileLogService.queryWorkMastLogById(id); }catch(Exception e) { System.out.println(e.getMessage()); return null; } return workMast; } /** * 查询所有 * @return */ @ResponseBody @RequestMapping("/getWorkMastLog.action") public List getWorkMast(){ try { return workFileLogService.getWorkMastLogList(); }catch(Exception e) { System.out.println(e.getMessage()); return null; } } }