| | |
| | | import com.ruoyi.approve.bean.vo.ApproveProcessVO; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | @RequestMapping("/approveProcess") |
| | | @AllArgsConstructor |
| | | @Tag(name = "审批") |
| | | public class ApproveProcessController extends BaseController { |
| | | public class ApproveProcessController { |
| | | |
| | | private IApproveProcessService approveProcessService; |
| | | /**、 |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getDept") |
| | | public R<?> getDept() { |
| | | public AjaxResult getDept() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | LoginUser user = SecurityUtils.getLoginUser(); |
| | | Long[] deptIds = SecurityUtils.getDeptId(); |
| | | |
| | | List<SysDept> sysDeptList = approveProcessService.selectDeptListByDeptIds(deptIds); |
| | | return R.ok(sysDeptList); |
| | | return AjaxResult.success(sysDeptList); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param approveProcessVO |
| | | * @return |
| | | */ |
| | | @Log(title = "添加审批", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Operation(summary = "添加审批") |
| | | public R<?> add(@RequestBody ApproveProcessVO approveProcessVO) throws Exception { |
| | | public AjaxResult add(@RequestBody ApproveProcessVO approveProcessVO) throws Exception { |
| | | if (approveProcessVO == null) { |
| | | return R.fail(HttpStatus.WARN,"参数不能为空"); |
| | | return AjaxResult.warn("参数不能为空"); |
| | | } |
| | | |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | return R.ok(null, "添加成功"); |
| | | return AjaxResult.success("添加成功"); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/get") |
| | | @Operation(summary = "审批详情") |
| | | public R<?> get(ApproveGetAndUpdateVo approveGetAndUpdateVo){ |
| | | public AjaxResult get(ApproveGetAndUpdateVo approveGetAndUpdateVo){ |
| | | if (approveGetAndUpdateVo.getId() == null || approveGetAndUpdateVo.getId().isEmpty()) { |
| | | return R.fail(HttpStatus.WARN,"参数不能为空"); |
| | | return AjaxResult.warn("参数不能为空"); |
| | | } |
| | | return R.ok(approveProcessService.getApproveById(approveGetAndUpdateVo.getId())); |
| | | return AjaxResult.success(approveProcessService.getApproveById(approveGetAndUpdateVo.getId())); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param approveGetAndUpdateVo |
| | | * @return |
| | | */ |
| | | @Log(title = "更新审批", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/update") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Operation(summary = "更新审批") |
| | | public R<?> update(@RequestBody ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException { |
| | | public AjaxResult update(@RequestBody ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException { |
| | | if (approveGetAndUpdateVo == null) { |
| | | return R.fail(HttpStatus.WARN,"参数不能为空"); |
| | | return AjaxResult.warn("参数不能为空"); |
| | | } |
| | | approveProcessService.updateByApproveId(approveGetAndUpdateVo); |
| | | return R.ok(null, "操作成功"); |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | /** |
| | | * 获取审批列表 |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | @Operation(summary = "获取审批列表") |
| | | public R<?> list(Page page, ApproveProcess approveProcess) { |
| | | return R.ok(approveProcessService.listAll(page, approveProcess)); |
| | | public AjaxResult list(Page page, ApproveProcess approveProcess) { |
| | | return AjaxResult.success(approveProcessService.listAll(page, approveProcess)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Log(title = "删除审批", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteIds") |
| | | @Operation(summary = "删除审批") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<?> deleteIds(@RequestBody List<Long> ids) { |
| | | public AjaxResult deleteIds(@RequestBody List<Long> ids) { |
| | | if (ids == null || ids.size() == 0) { |
| | | return R.fail(HttpStatus.WARN,"参数不能为空"); |
| | | return AjaxResult.warn("参数不能为空"); |
| | | } |
| | | approveProcessService.delApprove(ids); |
| | | return R.ok(null, "操作成功"); |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | |
| | | @Operation(summary = "公出管理导出") |
| | | @Log(title = "公出管理导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportOne") |
| | | public void exportOne(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | |
| | | } |
| | | |
| | | @Operation(summary = "请假管理导出") |
| | | @Log(title = "请假管理导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportTwo") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | |
| | | } |
| | | |
| | | @Operation(summary = "出差管理导出") |
| | | @Log(title = "出差管理导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportThree") |
| | | public void exportThree(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | |
| | | } |
| | | |
| | | @Operation(summary = "报销管理导出") |
| | | @Log(title = "报销管理导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportFour") |
| | | public void exportFour(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | |
| | | } |
| | | |
| | | @Operation(summary = "采购申请导出") |
| | | @Log(title = "采购申请导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportFive") |
| | | public void exportFive(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | |
| | | } |
| | | |
| | | @Operation(summary = "协同审批导出") |
| | | @Log(title = "协同审批导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportZero") |
| | | public void exportZero(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | |
| | | } |
| | | |
| | | @Operation(summary = "危险作业审批导出") |
| | | @Log(title = "危险作业审批导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportEight") |
| | | public void exportEight(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |