|
@@ -1,112 +0,0 @@
|
|
|
-package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.entry.OaEntryPageReqVO;
|
|
|
-import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.entry.OaEntryRespVO;
|
|
|
-import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.entry.OaEntrySaveReqVO;
|
|
|
-import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskApproveReqVO;
|
|
|
-import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.OaEntryDO;
|
|
|
-import cn.iocoder.yudao.module.bpm.service.oa.entry.OaEntryService;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import javax.annotation.Resource;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import io.swagger.v3.oas.annotations.Parameter;
|
|
|
-import io.swagger.v3.oas.annotations.Operation;
|
|
|
-
|
|
|
-import javax.validation.*;
|
|
|
-import javax.servlet.http.*;
|
|
|
-import java.util.*;
|
|
|
-import java.io.IOException;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
-import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
-import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
|
-import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
|
-
|
|
|
-
|
|
|
-@Tag(name = "管理后台 - 入职流程信息")
|
|
|
-@RestController
|
|
|
-@RequestMapping("/bpm/oa-entry")
|
|
|
-@Validated
|
|
|
-public class OaEntryController {
|
|
|
-
|
|
|
- @Resource
|
|
|
- private OaEntryService oaEntryService;
|
|
|
-
|
|
|
- @PostMapping("/start")
|
|
|
- @Operation(summary = "提交入职流程信息")
|
|
|
- @PreAuthorize("@ss.hasPermission('bpm:oa-entry:start')")
|
|
|
- public CommonResult<Integer> startOaEntry(@Valid @RequestBody OaEntrySaveReqVO createReqVO) {
|
|
|
- return success(oaEntryService.startOaEntry(getLoginUserId(),createReqVO));
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping("/complete")
|
|
|
- @Operation(summary = "审批入职流程信息")
|
|
|
- @PreAuthorize("@ss.hasPermission('bpm:oa-entry:start')")
|
|
|
- public CommonResult<Integer> completeOaEntry(@Valid @RequestBody OaEntrySaveReqVO createReqVO,@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
- return success(oaEntryService.completeOaEntry(getLoginUserId(),createReqVO,reqVO));
|
|
|
- }
|
|
|
-
|
|
|
-// @PostMapping("/return")
|
|
|
-// @Operation(summary = "撤回入职流程信息")
|
|
|
-// @PreAuthorize("@ss.hasPermission('bpm:oa-entry:start')")
|
|
|
-// public CommonResult<Integer> returnCompelete(@Valid @RequestBody OaEntrySaveReqVO createReqVO,@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
|
|
|
-// return success(oaEntryService.completeOaEntry(getLoginUserId(),createReqVO,reqVO));
|
|
|
-// }
|
|
|
-
|
|
|
-// @PutMapping("/update")
|
|
|
-// @Operation(summary = "更新入职流程信息")
|
|
|
-// @PreAuthorize("@ss.hasPermission('bpm:oa-entry:update')")
|
|
|
-// public CommonResult<Boolean> updateOaEntry(@Valid @RequestBody OaEntrySaveReqVO updateReqVO) {
|
|
|
-// oaEntryService.updateOaEntry(updateReqVO);
|
|
|
-// return success(true);
|
|
|
-// }
|
|
|
-
|
|
|
- @DeleteMapping("/delete")
|
|
|
- @Operation(summary = "删除入职流程信息")
|
|
|
- @Parameter(name = "id", description = "编号", required = true)
|
|
|
- @PreAuthorize("@ss.hasPermission('bpm:oa-entry:delete')")
|
|
|
- public CommonResult<Boolean> deleteOaEntry(@RequestParam("id") Integer id) {
|
|
|
- oaEntryService.deleteOaEntry(id);
|
|
|
- return success(true);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/get")
|
|
|
- @Operation(summary = "获得入职流程信息")
|
|
|
- @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
- @PreAuthorize("@ss.hasPermission('bpm:oa-entry:query')")
|
|
|
- public CommonResult<OaEntryRespVO> getOaEntry(@RequestParam("id") Integer id) {
|
|
|
- OaEntryDO oaEntry = oaEntryService.getOaEntry(id);
|
|
|
- return success(BeanUtils.toBean(oaEntry, OaEntryRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/page")
|
|
|
- @Operation(summary = "获得入职流程信息分页")
|
|
|
- @PreAuthorize("@ss.hasPermission('bpm:oa-entry:query')")
|
|
|
- public CommonResult<PageResult<OaEntryRespVO>> getOaEntryPage(@Valid OaEntryPageReqVO pageReqVO) {
|
|
|
- PageResult<OaEntryDO> pageResult = oaEntryService.getOaEntryPage(pageReqVO);
|
|
|
- return success(BeanUtils.toBean(pageResult, OaEntryRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/export-excel")
|
|
|
- @Operation(summary = "导出入职流程信息 Excel")
|
|
|
- @PreAuthorize("@ss.hasPermission('bpm:oa-entry:export')")
|
|
|
- @ApiAccessLog(operateType = EXPORT)
|
|
|
- public void exportOaEntryExcel(@Valid OaEntryPageReqVO pageReqVO,
|
|
|
- HttpServletResponse response) throws IOException {
|
|
|
- pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
- List<OaEntryDO> list = oaEntryService.getOaEntryPage(pageReqVO).getList();
|
|
|
- // 导出 Excel
|
|
|
- ExcelUtils.write(response, "入职流程信息.xls", "数据", OaEntryRespVO.class,
|
|
|
- BeanUtils.toBean(list, OaEntryRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
-}
|