2026-06-08 15:42:29 +08:00
|
|
|
package com.fad.hrm.controller;
|
2026-06-08 15:31:31 +08:00
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
2026-06-08 15:42:29 +08:00
|
|
|
import com.fad.common.annotation.Log;
|
|
|
|
|
import com.fad.common.core.controller.BaseController;
|
|
|
|
|
import com.fad.common.core.domain.PageQuery;
|
|
|
|
|
import com.fad.common.core.domain.R;
|
|
|
|
|
import com.fad.common.core.page.TableDataInfo;
|
|
|
|
|
import com.fad.common.enums.BusinessType;
|
|
|
|
|
import com.fad.hrm.domain.bo.HrmFlowInstanceBo;
|
|
|
|
|
import com.fad.hrm.domain.bo.HrmFlowStartBo;
|
|
|
|
|
import com.fad.hrm.domain.vo.HrmFlowInstanceVo;
|
|
|
|
|
import com.fad.hrm.service.IHrmFlowInstanceService;
|
2026-06-08 15:31:31 +08:00
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotEmpty;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Validated
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/hrm/flow/instance")
|
|
|
|
|
public class HrmFlowInstanceController extends BaseController {
|
|
|
|
|
|
|
|
|
|
private final IHrmFlowInstanceService service;
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo<HrmFlowInstanceVo> list(HrmFlowInstanceBo bo, PageQuery pageQuery) {
|
|
|
|
|
return service.queryPageList(bo, pageQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询我的申请列表
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/myList")
|
|
|
|
|
public TableDataInfo<HrmFlowInstanceVo> myList(HrmFlowInstanceBo bo, PageQuery pageQuery) {
|
|
|
|
|
return service.queryMyInstancePageList(bo, pageQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/{instId}")
|
|
|
|
|
public R<HrmFlowInstanceVo> getInfo(@PathVariable @NotNull Long instId) {
|
|
|
|
|
return R.ok(service.queryById(instId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Log(title = "流程实例", businessType = BusinessType.INSERT)
|
|
|
|
|
@PostMapping
|
|
|
|
|
public R<Void> add(@Validated @RequestBody HrmFlowInstanceBo bo) {
|
|
|
|
|
return toAjax(service.insertByBo(bo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Log(title = "流程实例", businessType = BusinessType.UPDATE)
|
|
|
|
|
@PutMapping
|
|
|
|
|
public R<Void> edit(@Validated @RequestBody HrmFlowInstanceBo bo) {
|
|
|
|
|
return toAjax(service.updateByBo(bo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Log(title = "流程实例", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{instIds}")
|
|
|
|
|
public R<Void> remove(@PathVariable @NotEmpty Long[] instIds) {
|
|
|
|
|
return toAjax(service.deleteWithValidByIds(Arrays.asList(instIds), true));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Log(title = "流程实例启动", businessType = BusinessType.INSERT)
|
|
|
|
|
@PostMapping("/start")
|
|
|
|
|
public R<Long> start(@Validated @RequestBody HrmFlowStartBo bo) {
|
|
|
|
|
return R.ok(service.startInstance(bo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/all")
|
|
|
|
|
public R<List<HrmFlowInstanceVo>> all(HrmFlowInstanceBo bo) {
|
|
|
|
|
return R.ok(service.queryList(bo));
|
|
|
|
|
}
|
|
|
|
|
}
|