首页>代码>spring+spring mvc+mybatis开发java医院HR人事管理系统(加强版本+ shiro)>/HR/src/main/java/edu/hebeu/controller/HistoryController.java
package edu.hebeu.controller; import java.util.List; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import com.baomidou.mybatisplus.plugins.Page; import edu.hebeu.entity.Employee; import edu.hebeu.entity.History; import edu.hebeu.security.PermissionSign; import edu.hebeu.service.EmployeeService; import edu.hebeu.service.HistoryService; import edu.hebeu.util.MTimeUtil; @Controller @RequestMapping("/history") public class HistoryController { @Autowired private HistoryService historyService; @Autowired private EmployeeService employeeService; @RequestMapping("/retireListPage.do") @RequiresPermissions(value = PermissionSign.HISTORY_LIST) public String selectRetireByPage(Model model, int pageNo){ Page<History> page = historyService.selectRetireByPage(pageNo); model.addAttribute("page", page); return "admin/retire_list"; } @RequestMapping("/{id}/detail.do") @RequiresPermissions(value = PermissionSign.HISTORY_DETAIL) public String selectHistory(@PathVariable Integer id, Model model){ History history = historyService.selectHistory(id); model.addAttribute("history", history); return "admin/history_detail"; } @RequestMapping("/{id}/toUpdate.do") @RequiresPermissions(value = PermissionSign.HISTORY_UPDATE) public String toUpdate(Model model, @PathVariable Integer id){ History history = historyService.selectHistory(id); if (history.getStatus().equals("在职")) { Employee employee = employeeService.selectByNumber(history.getEmployeeNumber()); return "forward:/employee/"+ employee.getId() +"/toUpdate.do"; }else{ model.addAttribute("history", history); return "admin/history_update"; } } @RequestMapping("/{id}/updateRetire.do") @RequiresPermissions(value = PermissionSign.HISTORY_UPDATE_SUBMIT) public String updateRetire(@PathVariable Integer id, History history, String date){ history.setId(id); history.setBirthday(MTimeUtil.stringParse(date)); historyService.updateById(history); return "forward:/history/retireListPage.do?pageNo=1"; } @RequestMapping("/listPage.do") public String selectListByPage(Model model, int pageNo){ Page<History> page = historyService.selectLisByPage(pageNo); model.addAttribute("page", page); return "admin/history_list"; } @RequestMapping("/{id}/update.do") public String updateById(@PathVariable Integer id, History history, String date){ history.setId(id); history.setBirthday(MTimeUtil.stringParse(date)); historyService.updateById(history); return "forward:/history/listPage.do?pageNo=1"; } @RequestMapping("/list.do") @RequiresPermissions(value = PermissionSign.EMPLOYEE_LIST) public String list(Model model){ List<History> hList = historyService.selectList(); model.addAttribute("hList", hList); return "admin/history_list"; } }
最近下载更多
minjing123 LV8
1月4日
小安同学 LV7
2023年12月7日
微信网友_6372890284232704 LV4
2023年8月30日
dowell_liu LV1
2023年8月2日
哇塞塞哈哈哈 LV8
2023年5月4日
bibibi234 LV1
2023年4月4日
a562571298 LV8
2023年3月23日
duoer12 LV5
2022年12月30日
洋葱007 LV5
2022年12月13日
Sunsi12345 LV8
2022年11月27日
最近浏览更多
FF加菲猫 LV4
2月15日
阿卡丽 LV3
2月7日
snake goast
1月7日
暂无贡献等级
minjing123 LV8
1月4日
小安同学 LV7
2023年12月4日
wuying8208 LV15
2023年11月25日
xuweisong2010 LV27
2023年11月12日
XNDIC522
2023年11月6日
暂无贡献等级
vitos5n LV9
2023年9月26日
微信网友_6372890284232704 LV4
2023年8月30日