Browse Source

1、请假审批接口

dongpo 1 year ago
parent
commit
b73b087a2a
18 changed files with 740 additions and 408 deletions
  1. 13 17
      yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java
  2. 1 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/conversion/OaConversionController.java
  3. 3 2
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/entry/OaEntryController.java
  4. 91 52
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/OaLeaveController.java
  5. 6 58
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeavePageReqVO.java
  6. 33 4
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeaveRespVO.java
  7. 22 71
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeaveSaveReqVO.java
  8. 1 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/OaRenewController.java
  9. 3 2
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/universal/OaUniversalController.java
  10. 34 14
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/leave/OaLeaveDO.java
  11. 0 18
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/leave/OaLeaveMapper.java
  12. 2 2
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/conversion/OaConversionServiceImpl.java
  13. 2 2
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/entry/OaEntryServiceImpl.java
  14. 18 40
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/leave/OaLeaveService.java
  15. 507 120
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/leave/OaLeaveServiceImpl.java
  16. 1 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/renew/OaRenewServiceImpl.java
  17. 1 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/turnover/OaTurnoverServiceImpl.java
  18. 2 2
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/universal/OaUniversalServiceImpl.java

+ 13 - 17
yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java

@@ -88,29 +88,25 @@ public interface ErrorCodeConstants {
 
 
     ErrorCode SERVICE_ID_NOT_EXISTS = new ErrorCode(1009011000, "业务单据ID不能为空");
     ErrorCode SERVICE_ID_NOT_EXISTS = new ErrorCode(1009011000, "业务单据ID不能为空");
     ErrorCode DELETE_FAIL_NOT_STAGING = new ErrorCode(1009011001, "非暂存状态不能删除");
     ErrorCode DELETE_FAIL_NOT_STAGING = new ErrorCode(1009011001, "非暂存状态不能删除");
-    // ========== 入职流程信息 1-009-012-000 ==========
-    ErrorCode OA_ENTRY_NOT_EXISTS = new ErrorCode(1009012000, "入职流程信息不存在");
 
 
-
-    // ========== 请假流程信息 1-009-017-000 ==========
-    ErrorCode OA_LEAVE_NOT_EXISTS = new ErrorCode(1009017000, "请假流程信息不存在");
-
-    // ========== 转正流程信息 1-009_017_002 ==========
-    ErrorCode OA_CONVERSION_NOT_EXISTS = new ErrorCode(1009017002, "转正流程信息不存在");
-    // ========== 合同续签流程信息 1-009_017_003 ==========
-    ErrorCode OA_RENEW_NOT_EXISTS = new ErrorCode(1009017003, "合同续签流程信息不存在");
-    // ========== 离职流程信息 1-009_017_004 ==========
+    // ========== 通用事项审批流程信息 1_009_017_000 ==========
+    ErrorCode OA_UNIVERSAL_NOT_EXISTS = new ErrorCode(1_009_017_000, "通用事项审批流程信息不存在");
+    // ========== 入职流程信息 1_009_017_001 ==========
+    ErrorCode OA_ENTRY_NOT_EXISTS = new ErrorCode(1_009_017_001, "入职流程信息不存在");
+    // ========== 转正流程信息 1_009_017_002 ==========
+    ErrorCode OA_CONVERSION_NOT_EXISTS = new ErrorCode(1_009_017_002, "转正流程信息不存在");
+    // ========== 合同续签流程信息 1_009_017_003 ==========
+    ErrorCode OA_RENEW_NOT_EXISTS = new ErrorCode(1_009_017_003, "合同续签流程信息不存在");
+    // ========== 离职流程信息 1_009_017_004 ==========
     ErrorCode OA_TURNOVER_NOT_EXISTS = new ErrorCode(1_009_017_004, "离职流程信息不存在");
     ErrorCode OA_TURNOVER_NOT_EXISTS = new ErrorCode(1_009_017_004, "离职流程信息不存在");
-    // ========== 请假流程信息 1-009_017_005 ==========
-    ErrorCode OA_HOLIDAY_NOT_EXISTS = new ErrorCode(1009017005, "请假流程信息不存在");
-    // ========== 通用事项审批流程信息 1-009_017_006 ==========
-    ErrorCode OA_UNIVERSAL_NOT_EXISTS = new ErrorCode(1009017006, "通用事项审批流程信息不存在");
+    // ========== 请假流程信息 1_009-017-005 ==========
+    ErrorCode OA_LEAVE_NOT_EXISTS = new ErrorCode(1_009_017_005, "请假流程信息不存在");
 
 
 
 
     // ========== 员工信息 1_009_018_000 ==========
     // ========== 员工信息 1_009_018_000 ==========
     ErrorCode OA_EMPLOYEE_NOT_EXISTS = new ErrorCode(1_009_018_000, "员工信息不存在");
     ErrorCode OA_EMPLOYEE_NOT_EXISTS = new ErrorCode(1_009_018_000, "员工信息不存在");
 
 
-    // ========== 登录用户信息 1_009_018_000 ==========
-    ErrorCode OA_LOGIN_USER_NOT_EXISTS = new ErrorCode(1_009_018_000, "登录用户不存在");
+    // ========== 登录用户信息 1_009_018_001 ==========
+    ErrorCode OA_LOGIN_USER_NOT_EXISTS = new ErrorCode(1_009_018_001, "登录用户不存在");
 
 
 }
 }

+ 1 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/conversion/OaConversionController.java

