diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TdLeaveController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TdLeaveController.java index 983aacd..9f20859 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TdLeaveController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TdLeaveController.java @@ -3,6 +3,7 @@ package com.ruoyi.web.controller.system; import java.util.List; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysUserService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -21,6 +22,7 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import oshi.jna.platform.mac.SystemB; /** * 人员离职Controller @@ -36,6 +38,10 @@ public class TdLeaveController extends BaseController @Autowired private ITdLeaveService tdLeaveService; + @Autowired + private ISysUserService userService; + @Autowired + private ISysPostService postService; @RequiresPermissions("system:leave:view") @@ -76,9 +82,9 @@ public class TdLeaveController extends BaseController * 新增人员离职 */ @GetMapping("/add") - public String add() + public String add(ModelMap mmap) { - + mmap.put("addleave",getSysUser()); return prefix + "/add"; } @@ -89,9 +95,8 @@ public class TdLeaveController extends BaseController @Log(title = "人员离职", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(TdLeave tdLeave,ModelMap mmap) + public AjaxResult addSave(TdLeave tdLeave) { - mmap.put("addleave",getSysUser()); return toAjax(tdLeaveService.insertTdLeave(tdLeave)); } @@ -142,4 +147,17 @@ public class TdLeaveController extends BaseController mmap.put("leaveuser", leaveuser); return prefix + "/leaveexamine"; } + + /** + * 离职打印 + */ + @RequiresPermissions("system:leave:print") + @Log(title = "人员离职", businessType = BusinessType.PRINT) + @GetMapping("/print/{userId}") + public String paint(@PathVariable("userId") Long userId, ModelMap mmap) + { + mmap.put("user",userService.selectUserById(userId)); + mmap.put("posts", postService.selectPostsByUserIds(userId)); + return prefix + "/leaveprint"; + } }