Browse Source

1、公务外出审批接口

dongpo 1 year ago
parent
commit
3b2a090f09
17 changed files with 1328 additions and 12 deletions
  1. 9 8
      yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java
  2. 0 4
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeaveRespVO.java
  3. 166 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/OaOutController.java
  4. 88 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/vo/OaOutPageReqVO.java
  5. 123 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/vo/OaOutRespVO.java
  6. 48 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/vo/OaOutSaveReqVO.java
  7. 144 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/out/OaOutDO.java
  8. 45 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/out/OaOutMapper.java
  9. 1 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/business/OaBusinessServiceImpl.java
  10. 1 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/conversion/OaConversionServiceImpl.java
  11. 1 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/entry/OaEntryServiceImpl.java
  12. 41 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/out/OaOutService.java
  13. 646 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/out/OaOutServiceImpl.java
  14. 1 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/renew/OaRenewServiceImpl.java
  15. 1 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/turnover/OaTurnoverServiceImpl.java
  16. 1 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/universal/OaUniversalServiceImpl.java
  17. 12 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/resources/mapper/oa/out/OaOutMapper.xml

+ 9 - 8
yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java

@@ -90,20 +90,21 @@ public interface ErrorCodeConstants {
     ErrorCode DELETE_FAIL_NOT_STAGING = new ErrorCode(1009011001, "非暂存状态不能删除");
 
     // ========== 通用事项审批流程信息 1_009_017_000 ==========
-    ErrorCode OA_UNIVERSAL_NOT_EXISTS = new ErrorCode(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, "入职流程信息不存在");
+    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, "转正流程信息不存在");
+    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, "合同续签流程信息不存在");
+    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_LEAVE_NOT_EXISTS = new ErrorCode(1_009_017_005, "请假流程信息不存在");
+    ErrorCode OA_LEAVE_NOT_EXISTS = new ErrorCode(1_009_017_005, "请假信息不存在");
     // ========== 出差流程信息 1_009_017_006 ==========
-    ErrorCode OA_BUSINESS_NOT_EXISTS = new ErrorCode(1_009_017_006, "出差流程信息不存在");
-
+    ErrorCode OA_BUSINESS_NOT_EXISTS = new ErrorCode(1_009_017_006, "出差信息不存在");
+    // ========== 公务外出流程信息 1_009_017_007 ==========
+    ErrorCode OA_OUT_NOT_EXISTS = new ErrorCode(1_009_017_007, "公务外出信息不存在");
 
     // ========== 员工信息 1_009_018_000 ==========
     ErrorCode OA_EMPLOYEE_NOT_EXISTS = new ErrorCode(1_009_018_000, "员工信息不存在");

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

