|
@@ -1,9 +1,12 @@
|
|
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.universal;
|
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.universal;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
|
|
+import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
+import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.universal.vo.OaUniversalPageReqVO;
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.universal.vo.OaUniversalPageReqVO;
|
|
@@ -12,9 +15,12 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.universal.vo.OaUniversalS
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskApproveReqVO;
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskApproveReqVO;
|
|
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.universal.OaUniversalDO;
|
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.universal.OaUniversalDO;
|
|
|
import cn.iocoder.yudao.module.bpm.service.oa.universal.OaUniversalService;
|
|
import cn.iocoder.yudao.module.bpm.service.oa.universal.OaUniversalService;
|
|
|
|
|
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
+import org.springframework.core.annotation.Order;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -29,7 +35,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPOR
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
|
|
|
|
|
|
-@Tag(name = "管理后台 - 通用审批流程信息")
|
|
|
|
|
|
|
+@Tag(name = "管理后台 - 通用事项审批流程信息")
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/bpm/oa-universal")
|
|
@RequestMapping("/bpm/oa-universal")
|
|
|
@Validated
|
|
@Validated
|
|
@@ -38,29 +44,42 @@ public class OaUniversalController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private OaUniversalService oaUniversalService;
|
|
private OaUniversalService oaUniversalService;
|
|
|
|
|
|
|
|
- @PostMapping("/start")
|
|
|
|
|
- @Operation(summary = "提交或暂存通用审批流程信息")
|
|
|
|
|
- @PreAuthorize("@ss.hasPermission('bpm:oa-Universal:start')")
|
|
|
|
|
- public CommonResult<Long> startOaUniversal(@Valid @RequestBody OaUniversalSaveReqVO createReqVO) {
|
|
|
|
|
- return success(oaUniversalService.startOaUniversal(getLoginUserId(), createReqVO));
|
|
|
|
|
|
|
+ @PostMapping("/commit")
|
|
|
|
|
+ @Operation(summary = "提交通用事项审批流程信息")
|
|
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('bpm:oa-universal:commit')")
|
|
|
|
|
+ public CommonResult<Long> commitOaUniversal(@Valid @RequestBody OaUniversalSaveReqVO createReqVO) {
|
|
|
|
|
+ if (CollectionUtil.isEmpty(createReqVO.getStartUserSelectAssignees())) {
|
|
|
|
|
+ return CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(),"请选择审批人");
|
|
|
|
|
+ }
|
|
|
|
|
+ Long oaUniversalId = oaUniversalService.commitOaUniversal(createReqVO);
|
|
|
|
|
+ return success(oaUniversalId, "提交成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ @PostMapping("/staging")
|
|
|
|
|
+ @Operation(summary = "暂存通用事项审批流程信息")
|
|
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('bpm:oa-universal:staging')")
|
|
|
|
|
+ public CommonResult<Long> startOaUniversal(@RequestBody OaUniversalSaveReqVO createReqVO) {
|
|
|
|
|
+ Long oaUniversalId = oaUniversalService.stagingOaUniversal(createReqVO);
|
|
|
|
|
+ return success(oaUniversalId, "暂存成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/completeTure")
|
|
@PostMapping("/completeTure")
|
|
|
- @Operation(summary = "审批同意通用审批流程信息")
|
|
|
|
|
|
|
+ @Operation(summary = "审批同意通用事项审批流程信息")
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-entry:complete-true')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-entry:complete-true')")
|
|
|
public CommonResult<Long> completeTrueOaUniversal(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
public CommonResult<Long> completeTrueOaUniversal(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
return success(oaUniversalService.completeTrueOaUniversal(getLoginUserId(), reqVO));
|
|
return success(oaUniversalService.completeTrueOaUniversal(getLoginUserId(), reqVO));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/completeFalse")
|
|
@PostMapping("/completeFalse")
|
|
|
- @Operation(summary = "驳回或撤回通用审批流程信息")
|
|
|
|
|
|
|
+ @Operation(summary = "驳回或撤回通用事项审批流程信息")
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-entry:complete-false')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-entry:complete-false')")
|
|
|
public CommonResult<Long> completeFalseOaUniversal(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
public CommonResult<Long> completeFalseOaUniversal(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
return success(oaUniversalService.completeFalseOaUniversal(getLoginUserId(), reqVO));
|
|
return success(oaUniversalService.completeFalseOaUniversal(getLoginUserId(), reqVO));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/updateComplete")
|
|
@PostMapping("/updateComplete")
|
|
|
- @Operation(summary = "驳回和撤回后再次提交或关闭通用审批流程信息")
|
|
|
|
|
|
|
+ @Operation(summary = "驳回和撤回后再次提交或关闭通用事项审批流程信息")
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-entry:update-complete')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-entry:update-complete')")
|
|
|
public CommonResult<Long> updateCompleteOaUniversal(@Valid @RequestBody OaUniversalSaveReqVO createReqVO) {
|
|
public CommonResult<Long> updateCompleteOaUniversal(@Valid @RequestBody OaUniversalSaveReqVO createReqVO) {
|
|
|
return success(oaUniversalService.updateCompleteOaUniversal(getLoginUserId(), createReqVO, createReqVO.getBpmTaskApproveReqVO()));
|
|
return success(oaUniversalService.updateCompleteOaUniversal(getLoginUserId(), createReqVO, createReqVO.getBpmTaskApproveReqVO()));
|
|
@@ -68,14 +87,14 @@ public class OaUniversalController {
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/create")
|
|
@PostMapping("/create")
|
|
|
- @Operation(summary = "创建通用审批流程信息")
|
|
|
|
|
|
|
+ @Operation(summary = "创建通用事项审批流程信息")
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:create')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:create')")
|
|
|
public CommonResult<Long> createOaUniversal(@Valid @RequestBody OaUniversalSaveReqVO createReqVO) {
|
|
public CommonResult<Long> createOaUniversal(@Valid @RequestBody OaUniversalSaveReqVO createReqVO) {
|
|
|
return success(oaUniversalService.createOaUniversal(createReqVO));
|
|
return success(oaUniversalService.createOaUniversal(createReqVO));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PutMapping("/update")
|
|
@PutMapping("/update")
|
|
|
- @Operation(summary = "更新通用审批流程信息")
|
|
|
|
|
|
|
+ @Operation(summary = "更新通用事项审批流程信息")
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:update')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:update')")
|
|
|
public CommonResult<Boolean> updateOaUniversal(@Valid @RequestBody OaUniversalSaveReqVO updateReqVO) {
|
|
public CommonResult<Boolean> updateOaUniversal(@Valid @RequestBody OaUniversalSaveReqVO updateReqVO) {
|
|
|
oaUniversalService.updateOaUniversal(updateReqVO);
|
|
oaUniversalService.updateOaUniversal(updateReqVO);
|
|
@@ -83,7 +102,7 @@ public class OaUniversalController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
@DeleteMapping("/delete")
|
|
|
- @Operation(summary = "删除通用审批流程信息")
|
|
|
|
|
|
|
+ @Operation(summary = "删除通用事项审批流程信息")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:delete')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:delete')")
|
|
|
public CommonResult<Boolean> deleteOaUniversal(@RequestParam("id") Long id) {
|
|
public CommonResult<Boolean> deleteOaUniversal(@RequestParam("id") Long id) {
|
|
@@ -92,7 +111,7 @@ public class OaUniversalController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
|
- @Operation(summary = "获得通用审批流程信息")
|
|
|
|
|
|
|
+ @Operation(summary = "获得通用事项审批流程信息")
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:query')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:query')")
|
|
|
public CommonResult<OaUniversalRespVO> getOaUniversal(@RequestParam("id") Long id) {
|
|
public CommonResult<OaUniversalRespVO> getOaUniversal(@RequestParam("id") Long id) {
|
|
@@ -101,7 +120,7 @@ public class OaUniversalController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/page")
|
|
@GetMapping("/page")
|
|
|
- @Operation(summary = "获得通用审批流程信息分页")
|
|
|
|
|
|
|
+ @Operation(summary = "获得通用事项审批流程信息分页")
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:query')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:query')")
|
|
|
public CommonResult<PageResult<OaUniversalRespVO>> getOaUniversalPage(@Valid OaUniversalPageReqVO pageReqVO) {
|
|
public CommonResult<PageResult<OaUniversalRespVO>> getOaUniversalPage(@Valid OaUniversalPageReqVO pageReqVO) {
|
|
|
PageResult<OaUniversalDO> pageResult = oaUniversalService.getOaUniversalPage(pageReqVO);
|
|
PageResult<OaUniversalDO> pageResult = oaUniversalService.getOaUniversalPage(pageReqVO);
|
|
@@ -109,7 +128,7 @@ public class OaUniversalController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
@GetMapping("/export-excel")
|
|
|
- @Operation(summary = "导出通用审批流程信息 Excel")
|
|
|
|
|
|
|
+ @Operation(summary = "导出通用事项审批流程信息 Excel")
|
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:export')")
|
|
@PreAuthorize("@ss.hasPermission('bpm:oa-universal:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
public void exportOaUniversalExcel(@Valid OaUniversalPageReqVO pageReqVO,
|
|
public void exportOaUniversalExcel(@Valid OaUniversalPageReqVO pageReqVO,
|
|
@@ -117,7 +136,7 @@ public class OaUniversalController {
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
List<OaUniversalDO> list = oaUniversalService.getOaUniversalPage(pageReqVO).getList();
|
|
List<OaUniversalDO> list = oaUniversalService.getOaUniversalPage(pageReqVO).getList();
|
|
|
// 导出 Excel
|
|
// 导出 Excel
|
|
|
- ExcelUtils.write(response, "通用审批流程信息.xls", "数据", OaUniversalRespVO.class,
|
|
|
|
|
|
|
+ ExcelUtils.write(response, "通用事项审批流程信息.xls", "数据", OaUniversalRespVO.class,
|
|
|
BeanUtils.toBean(list, OaUniversalRespVO.class));
|
|
BeanUtils.toBean(list, OaUniversalRespVO.class));
|
|
|
}
|
|
}
|
|
|
|
|
|