办公V3
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package com.klp.hrm.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
@@ -9,6 +7,7 @@ import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.hrm.domain.bo.HrmFlowTaskBo;
|
||||
import com.klp.hrm.domain.bo.HrmFlowTaskApproveBo;
|
||||
import com.klp.hrm.domain.bo.HrmSealStampBo;
|
||||
import com.klp.hrm.domain.vo.HrmFlowTaskVo;
|
||||
import com.klp.hrm.service.IHrmFlowTaskService;
|
||||
@@ -29,59 +28,66 @@ public class HrmFlowTaskController extends BaseController {
|
||||
|
||||
private final IHrmFlowTaskService service;
|
||||
|
||||
@SaCheckPermission("hrm:flow:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<HrmFlowTaskVo> list(HrmFlowTaskBo bo, PageQuery pageQuery) {
|
||||
return service.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:flow:list")
|
||||
@GetMapping("/todo")
|
||||
public R<List<HrmFlowTaskVo>> todo(@RequestParam(required = false) Long assigneeUserId) {
|
||||
|
||||
HrmFlowTaskBo bo = new HrmFlowTaskBo();
|
||||
bo.setAssigneeUserId(assigneeUserId != null ? assigneeUserId : StpUtil.getLoginIdAsLong());
|
||||
bo.setAssigneeUserId(assigneeUserId);
|
||||
bo.setStatus("pending");
|
||||
return R.ok(service.queryList(bo));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情页使用:按 bizType + bizId 查询当前用户的待办任务(pending)
|
||||
*/
|
||||
@GetMapping("/todoByBiz")
|
||||
public R<HrmFlowTaskVo> todoByBiz(@RequestParam @NotNull String bizType,
|
||||
@RequestParam @NotNull Long bizId,
|
||||
@RequestParam(required = false) Long assigneeUserId) {
|
||||
|
||||
return R.ok(service.queryTodoByBiz(bizType, bizId, assigneeUserId));
|
||||
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:flow:query")
|
||||
@GetMapping("/{taskId}")
|
||||
public R<HrmFlowTaskVo> getInfo(@PathVariable @NotNull Long taskId) {
|
||||
return R.ok(service.queryById(taskId));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:flow:add")
|
||||
@Log(title = "流程任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@Validated @RequestBody HrmFlowTaskBo bo) {
|
||||
return toAjax(service.insertByBo(bo));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:flow:edit")
|
||||
@Log(title = "流程任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@Validated @RequestBody HrmFlowTaskBo bo) {
|
||||
return toAjax(service.updateByBo(bo));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:flow:remove")
|
||||
@Log(title = "流程任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{taskIds}")
|
||||
public R<Void> remove(@PathVariable @NotEmpty Long[] taskIds) {
|
||||
return toAjax(service.deleteWithValidByIds(Arrays.asList(taskIds), true));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:flow:edit")
|
||||
@Log(title = "流程任务审批通过", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/{taskId}/approve")
|
||||
public R<Void> approve(@PathVariable @NotNull Long taskId,
|
||||
@RequestParam(required = false) Long actionUserId,
|
||||
@RequestParam(required = false) String remark,
|
||||
@RequestBody(required = false) HrmSealStampBo stampBo) {
|
||||
@RequestBody(required = false) HrmFlowTaskApproveBo approveBo) {
|
||||
String remark = approveBo != null ? approveBo.getRemark() : null;
|
||||
HrmSealStampBo stampBo = approveBo != null ? approveBo.getStampBo() : null;
|
||||
return toAjax(service.approve(taskId, actionUserId, remark, stampBo));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:flow:edit")
|
||||
@Log(title = "流程任务审批驳回", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/{taskId}/reject")
|
||||
public R<Void> reject(@PathVariable @NotNull Long taskId,
|
||||
@@ -90,7 +96,6 @@ public class HrmFlowTaskController extends BaseController {
|
||||
return toAjax(service.reject(taskId, actionUserId, remark));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:flow:edit")
|
||||
@Log(title = "流程任务撤回", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/{taskId}/withdraw")
|
||||
public R<Void> withdraw(@PathVariable @NotNull Long taskId,
|
||||
@@ -98,4 +103,13 @@ public class HrmFlowTaskController extends BaseController {
|
||||
@RequestParam(required = false) String remark) {
|
||||
return toAjax(service.withdraw(taskId, actionUserId, remark));
|
||||
}
|
||||
|
||||
@Log(title = "流程任务转发", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/{taskId}/transfer")
|
||||
public R<Void> transfer(@PathVariable @NotNull Long taskId,
|
||||
@RequestParam @NotNull Long newAssigneeUserId,
|
||||
@RequestParam(required = false) Long actionUserId,
|
||||
@RequestParam(required = false) String remark) {
|
||||
return toAjax(service.transfer(taskId, newAssigneeUserId, actionUserId, remark));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user