@@ -43,10 +43,6 @@ public class OaLeaveRespVO {
     @ExcelProperty("部门id")
     private Long deptId;
 
-    @Schema(description = "部门uuid", example = "24393")
-    @ExcelProperty("部门uuid")
-    private String deptUuid;
-
     @Schema(description = "部门名称")
     @ExcelProperty("部门名称")
     private String deptName;

+ 166 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/OaOutController.java

@@ -0,0 +1,166 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.out;
+
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutSaveReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutSaveReqVO;
+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.service.oa.out.OaOutService;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import org.springdoc.api.annotations.ParameterObject;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.out.OaOutDO;
+import cn.iocoder.yudao.module.bpm.service.oa.out.OaOutService;
+
+@Tag(name = "管理后台 - 公务外出流程信息")
+@RestController
+@RequestMapping("/bpm/oa-out")
+@Validated
+public class OaOutController {
+
+    @Resource
+    private OaOutService oaOutService;
+
+    @PostMapping("/staging")
+    @Operation(summary = "暂存公务外出审批流程信息")
+    @ApiOperationSupport(order = 1)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:staging')")
+    public CommonResult<Long> stagingOaOut(@RequestBody OaOutSaveReqVO stagingReqVO) {
+        Long oaOutId = oaOutService.stagingOaOut(stagingReqVO);
+        return success(oaOutId, "暂存成功");
+    }
+
+    @PostMapping("/commit")
+    @Operation(summary = "提交公务外出审批流程信息")
+    @ApiOperationSupport(order = 2)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:commit')")
+    public CommonResult<Long> commitOaOut(@Valid @RequestBody OaOutSaveReqVO commitReqVO) {
+        Long oaOutId = oaOutService.commitOaOut(commitReqVO);
+        return success(oaOutId, "提交成功");
+    }
+
+    @PostMapping("/agree")
+    @Operation(summary = "审批同意公务外出审批流程信息")
+    @ApiOperationSupport(order = 3)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:agree')")
+    public CommonResult<Long> agreeOaOut(@Valid @RequestBody BpmTaskApproveReqVO agreeReqVO) {
+        Long result = oaOutService.agreeOaOut(agreeReqVO);
+        return success(result, "审批成功");
+    }
+
+    @PostMapping("/disagree")
+    @Operation(summary = "驳回公务外出审批流程信息")
+    @ApiOperationSupport(order = 4)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:disagree')")
+    public CommonResult<Long> disagreeOaOut(@Valid @RequestBody BpmTaskReturnReqVO disagreeReqVO) {
+        Long result = oaOutService.disagreeOaOut(disagreeReqVO);
+        return success(result, "驳回成功");
+    }
+
+    @PostMapping("/revocation")
+    @Operation(summary = "撤回公务外出审批流程信息")
+    @ApiOperationSupport(order = 5)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:revocation')")
+    public CommonResult<Long> revocationOaOut(@Valid @RequestBody BpmTaskApproveReqVO revocationReqVO) {
+        Long result = oaOutService.revocationOaOut(revocationReqVO);
+        return success(result, "撤回成功");
+    }
+
+    @PostMapping("/reCommit")
+    @Operation(summary = "驳回或撤回后再次提交公务外出审批流程信息")
+    @ApiOperationSupport(order = 6)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:re-commit')")
+    public CommonResult<Long> reCommitOaOut(@Valid @RequestBody OaOutSaveReqVO reCommitReqVO) {
+        Long result = oaOutService.reCommitOaOut(reCommitReqVO);
+        return success(result, "再次提交成功");
+    }
+
+    @DeleteMapping("/close")
+    @Operation(summary = "驳回或撤回后关闭公务外出审批流程信息")
+    @ApiOperationSupport(order = 7)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-entry:close')")
+    public CommonResult<Long> closeOaOut(@RequestParam("id") Long id) {
+        Long result = oaOutService.closeOaOut(id);
+
+        return success(result, "关闭成功");
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除公务外出审批流程信息")
+    @ApiOperationSupport(order = 8)
+    @Parameter(name = "id", description = "编号", required = true)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:delete')")
+    public CommonResult<Boolean> deleteOaOut(@RequestParam("id") Long id) {
+        oaOutService.deleteOaOut(id);
+        return success(true, "删除成功");
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "根据id获得公务外出审批流程信息")
+    @Parameter(name = "id", description = "编号", required = true, example = "1")
+    @ApiOperationSupport(order = 9)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:query-id')")
+    public CommonResult<OaOutRespVO> getOaOut(@RequestParam("id") Long id) {
+        OaOutRespVO respVO = oaOutService.getOaOut(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-out:query-proc-inst-id')")
+    public CommonResult<OaOutRespVO> getOaOutByProcInstId(@RequestParam("procInstId") String procInstId) {
+        OaOutRespVO respVO = oaOutService.getOaOutByProcInstId(procInstId);
+        return success(respVO, "查询对象成功");
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得公务外出审批流程信息分页")
+    @ApiOperationSupport(order = 11)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:query-page')")
+    public CommonResult<PageResult<OaOutRespVO>> getOaOutPage(@Valid @ParameterObject OaOutPageReqVO pageReqVO) {
+        return success(oaOutService.getOaOutPage(pageReqVO), "查询列表成功");
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出公务外出审批流程信息 Excel")
+    @ApiOperationSupport(order = 12)
+    // @PreAuthorize("@ss.hasPermission('bpm:oa-out:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportOaOutExcel(@ParameterObject OaOutPageReqVO pageReqVO,
+                                   HttpServletResponse response) throws IOException {
+        PageResult<OaOutRespVO> pageResult = oaOutService.exportOaOutExcel(pageReqVO);
+        List<OaOutRespVO> list = pageResult.getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "公务外出审批流程信息.xls", "数据", OaOutRespVO.class,
+                BeanUtils.toBean(list, OaOutRespVO.class));
+    }
+
+}

+ 88 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/vo/OaOutPageReqVO.java

@@ -0,0 +1,88 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 公务外出流程信息分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class OaOutPageReqVO extends PageParam {
+
+    @Schema(description = "uuid", example = "9006")
+    private String outId;
+
+    @Schema(description = "外出人id", example = "1")
+    private Long employeeId;
+
+    @Schema(description = "外出员工姓名", example = "李四")
+    private String employeeName;
+
+    @Schema(description = "外出员工手机号")
+    private String employeePhone;
+
+    @Schema(description = "用户账号id", example = "32289")
+    private Long userId;
+
+    @Schema(description = "部门id", example = "31013")
+    private Long deptId;
+
+    @Schema(description = "员工职位")
+    private String position;
+
+    @Schema(description = "外出事由", example = "不香")
+    private String reason;
+
+    @Schema(description = "外出地点")
+    private String destination;
+
+    @Schema(description = "外出开始时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String[] startDate;
+
+    @Schema(description = "外出结束时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String[] endDate;
+
+    @Schema(description = "外出时长,单位(小时)")
+    private String hour;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "流程实例id", example = "8014")
+    private String procInstId;
+
+    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)", example = "2")
+    private String auditStatus;
+
+    @Schema(description = "当前审核人员工id", example = "11675")
+    private Long currentAuditEmployeeId;
+
+    @Schema(description = "当前审核人员工姓名", example = "张三")
+    private String currentAuditEmployeeName;
+
+    @Schema(description = "当前审核人用户id", example = "29595")
+    private Long currentAuditUserId;
+
+    @Schema(description = "最后审核时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] finalAuditDate;
+
+    @Schema(description = "申请人员工id", example = "1")
+    private Long applyEmployeeId;
+
+    @Schema(description = "申请人员工姓名", example = "王五")
+    private String applyEmployeeName;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 123 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/vo/OaOutRespVO.java

@@ -0,0 +1,123 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.out.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 lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 公务外出流程信息 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class OaOutRespVO {
+
+    @Schema(description = "出差表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("出差表单主键")
+    private Integer id;
+
+    @Schema(description = "uuid", example = "9006")
+    @ExcelProperty("uuid")
+    private String outId;
+
+    @Schema(description = "外出人id", example = "1")
+    @ExcelProperty("外出人id")
+    private Long employeeId;
+
+    @Schema(description = "外出员工姓名", example = "李四")
+    @ExcelProperty("外出员工姓名")
+    private String employeeName;
+
+    @Schema(description = "外出员工手机号")
+    @ExcelProperty("外出员工手机号")
+    private String employeePhone;
+
+    @Schema(description = "用户账号id", example = "32289")
+    @ExcelProperty("用户账号id")
+    private Long userId;
+
+    @Schema(description = "部门id", example = "31013")
+    @ExcelProperty("部门id")
+    private Long deptId;
+
+    @Schema(description = "部门名称")
+    @ExcelProperty("部门名称")
+    private String deptName;
+
+    @Schema(description = "员工职位")
+    @ExcelProperty("员工职位")
+    private String position;
+
+    @Schema(description = "外出事由", requiredMode = Schema.RequiredMode.REQUIRED, example = "不香")
+    @ExcelProperty("外出事由")
+    private String reason;
+
+    @Schema(description = "外出地点", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("外出地点")
+    private String destination;
+
+    @Schema(description = "外出开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("外出开始时间")
+    private String startDate;
+
+    @Schema(description = "外出结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("外出结束时间")
+    private String endDate;
+
+    @Schema(description = "外出时长,单位(小时)", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("外出时长,单位(小时)")
+    private String hour;
+
+    @Schema(description = "流程实例id", example = "8014")
+    @ExcelProperty("流程实例id")
+    private String procInstId;
+
+    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)", example = "2")
+    @ExcelProperty("审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)")
+    private String auditStatus;
+
+    @Schema(description = "当前审核人员工id", example = "11675")
+    @ExcelProperty("当前审核人员工id")
+    private Long currentAuditEmployeeId;
+
+    @Schema(description = "当前审核人员工姓名", example = "张三")
+    @ExcelProperty("当前审核人员工姓名")
+    private String currentAuditEmployeeName;
+
+    @Schema(description = "当前审核人用户id", example = "29595")
+    @ExcelProperty("当前审核人用户id")
+    private Long currentAuditUserId;
+
+    @Schema(description = "最后审核时间")
+    @ExcelProperty("最后审核时间")
+    private LocalDateTime finalAuditDate;
+
+    @Schema(description = "申请人员工id", example = "1")
+    @ExcelProperty("申请人员工id")
+    private Long applyEmployeeId;
+
+    @Schema(description = "申请人员工姓名", example = "王五")
+    @ExcelProperty("申请人员工姓名")
+    private String applyEmployeeName;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "附件列表")
+    private List<FileDTO> fileList;
+
+    @Schema(description = "审批记录列表")
+    private List<BpmTaskRespVO> auditRecordList;
+
+    @Schema(description = "审批人员列表")
+    private List<AdminUserRespDTO> auditUserList;
+
+    @Schema(description = "当前用户待处理的任务id")
+    private String taskId;
+
+}

+ 48 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/vo/OaOutSaveReqVO.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 公务外出流程信息新增/修改 Request VO")
+@Data
+public class OaOutSaveReqVO {
+
+    @Schema(description = "出差表单主键", example = "1")
+    private Integer id;
+
+    @Schema(description = "外出人id", example = "1")
+    private Long employeeId;
+
+    @Schema(description = "外出事由", example = "不香")
+    @NotBlank(message = "外出事由不能为空")
+    private String reason;
+
+    @Schema(description = "外出地点")
+    @NotBlank(message = "外出地点不能为空")
+    private String destination;
+
+    @Schema(description = "外出开始时间")
+    @NotBlank(message = "外出开始时间不能为空")
+    private String startDate;
+
+    @Schema(description = "外出结束时间")
+    @NotBlank(message = "外出结束时间不能为空")
+    private String endDate;
+
+    @Schema(description = "外出时长,单位(小时)")
+    @NotBlank(message = "外出时长,单位(小时)不能为空")
+    private String hour;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "发起人自选审批人", example = " [100, 1]")
+    @NotEmpty(message = "发起人自选审批人不能为空")
+    private List<Long> startUserSelectAssignees;
+
+    @Schema(description = "附件主键id", example = "[1, 2]")
+    private List<Long> fileIdList;
+
+}

+ 144 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/out/OaOutDO.java

@@ -0,0 +1,144 @@
+package cn.iocoder.yudao.module.bpm.dal.dataobject.oa.out;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 公务外出流程信息 DO
+ *
+ * @author dp
+ */
+@TableName("bpm_oa_out")
+@KeySequence("bpm_oa_out_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class OaOutDO extends BaseDO {
+
+    /**
+     * 出差表单主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * uuid
+     */
+    private String outId;
+    /**
+     * 外出人id
+     */
+    private Long employeeId;
+    /**
+     * 外出人uuid
+     */
+    private String employeeUuid;
+    /**
+     * 外出员工姓名
+     */
+    private String employeeName;
+    /**
+     * 外出员工手机号
+     */
+    private String employeePhone;
+    /**
+     * 用户账号id
+     */
+    private Long userId;
+    /**
+     * 用户账号uuid
+     */
+    private String userUuid;
+    /**
+     * 部门id
+     */
+    private Long deptId;
+    /**
+     * 部门uuid
+     */
+    private String deptUuid;
+    /**
+     * 员工职位
+     */
+    private String position;
+    /**
+     * 外出事由
+     */
+    private String reason;
+    /**
+     * 外出地点
+     */
+    private String destination;
+    /**
+     * 外出开始时间
+     */
+    private String startDate;
+    /**
+     * 外出结束时间
+     */
+    private String endDate;
+    /**
+     * 外出时长,单位(小时)
+     */
+    private String hour;
+    /**
+     * 备注
+     */
+    private String remarks;
+    /**
+     * 流程实例id
+     */
+    private String procInstId;
+    /**
+     * 审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)
+     */
+    private String auditStatus;
+    /**
+     * 当前审核人员工id
+     */
+    private Long currentAuditEmployeeId;
+    /**
+     * 当前审核人员工uuid
+     */
+    private String currentAuditEmployeeUuid;
+    /**
+     * 当前审核人员工姓名
+     */
+    private String currentAuditEmployeeName;
+    /**
+     * 当前审核人用户id
+     */
+    private Long currentAuditUserId;
+    /**
+     * 当前审核人用户uuid
+     */
+    private String currentAuditUserUuid;
+    /**
+     * 最后审核时间
+     */
+    private LocalDateTime finalAuditDate;
+    /**
+     * 发起人选择的审批人
+     */
+    private String startUserSelectAssignees;
+    /**
+     * 申请人员工id
+     */
+    private Long applyEmployeeId;
+    /**
+     * 申请人员工姓名
+     */
+    private String applyEmployeeName;
+    /**
+     * 数据来源,0流程添加、1手动添加
+     */
+    private String infoSource;
+
+}

+ 45 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/out/OaOutMapper.java

@@ -0,0 +1,45 @@
+package cn.iocoder.yudao.module.bpm.dal.mysql.oa.out;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutPageReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.out.OaOutDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 公务外出流程信息 Mapper
+ *
+ * @author dp
+ */
+@Mapper
+public interface OaOutMapper extends BaseMapperX<OaOutDO> {
+
+    default PageResult<OaOutDO> selectPage(OaOutPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<OaOutDO>()
+                .eqIfPresent(OaOutDO::getOutId, reqVO.getOutId())
+                .eqIfPresent(OaOutDO::getEmployeeId, reqVO.getEmployeeId())
+                .likeIfPresent(OaOutDO::getEmployeeName, reqVO.getEmployeeName())
+                .eqIfPresent(OaOutDO::getEmployeePhone, reqVO.getEmployeePhone())
+                .eqIfPresent(OaOutDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(OaOutDO::getDeptId, reqVO.getDeptId())
+                .eqIfPresent(OaOutDO::getPosition, reqVO.getPosition())
+                .eqIfPresent(OaOutDO::getReason, reqVO.getReason())
+                .eqIfPresent(OaOutDO::getDestination, reqVO.getDestination())
+                .betweenIfPresent(OaOutDO::getStartDate, reqVO.getStartDate())
+                .betweenIfPresent(OaOutDO::getEndDate, reqVO.getEndDate())
+                .eqIfPresent(OaOutDO::getHour, reqVO.getHour())
+                .eqIfPresent(OaOutDO::getRemarks, reqVO.getRemarks())
+                .eqIfPresent(OaOutDO::getProcInstId, reqVO.getProcInstId())
+                .eqIfPresent(OaOutDO::getAuditStatus, reqVO.getAuditStatus())
+                .eqIfPresent(OaOutDO::getCurrentAuditEmployeeId, reqVO.getCurrentAuditEmployeeId())
+                .likeIfPresent(OaOutDO::getCurrentAuditEmployeeName, reqVO.getCurrentAuditEmployeeName())
+                .eqIfPresent(OaOutDO::getCurrentAuditUserId, reqVO.getCurrentAuditUserId())
+                .betweenIfPresent(OaOutDO::getFinalAuditDate, reqVO.getFinalAuditDate())
+                .eqIfPresent(OaOutDO::getApplyEmployeeId, reqVO.getApplyEmployeeId())
+                .likeIfPresent(OaOutDO::getApplyEmployeeName, reqVO.getApplyEmployeeName())
+                .betweenIfPresent(OaOutDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(OaOutDO::getId));
+    }
+
+}

+ 1 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/business/OaBusinessServiceImpl.java

@@ -114,6 +114,7 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         if (oaBusiness.getId() == null) {
             oaBusinessMapper.insert(oaBusiness);
         } else {
+            validateOaBusinessExists(oaBusiness.getId());
             oaBusinessMapper.updateById(oaBusiness);
         }
         // 保存业务uuid到附件中

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

@@ -114,6 +114,7 @@ public class OaConversionServiceImpl implements OaConversionService {
         if (oaConversion.getId() == null) {
             oaConversionMapper.insert(oaConversion);
         } else {
+            validateOaConversionExists(oaConversion.getId());
             oaConversionMapper.updateById(oaConversion);
         }
         // 保存业务uuid到附件中

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

@@ -106,6 +106,7 @@ public class OaEntryServiceImpl implements OaEntryService {
         if (oaEntry.getId() == null) {
             oaEntryMapper.insert(oaEntry);
         } else {
+            validateOaEntryExists(oaEntry.getId());
             oaEntryMapper.updateById(oaEntry);
         }
         // 保存业务uuid到附件中

+ 41 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/out/OaOutService.java

@@ -0,0 +1,41 @@
+package cn.iocoder.yudao.module.bpm.service.oa.out;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutSaveReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskApproveReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskReturnReqVO;
+
+/**
+ * 公务外出流程信息 Service 接口
+ *
+ * @author dp
+ */
+public interface OaOutService {
+
+    Long stagingOaOut(OaOutSaveReqVO stagingReqVO);
+
+    Long commitOaOut(OaOutSaveReqVO commitReqVO);
+
+    Long agreeOaOut(BpmTaskApproveReqVO agreeReqVO);
+
+    Long disagreeOaOut(BpmTaskReturnReqVO disagreeReqVO);
+
+    Long revocationOaOut(BpmTaskApproveReqVO revocationReqVO);
+
+    Long reCommitOaOut(OaOutSaveReqVO reCommitReqVO);
+
+    Long closeOaOut(Long id);
+
+    void deleteOaOut(Long id);
+
+    OaOutRespVO getOaOut(Long id);
+
+    OaOutRespVO getOaOutByProcInstId(String procInstId);
+
+    PageResult<OaOutRespVO> getOaOutPage(OaOutPageReqVO pageReqVO);
+
+    PageResult<OaOutRespVO> exportOaOutExcel(OaOutPageReqVO pageReqVO);
+
+}

+ 646 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/out/OaOutServiceImpl.java

@@ -0,0 +1,646 @@
+package cn.iocoder.yudao.module.bpm.service.oa.out;
+
+import cn.hutool.core.collection.CollectionUtil;
+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.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.dto.BpmProcessInstanceCreateReqDTO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutSaveReqVO;
+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.dal.dataobject.oa.out.OaOutDO;
+import cn.iocoder.yudao.module.bpm.dal.mysql.oa.out.OaOutMapper;
+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.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 org.apache.commons.lang3.StringUtils;
+import org.flowable.engine.TaskService;
+import org.flowable.task.api.Task;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_OUT_NOT_EXISTS;
+
+/**
+ * 公务外出流程信息 Service 实现类
+ *
+ * @author dp
+ */
+@Service
+@Validated
+public class OaOutServiceImpl implements OaOutService {
+
+    /**
+     * 对应的流程定义 KEY
+     */
+    public static final String PROCESS_KEY = "oa_out";
+
+
+    @Resource
+    private OaOutMapper oaOutMapper;
+
+    @Resource
+    private BpmProcessInstanceApi processInstanceApi;
+
+    @Resource
+    private BpmTaskService bpmTaskService;
+
+    @Resource
+    private TaskService taskService;
+
+    @Resource
+    private FileApi fileApi;
+
+    @Resource
+    private AdminUserApi adminUserApi;
+
+    @Resource
+    private DeptApi deptApi;
+
+    @Override
+    @Transactional
+    public Long stagingOaOut(OaOutSaveReqVO stagingReqVO) {
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
+        Objects.requireNonNull(loginUser, "登录用户不能为空");
+        // 转正人信息
+        AdminUserRespDTO employee = adminUserApi.getUser(loginUserId);
+
+        OaOutDO oaOut = BeanUtils.toBean(stagingReqVO, OaOutDO.class);
+        if (StringUtils.isBlank(oaOut.getOutId())) {
+            // 创建单据uuid
+            String uuid = IdUtil.fastSimpleUUID();
+            oaOut.setOutId(uuid);
+        }
+        if (employee != null) {
+            oaOut.setEmployeeId(loginUser.getId());
+            oaOut.setEmployeeName(loginUser.getNickname());
+            oaOut.setEmployeePhone(loginUser.getMobile());
+            oaOut.setDeptId(loginUser.getDeptId());
+            oaOut.setPosition("员工职位");
+            oaOut.setUserId(loginUser.getId());
+        }
+        oaOut.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_STAGING);
+        oaOut.setInfoSource("0");
+        oaOut.setApplyEmployeeId(loginUser.getId());
+        oaOut.setApplyEmployeeName(loginUser.getNickname());
+        // 暂存不保存审批人信息
+        oaOut.setStartUserSelectAssignees(null);
+        // 保存或更新表单信息
+        if (oaOut.getId() == null) {
+            oaOutMapper.insert(oaOut);
+        } else {
+            validateOaOutExists(oaOut.getId());
+            oaOutMapper.updateById(oaOut);
+        }
+        // 保存业务uuid到附件中
+        saveFileList(stagingReqVO.getFileIdList(), oaOut.getOutId());
+
+        return oaOut.getId();
+    }
+
+    @Override
+    @Transactional
+    public Long commitOaOut(OaOutSaveReqVO 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);
+        }
+
+
+        OaOutDO oaOut = BeanUtils.toBean(commitReqVO, OaOutDO.class);
+        if (StringUtils.isBlank(oaOut.getOutId())) {
+            // 创建单据uuid
+            String uuid = IdUtil.fastSimpleUUID();
+            oaOut.setOutId(uuid);
+        }
+        oaOut.setEmployeeId(employee.getId());
+        oaOut.setEmployeeName(employee.getNickname());
+        oaOut.setEmployeePhone(employee.getMobile());
+        oaOut.setDeptId(employee.getDeptId());
+        oaOut.setPosition("员工职位");
+        oaOut.setUserId(loginUser.getId());
+        oaOut.setInfoSource("0");
+        oaOut.setApplyEmployeeId(loginUser.getId());
+        oaOut.setApplyEmployeeName(loginUser.getNickname());
+        // 保存或更新表单信息
+        if (oaOut.getId() == null) {
+            oaOutMapper.insert(oaOut);
+        } else {
+            OaOutDO oaOutDO = validateOaOutExists(oaOut.getId());
+            if (StrUtil.isNotBlank(oaOutDO.getProcInstId())) {
+                throw exception(ErrorCodeConstants.PROCESS_INSTANCE_CREATE_FAIL_HAS_PROCESS);
+            }
+            oaOutMapper.updateById(oaOut);
+        }
+        // 发起流程
+        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(oaOut.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、单据状态、最后一次审批时间、当前审批人更新到单据信息中
+        oaOutMapper.updateById(new OaOutDO()
+                .setId(oaOut.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(), oaOut.getOutId());
+        // TODO DP 发送提交成功站内信
+        return oaOut.getId();
+    }
+
+    @Override
+    @Transactional
+    public Long agreeOaOut(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<OaOutDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(OaOutDO::getProcInstId, currentTask.getProcessInstanceId());
+        OaOutDO oaOut = oaOutMapper.selectOne(lambdaQueryWrapper);
+        // 如果是最后一个人审批同意,设置流程审批状态为已审核
+        String[] auditPersons = oaOut.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);
+        }
+        // 审批同意
+        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();
+        OaOutDO oaOutDO = new OaOutDO();
+        if (nextTask != null) {
+            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);
+            oaOutDO.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_AUDITING)
+                    .setCurrentAuditEmployeeId(currentAuditEmployeeId)
+                    .setCurrentAuditEmployeeName(currentAuditEmployee.getNickname())
+                    .setFinalAuditDate(LocalDateTime.now())
+                    .setId(oaOut.getId());
+
+        } else {
+            oaOutDO.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_AUDITED)
+                    .setCurrentAuditEmployeeId(null)
+                    .setCurrentAuditEmployeeName(null)
+                    .setFinalAuditDate(LocalDateTime.now())
+                    .setId(oaOut.getId());
+
+            // TODO 复制业务单据信息到业务模块单据表
+
+        }
+        oaOutMapper.updateById(oaOutDO);
+        // 发送通知
+
+        // 返回
+        return 1L;
+    }
+
+    @Override
+    @Transactional
+    public Long disagreeOaOut(BpmTaskReturnReqVO disagreeReqVO) {
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        // TODO DP 根据登录人查询出对应的员工信息
+
+        Task currentTask = bpmTaskService.getTask(disagreeReqVO.getId());
+
+        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();
+        Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
+        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+
+        // 更新单据状态,当前处理人,最后处理时间
+        LambdaUpdateWrapper<OaOutDO> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.set(OaOutDO::getCurrentAuditEmployeeId, currentAuditEmployeeId)
+                .set(OaOutDO::getCurrentAuditEmployeeName, currentAuditEmployee.getNickname())
+                .set(OaOutDO::getFinalAuditDate, LocalDateTime.now())
+                .set(OaOutDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_RETURNED)
+                .eq(OaOutDO::getProcInstId, currentTask.getProcessInstanceId());
+        oaOutMapper.update(updateWrapper);
+
+        // 发送通知
+
+        return 1L;
+    }
+
+    @Override
+    @Transactional
+    public Long revocationOaOut(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<OaOutDO> lambdaQueryWrapper = new LambdaQueryWrapper<OaOutDO>()
+                .eq(OaOutDO::getProcInstId, currentTask.getProcessInstanceId());
+        OaOutDO oaOutDO = oaOutMapper.selectOne(lambdaQueryWrapper);
+        if (!DictDataConstants.OA_AUDIT_STATUS_COMMITTED.equals(oaOutDO.getAuditStatus())
+                || !Objects.equals(String.valueOf(loginUserId), oaOutDO.getCreator())) {
+            throw ServiceExceptionUtil.exception(ErrorCodeConstants.TASK_REVOCATION_NOT_ALLOWED);
+        }
+
+        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 nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
+        Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
+        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+
+        // 更新单据状态,当前处理人,最后处理时间
+        LambdaUpdateWrapper<OaOutDO> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.set(OaOutDO::getCurrentAuditEmployeeId, currentAuditEmployeeId)
+                .set(OaOutDO::getCurrentAuditEmployeeName, currentAuditEmployee.getNickname())
+                .set(OaOutDO::getFinalAuditDate, LocalDateTime.now())
+                .set(OaOutDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_RECALLED)
+                .eq(OaOutDO::getProcInstId, currentTask.getProcessInstanceId());
+        oaOutMapper.update(updateWrapper);
+
+        // 发送通知
+
+        return 1L;
+    }
+
+    @Override
+    @Transactional
+    public Long reCommitOaOut(OaOutSaveReqVO 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);
+        }
+
+        OaOutDO oaOutNew = BeanUtils.toBean(reCommitReqVO, OaOutDO.class);
+        OaOutDO oaOutOld = validateOaOutExists(oaOutNew.getId());
+        oaOutNew.setOutId(oaOutOld.getOutId())
+                .setProcInstId(oaOutOld.getProcInstId());
+
+        oaOutNew.setEmployeeId(employee.getId());
+        oaOutNew.setEmployeeName(employee.getNickname());
+        oaOutNew.setEmployeePhone(employee.getMobile());
+        oaOutNew.setDeptId(employee.getDeptId());
+        oaOutNew.setPosition("员工职位");
+        oaOutNew.setUserId(loginUser.getId());
+        oaOutNew.setApplyEmployeeId(loginUser.getId());
+        oaOutNew.setApplyEmployeeName(loginUser.getNickname());
+
+        Task currentTask = taskService.createTaskQuery().processInstanceId(oaOutNew.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);
+            // 保存审批人信息
+            oaOutNew.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);
+        oaOutNew.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_COMMITTED)
+                .setCurrentAuditEmployeeId(currentAuditEmployeeId)
+                .setCurrentAuditEmployeeName(currentAuditEmployee.getNickname())
+                .setFinalAuditDate(LocalDateTime.now());
+        oaOutMapper.updateById(oaOutNew);
+
+        // 保存业务uuid到附件中
+        saveFileList(reCommitReqVO.getFileIdList(), oaOutNew.getOutId());
+
+        return 1L;
+    }
+
+    @Override
+    @Transactional
+    public Long closeOaOut(Long id) {
+        if (id == null) {
+            throw exception(ErrorCodeConstants.SERVICE_ID_NOT_EXISTS);
+        }
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        // TODO DP 根据登录人查询出对应的员工信息
+
+        OaOutDO oaOutDO = oaOutMapper.selectById(id);
+        if (!DictDataConstants.OA_AUDIT_STATUS_RETURNED.equals(oaOutDO.getAuditStatus())
+                && !DictDataConstants.OA_AUDIT_STATUS_RECALLED.equals(oaOutDO.getAuditStatus())) {
+            throw exception(ErrorCodeConstants.TASK_CLOSE_NOT_ALLOWED);
+        }
+
+        Task currentTask = taskService.createTaskQuery().processInstanceId(oaOutDO.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<OaOutDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+        lambdaUpdateWrapper.set(OaOutDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_CLOSED)
+                .set(OaOutDO::getCurrentAuditEmployeeId, null)
+                .set(OaOutDO::getCurrentAuditEmployeeName, null)
+                .set(OaOutDO::getFinalAuditDate, LocalDateTime.now())
+                .eq(OaOutDO::getId, id);
+        oaOutMapper.update(lambdaUpdateWrapper);
+        return 1L;
+    }
+
+    @Override
+    public void deleteOaOut(Long id) {
+        // 校验存在
+        validateOaOutDelete(id);
+        // 删除
+        oaOutMapper.deleteById(id);
+    }
+
+    @Override
+    public OaOutRespVO getOaOut(Long id) {
+        // 登录人信息
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        // TODO DP 根据登录人查询出对应的员工信息
+
+        OaOutDO oaOutDO = validateOaOutExists(id);
+        OaOutRespVO oaOutRespVO = BeanUtils.toBean(oaOutDO, OaOutRespVO.class);
+        if (oaOutDO.getDeptId() != null) {
+            DeptRespDTO dept = deptApi.getDept(oaOutDO.getDeptId());
+            if (dept != null) {
+                oaOutRespVO.setDeptName(dept.getName());
+            }
+        }
+
+        String procInstId = oaOutDO.getProcInstId();
+        if (StrUtil.isNotBlank(procInstId)) {
+            Task task = taskService.createTaskQuery()
+                    .processInstanceId(procInstId)
+                    .taskAssignee(String.valueOf(loginUserId))
+                    .singleResult();
+            if (DictDataConstants.OA_AUDIT_STATUS_COMMITTED.equals(oaOutDO.getAuditStatus())) {
+                // 如果是已提交,不限制任务处理人是当前登录人,用于直接撤回
+                task = taskService.createTaskQuery()
+                        .processInstanceId(procInstId)
+                        .singleResult();
+            }
+            if (task != null) {
+                oaOutRespVO.setTaskId(task.getId());
+            }
+        }
+
+        // 附件列表
+        List<FileDTO> fileList = fileApi.getFileDTOListByBiz(oaOutDO.getOutId());
+        oaOutRespVO.setFileList(fileList);
+
+        // 审批记录
+        if (StrUtil.isNotBlank(oaOutDO.getProcInstId())) {
+            List<BpmTaskRespVO> auditRecordList = bpmTaskService.getAuditRecordListByProcessInstanceId(oaOutDO.getProcInstId());
+            oaOutRespVO.setAuditRecordList(auditRecordList);
+        }
+
+        // 审批人
+        String startUserSelectAssignees = oaOutDO.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;
+                    }
+                }
+            }
+            oaOutRespVO.setAuditUserList(auditUserList);
+        }
+
+        return oaOutRespVO;
+    }
+
+    @Override
+    public OaOutRespVO getOaOutByProcInstId(String procInstId) {
+        OaOutDO oaOutDO = oaOutMapper.selectOne(OaOutDO::getProcInstId, procInstId);
+        OaOutRespVO oaOutRespVO = BeanUtils.toBean(oaOutDO, OaOutRespVO.class);
+        if (oaOutDO.getDeptId() != null) {
+            DeptRespDTO dept = deptApi.getDept(oaOutDO.getDeptId());
+            if (dept != null) {
+                oaOutRespVO.setDeptName(dept.getName());
+            }
+        }
+
+        // 附件列表
+        List<FileDTO> fileList = fileApi.getFileDTOListByBiz(oaOutDO.getOutId());
+        oaOutRespVO.setFileList(fileList);
+
+        // 审批记录
+        if (StrUtil.isNotBlank(oaOutDO.getProcInstId())) {
+            List<BpmTaskRespVO> auditRecordList = bpmTaskService.getAuditRecordListByProcessInstanceId(oaOutDO.getProcInstId());
+            oaOutRespVO.setAuditRecordList(auditRecordList);
+        }
+
+        // 审批人
+        String startUserSelectAssignees = oaOutDO.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;
+                    }
+                }
+            }
+            oaOutRespVO.setAuditUserList(auditUserList);
+        }
+
+        return oaOutRespVO;
+    }
+
+    @Override
+    public PageResult<OaOutRespVO> getOaOutPage(OaOutPageReqVO pageReqVO) {
+        PageResult<OaOutDO> oaOutDOPageResult = oaOutMapper.selectPage(pageReqVO);
+        PageResult<OaOutRespVO> oaOutRespVOPageResult = BeanUtils.toBean(oaOutDOPageResult, OaOutRespVO.class);
+
+        List<OaOutRespVO> oaOutRespVOList = oaOutRespVOPageResult.getList();
+        if (CollectionUtil.isNotEmpty(oaOutRespVOList)) {
+            List<Long> employeeIdList = oaOutRespVOList.stream().map(OaOutRespVO::getCurrentAuditEmployeeId).collect(Collectors.toList());
+            List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
+            for (OaOutRespVO respVO : oaOutRespVOList) {
+                for (AdminUserRespDTO employee : employeeList) {
+                    if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
+                        respVO.setCurrentAuditEmployeeName(employee.getNickname());
+                        break;
+                    }
+                }
+            }
+
+            List<Long> deptIdList = oaOutRespVOList.stream().map(OaOutRespVO::getDeptId).collect(Collectors.toList());
+            List<DeptRespDTO> deptList = deptApi.getDeptList(deptIdList);
+            for (OaOutRespVO respVO : oaOutRespVOList) {
+                for (DeptRespDTO dept : deptList) {
+                    if (dept.getId() != null && dept.getId().equals(respVO.getDeptId())) {
+                        respVO.setDeptName(dept.getName());
+                        break;
+                    }
+                }
+            }
+        }
+
+        return oaOutRespVOPageResult;
+    }
+
+    @Override
+    public PageResult<OaOutRespVO> exportOaOutExcel(OaOutPageReqVO pageReqVO) {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        return getOaOutPage(pageReqVO);
+    }
+
+    private void validateOaOutDelete(Long id) {
+        OaOutDO oaOutDO = validateOaOutExists(id);
+        if (!DictDataConstants.OA_AUDIT_STATUS_STAGING.equals(oaOutDO.getAuditStatus())) {
+            throw exception(ErrorCodeConstants.DELETE_FAIL_NOT_STAGING);
+        }
+    }
+
+    private OaOutDO validateOaOutExists(Long id) {
+        OaOutDO oaOutDO = oaOutMapper.selectById(id);
+        if (oaOutDO == null) {
+            throw exception(OA_OUT_NOT_EXISTS);
+        }
+        return oaOutDO;
+    }
+
+    /**
+     * 保存业务uuid到附件中
+     */
+    private void saveFileList(List<Long> fileIdList, String serviceId) {
+        if (CollectionUtil.isNotEmpty(fileIdList) && StrUtil.isNotEmpty(serviceId)) {
+            fileApi.updateFileBiz(fileIdList, serviceId);
+        }
+    }
+}

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