@@ -144,7 +144,7 @@ public class OaConversionController {
     @ApiOperationSupport(order = 12)
     @ApiOperationSupport(order = 12)
     // @PreAuthorize("@ss.hasPermission('bpm:oa-conversion:export')")
     // @PreAuthorize("@ss.hasPermission('bpm:oa-conversion:export')")
     @ApiAccessLog(operateType = EXPORT)
     @ApiAccessLog(operateType = EXPORT)
-    public void exportOaConversionExcel(@Valid OaConversionPageReqVO pageReqVO,
+    public void exportOaConversionExcel(@ParameterObject OaConversionPageReqVO pageReqVO,
                                        HttpServletResponse response) throws IOException {
                                        HttpServletResponse response) throws IOException {
         PageResult<OaConversionRespVO> pageResult = oaConversionService.exportOaConversionExcel(pageReqVO);
         PageResult<OaConversionRespVO> pageResult = oaConversionService.exportOaConversionExcel(pageReqVO);
         List<OaConversionRespVO> list = pageResult.getList();
         List<OaConversionRespVO> list = pageResult.getList();

+ 3 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/entry/OaEntryController.java

@@ -15,6 +15,7 @@ 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.springdoc.api.annotations.ParameterObject;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
@@ -135,7 +136,7 @@ public class OaEntryController {
     @Operation(summary = "获得入职审批流程信息分页")
     @Operation(summary = "获得入职审批流程信息分页")
     @ApiOperationSupport(order = 11)
     @ApiOperationSupport(order = 11)
     // @PreAuthorize("@ss.hasPermission('bpm:oa-entry:query-page')")
     // @PreAuthorize("@ss.hasPermission('bpm:oa-entry:query-page')")
-    public CommonResult<PageResult<OaEntryRespVO>> getOaEntryPage(@Valid OaEntryPageReqVO pageReqVO) {
+    public CommonResult<PageResult<OaEntryRespVO>> getOaEntryPage(@Valid @ParameterObject OaEntryPageReqVO pageReqVO) {
         return success(oaEntryService.getOaEntryPage(pageReqVO), "查询列表成功");
         return success(oaEntryService.getOaEntryPage(pageReqVO), "查询列表成功");
     }
     }
 
 
@@ -144,7 +145,7 @@ public class OaEntryController {
     @ApiOperationSupport(order = 12)
     @ApiOperationSupport(order = 12)
     // @PreAuthorize("@ss.hasPermission('bpm:oa-entry:export')")
     // @PreAuthorize("@ss.hasPermission('bpm:oa-entry:export')")
     @ApiAccessLog(operateType = EXPORT)
     @ApiAccessLog(operateType = EXPORT)
-    public void exportOaEntryExcel(@Valid OaEntryPageReqVO pageReqVO,
+    public void exportOaEntryExcel(@ParameterObject OaEntryPageReqVO pageReqVO,
                                        HttpServletResponse response) throws IOException {
                                        HttpServletResponse response) throws IOException {
         PageResult<OaEntryRespVO> pageResult = oaEntryService.exportOaEntryExcel(pageReqVO);
         PageResult<OaEntryRespVO> pageResult = oaEntryService.exportOaEntryExcel(pageReqVO);
         List<OaEntryRespVO> list = pageResult.getList();
         List<OaEntryRespVO> list = pageResult.getList();

+ 91 - 52
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/OaLeaveController.java

@@ -9,12 +9,18 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeavePageReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeavePageReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveRespVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveRespVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveSaveReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveSaveReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeavePageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveSaveReqVO;
 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.controller.admin.task.vo.task.BpmTaskReturnReqVO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.leave.OaLeaveDO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.leave.OaLeaveDO;
 import cn.iocoder.yudao.module.bpm.service.oa.leave.OaLeaveService;
 import cn.iocoder.yudao.module.bpm.service.oa.leave.OaLeaveService;
+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.springdoc.api.annotations.ParameterObject;
 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.*;
@@ -38,87 +44,120 @@ public class OaLeaveController {
     @Resource
     @Resource
     private OaLeaveService oaLeaveService;
     private OaLeaveService oaLeaveService;
 
 
-    @PostMapping("/start")
-    @Operation(summary = "提交或暂存请假流程信息")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-Leave:start')")
-    public CommonResult<Long> startOaLeave(@Valid @RequestBody OaLeaveSaveReqVO createReqVO) {
-        return success(oaLeaveService.startOaLeave(getLoginUserId(), createReqVO));
+    @PostMapping("/staging")
+    @Operation(summary = "暂存请假审批流程信息")
+    @ApiOperationSupport(order = 1)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:staging')")
+    public CommonResult<Long> stagingOaLeave(@RequestBody OaLeaveSaveReqVO stagingReqVO) {
+        Long oaLeaveId = oaLeaveService.stagingOaLeave(stagingReqVO);
+        return success(oaLeaveId, "暂存成功");
     }
     }
 
 
-    @PostMapping("/completeTure")
-    @Operation(summary = "审批同意请假流程信息")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-entry:complete-true')")
-    public CommonResult<Long> completeTrueOaLeave(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
-        return success(oaLeaveService.completeTrueOaLeave(getLoginUserId(), reqVO));
+    @PostMapping("/commit")
+    @Operation(summary = "提交请假审批流程信息")
+    @ApiOperationSupport(order = 2)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:commit')")
+    public CommonResult<Long> commitOaLeave(@Valid @RequestBody OaLeaveSaveReqVO commitReqVO) {
+        Long oaLeaveId = oaLeaveService.commitOaLeave(commitReqVO);
+        return success(oaLeaveId, "提交成功");
     }
     }
 
 
-    @PostMapping("/completeFalse")
-    @Operation(summary = "驳回或撤回请假流程信息")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-entry:complete-false')")
-    public CommonResult<Long> completeFalseOaLeave(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
-        return success(oaLeaveService.completeFalseOaLeave(getLoginUserId(), reqVO));
+    @PostMapping("/agree")
+    @Operation(summary = "审批同意请假审批流程信息")
+    @ApiOperationSupport(order = 3)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:agree')")
+    public CommonResult<Long> agreeOaLeave(@Valid @RequestBody BpmTaskApproveReqVO agreeReqVO) {
+        Long result = oaLeaveService.agreeOaLeave(agreeReqVO);
+        return success(result, "审批成功");
     }
     }
 
 
-    @PostMapping("/updateComplete")
-    @Operation(summary = "驳回和撤回后再次提交或关闭请假流程信息")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-entry:update-complete')")
-    public CommonResult<Long> updateCompleteOaLeave(@Valid @RequestBody OaLeaveSaveReqVO createReqVO) {
-        return success(oaLeaveService.updateCompleteOaLeave(getLoginUserId(), createReqVO, createReqVO.getBpmTaskApproveReqVO()));
+    @PostMapping("/disagree")
+    @Operation(summary = "驳回请假审批流程信息")
+    @ApiOperationSupport(order = 4)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:disagree')")
+    public CommonResult<Long> disagreeOaLeave(@Valid @RequestBody BpmTaskReturnReqVO disagreeReqVO) {
+        Long result = oaLeaveService.disagreeOaLeave(disagreeReqVO);
+        return success(result, "驳回成功");
     }
     }
 
 
+    @PostMapping("/revocation")
+    @Operation(summary = "撤回请假审批流程信息")
+    @ApiOperationSupport(order = 5)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:revocation')")
+    public CommonResult<Long> revocationOaLeave(@Valid @RequestBody BpmTaskApproveReqVO revocationReqVO) {
+        Long result = oaLeaveService.revocationOaLeave(revocationReqVO);
+        return success(result, "撤回成功");
+    }
 
 
-    @PostMapping("/create")
-    @Operation(summary = "创建请假流程信息")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-leave:create')")
-    public CommonResult<Long> createOaLeave(@Valid @RequestBody OaLeaveSaveReqVO createReqVO) {
-        return success(oaLeaveService.createOaLeave(createReqVO));
+    @PostMapping("/reCommit")
+    @Operation(summary = "驳回或撤回后再次提交请假审批流程信息")
+    @ApiOperationSupport(order = 6)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:re-commit')")
+    public CommonResult<Long> reCommitOaLeave(@Valid @RequestBody OaLeaveSaveReqVO reCommitReqVO) {
+        Long result = oaLeaveService.reCommitOaLeave(reCommitReqVO);
+        return success(result, "再次提交成功");
     }
     }
 
 
-    @PutMapping("/update")
-    @Operation(summary = "更新请假流程信息")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-leave:update')")
-    public CommonResult<Boolean> updateOaLeave(@Valid @RequestBody OaLeaveSaveReqVO updateReqVO) {
-        oaLeaveService.updateOaLeave(updateReqVO);
-        return success(true);
+    @DeleteMapping("/close")
+    @Operation(summary = "驳回或撤回后关闭请假审批流程信息")
+    @ApiOperationSupport(order = 7)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-entry:close')")
+    public CommonResult<Long> closeOaLeave(@RequestParam("id") Long id) {
+        Long result = oaLeaveService.closeOaLeave(id);
+
+        return success(result, "关闭成功");
     }
     }
 
 
     @DeleteMapping("/delete")
     @DeleteMapping("/delete")
-    @Operation(summary = "删除请假流程信息")
+    @Operation(summary = "删除请假审批流程信息")
+    @ApiOperationSupport(order = 8)
     @Parameter(name = "id", description = "编号", required = true)
     @Parameter(name = "id", description = "编号", required = true)
-    @PreAuthorize("@ss.hasPermission('bpm:oa-leave:delete')")
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:delete')")
     public CommonResult<Boolean> deleteOaLeave(@RequestParam("id") Long id) {
     public CommonResult<Boolean> deleteOaLeave(@RequestParam("id") Long id) {
         oaLeaveService.deleteOaLeave(id);
         oaLeaveService.deleteOaLeave(id);
-        return success(true);
+        return success(true, "删除成功");
     }
     }
 
 
     @GetMapping("/get")
     @GetMapping("/get")
-    @Operation(summary = "获得请假流程信息")
-    @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')")
+    @Operation(summary = "根据id获得请假审批流程信息")
+    @Parameter(name = "id", description = "编号", required = true, example = "1")
+    @ApiOperationSupport(order = 9)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query-id')")
     public CommonResult<OaLeaveRespVO> getOaLeave(@RequestParam("id") Long id) {
     public CommonResult<OaLeaveRespVO> getOaLeave(@RequestParam("id") Long id) {
-        OaLeaveDO oaLeave = oaLeaveService.getOaLeave(id);
-        return success(BeanUtils.toBean(oaLeave, OaLeaveRespVO.class));
+        OaLeaveRespVO respVO = oaLeaveService.getOaLeave(id);
+        return success(respVO, "查询对象成功");
+    }
+
+    @GetMapping("/getByProcInstId")
+    @Operation(summary = "根据流程实例id获得请假审批流程信息")
+    @Parameter(name = "procInstId", description = "流程实例id", required = true, example = "9528a78d-457e-11ef-853c-4c034fce6445")
+    @ApiOperationSupport(order = 10)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query-proc-inst-id')")
+    public CommonResult<OaLeaveRespVO> getOaLeaveByProcInstId(@RequestParam("procInstId") String procInstId) {
+        OaLeaveRespVO respVO = oaLeaveService.getOaLeaveByProcInstId(procInstId);
+        return success(respVO, "查询对象成功");
     }
     }
 
 
     @GetMapping("/page")
     @GetMapping("/page")
-    @Operation(summary = "获得请假流程信息分页")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')")
-    public CommonResult<PageResult<OaLeaveRespVO>> getOaLeavePage(@Valid OaLeavePageReqVO pageReqVO) {
-        PageResult<OaLeaveDO> pageResult = oaLeaveService.getOaLeavePage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, OaLeaveRespVO.class));
+    @Operation(summary = "获得请假审批流程信息分页")
+    @ApiOperationSupport(order = 11)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query-page')")
+    public CommonResult<PageResult<OaLeaveRespVO>> getOaLeavePage(@Valid @ParameterObject OaLeavePageReqVO pageReqVO) {
+        return success(oaLeaveService.getOaLeavePage(pageReqVO), "查询列表成功");
     }
     }
 
 
     @GetMapping("/export-excel")
     @GetMapping("/export-excel")
-    @Operation(summary = "导出请假流程信息 Excel")
-    @PreAuthorize("@ss.hasPermission('bpm:oa-leave:export')")
+    @Operation(summary = "导出请假审批流程信息 Excel")
+    @ApiOperationSupport(order = 12)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-leave:export')")
     @ApiAccessLog(operateType = EXPORT)
     @ApiAccessLog(operateType = EXPORT)
-    public void exportOaLeaveExcel(@Valid OaLeavePageReqVO pageReqVO,
-              HttpServletResponse response) throws IOException {
-        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
-        List<OaLeaveDO> list = oaLeaveService.getOaLeavePage(pageReqVO).getList();
+    public void exportOaLeaveExcel(@ParameterObject OaLeavePageReqVO pageReqVO,
+                                   HttpServletResponse response) throws IOException {
+        PageResult<OaLeaveRespVO> pageResult = oaLeaveService.exportOaLeaveExcel(pageReqVO);
+        List<OaLeaveRespVO> list = pageResult.getList();
         // 导出 Excel
         // 导出 Excel
-        ExcelUtils.write(response, "请假流程信息.xls", "数据", OaLeaveRespVO.class,
-                        BeanUtils.toBean(list, OaLeaveRespVO.class));
+        ExcelUtils.write(response, "请假审批流程信息.xls", "数据", OaLeaveRespVO.class,
+                BeanUtils.toBean(list, OaLeaveRespVO.class));
     }
     }
 
 
 }
 }

+ 6 - 58
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeavePageReqVO.java

@@ -14,34 +14,19 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
 @ToString(callSuper = true)
 @ToString(callSuper = true)
 public class OaLeavePageReqVO extends PageParam {
 public class OaLeavePageReqVO extends PageParam {
 
 
-    @Schema(description = "uuid", example = "20728")
-    private String leaveId;
-
-    @Schema(description = "转正人id", example = "12388")
-    private Long employeeId;
-
-    @Schema(description = "转正人uuid", example = "31445")
-    private String employeeUuid;
-
-    @Schema(description = "转正员工姓名", example = "王五")
+    @Schema(description = "请假员工姓名", example = "王五")
     private String employeeName;
     private String employeeName;
 
 
-    @Schema(description = "用户账号id", example = "25603")
-    private Long userId;
+    @Schema(description = "续签员工手机号", example = "1394920000")
+    private String employeePhone;
 
 
-    @Schema(description = "用户账号uuid", example = "13640")
-    private String userUuid;
-
-    @Schema(description = "部门id", example = "26110")
+    @Schema(description = "部门id", example = "115")
     private Long deptId;
     private Long deptId;
 
 
-    @Schema(description = "部门uuid", example = "24393")
-    private String deptUuid;
-
     @Schema(description = "员工职位")
     @Schema(description = "员工职位")
     private String position;
     private String position;
 
 
-    @Schema(description = "请假类型", example = "1")
+    @Schema(description = "请假类型", example = "事假")
     private String leaveType;
     private String leaveType;
 
 
     @Schema(description = "开始日期")
     @Schema(description = "开始日期")
@@ -52,46 +37,9 @@ public class OaLeavePageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private String[] endDate;
     private String[] endDate;
 
 
-    @Schema(description = "请假天数")
-    private String day;
-
-    @Schema(description = "具体到上下午,am上午 pm下午")
-    private String startTime;
-
-    @Schema(description = "具体到上下午,am上午 pm下午")
-    private String endTime;
-
-    @Schema(description = "请假原因", example = "不好")
-    private String reason;
-
-    @Schema(description = "备注")
-    private String remarks;
-
-    @Schema(description = "流程实例id", example = "26074")
-    private String procInstId;
-
-    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)", example = "2")
+    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回、6已撤回)", example = "2")
     private String auditStatus;
     private String auditStatus;
 
 
-    @Schema(description = "当前审核人用户id", example = "19230")
-    private Long currentAuditUserId;
-
-    @Schema(description = "当前审核人用户uuid", example = "30632")
-    private String currentAuditUserUuid;
-
-    @Schema(description = "当前审核人员工id", example = "7920")
-    private Long currentAuditEmployeeId;
-
-    @Schema(description = "当前审核人员工uuid", example = "18105")
-    private String currentAuditEmployeeUuid;
-
-    @Schema(description = "最后审核时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] finalAuditDate;
-
-    @Schema(description = "数据来源,0流程添加、1手动添加")
-    private String infoSource;
-
     @Schema(description = "创建时间")
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
     private LocalDateTime[] createTime;

+ 33 - 4
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeaveRespVO.java

@@ -1,9 +1,14 @@
 package cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo;
 package cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo;
 
 
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
+import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 import lombok.*;
 
 
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.List;
+
 import com.alibaba.excel.annotation.*;
 import com.alibaba.excel.annotation.*;
 
 
 @Schema(description = "管理后台 - 请假流程信息 Response VO")
 @Schema(description = "管理后台 - 请假流程信息 Response VO")
@@ -47,6 +52,10 @@ public class OaLeaveRespVO {
     @ExcelProperty("部门uuid")
     @ExcelProperty("部门uuid")
     private String deptUuid;
     private String deptUuid;
 
 
+    @Schema(description = "部门名称")
+    @ExcelProperty("部门名称")
+    private String deptName;
+
     @Schema(description = "员工职位")
     @Schema(description = "员工职位")
     @ExcelProperty("员工职位")
     @ExcelProperty("员工职位")
     private String position;
     private String position;
@@ -107,16 +116,36 @@ public class OaLeaveRespVO {
     @ExcelProperty("当前审核人员工uuid")
     @ExcelProperty("当前审核人员工uuid")
     private String currentAuditEmployeeUuid;
     private String currentAuditEmployeeUuid;
 
 
+    @Schema(description = "当前审核人员工姓名")
+    @ExcelProperty("当前审核人员工姓名")
+    private String currentAuditEmployeeName;
+
     @Schema(description = "最后审核时间")
     @Schema(description = "最后审核时间")
     @ExcelProperty("最后审核时间")
     @ExcelProperty("最后审核时间")
     private LocalDateTime finalAuditDate;
     private LocalDateTime finalAuditDate;
 
 
-    @Schema(description = "数据来源,0流程添加、1手动添加")
-    @ExcelProperty("数据来源,0流程添加、1手动添加")
-    private String infoSource;
-
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("创建时间")
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
     private LocalDateTime createTime;
 
 
+    @Schema(description = "申请人id")
+    @ExcelProperty("申请人id")
+    private Long applyEmployeeId;
+
+    @Schema(description = "申请人姓名")
+    @ExcelProperty("申请人姓名")
+    private String applyEmployeeName;
+
+    @Schema(description = "附件列表")
+    private List<FileDTO> fileList;
+
+    @Schema(description = "审批记录列表")
+    private List<BpmTaskRespVO> auditRecordList;
+
+    @Schema(description = "审批人员列表")
+    private List<AdminUserRespDTO> auditUserList;
+
+    @Schema(description = "当前用户待处理的任务id")
+    private String taskId;
+
 }
 }

+ 22 - 71
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeaveSaveReqVO.java

@@ -2,104 +2,55 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo;
 
 
 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 io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.util.*;
-import java.time.LocalDateTime;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
 
 
 @Schema(description = "管理后台 - 请假流程信息新增/修改 Request VO")
 @Schema(description = "管理后台 - 请假流程信息新增/修改 Request VO")
 @Data
 @Data
 public class OaLeaveSaveReqVO {
 public class OaLeaveSaveReqVO {
 
 
-    @Schema(description = "请假表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26233")
+    @Schema(description = "请假表单主键", example = "1")
     private Long id;
     private Long id;
 
 
-    @Schema(description = "uuid", example = "20728")
-    private String leaveId;
-
-    @Schema(description = "转正人id", example = "12388")
-    private Long employeeId;
-
-    @Schema(description = "转正人uuid", example = "31445")
-    private String employeeUuid;
-
-    @Schema(description = "转正员工姓名", example = "王五")
-    private String employeeName;
-
-    @Schema(description = "用户账号id", example = "25603")
-    private Long userId;
-
-    @Schema(description = "用户账号uuid", example = "13640")
-    private String userUuid;
-
-    @Schema(description = "部门id", example = "26110")
-    private Long deptId;
-
-    @Schema(description = "部门uuid", example = "24393")
-    private String deptUuid;
-
-    @Schema(description = "员工职位")
-    private String position;
-
-    @Schema(description = "请假类型", example = "1")
+    @Schema(description = "请假类型", example = "事假")
+    @NotBlank(message = "请假类型不能为空")
     private String leaveType;
     private String leaveType;
 
 
     @Schema(description = "开始日期")
     @Schema(description = "开始日期")
+    @NotBlank(message = "开始日期不能为空")
     private String startDate;
     private String startDate;
 
 
+    @Schema(description = "开始具体时间,精确到上下午,am上午 pm下午")
+    @NotBlank(message = "开始具体时间不能为空")
+    private String startTime;
+
     @Schema(description = "结束日期")
     @Schema(description = "结束日期")
+    @NotBlank(message = "结束日期不能为空")
     private String endDate;
     private String endDate;
 
 
+    @Schema(description = "结束具体时间,精确到上下午,am上午 pm下午")
+    @NotBlank(message = "结束具体时间不能为空")
+    private String endTime;
+
     @Schema(description = "请假天数")
     @Schema(description = "请假天数")
+    @NotBlank(message = "请假天数不能为空")
     private String day;
     private String day;
 
 
-    @Schema(description = "具体到上下午,am上午 pm下午")
-    private String startTime;
-
-    @Schema(description = "具体到上下午,am上午 pm下午")
-    private String endTime;
-
     @Schema(description = "请假原因", example = "不好")
     @Schema(description = "请假原因", example = "不好")
+    @NotBlank(message = "请假原因不能为空")
     private String reason;
     private String reason;
 
 
     @Schema(description = "备注")
     @Schema(description = "备注")
     private String remarks;
     private String remarks;
 
 
-    @Schema(description = "流程实例id", example = "26074")
-    private String procInstId;
-
-    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)", example = "2")
-    private String auditStatus;
-
-    @Schema(description = "当前审核人用户id", example = "19230")
-    private Long currentAuditUserId;
-
-    @Schema(description = "当前审核人用户uuid", example = "30632")
-    private String currentAuditUserUuid;
-
-    @Schema(description = "当前审核人员工id", example = "7920")
-    private Long currentAuditEmployeeId;
-
-    @Schema(description = "当前审核人员工uuid", example = "18105")
-    private String currentAuditEmployeeUuid;
-
-    @Schema(description = "最后审核时间")
-    private LocalDateTime finalAuditDate;
-
-    @Schema(description = "数据来源,0流程添加、1手动添加")
-    private String infoSource;
-
-
-    @Schema(description = "审批,true 通过,false 驳回", example = "true")
-    private Boolean auditPass;
-
-    @Schema(description = "发起人自选审批人 Map", example = " [1, 1]")
+    @Schema(description = "发起人自选审批人", example = " [100, 1]")
+    @NotEmpty(message = "发起人自选审批人不能为空")
     private List<Long> startUserSelectAssignees;
     private List<Long> startUserSelectAssignees;
 
 
     @Schema(description = "附件主键id", example = "[1, 2]")
     @Schema(description = "附件主键id", example = "[1, 2]")
     private List<Long> fileIdList;
     private List<Long> fileIdList;
 
 
-    @Schema(description = "审批信息")
-    private BpmTaskApproveReqVO bpmTaskApproveReqVO;
-
-
 }
 }

+ 1 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/OaRenewController.java

@@ -144,7 +144,7 @@ public class OaRenewController {
     @ApiOperationSupport(order = 12)
     @ApiOperationSupport(order = 12)
     // @PreAuthorize("@ss.hasPermission('bpm:oa-renew:export')")
     // @PreAuthorize("@ss.hasPermission('bpm:oa-renew:export')")
     @ApiAccessLog(operateType = EXPORT)
     @ApiAccessLog(operateType = EXPORT)
-    public void exportOaRenewExcel(@Valid OaRenewPageReqVO pageReqVO,
+    public void exportOaRenewExcel(@ParameterObject OaRenewPageReqVO pageReqVO,
                                         HttpServletResponse response) throws IOException {
                                         HttpServletResponse response) throws IOException {
         PageResult<OaRenewRespVO> pageResult = oaRenewService.exportOaRenewExcel(pageReqVO);
         PageResult<OaRenewRespVO> pageResult = oaRenewService.exportOaRenewExcel(pageReqVO);
         List<OaRenewRespVO> list = pageResult.getList();
         List<OaRenewRespVO> list = pageResult.getList();

+ 3 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/universal/OaUniversalController.java

@@ -15,6 +15,7 @@ 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.springdoc.api.annotations.ParameterObject;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
@@ -134,7 +135,7 @@ public class OaUniversalController {
     @Operation(summary = "获得通用事项审批流程信息分页")
     @Operation(summary = "获得通用事项审批流程信息分页")
     @ApiOperationSupport(order = 11)
     @ApiOperationSupport(order = 11)
     // @PreAuthorize("@ss.hasPermission('bpm:oa-universal:query-page')")
     // @PreAuthorize("@ss.hasPermission('bpm:oa-universal:query-page')")
-    public CommonResult<PageResult<OaUniversalRespVO>> getOaUniversalPage(@Valid OaUniversalPageReqVO pageReqVO) {
+    public CommonResult<PageResult<OaUniversalRespVO>> getOaUniversalPage(@Valid @ParameterObject OaUniversalPageReqVO pageReqVO) {
         return success(oaUniversalService.getOaUniversalPage(pageReqVO), "查询列表成功");
         return success(oaUniversalService.getOaUniversalPage(pageReqVO), "查询列表成功");
     }
     }
 
 
@@ -143,7 +144,7 @@ public class OaUniversalController {
     @ApiOperationSupport(order = 12)
     @ApiOperationSupport(order = 12)
     // @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(@ParameterObject OaUniversalPageReqVO pageReqVO,
               HttpServletResponse response) throws IOException {
               HttpServletResponse response) throws IOException {
         PageResult<OaUniversalRespVO> pageResult = oaUniversalService.exportOaUniversalExcel(pageReqVO);
         PageResult<OaUniversalRespVO> pageResult = oaUniversalService.exportOaUniversalExcel(pageReqVO);
         List<OaUniversalRespVO> list = pageResult.getList();
         List<OaUniversalRespVO> list = pageResult.getList();

+ 34 - 14
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/leave/OaLeaveDO.java

@@ -32,17 +32,21 @@ public class OaLeaveDO extends BaseDO {
      */
      */
     private String leaveId;
     private String leaveId;
     /**
     /**
-     * 转正人id
+     * 请假人id
      */
      */
     private Long employeeId;
     private Long employeeId;
     /**
     /**
-     * 转正人uuid
+     * 请假人uuid
      */
      */
     private String employeeUuid;
     private String employeeUuid;
     /**
     /**
-     * 转正员工姓名
+     * 请假员工姓名
      */
      */
     private String employeeName;
     private String employeeName;
+    /**
+     * 请假员工手机号
+     */
+    private String employeePhone;
     /**
     /**
      * 用户账号id
      * 用户账号id
      */
      */
@@ -60,7 +64,7 @@ public class OaLeaveDO extends BaseDO {
      */
      */
     private String deptUuid;
     private String deptUuid;
     /**
     /**
-     * 员工职位
+     * 职位
      */
      */
     private String position;
     private String position;
     /**
     /**
@@ -72,21 +76,21 @@ public class OaLeaveDO extends BaseDO {
      */
      */
     private String startDate;
     private String startDate;
     /**
     /**
-     * 结束日期
+     * 具体到上下午,am上午 pm下午
      */
      */
-    private String endDate;
+    private String startTime;
     /**
     /**
-     * 请假天数
+     * 结束日期
      */
      */
-    private String day;
+    private String endDate;
     /**
     /**
      * 具体到上下午,am上午 pm下午
      * 具体到上下午,am上午 pm下午
      */
      */
-    private String startTime;
+    private String endTime;
     /**
     /**
-     * 具体到上下午,am上午 pm下午
+     * 请假天数
      */
      */
-    private String endTime;
+    private String day;
     /**
     /**
      * 请假原因
      * 请假原因
      */
      */
@@ -100,9 +104,13 @@ public class OaLeaveDO extends BaseDO {
      */
      */
     private String procInstId;
     private String procInstId;
     /**
     /**
-     * 审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)
+     * 审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回、6已撤回
      */
      */
     private String auditStatus;
     private String auditStatus;
+    /**
+     * 数据来源,0流程添加、1手动添加
+     */
+    private String infoSource;
     /**
     /**
      * 当前审核人用户id
      * 当前审核人用户id
      */
      */
@@ -119,13 +127,25 @@ public class OaLeaveDO extends BaseDO {
      * 当前审核人员工uuid
      * 当前审核人员工uuid
      */
      */
     private String currentAuditEmployeeUuid;
     private String currentAuditEmployeeUuid;
+    /**
+     * 当前审核人员工姓名
+     */
+    private String currentAuditEmployeeName;
     /**
     /**
      * 最后审核时间
      * 最后审核时间
      */
      */
     private LocalDateTime finalAuditDate;
     private LocalDateTime finalAuditDate;
     /**
     /**
-     * 数据来源,0流程添加、1手动添加
+     * 申请人选择的审批人
      */
      */
-    private String infoSource;
+    private String startUserSelectAssignees;
+    /**
+     * 申请人id
+     */
+    private Long applyEmployeeId;
+    /**
+     * 申请人姓名
+     */
+    private String applyEmployeeName;
 
 
 }
 }

+ 0 - 18
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/leave/OaLeaveMapper.java

@@ -17,31 +17,13 @@ public interface OaLeaveMapper extends BaseMapperX<OaLeaveDO> {
 
 
     default PageResult<OaLeaveDO> selectPage(OaLeavePageReqVO reqVO) {
     default PageResult<OaLeaveDO> selectPage(OaLeavePageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<OaLeaveDO>()
         return selectPage(reqVO, new LambdaQueryWrapperX<OaLeaveDO>()
-                .eqIfPresent(OaLeaveDO::getLeaveId, reqVO.getLeaveId())
-                .eqIfPresent(OaLeaveDO::getEmployeeId, reqVO.getEmployeeId())
-                .eqIfPresent(OaLeaveDO::getEmployeeUuid, reqVO.getEmployeeUuid())
                 .likeIfPresent(OaLeaveDO::getEmployeeName, reqVO.getEmployeeName())
                 .likeIfPresent(OaLeaveDO::getEmployeeName, reqVO.getEmployeeName())
-                .eqIfPresent(OaLeaveDO::getUserId, reqVO.getUserId())
-                .eqIfPresent(OaLeaveDO::getUserUuid, reqVO.getUserUuid())
                 .eqIfPresent(OaLeaveDO::getDeptId, reqVO.getDeptId())
                 .eqIfPresent(OaLeaveDO::getDeptId, reqVO.getDeptId())
-                .eqIfPresent(OaLeaveDO::getDeptUuid, reqVO.getDeptUuid())
                 .eqIfPresent(OaLeaveDO::getPosition, reqVO.getPosition())
                 .eqIfPresent(OaLeaveDO::getPosition, reqVO.getPosition())
                 .eqIfPresent(OaLeaveDO::getLeaveType, reqVO.getLeaveType())
                 .eqIfPresent(OaLeaveDO::getLeaveType, reqVO.getLeaveType())
                 .betweenIfPresent(OaLeaveDO::getStartDate, reqVO.getStartDate())
                 .betweenIfPresent(OaLeaveDO::getStartDate, reqVO.getStartDate())
                 .betweenIfPresent(OaLeaveDO::getEndDate, reqVO.getEndDate())
                 .betweenIfPresent(OaLeaveDO::getEndDate, reqVO.getEndDate())
-                .eqIfPresent(OaLeaveDO::getDay, reqVO.getDay())
-                .eqIfPresent(OaLeaveDO::getStartTime, reqVO.getStartTime())
-                .eqIfPresent(OaLeaveDO::getEndTime, reqVO.getEndTime())
-                .eqIfPresent(OaLeaveDO::getReason, reqVO.getReason())
-                .eqIfPresent(OaLeaveDO::getRemarks, reqVO.getRemarks())
-                .eqIfPresent(OaLeaveDO::getProcInstId, reqVO.getProcInstId())
                 .eqIfPresent(OaLeaveDO::getAuditStatus, reqVO.getAuditStatus())
                 .eqIfPresent(OaLeaveDO::getAuditStatus, reqVO.getAuditStatus())
-                .eqIfPresent(OaLeaveDO::getCurrentAuditUserId, reqVO.getCurrentAuditUserId())
-                .eqIfPresent(OaLeaveDO::getCurrentAuditUserUuid, reqVO.getCurrentAuditUserUuid())
-                .eqIfPresent(OaLeaveDO::getCurrentAuditEmployeeId, reqVO.getCurrentAuditEmployeeId())
-                .eqIfPresent(OaLeaveDO::getCurrentAuditEmployeeUuid, reqVO.getCurrentAuditEmployeeUuid())
-                .betweenIfPresent(OaLeaveDO::getFinalAuditDate, reqVO.getFinalAuditDate())
-                .eqIfPresent(OaLeaveDO::getInfoSource, reqVO.getInfoSource())
                 .betweenIfPresent(OaLeaveDO::getCreateTime, reqVO.getCreateTime())
                 .betweenIfPresent(OaLeaveDO::getCreateTime, reqVO.getCreateTime())
                 .orderByDesc(OaLeaveDO::getId));
                 .orderByDesc(OaLeaveDO::getId));
     }
     }

+ 2 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/conversion/OaConversionServiceImpl.java

@@ -590,7 +590,7 @@ public class OaConversionServiceImpl implements OaConversionService {
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             for (OaConversionRespVO respVO : oaConversionRespVOList) {
             for (OaConversionRespVO respVO : oaConversionRespVOList) {
                 for (AdminUserRespDTO employee : employeeList) {
                 for (AdminUserRespDTO employee : employeeList) {
-                    if (respVO.getCurrentAuditEmployeeId() == employee.getId()) {
+                    if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         break;
                         break;
                     }
                     }
@@ -601,7 +601,7 @@ public class OaConversionServiceImpl implements OaConversionService {
             List<DeptRespDTO> deptList = deptApi.getDeptList(deptIdList);
             List<DeptRespDTO> deptList = deptApi.getDeptList(deptIdList);
             for (OaConversionRespVO respVO : oaConversionRespVOList) {
             for (OaConversionRespVO respVO : oaConversionRespVOList) {
                 for (DeptRespDTO dept : deptList) {
                 for (DeptRespDTO dept : deptList) {
-                    if (respVO.getDeptId() == dept.getId()) {
+                    if (dept.getId() != null && dept.getId().equals(respVO.getDeptId())) {
                         respVO.setDeptName(dept.getName());
                         respVO.setDeptName(dept.getName());
                         break;
                         break;
                     }
                     }

+ 2 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/entry/OaEntryServiceImpl.java

@@ -529,7 +529,7 @@ public class OaEntryServiceImpl implements OaEntryService {
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             for (OaEntryRespVO respVO : oaEntryRespVOList) {
             for (OaEntryRespVO respVO : oaEntryRespVOList) {
                 for (AdminUserRespDTO employee : employeeList) {
                 for (AdminUserRespDTO employee : employeeList) {
-                    if (respVO.getCurrentAuditEmployeeId() == employee.getId()) {
+                    if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         break;
                         break;
                     }
                     }
@@ -540,7 +540,7 @@ public class OaEntryServiceImpl implements OaEntryService {
             List<DeptRespDTO> deptList = deptApi.getDeptList(deptIdList);
             List<DeptRespDTO> deptList = deptApi.getDeptList(deptIdList);
             for (OaEntryRespVO respVO : oaEntryRespVOList) {
             for (OaEntryRespVO respVO : oaEntryRespVOList) {
                 for (DeptRespDTO dept : deptList) {
                 for (DeptRespDTO dept : deptList) {
-                    if (respVO.getDeptId() == dept.getId()) {
+                    if (dept.getId() != null && dept.getId().equals(respVO.getDeptId())) {
                         respVO.setDeptName(dept.getName());
                         respVO.setDeptName(dept.getName());
                         break;
                         break;
                     }
                     }

+ 18 - 40
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/leave/OaLeaveService.java

@@ -2,65 +2,43 @@ package cn.iocoder.yudao.module.bpm.service.oa.leave;
 
 
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeavePageReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeavePageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveRespVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveSaveReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveSaveReqVO;
 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.controller.admin.task.vo.task.BpmTaskReturnReqVO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.leave.OaLeaveDO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.leave.OaLeaveDO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 
-import javax.validation.Valid;
-
 /**
 /**
  * 请假流程信息 Service 接口
  * 请假流程信息 Service 接口
  *
  *
  * @author dp
  * @author dp
  */
  */
-public interface OaLeaveService extends IService<OaLeaveDO> {
+public interface OaLeaveService {
 
 
-    Long startOaLeave(Long userId, @Valid OaLeaveSaveReqVO createReqVO);
+    Long stagingOaLeave(OaLeaveSaveReqVO stagingReqVO);
 
 
-    Long completeTrueOaLeave(Long userId, BpmTaskApproveReqVO reqVO);
+    Long commitOaLeave(OaLeaveSaveReqVO commitReqVO);
 
 
-    Long completeFalseOaLeave(Long userId, BpmTaskApproveReqVO reqVO);
+    Long agreeOaLeave(BpmTaskApproveReqVO agreeReqVO);
 
 
-    Long updateCompleteOaLeave(Long userId, @Valid OaLeaveSaveReqVO createReqVO, @Valid BpmTaskApproveReqVO reqVO);
+    Long disagreeOaLeave(BpmTaskReturnReqVO disagreeReqVO);
 
 
+    Long revocationOaLeave(BpmTaskApproveReqVO revocationReqVO);
 
 
-    /**
-     * 创建请假流程信息
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
-     */
-    Long createOaLeave(@Valid OaLeaveSaveReqVO createReqVO);
+    Long reCommitOaLeave(OaLeaveSaveReqVO reCommitReqVO);
 
 
-    /**
-     * 更新请假流程信息
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updateOaLeave(@Valid OaLeaveSaveReqVO updateReqVO);
+    Long closeOaLeave(Long id);
 
 
-    /**
-     * 删除请假流程信息
-     *
-     * @param id 编号
-     */
     void deleteOaLeave(Long id);
     void deleteOaLeave(Long id);
 
 
-    /**
-     * 获得请假流程信息
-     *
-     * @param id 编号
-     * @return 请假流程信息
-     */
-    OaLeaveDO getOaLeave(Long id);
-
-    /**
-     * 获得请假流程信息分页
-     *
-     * @param pageReqVO 分页查询
-     * @return 请假流程信息分页
-     */
-    PageResult<OaLeaveDO> getOaLeavePage(OaLeavePageReqVO pageReqVO);
+    OaLeaveRespVO getOaLeave(Long id);
+
+    OaLeaveRespVO getOaLeaveByProcInstId(String procInstId);
+
+    PageResult<OaLeaveRespVO> getOaLeavePage(OaLeavePageReqVO pageReqVO);
+
+    PageResult<OaLeaveRespVO> exportOaLeaveExcel(OaLeavePageReqVO pageReqVO);
+
 
 
 }
 }

+ 507 - 120
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/leave/OaLeaveServiceImpl.java

@@ -2,19 +2,34 @@ package cn.iocoder.yudao.module.bpm.service.oa.leave;
 
 
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
+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.object.BeanUtils;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
 import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
 import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
 import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
 import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeavePageReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeavePageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveRespVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveSaveReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeaveSaveReqVO;
 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.controller.admin.task.vo.task.BpmTaskRespVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskReturnReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskReturnReqVO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.leave.OaLeaveDO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.leave.OaLeaveDO;
 import cn.iocoder.yudao.module.bpm.dal.mysql.oa.leave.OaLeaveMapper;
 import cn.iocoder.yudao.module.bpm.dal.mysql.oa.leave.OaLeaveMapper;
+import cn.iocoder.yudao.module.bpm.enums.DictDataConstants;
+import cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants;
+import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmConstants;
 import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
 import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
+import cn.iocoder.yudao.module.infra.api.file.FileApi;
+import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.flowable.engine.TaskService;
 import org.flowable.engine.TaskService;
 import org.flowable.task.api.Task;
 import org.flowable.task.api.Task;
@@ -24,13 +39,11 @@ import org.springframework.validation.annotation.Validated;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_HOLIDAY_NOT_EXISTS;
+import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_LEAVE_NOT_EXISTS;
 
 
 /**
 /**
  * 请假流程信息 Service 实现类
  * 请假流程信息 Service 实现类
@@ -39,11 +52,11 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_HOLIDAY_NO
  */
  */
 @Service
 @Service
 @Validated
 @Validated
-public class OaLeaveServiceImpl extends ServiceImpl<OaLeaveMapper, OaLeaveDO> implements OaLeaveService {
+public class OaLeaveServiceImpl implements OaLeaveService {
 
 
 
 
     /**
     /**
-     * OA 离职对应的流程定义 KEY
+     * OA 请假对应的流程定义 KEY
      */
      */
     public static final String PROCESS_KEY = "oa_leave";
     public static final String PROCESS_KEY = "oa_leave";
 
 
@@ -60,90 +73,211 @@ public class OaLeaveServiceImpl extends ServiceImpl<OaLeaveMapper, OaLeaveDO> im
     @Resource
     @Resource
     private TaskService taskService;
     private TaskService taskService;
 
 
+    @Resource
+    private FileApi fileApi;
+
+    @Resource
+    private AdminUserApi adminUserApi;
+
+    @Resource
+    private DeptApi deptApi;
+
     @Override
     @Override
     @Transactional
     @Transactional
-    public Long startOaLeave(Long userId, OaLeaveSaveReqVO createReqVO) {
-        //判断是否已经发起流程
-        Boolean auditPass = createReqVO.getAuditPass();
-        // 创建单据uuid
-        String uuid = IdUtil.fastSimpleUUID();
-        OaLeaveDO oaLeave = BeanUtils.toBean(createReqVO, OaLeaveDO.class);
+    public Long stagingOaLeave(OaLeaveSaveReqVO stagingReqVO) {
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
+        Objects.requireNonNull(loginUser, "登录用户不能为空");
+        // 转正人信息
+        AdminUserRespDTO employee = adminUserApi.getUser(loginUserId);
+
+        OaLeaveDO oaLeave = BeanUtils.toBean(stagingReqVO, OaLeaveDO.class);
         if (StringUtils.isBlank(oaLeave.getLeaveId())) {
         if (StringUtils.isBlank(oaLeave.getLeaveId())) {
+            // 创建单据uuid
+            String uuid = IdUtil.fastSimpleUUID();
             oaLeave.setLeaveId(uuid);
             oaLeave.setLeaveId(uuid);
         }
         }
+        if (employee != null) {
+            oaLeave.setEmployeeId(loginUser.getId());
+            oaLeave.setEmployeeName(loginUser.getNickname());
+            oaLeave.setEmployeePhone(loginUser.getMobile());
+            oaLeave.setDeptId(loginUser.getDeptId());
+            oaLeave.setPosition("员工职位");
+            oaLeave.setUserId(loginUser.getId());
+        }
+        oaLeave.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_STAGING);
+        oaLeave.setInfoSource("0");
+        oaLeave.setApplyEmployeeId(loginUser.getId());
+        oaLeave.setApplyEmployeeName(loginUser.getNickname());
+        // 暂存不保存审批人信息
+        oaLeave.setStartUserSelectAssignees(null);
         // 保存或更新表单信息
         // 保存或更新表单信息
-        this.saveOrUpdate(oaLeave);
-
-        // 提交
-        if (auditPass) {
-            // 发起 BPM 流程
-            Map<String, Object> processInstanceVariables = new HashMap<>();
-            processInstanceVariables.put("auditPass", auditPass);
-            //添加审批人信息
-            Map<String, List<Long>> startUserSelectAssignees = new HashMap<>();
-            startUserSelectAssignees.put("approver", createReqVO.getStartUserSelectAssignees());
-            String processInstanceId = processInstanceApi
-                    .createProcessInstance(userId,
-                            new BpmProcessInstanceCreateReqDTO()
-                                    .setProcessDefinitionKey(PROCESS_KEY)
-                                    .setVariables(processInstanceVariables)
-                                    .setBusinessKey(String.valueOf(oaLeave.getId()))
-                                    .setStartUserSelectAssignees(startUserSelectAssignees));
-
-            //获取下一个审批人
-            Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
-
-            // 将工作流的编号,单据状态 最后一次审批时间 当前审批人  更新到 OA 转正中
-            oaLeaveMapper.updateById(new OaLeaveDO()
-                    .setId(oaLeave.getId())
-                    .setProcInstId(processInstanceId)
-                    .setAuditStatus("1")
-                    .setLeaveId(uuid)
-                    .setFinalAuditDate(LocalDateTime.now())
-                    .setCurrentAuditEmployeeId(Long.valueOf(task.getAssignee())));
+        if (oaLeave.getId() == null) {
+            oaLeaveMapper.insert(oaLeave);
+        } else {
+            oaLeaveMapper.updateById(oaLeave);
+        }
+        // 保存业务uuid到附件中
+        saveFileList(stagingReqVO.getFileIdList(), oaLeave.getLeaveId());
 
 
-            // TODO 发送通知
+        return oaLeave.getId();
+    }
 
 
-        }else {
-            // 暂存,不发起流程
-            // 将单据状态 更新到 OA转正中
-            oaLeaveMapper.updateById(new OaLeaveDO()
-                    .setId(oaLeave.getId())
-                    .setAuditStatus("0"));
+    @Override
+    @Transactional
+    public Long commitOaLeave(OaLeaveSaveReqVO commitReqVO) {
+        if (CollectionUtil.isEmpty(commitReqVO.getStartUserSelectAssignees())) {
+            throw exception(ErrorCodeConstants.TASK_CREATE_FAIL_NO_START_SELECT_ASSIGNEE);
+        }
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
+        if (loginUser == null) {
+            throw exception(ErrorCodeConstants.OA_LOGIN_USER_NOT_EXISTS);
         }
         }
+        // 转正人信息
+        AdminUserRespDTO employee = adminUserApi.getUser(loginUserId);
+        if (employee == null) {
+            throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
+        }
+
 
 
-        // TODO 保存或更新附件uuid
-        if (CollectionUtil.isNotEmpty(createReqVO.getFileIdList())) {
+        OaLeaveDO oaLeave = BeanUtils.toBean(commitReqVO, OaLeaveDO.class);
+        if (StringUtils.isBlank(oaLeave.getLeaveId())) {
+            // 创建单据uuid
+            String uuid = IdUtil.fastSimpleUUID();
+            oaLeave.setLeaveId(uuid);
+        }
+        oaLeave.setEmployeeId(employee.getId());
+        oaLeave.setEmployeeName(employee.getNickname());
+        oaLeave.setEmployeePhone(employee.getMobile());
+        oaLeave.setDeptId(employee.getDeptId());
+        oaLeave.setPosition("员工职位");
+        oaLeave.setUserId(loginUser.getId());
+        oaLeave.setInfoSource("0");
+        oaLeave.setApplyEmployeeId(loginUser.getId());
+        oaLeave.setApplyEmployeeName(loginUser.getNickname());
+        // 保存或更新表单信息
+        if (oaLeave.getId() == null) {
+            oaLeaveMapper.insert(oaLeave);
+        } else {
+            OaLeaveDO oaLeaveDO = oaLeaveMapper.selectById(oaLeave.getId());
+            if (StrUtil.isNotBlank(oaLeaveDO.getProcInstId())) {
+                throw exception(ErrorCodeConstants.PROCESS_INSTANCE_CREATE_FAIL_HAS_PROCESS);
+            }
+            oaLeaveMapper.updateById(oaLeave);
         }
         }
+        // 发起流程
+        Map<String, Object> processInstanceVariables = new HashMap<>();
+        processInstanceVariables.put("auditPass", "true");
+        // 添加审批人信息
+        Map<String, List<Long>> startUserSelectAssignees = new HashMap<>();
+        List<Long> selectAssignees = commitReqVO.getStartUserSelectAssignees();
+        startUserSelectAssignees.put("approver", selectAssignees);
+        String processInstanceId = processInstanceApi
+                .createProcessInstance(loginUser.getId(),
+                        new BpmProcessInstanceCreateReqDTO()
+                                .setProcessDefinitionKey(PROCESS_KEY)
+                                .setVariables(processInstanceVariables)
+                                .setBusinessKey(String.valueOf(oaLeave.getId()))
+                                .setStartUserSelectAssignees(startUserSelectAssignees));
+
+        //获取下一个审批人
+        Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
 
 
-        // 返回
+        // 审批同意
+        BpmTaskApproveReqVO agreeReqVO = new BpmTaskApproveReqVO();
+        agreeReqVO.setId(task.getId());
+        agreeReqVO.setReason("[首次提交]");
+        agreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_COMMITTED));
+        taskService.setVariable(task.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_COMMITTED);
+        taskService.setVariable(task.getId(), "auditPass", "true");
+        bpmTaskService.approveTask(loginUserId, agreeReqVO);
+
+        Task nextTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
+        if (nextTask == null) {
+            throw exception(ErrorCodeConstants.TASK_CREATE_FAIL_NO_START_SELECT_ASSIGNEE);
+        }
+        Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
+        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+
+
+        // 将工作流的流程实例ID、单据状态、最后一次审批时间、当前审批人更新到单据信息中
+        oaLeaveMapper.updateById(new OaLeaveDO()
+                .setId(oaLeave.getId())
+                .setProcInstId(processInstanceId)
+                .setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_COMMITTED)
+                .setFinalAuditDate(LocalDateTime.now())
+                .setCurrentAuditEmployeeId(currentAuditEmployeeId)
+                .setCurrentAuditEmployeeName(currentAuditEmployee.getNickname())
+                .setStartUserSelectAssignees(selectAssignees.stream().map(String::valueOf).collect(Collectors.joining(","))));
+        // 保存业务uuid到附件中
+        saveFileList(commitReqVO.getFileIdList(), oaLeave.getLeaveId());
+        // TODO DP 发送提交成功站内信
         return oaLeave.getId();
         return oaLeave.getId();
     }
     }
+
     @Override
     @Override
-    public Long completeTrueOaLeave(Long userId, BpmTaskApproveReqVO reqVO) {
-        Task currentTask = bpmTaskService.getTask(reqVO.getId());
+    @Transactional
+    public Long agreeOaLeave(BpmTaskApproveReqVO agreeReqVO) {
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        // TODO DP 根据登录人查询出对应的员工信息
+
+        Task currentTask = bpmTaskService.getTask(agreeReqVO.getId());
+        if (currentTask == null) {
+            throw exception(ErrorCodeConstants.TASK_NOT_EXISTS);
+        }
+        // 先更新为审批中
+        taskService.setVariable(currentTask.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_AUDITING);
+        LambdaQueryWrapper<OaLeaveDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(OaLeaveDO::getProcInstId, currentTask.getProcessInstanceId());
+        OaLeaveDO oaLeave = oaLeaveMapper.selectOne(lambdaQueryWrapper);
+        // 如果是最后一个人审批同意,设置流程审批状态为已审核
+        String[] auditPersons = oaLeave.getStartUserSelectAssignees().split(",");
+        String lastAuditPerson = Arrays.stream(auditPersons)
+                .reduce((first, second) -> second)
+                .orElse(null);
+        if (currentTask.getAssignee().equals(lastAuditPerson)) {
+            // 更新为已审核(暂时未生效,未找到原因,先不处理)
+            taskService.setVariable(agreeReqVO.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_AUDITED);
+        }
         // 审批同意
         // 审批同意
-        bpmTaskService.approveTask(userId, reqVO);
+        String reason = "[同意]";
+        if (StrUtil.isNotBlank(agreeReqVO.getReason())) {
+            reason = reason + agreeReqVO.getReason();
+        }
+        agreeReqVO.setReason(reason);
+        agreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_AUDITING));
+        taskService.setVariable(agreeReqVO.getId(), "auditPass", "true");
+        bpmTaskService.approveTask(loginUserId, agreeReqVO);
 
 
         Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
         Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
+        OaLeaveDO oaLeaveDO = new OaLeaveDO();
         if (nextTask != null) {
         if (nextTask != null) {
-            LambdaUpdateWrapper<OaLeaveDO> updateWrapper = new LambdaUpdateWrapper<>();
-            updateWrapper.set(OaLeaveDO::getAuditStatus, "2")
-                    .set(OaLeaveDO::getCurrentAuditEmployeeId, nextTask.getAssignee())
-                    .set(OaLeaveDO::getFinalAuditDate, new Date())
-                    .eq(OaLeaveDO::getProcInstId, currentTask.getProcessInstanceId());
-            oaLeaveMapper.update(updateWrapper);
+            Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
+            AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+
+            // 如果审批人重复,实际未结束,再次更新为审核中
+            taskService.setVariable(nextTask.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_AUDITING);
+            oaLeaveDO.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_AUDITING)
+                    .setCurrentAuditEmployeeId(currentAuditEmployeeId)
+                    .setCurrentAuditEmployeeName(currentAuditEmployee.getNickname())
+                    .setFinalAuditDate(LocalDateTime.now())
+                    .setId(oaLeave.getId());
+
         } else {
         } else {
-            LambdaUpdateWrapper<OaLeaveDO> updateWrapper = new LambdaUpdateWrapper<>();
-            updateWrapper.set(OaLeaveDO::getAuditStatus, "3")
-                    .set(OaLeaveDO::getCurrentAuditEmployeeId, null)
-                    .set(OaLeaveDO::getFinalAuditDate, new Date())
-                    .eq(OaLeaveDO::getProcInstId, currentTask.getProcessInstanceId());
-            oaLeaveMapper.update(updateWrapper);
+            oaLeaveDO.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_AUDITED)
+                    .setCurrentAuditEmployeeId(null)
+                    .setCurrentAuditEmployeeName(null)
+                    .setFinalAuditDate(LocalDateTime.now())
+                    .setId(oaLeave.getId());
 
 
             // TODO 复制业务单据信息到业务模块单据表
             // TODO 复制业务单据信息到业务模块单据表
 
 
         }
         }
+        oaLeaveMapper.updateById(oaLeaveDO);
         // 发送通知
         // 发送通知
 
 
         // 返回
         // 返回
@@ -151,81 +285,187 @@ public class OaLeaveServiceImpl extends ServiceImpl<OaLeaveMapper, OaLeaveDO> im
     }
     }
 
 
     @Override
     @Override
-    public Long completeFalseOaLeave(Long userId, BpmTaskApproveReqVO reqVO) {
+    @Transactional
+    public Long disagreeOaLeave(BpmTaskReturnReqVO disagreeReqVO) {
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        // TODO DP 根据登录人查询出对应的员工信息
 
 
-        Task currentTask = bpmTaskService.getTask(reqVO.getId());
+        Task currentTask = bpmTaskService.getTask(disagreeReqVO.getId());
 
 
-        BpmTaskReturnReqVO reqVO2 = BeanUtils.toBean(reqVO, BpmTaskReturnReqVO.class);
-        reqVO2.setTargetTaskDefinitionKey("modifyApply");
-        bpmTaskService.returnTask(userId, reqVO2);
+        disagreeReqVO.setTargetTaskDefinitionKey("modifyApply");
+        disagreeReqVO.setReason("[驳回]" + disagreeReqVO.getReason());
+        disagreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_RETURNED));
+        taskService.setVariable(disagreeReqVO.getId(), "auditPass", "false");
+        taskService.setVariable(disagreeReqVO.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_RETURNED);
+        bpmTaskService.returnTask(loginUserId, disagreeReqVO);
 
 
         Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
         Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
+        Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
+        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
 
 
         // 更新单据状态,当前处理人,最后处理时间
         // 更新单据状态,当前处理人,最后处理时间
         LambdaUpdateWrapper<OaLeaveDO> updateWrapper = new LambdaUpdateWrapper<>();
         LambdaUpdateWrapper<OaLeaveDO> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.set(OaLeaveDO::getCurrentAuditEmployeeId, nextTask.getAssignee())
-                .set(OaLeaveDO::getFinalAuditDate, new Date())
-                .set(OaLeaveDO::getAuditStatus, "0")
+        updateWrapper.set(OaLeaveDO::getCurrentAuditEmployeeId, currentAuditEmployeeId)
+                .set(OaLeaveDO::getCurrentAuditEmployeeName, currentAuditEmployee.getNickname())
+                .set(OaLeaveDO::getFinalAuditDate, LocalDateTime.now())
+                .set(OaLeaveDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_RETURNED)
                 .eq(OaLeaveDO::getProcInstId, currentTask.getProcessInstanceId());
                 .eq(OaLeaveDO::getProcInstId, currentTask.getProcessInstanceId());
         oaLeaveMapper.update(updateWrapper);
         oaLeaveMapper.update(updateWrapper);
 
 
         // 发送通知
         // 发送通知
 
 
-        // 返回
         return 1L;
         return 1L;
     }
     }
 
 
     @Override
     @Override
-    public Long updateCompleteOaLeave(Long userId, OaLeaveSaveReqVO createReqVO, BpmTaskApproveReqVO reqVO) {
-        // 判断是否已经发起流程
-        Boolean auditPass = createReqVO.getAuditPass();
+    @Transactional
+    public Long revocationOaLeave(BpmTaskApproveReqVO revocationReqVO) {
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        // TODO DP 根据登录人查询出对应的员工信息
+
+        Task currentTask = bpmTaskService.getTask(revocationReqVO.getId());
+        if (currentTask == null) {
+            throw ServiceExceptionUtil.exception(ErrorCodeConstants.TASK_NOT_EXISTS);
+        }
+        LambdaQueryWrapper<OaLeaveDO> lambdaQueryWrapper = new LambdaQueryWrapper<OaLeaveDO>()
+                .eq(OaLeaveDO::getProcInstId, currentTask.getProcessInstanceId());
+        OaLeaveDO oaLeaveDO = oaLeaveMapper.selectOne(lambdaQueryWrapper);
+        if (!DictDataConstants.OA_AUDIT_STATUS_COMMITTED.equals(oaLeaveDO.getAuditStatus())
+                || !Objects.equals(String.valueOf(loginUserId), oaLeaveDO.getCreator())) {
+            throw ServiceExceptionUtil.exception(ErrorCodeConstants.TASK_REVOCATION_NOT_ALLOWED);
+        }
 
 
-        OaLeaveDO oaLeave = BeanUtils.toBean(createReqVO, OaLeaveDO.class);
+        BpmTaskReturnReqVO returnReqVO = BeanUtils.toBean(revocationReqVO, BpmTaskReturnReqVO.class);
+        returnReqVO.setTargetTaskDefinitionKey("modifyApply");
+        String reason = "[撤回]";
+        if (StrUtil.isNotBlank(returnReqVO.getReason())) {
+            reason = reason + returnReqVO.getReason();
+        }
+        returnReqVO.setReason(reason);
+        returnReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_RECALLED));
+        taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_RECALLED);
+        bpmTaskService.revocationTask(loginUserId, returnReqVO);
 
 
-        Task currentTask = taskService.createTaskQuery().processInstanceId(oaLeave.getProcInstId()).singleResult();
+        Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
+        Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
+        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
 
 
-        //审批通过
-        bpmTaskService.approveTask(userId, reqVO);
+        // 更新单据状态,当前处理人,最后处理时间
+        LambdaUpdateWrapper<OaLeaveDO> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.set(OaLeaveDO::getCurrentAuditEmployeeId, currentAuditEmployeeId)
+                .set(OaLeaveDO::getCurrentAuditEmployeeName, currentAuditEmployee.getNickname())
+                .set(OaLeaveDO::getFinalAuditDate, LocalDateTime.now())
+                .set(OaLeaveDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_RECALLED)
+                .eq(OaLeaveDO::getProcInstId, currentTask.getProcessInstanceId());
+        oaLeaveMapper.update(updateWrapper);
 
 
-        // 提交
-        if (auditPass) {
-            Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
+        // 发送通知
 
 
-            oaLeave.setAuditStatus("1");
-            oaLeave.setCurrentAuditEmployeeId(Long.valueOf(nextTask.getAssignee()));
-            oaLeave.setFinalAuditDate(LocalDateTime.now());
-            oaLeaveMapper.updateById(oaLeave);
+        return 1L;
+    }
 
 
-        } else {
-            OaLeaveDO oaLeaveClose = new OaLeaveDO();
-            oaLeaveClose.setId(oaLeave.getId());
-            oaLeaveClose.setAuditStatus("4");
-            oaLeaveClose.setCurrentAuditEmployeeId(null);
-            oaLeaveClose.setFinalAuditDate(LocalDateTime.now());
-            oaLeaveMapper.updateById(oaLeaveClose);
+    @Override
+    @Transactional
+    public Long reCommitOaLeave(OaLeaveSaveReqVO reCommitReqVO) {
+        if (reCommitReqVO.getId() == null) {
+            throw exception(ErrorCodeConstants.SERVICE_ID_NOT_EXISTS);
+        }
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
+        if (loginUser == null) {
+            throw exception(ErrorCodeConstants.OA_LOGIN_USER_NOT_EXISTS);
+        }
+        // 转正人信息
+        AdminUserRespDTO employee = adminUserApi.getUser(loginUserId);
+        if (employee == null) {
+            throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
         }
         }
 
 
-        return oaLeave.getId();
-    }
+        OaLeaveDO oaLeaveNew = BeanUtils.toBean(reCommitReqVO, OaLeaveDO.class);
+        OaLeaveDO oaLeaveOld = oaLeaveMapper.selectById(oaLeaveNew.getId());
+        oaLeaveNew.setLeaveId(oaLeaveOld.getLeaveId())
+                .setProcInstId(oaLeaveOld.getProcInstId());
+
+        oaLeaveNew.setEmployeeId(employee.getId());
+        oaLeaveNew.setEmployeeName(employee.getNickname());
+        oaLeaveNew.setEmployeePhone(employee.getMobile());
+        oaLeaveNew.setDeptId(employee.getDeptId());
+        oaLeaveNew.setPosition("员工职位");
+        oaLeaveNew.setUserId(loginUser.getId());
+        oaLeaveNew.setApplyEmployeeId(loginUser.getId());
+        oaLeaveNew.setApplyEmployeeName(loginUser.getNickname());
+
+        Task currentTask = taskService.createTaskQuery().processInstanceId(oaLeaveNew.getProcInstId()).singleResult();
+        BpmTaskApproveReqVO approveReqVO = new BpmTaskApproveReqVO();
+        approveReqVO.setId(currentTask.getId())
+                .setReason("[再次提交]");
+        approveReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_COMMITTED));
+        if (CollectionUtil.isNotEmpty(reCommitReqVO.getStartUserSelectAssignees())) {
+            // 添加审批人信息到流程参数中
+            Map<String, List<Long>> startUserSelectAssignees = new HashMap<>();
+            List<Long> selectAssignees = reCommitReqVO.getStartUserSelectAssignees();
+            startUserSelectAssignees.put("approver", selectAssignees);
+            taskService.setVariable(currentTask.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES, startUserSelectAssignees);
+            // 保存审批人信息
+            oaLeaveNew.setStartUserSelectAssignees(selectAssignees.stream().map(String::valueOf).collect(Collectors.joining(",")));
+        }
+        taskService.setVariable(currentTask.getId(), "auditPass", "true");
+        taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_COMMITTED);
+        // 再次提交,和审批通过逻辑相同
+        bpmTaskService.approveTask(loginUserId, approveReqVO);
 
 
+        Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
+        Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
+        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+        oaLeaveNew.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_COMMITTED)
+                .setCurrentAuditEmployeeId(currentAuditEmployeeId)
+                .setCurrentAuditEmployeeName(currentAuditEmployee.getNickname())
+                .setFinalAuditDate(LocalDateTime.now());
+        oaLeaveMapper.updateById(oaLeaveNew);
 
 
+        // 保存业务uuid到附件中
+        saveFileList(reCommitReqVO.getFileIdList(), oaLeaveNew.getLeaveId());
 
 
-    @Override
-    public Long createOaLeave(OaLeaveSaveReqVO createReqVO) {
-        // 插入
-        OaLeaveDO oaLeave = BeanUtils.toBean(createReqVO, OaLeaveDO.class);
-        oaLeaveMapper.insert(oaLeave);
-        // 返回
-        return oaLeave.getId();
+        return 1L;
     }
     }
 
 
     @Override
     @Override
-    public void updateOaLeave(OaLeaveSaveReqVO updateReqVO) {
-        // 校验存在
-        validateOaLeaveExists(updateReqVO.getId());
-        // 更新
-        OaLeaveDO updateObj = BeanUtils.toBean(updateReqVO, OaLeaveDO.class);
-        oaLeaveMapper.updateById(updateObj);
+    @Transactional
+    public Long closeOaLeave(Long id) {
+        if (id == null) {
+            throw exception(ErrorCodeConstants.SERVICE_ID_NOT_EXISTS);
+        }
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        // TODO DP 根据登录人查询出对应的员工信息
+
+        OaLeaveDO oaLeaveDO = oaLeaveMapper.selectById(id);
+        if (!DictDataConstants.OA_AUDIT_STATUS_RETURNED.equals(oaLeaveDO.getAuditStatus())
+                && !DictDataConstants.OA_AUDIT_STATUS_RECALLED.equals(oaLeaveDO.getAuditStatus())) {
+            throw exception(ErrorCodeConstants.TASK_CLOSE_NOT_ALLOWED);
+        }
+
+        Task currentTask = taskService.createTaskQuery().processInstanceId(oaLeaveDO.getProcInstId()).singleResult();
+        BpmTaskApproveReqVO approveReqVO = new BpmTaskApproveReqVO();
+        approveReqVO.setId(currentTask.getId())
+                .setReason("[关闭]");
+        approveReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_CLOSED));
+        taskService.setVariable(currentTask.getId(), "auditPass", "false");
+        taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_CLOSED);
+        // 关闭,使用审批通过的方法实现
+        bpmTaskService.approveTask(loginUserId, approveReqVO);
+
+        LambdaUpdateWrapper<OaLeaveDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+        lambdaUpdateWrapper.set(OaLeaveDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_CLOSED)
+                .set(OaLeaveDO::getCurrentAuditEmployeeId, null)
+                .set(OaLeaveDO::getCurrentAuditEmployeeName, null)
+                .set(OaLeaveDO::getFinalAuditDate, LocalDateTime.now())
+                .eq(OaLeaveDO::getId, id);
+        oaLeaveMapper.update(lambdaUpdateWrapper);
+        return 1L;
     }
     }
 
 
     @Override
     @Override
@@ -236,20 +476,167 @@ public class OaLeaveServiceImpl extends ServiceImpl<OaLeaveMapper, OaLeaveDO> im
         oaLeaveMapper.deleteById(id);
         oaLeaveMapper.deleteById(id);
     }
     }
 
 
-    private void validateOaLeaveExists(Long id) {
-        if (oaLeaveMapper.selectById(id) == null) {
-            throw exception(OA_HOLIDAY_NOT_EXISTS);
+    @Override
+    public OaLeaveRespVO getOaLeave(Long id) {
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        // TODO DP 根据登录人查询出对应的员工信息
+
+        OaLeaveDO oaLeaveDO = oaLeaveMapper.selectById(id);
+        OaLeaveRespVO oaLeaveRespVO = BeanUtils.toBean(oaLeaveDO, OaLeaveRespVO.class);
+        if (oaLeaveDO.getDeptId() != null) {
+            DeptRespDTO dept = deptApi.getDept(oaLeaveDO.getDeptId());
+            if (dept != null) {
+                oaLeaveRespVO.setDeptName(dept.getName());
+            }
+        }
+
+        String procInstId = oaLeaveDO.getProcInstId();
+        if (StrUtil.isNotBlank(procInstId)) {
+            Task task = taskService.createTaskQuery()
+                    .processInstanceId(procInstId)
+                    .taskAssignee(String.valueOf(loginUserId))
+                    .singleResult();
+            if (DictDataConstants.OA_AUDIT_STATUS_COMMITTED.equals(oaLeaveDO.getAuditStatus())) {
+                // 如果是已提交,不限制任务处理人是当前登录人,用于直接撤回
+                task = taskService.createTaskQuery()
+                        .processInstanceId(procInstId)
+                        .singleResult();
+            }
+            if (task != null) {
+                oaLeaveRespVO.setTaskId(task.getId());
+            }
+        }
+
+        // 附件列表
+        List<FileDTO> fileList = fileApi.getFileDTOListByBiz(oaLeaveDO.getLeaveId());
+        oaLeaveRespVO.setFileList(fileList);
+
+        // 审批记录
+        if (StrUtil.isNotBlank(oaLeaveDO.getProcInstId())) {
+            List<BpmTaskRespVO> auditRecordList = bpmTaskService.getAuditRecordListByProcessInstanceId(oaLeaveDO.getProcInstId());
+            oaLeaveRespVO.setAuditRecordList(auditRecordList);
+        }
+
+        // 审批人
+        String startUserSelectAssignees = oaLeaveDO.getStartUserSelectAssignees();
+        if (StrUtil.isNotEmpty(startUserSelectAssignees)) {
+            List<Long> userIdList = Arrays.stream(startUserSelectAssignees.split(","))
+                    .map(Long::valueOf).collect(Collectors.toList());
+            List<AdminUserRespDTO> userList = adminUserApi.getUserList(userIdList);
+            List<AdminUserRespDTO> auditUserList = new ArrayList<>();
+            for (Long userId : userIdList) {
+                for (AdminUserRespDTO adminUserRespDTO : userList) {
+                    if (Objects.equals(userId, adminUserRespDTO.getId())) {
+                        auditUserList.add(adminUserRespDTO);
+                        break;
+                    }
+                }
+            }
+            oaLeaveRespVO.setAuditUserList(auditUserList);
+        }
+
+        return oaLeaveRespVO;
+    }
+
+    @Override
+    public OaLeaveRespVO getOaLeaveByProcInstId(String procInstId) {
+        OaLeaveDO oaLeaveDO = oaLeaveMapper.selectOne(OaLeaveDO::getProcInstId, procInstId);
+        OaLeaveRespVO oaLeaveRespVO = BeanUtils.toBean(oaLeaveDO, OaLeaveRespVO.class);
+        if (oaLeaveDO.getDeptId() != null) {
+            DeptRespDTO dept = deptApi.getDept(oaLeaveDO.getDeptId());
+            if (dept != null) {
+                oaLeaveRespVO.setDeptName(dept.getName());
+            }
+        }
+
+        // 附件列表
+        List<FileDTO> fileList = fileApi.getFileDTOListByBiz(oaLeaveDO.getLeaveId());
+        oaLeaveRespVO.setFileList(fileList);
+
+        // 审批记录
+        if (StrUtil.isNotBlank(oaLeaveDO.getProcInstId())) {
+            List<BpmTaskRespVO> auditRecordList = bpmTaskService.getAuditRecordListByProcessInstanceId(oaLeaveDO.getProcInstId());
+            oaLeaveRespVO.setAuditRecordList(auditRecordList);
+        }
+
+        // 审批人
+        String startUserSelectAssignees = oaLeaveDO.getStartUserSelectAssignees();
+        if (StrUtil.isNotEmpty(startUserSelectAssignees)) {
+            List<Long> userIdList = Arrays.stream(startUserSelectAssignees.split(","))
+                    .map(Long::valueOf).collect(Collectors.toList());
+            List<AdminUserRespDTO> userList = adminUserApi.getUserList(userIdList);
+            List<AdminUserRespDTO> auditUserList = new ArrayList<>();
+            for (Long userId : userIdList) {
+                for (AdminUserRespDTO adminUserRespDTO : userList) {
+                    if (Objects.equals(userId, adminUserRespDTO.getId())) {
+                        auditUserList.add(adminUserRespDTO);
+                        break;
+                    }
+                }
+            }
+            oaLeaveRespVO.setAuditUserList(auditUserList);
         }
         }
+
+        return oaLeaveRespVO;
     }
     }
 
 
     @Override
     @Override
-    public OaLeaveDO getOaLeave(Long id) {
-        return oaLeaveMapper.selectById(id);
+    public PageResult<OaLeaveRespVO> getOaLeavePage(OaLeavePageReqVO pageReqVO) {
+        PageResult<OaLeaveDO> oaLeaveDOPageResult = oaLeaveMapper.selectPage(pageReqVO);
+        PageResult<OaLeaveRespVO> oaLeaveRespVOPageResult = BeanUtils.toBean(oaLeaveDOPageResult, OaLeaveRespVO.class);
+
+        List<OaLeaveRespVO> oaLeaveRespVOList = oaLeaveRespVOPageResult.getList();
+        if (CollectionUtil.isNotEmpty(oaLeaveRespVOList)) {
+            List<Long> employeeIdList = oaLeaveRespVOList.stream().map(OaLeaveRespVO::getCurrentAuditEmployeeId).collect(Collectors.toList());
+            List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
+            for (OaLeaveRespVO respVO : oaLeaveRespVOList) {
+                for (AdminUserRespDTO employee : employeeList) {
+                    if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
+                        respVO.setCurrentAuditEmployeeName(employee.getNickname());
+                        break;
+                    }
+                }
+            }
+
+            List<Long> deptIdList = oaLeaveRespVOList.stream().map(OaLeaveRespVO::getDeptId).collect(Collectors.toList());
+            List<DeptRespDTO> deptList = deptApi.getDeptList(deptIdList);
+            for (OaLeaveRespVO respVO : oaLeaveRespVOList) {
+                for (DeptRespDTO dept : deptList) {
+                    if (dept.getId() != null && dept.getId().equals(respVO.getDeptId())) {
+                        respVO.setDeptName(dept.getName());
+                        break;
+                    }
+                }
+            }
+        }
+
+        return oaLeaveRespVOPageResult;
     }
     }
 
 
     @Override
     @Override
-    public PageResult<OaLeaveDO> getOaLeavePage(OaLeavePageReqVO pageReqVO) {
-        return oaLeaveMapper.selectPage(pageReqVO);
+    public PageResult<OaLeaveRespVO> exportOaLeaveExcel(OaLeavePageReqVO pageReqVO) {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        return getOaLeavePage(pageReqVO);
+    }
+
+    private void validateOaLeaveExists(Long id) {
+        OaLeaveDO oaLeaveDO = oaLeaveMapper.selectById(id);
+        if (oaLeaveDO == null) {
+            throw exception(OA_LEAVE_NOT_EXISTS);
+        }
+        if (!DictDataConstants.OA_AUDIT_STATUS_STAGING.equals(oaLeaveDO.getAuditStatus())) {
+            throw exception(ErrorCodeConstants.DELETE_FAIL_NOT_STAGING);
+        }
+    }
+
+    /**
+     * 保存业务uuid到附件中
+     */
+    private void saveFileList(List<Long> fileIdList, String serviceId) {
+        if (CollectionUtil.isNotEmpty(fileIdList) && StrUtil.isNotEmpty(serviceId)) {
+            fileApi.updateFileBiz(fileIdList, serviceId);
+        }
     }
     }
 
 
 }
 }

+ 1 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/renew/OaRenewServiceImpl.java

@@ -597,7 +597,7 @@ public class OaRenewServiceImpl implements OaRenewService {
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             for (OaRenewRespVO respVO : oaRenewRespVOList) {
             for (OaRenewRespVO respVO : oaRenewRespVOList) {
                 for (AdminUserRespDTO employee : employeeList) {
                 for (AdminUserRespDTO employee : employeeList) {
-                    if (respVO.getCurrentAuditEmployeeId() == employee.getId()) {
+                    if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         break;
                         break;
                     }
                     }

+ 1 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/turnover/OaTurnoverServiceImpl.java

@@ -595,7 +595,7 @@ public class OaTurnoverServiceImpl implements OaTurnoverService {
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             for (OaTurnoverRespVO respVO : oaTurnoverRespVOList) {
             for (OaTurnoverRespVO respVO : oaTurnoverRespVOList) {
                 for (AdminUserRespDTO employee : employeeList) {
                 for (AdminUserRespDTO employee : employeeList) {
-                    if (respVO.getCurrentAuditEmployeeId() == employee.getId()) {
+                    if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         break;
                         break;
                     }
                     }

+ 2 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/universal/OaUniversalServiceImpl.java

@@ -544,7 +544,7 @@ public class OaUniversalServiceImpl implements OaUniversalService {
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
             for (OaUniversalRespVO respVO : oaUniversalRespVOList) {
             for (OaUniversalRespVO respVO : oaUniversalRespVOList) {
                 for (AdminUserRespDTO employee : employeeList) {
                 for (AdminUserRespDTO employee : employeeList) {
-                    if (respVO.getCurrentAuditEmployeeId() == employee.getId()) {
+                    if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         respVO.setCurrentAuditEmployeeName(employee.getNickname());
                         break;
                         break;
                     }
                     }
@@ -555,7 +555,7 @@ public class OaUniversalServiceImpl implements OaUniversalService {
             List<DeptRespDTO> deptList = deptApi.getDeptList(deptIdList);
             List<DeptRespDTO> deptList = deptApi.getDeptList(deptIdList);
             for (OaUniversalRespVO respVO : oaUniversalRespVOList) {
             for (OaUniversalRespVO respVO : oaUniversalRespVOList) {
                 for (DeptRespDTO dept : deptList) {
                 for (DeptRespDTO dept : deptList) {
-                    if (respVO.getDeptId() == dept.getId()) {
+                    if (dept.getId() != null && dept.getId().equals(respVO.getDeptId())) {
                         respVO.setDeptName(dept.getName());
                         respVO.setDeptName(dept.getName());
                         break;
                         break;
                     }
                     }