@@ -117,6 +117,7 @@ public class OaRenewServiceImpl implements OaRenewService {
         if (oaRenew.getId() == null) {
             oaRenewMapper.insert(oaRenew);
         } else {
+            validateOaRenewExists(oaRenew.getId());
             oaRenewMapper.updateById(oaRenew);
         }
         // 保存业务uuid到附件中

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

@@ -117,6 +117,7 @@ public class OaTurnoverServiceImpl implements OaTurnoverService {
         if (oaTurnover.getId() == null) {
             oaTurnoverMapper.insert(oaTurnover);
         } else {
+            validateOaTurnoverExists(oaTurnover.getId());
             oaTurnoverMapper.updateById(oaTurnover);
         }
         // 保存业务uuid到附件中

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

@@ -111,6 +111,7 @@ public class OaUniversalServiceImpl implements OaUniversalService {
         if (oaUniversal.getId() == null) {
             oaUniversalMapper.insert(oaUniversal);
         } else {
+            validateOaUniversalExists(oaUniversal.getId());
             oaUniversalMapper.updateById(oaUniversal);
         }
         // 保存业务uuid到附件中

+ 12 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/resources/mapper/oa/out/OaOutMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.iocoder.yudao.module.bpm.dal.mysql.oa.out.OaOutMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>