Browse Source

合同续签流程信息代码生成

dongpo 1 year ago
parent
commit
617f223aff
13 changed files with 1002 additions and 2 deletions
  1. 2 0
      yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java
  2. 96 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/OaRenewController.java
  3. 102 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/vo/OaRenewPageReqVO.java
  4. 124 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/vo/OaRenewRespVO.java
  5. 92 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/vo/OaRenewSaveReqVO.java
  6. 132 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/renew/OaRenewDO.java
  7. 49 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/renew/OaRenewMapper.java
  8. 55 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/renew/OaRenewService.java
  9. 72 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/renew/OaRenewServiceImpl.java
  10. 12 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/resources/mapper/oa/renew/OaRenewMapper.xml
  11. 225 0
      yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/oa/renew/OaRenewServiceImplTest.java
  12. 3 1
      yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/clean.sql
  13. 38 1
      yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/create_tables.sql

+ 2 - 0
yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java

@@ -93,4 +93,6 @@ public interface ErrorCodeConstants {
 
     // ========== 转正流程信息 1-009_017_002 ==========
     ErrorCode OA_CONVERSION_NOT_EXISTS = new ErrorCode(1009017002, "转正流程信息不存在");
+    // ========== 合同续签流程信息 1-009_017_003 ==========
+    ErrorCode OA_RENEW_NOT_EXISTS = new ErrorCode(1009017003, "合同续签流程信息不存在");
 }

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

@@ -0,0 +1,96 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.renew;
+
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewSaveReqVO;
+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.renew.OaRenewDO;
+import cn.iocoder.yudao.module.bpm.service.oa.renew.OaRenewService;
+
+@Tag(name = "管理后台 - 合同续签流程信息")
+@RestController
+@RequestMapping("/bpm/oa-renew")
+@Validated
+public class OaRenewController {
+
+    @Resource
+    private OaRenewService oaRenewService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建合同续签流程信息")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-renew:create')")
+    public CommonResult<Long> createOaRenew(@Valid @RequestBody OaRenewSaveReqVO createReqVO) {
+        return success(oaRenewService.createOaRenew(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新合同续签流程信息")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-renew:update')")
+    public CommonResult<Boolean> updateOaRenew(@Valid @RequestBody OaRenewSaveReqVO updateReqVO) {
+        oaRenewService.updateOaRenew(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除合同续签流程信息")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('bpm:oa-renew:delete')")
+    public CommonResult<Boolean> deleteOaRenew(@RequestParam("id") Long id) {
+        oaRenewService.deleteOaRenew(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得合同续签流程信息")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-renew:query')")
+    public CommonResult<OaRenewRespVO> getOaRenew(@RequestParam("id") Long id) {
+        OaRenewDO oaRenew = oaRenewService.getOaRenew(id);
+        return success(BeanUtils.toBean(oaRenew, OaRenewRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得合同续签流程信息分页")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-renew:query')")
+    public CommonResult<PageResult<OaRenewRespVO>> getOaRenewPage(@Valid OaRenewPageReqVO pageReqVO) {
+        PageResult<OaRenewDO> pageResult = oaRenewService.getOaRenewPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, OaRenewRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出合同续签流程信息 Excel")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-renew:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportOaRenewExcel(@Valid OaRenewPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<OaRenewDO> list = oaRenewService.getOaRenewPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "合同续签流程信息.xls", "数据", OaRenewRespVO.class,
+                        BeanUtils.toBean(list, OaRenewRespVO.class));
+    }
+
+}

+ 102 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/vo/OaRenewPageReqVO.java

@@ -0,0 +1,102 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.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 OaRenewPageReqVO extends PageParam {
+
+    @Schema(description = "uuid", example = "14308")
+    private String renewId;
+
+    @Schema(description = "转正人id", example = "4530")
+    private Long employeeId;
+
+    @Schema(description = "转正人uuid", example = "24001")
+    private String employeeUuid;
+
+    @Schema(description = "转正员工姓名", example = "赵六")
+    private String employeeName;
+
+    @Schema(description = "用户账号id", example = "16762")
+    private Long userId;
+
+    @Schema(description = "用户账号uuid", example = "12052")
+    private String userUuid;
+
+    @Schema(description = "部门id", example = "28162")
+    private Long deptId;
+
+    @Schema(description = "部门uuid", example = "17499")
+    private String deptUuid;
+
+    @Schema(description = "职位")
+    private String position;
+
+    @Schema(description = "原合同开始日期")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String[] oldContractStartDate;
+
+    @Schema(description = "原合同结束日期")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String[] oldContractEndDate;
+
+    @Schema(description = "续签合同期限")
+    private String renewPeriod;
+
+    @Schema(description = "续签开始日期")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String[] renewContractStartDate;
+
+    @Schema(description = "续签结束日期")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String[] renewContractEndDate;
+
+    @Schema(description = "续签理由", example = "不喜欢")
+    private String renewReason;
+
+    @Schema(description = "工作表现")
+    private String workPerformance;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "流程实例id", example = "25043")
+    private String procInstId;
+
+    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)", example = "1")
+    private String auditStatus;
+
+    @Schema(description = "当前审核人用户id", example = "19532")
+    private Long currentAuditUserId;
+
+    @Schema(description = "当前审核人用户uuid", example = "31429")
+    private String currentAuditUserUuid;
+
+    @Schema(description = "当前审核人员工id", example = "22621")
+    private Long currentAuditEmployeeId;
+
+    @Schema(description = "当前审核人员工uuid", example = "12859")
+    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 = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 124 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/vo/OaRenewRespVO.java

@@ -0,0 +1,124 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo;
+
+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 OaRenewRespVO {
+
+    @Schema(description = "续签表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31139")
+    @ExcelProperty("续签表单主键")
+    private Long id;
+
+    @Schema(description = "uuid", example = "14308")
+    @ExcelProperty("uuid")
+    private String renewId;
+
+    @Schema(description = "转正人id", example = "4530")
+    @ExcelProperty("转正人id")
+    private Long employeeId;
+
+    @Schema(description = "转正人uuid", example = "24001")
+    @ExcelProperty("转正人uuid")
+    private String employeeUuid;
+
+    @Schema(description = "转正员工姓名", example = "赵六")
+    @ExcelProperty("转正员工姓名")
+    private String employeeName;
+
+    @Schema(description = "用户账号id", example = "16762")
+    @ExcelProperty("用户账号id")
+    private Long userId;
+
+    @Schema(description = "用户账号uuid", example = "12052")
+    @ExcelProperty("用户账号uuid")
+    private String userUuid;
+
+    @Schema(description = "部门id", example = "28162")
+    @ExcelProperty("部门id")
+    private Long deptId;
+
+    @Schema(description = "部门uuid", example = "17499")
+    @ExcelProperty("部门uuid")
+    private String deptUuid;
+
+    @Schema(description = "职位")
+    @ExcelProperty("职位")
+    private String position;
+
+    @Schema(description = "原合同开始日期")
+    @ExcelProperty("原合同开始日期")
+    private String oldContractStartDate;
+
+    @Schema(description = "原合同结束日期")
+    @ExcelProperty("原合同结束日期")
+    private String oldContractEndDate;
+
+    @Schema(description = "续签合同期限")
+    @ExcelProperty("续签合同期限")
+    private String renewPeriod;
+
+    @Schema(description = "续签开始日期")
+    @ExcelProperty("续签开始日期")
+    private String renewContractStartDate;
+
+    @Schema(description = "续签结束日期")
+    @ExcelProperty("续签结束日期")
+    private String renewContractEndDate;
+
+    @Schema(description = "续签理由", example = "不喜欢")
+    @ExcelProperty("续签理由")
+    private String renewReason;
+
+    @Schema(description = "工作表现")
+    @ExcelProperty("工作表现")
+    private String workPerformance;
+
+    @Schema(description = "备注")
+    @ExcelProperty("备注")
+    private String remarks;
+
+    @Schema(description = "流程实例id", example = "25043")
+    @ExcelProperty("流程实例id")
+    private String procInstId;
+
+    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)", example = "1")
+    @ExcelProperty("审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)")
+    private String auditStatus;
+
+    @Schema(description = "当前审核人用户id", example = "19532")
+    @ExcelProperty("当前审核人用户id")
+    private Long currentAuditUserId;
+
+    @Schema(description = "当前审核人用户uuid", example = "31429")
+    @ExcelProperty("当前审核人用户uuid")
+    private String currentAuditUserUuid;
+
+    @Schema(description = "当前审核人员工id", example = "22621")
+    @ExcelProperty("当前审核人员工id")
+    private Long currentAuditEmployeeId;
+
+    @Schema(description = "当前审核人员工uuid", example = "12859")
+    @ExcelProperty("当前审核人员工uuid")
+    private String currentAuditEmployeeUuid;
+
+    @Schema(description = "最后审核时间")
+    @ExcelProperty("最后审核时间")
+    private LocalDateTime finalAuditDate;
+
+    @Schema(description = "数据来源,0流程添加、1手动添加")
+    @ExcelProperty("数据来源,0流程添加、1手动添加")
+    private String infoSource;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 92 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/renew/vo/OaRenewSaveReqVO.java

@@ -0,0 +1,92 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 合同续签流程信息新增/修改 Request VO")
+@Data
+public class OaRenewSaveReqVO {
+
+    @Schema(description = "续签表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31139")
+    private Long id;
+
+    @Schema(description = "uuid", example = "14308")
+    private String renewId;
+
+    @Schema(description = "转正人id", example = "4530")
+    private Long employeeId;
+
+    @Schema(description = "转正人uuid", example = "24001")
+    private String employeeUuid;
+
+    @Schema(description = "转正员工姓名", example = "赵六")
+    private String employeeName;
+
+    @Schema(description = "用户账号id", example = "16762")
+    private Long userId;
+
+    @Schema(description = "用户账号uuid", example = "12052")
+    private String userUuid;
+
+    @Schema(description = "部门id", example = "28162")
+    private Long deptId;
+
+    @Schema(description = "部门uuid", example = "17499")
+    private String deptUuid;
+
+    @Schema(description = "职位")
+    private String position;
+
+    @Schema(description = "原合同开始日期")
+    private String oldContractStartDate;
+
+    @Schema(description = "原合同结束日期")
+    private String oldContractEndDate;
+
+    @Schema(description = "续签合同期限")
+    private String renewPeriod;
+
+    @Schema(description = "续签开始日期")
+    private String renewContractStartDate;
+
+    @Schema(description = "续签结束日期")
+    private String renewContractEndDate;
+
+    @Schema(description = "续签理由", example = "不喜欢")
+    private String renewReason;
+
+    @Schema(description = "工作表现")
+    private String workPerformance;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "流程实例id", example = "25043")
+    private String procInstId;
+
+    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)", example = "1")
+    private String auditStatus;
+
+    @Schema(description = "当前审核人用户id", example = "19532")
+    private Long currentAuditUserId;
+
+    @Schema(description = "当前审核人用户uuid", example = "31429")
+    private String currentAuditUserUuid;
+
+    @Schema(description = "当前审核人员工id", example = "22621")
+    private Long currentAuditEmployeeId;
+
+    @Schema(description = "当前审核人员工uuid", example = "12859")
+    private String currentAuditEmployeeUuid;
+
+    @Schema(description = "最后审核时间")
+    private LocalDateTime finalAuditDate;
+
+    @Schema(description = "数据来源,0流程添加、1手动添加")
+    private String infoSource;
+
+}

+ 132 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/renew/OaRenewDO.java

@@ -0,0 +1,132 @@
+package cn.iocoder.yudao.module.bpm.dal.dataobject.oa.renew;
+
+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_renew")
+@KeySequence("bpm_oa_renew_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class OaRenewDO extends BaseDO {
+
+    /**
+     * 续签表单主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * uuid
+     */
+    private String renewId;
+    /**
+     * 转正人id
+     */
+    private Long employeeId;
+    /**
+     * 转正人uuid
+     */
+    private String employeeUuid;
+    /**
+     * 转正员工姓名
+     */
+    private String employeeName;
+    /**
+     * 用户账号id
+     */
+    private Long userId;
+    /**
+     * 用户账号uuid
+     */
+    private String userUuid;
+    /**
+     * 部门id
+     */
+    private Long deptId;
+    /**
+     * 部门uuid
+     */
+    private String deptUuid;
+    /**
+     * 职位
+     */
+    private String position;
+    /**
+     * 原合同开始日期
+     */
+    private String oldContractStartDate;
+    /**
+     * 原合同结束日期
+     */
+    private String oldContractEndDate;
+    /**
+     * 续签合同期限
+     */
+    private String renewPeriod;
+    /**
+     * 续签开始日期
+     */
+    private String renewContractStartDate;
+    /**
+     * 续签结束日期
+     */
+    private String renewContractEndDate;
+    /**
+     * 续签理由
+     */
+    private String renewReason;
+    /**
+     * 工作表现
+     */
+    private String workPerformance;
+    /**
+     * 备注
+     */
+    private String remarks;
+    /**
+     * 流程实例id
+     */
+    private String procInstId;
+    /**
+     * 审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回)
+     */
+    private String auditStatus;
+    /**
+     * 当前审核人用户id
+     */
+    private Long currentAuditUserId;
+    /**
+     * 当前审核人用户uuid
+     */
+    private String currentAuditUserUuid;
+    /**
+     * 当前审核人员工id
+     */
+    private Long currentAuditEmployeeId;
+    /**
+     * 当前审核人员工uuid
+     */
+    private String currentAuditEmployeeUuid;
+    /**
+     * 最后审核时间
+     */
+    private LocalDateTime finalAuditDate;
+    /**
+     * 数据来源,0流程添加、1手动添加
+     */
+    private String infoSource;
+
+}

+ 49 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/renew/OaRenewMapper.java

@@ -0,0 +1,49 @@
+package cn.iocoder.yudao.module.bpm.dal.mysql.oa.renew;
+
+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.renew.vo.OaRenewPageReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.renew.OaRenewDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 合同续签流程信息 Mapper
+ *
+ * @author dp
+ */
+@Mapper
+public interface OaRenewMapper extends BaseMapperX<OaRenewDO> {
+
+    default PageResult<OaRenewDO> selectPage(OaRenewPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<OaRenewDO>()
+                .eqIfPresent(OaRenewDO::getRenewId, reqVO.getRenewId())
+                .eqIfPresent(OaRenewDO::getEmployeeId, reqVO.getEmployeeId())
+                .eqIfPresent(OaRenewDO::getEmployeeUuid, reqVO.getEmployeeUuid())
+                .likeIfPresent(OaRenewDO::getEmployeeName, reqVO.getEmployeeName())
+                .eqIfPresent(OaRenewDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(OaRenewDO::getUserUuid, reqVO.getUserUuid())
+                .eqIfPresent(OaRenewDO::getDeptId, reqVO.getDeptId())
+                .eqIfPresent(OaRenewDO::getDeptUuid, reqVO.getDeptUuid())
+                .eqIfPresent(OaRenewDO::getPosition, reqVO.getPosition())
+                .betweenIfPresent(OaRenewDO::getOldContractStartDate, reqVO.getOldContractStartDate())
+                .betweenIfPresent(OaRenewDO::getOldContractEndDate, reqVO.getOldContractEndDate())
+                .eqIfPresent(OaRenewDO::getRenewPeriod, reqVO.getRenewPeriod())
+                .betweenIfPresent(OaRenewDO::getRenewContractStartDate, reqVO.getRenewContractStartDate())
+                .betweenIfPresent(OaRenewDO::getRenewContractEndDate, reqVO.getRenewContractEndDate())
+                .eqIfPresent(OaRenewDO::getRenewReason, reqVO.getRenewReason())
+                .eqIfPresent(OaRenewDO::getWorkPerformance, reqVO.getWorkPerformance())
+                .eqIfPresent(OaRenewDO::getRemarks, reqVO.getRemarks())
+                .eqIfPresent(OaRenewDO::getProcInstId, reqVO.getProcInstId())
+                .eqIfPresent(OaRenewDO::getAuditStatus, reqVO.getAuditStatus())
+                .eqIfPresent(OaRenewDO::getCurrentAuditUserId, reqVO.getCurrentAuditUserId())
+                .eqIfPresent(OaRenewDO::getCurrentAuditUserUuid, reqVO.getCurrentAuditUserUuid())
+                .eqIfPresent(OaRenewDO::getCurrentAuditEmployeeId, reqVO.getCurrentAuditEmployeeId())
+                .eqIfPresent(OaRenewDO::getCurrentAuditEmployeeUuid, reqVO.getCurrentAuditEmployeeUuid())
+                .betweenIfPresent(OaRenewDO::getFinalAuditDate, reqVO.getFinalAuditDate())
+                .eqIfPresent(OaRenewDO::getInfoSource, reqVO.getInfoSource())
+                .betweenIfPresent(OaRenewDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(OaRenewDO::getId));
+    }
+
+}

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

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.bpm.service.oa.renew;
+
+import javax.validation.*;
+
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewSaveReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.renew.OaRenewDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+
+/**
+ * 合同续签流程信息 Service 接口
+ *
+ * @author dp
+ */
+public interface OaRenewService {
+
+    /**
+     * 创建合同续签流程信息
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createOaRenew(@Valid OaRenewSaveReqVO createReqVO);
+
+    /**
+     * 更新合同续签流程信息
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateOaRenew(@Valid OaRenewSaveReqVO updateReqVO);
+
+    /**
+     * 删除合同续签流程信息
+     *
+     * @param id 编号
+     */
+    void deleteOaRenew(Long id);
+
+    /**
+     * 获得合同续签流程信息
+     *
+     * @param id 编号
+     * @return 合同续签流程信息
+     */
+    OaRenewDO getOaRenew(Long id);
+
+    /**
+     * 获得合同续签流程信息分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 合同续签流程信息分页
+     */
+    PageResult<OaRenewDO> getOaRenewPage(OaRenewPageReqVO pageReqVO);
+
+}

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

@@ -0,0 +1,72 @@
+package cn.iocoder.yudao.module.bpm.service.oa.renew;
+
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewSaveReqVO;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.renew.OaRenewDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+
+import cn.iocoder.yudao.module.bpm.dal.mysql.oa.renew.OaRenewMapper;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*;
+
+/**
+ * 合同续签流程信息 Service 实现类
+ *
+ * @author dp
+ */
+@Service
+@Validated
+public class OaRenewServiceImpl implements OaRenewService {
+
+    @Resource
+    private OaRenewMapper oaRenewMapper;
+
+    @Override
+    public Long createOaRenew(OaRenewSaveReqVO createReqVO) {
+        // 插入
+        OaRenewDO oaRenew = BeanUtils.toBean(createReqVO, OaRenewDO.class);
+        oaRenewMapper.insert(oaRenew);
+        // 返回
+        return oaRenew.getId();
+    }
+
+    @Override
+    public void updateOaRenew(OaRenewSaveReqVO updateReqVO) {
+        // 校验存在
+        validateOaRenewExists(updateReqVO.getId());
+        // 更新
+        OaRenewDO updateObj = BeanUtils.toBean(updateReqVO, OaRenewDO.class);
+        oaRenewMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteOaRenew(Long id) {
+        // 校验存在
+        validateOaRenewExists(id);
+        // 删除
+        oaRenewMapper.deleteById(id);
+    }
+
+    private void validateOaRenewExists(Long id) {
+        if (oaRenewMapper.selectById(id) == null) {
+            throw exception(OA_RENEW_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public OaRenewDO getOaRenew(Long id) {
+        return oaRenewMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<OaRenewDO> getOaRenewPage(OaRenewPageReqVO pageReqVO) {
+        return oaRenewMapper.selectPage(pageReqVO);
+    }
+
+}

+ 12 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/resources/mapper/oa/renew/OaRenewMapper.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.renew.OaRenewMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 225 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/oa/renew/OaRenewServiceImplTest.java

@@ -0,0 +1,225 @@
+package cn.iocoder.yudao.module.bpm.service.oa.renew;
+
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.renew.vo.OaRenewSaveReqVO;
+import cn.iocoder.yudao.module.bpm.service.oa.renew.OaRenewServiceImpl;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import javax.annotation.Resource;
+
+import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.renew.OaRenewDO;
+import cn.iocoder.yudao.module.bpm.dal.mysql.oa.renew.OaRenewMapper;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+
+import org.springframework.context.annotation.Import;
+
+import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*;
+import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*;
+import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
+import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * {@link OaRenewServiceImpl} 的单元测试类
+ *
+ * @author dp
+ */
+@Import(OaRenewServiceImpl.class)
+public class OaRenewServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private OaRenewServiceImpl oaRenewService;
+
+    @Resource
+    private OaRenewMapper oaRenewMapper;
+
+    @Test
+    public void testCreateOaRenew_success() {
+        // 准备参数
+        OaRenewSaveReqVO createReqVO = randomPojo(OaRenewSaveReqVO.class).setId(null);
+
+        // 调用
+        Long oaRenewId = oaRenewService.createOaRenew(createReqVO);
+        // 断言
+        assertNotNull(oaRenewId);
+        // 校验记录的属性是否正确
+        OaRenewDO oaRenew = oaRenewMapper.selectById(oaRenewId);
+        assertPojoEquals(createReqVO, oaRenew, "id");
+    }
+
+    @Test
+    public void testUpdateOaRenew_success() {
+        // mock 数据
+        OaRenewDO dbOaRenew = randomPojo(OaRenewDO.class);
+        oaRenewMapper.insert(dbOaRenew);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        OaRenewSaveReqVO updateReqVO = randomPojo(OaRenewSaveReqVO.class, o -> {
+            o.setId(dbOaRenew.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        oaRenewService.updateOaRenew(updateReqVO);
+        // 校验是否更新正确
+        OaRenewDO oaRenew = oaRenewMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, oaRenew);
+    }
+
+    @Test
+    public void testUpdateOaRenew_notExists() {
+        // 准备参数
+        OaRenewSaveReqVO updateReqVO = randomPojo(OaRenewSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> oaRenewService.updateOaRenew(updateReqVO), OA_RENEW_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeleteOaRenew_success() {
+        // mock 数据
+        OaRenewDO dbOaRenew = randomPojo(OaRenewDO.class);
+        oaRenewMapper.insert(dbOaRenew);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbOaRenew.getId();
+
+        // 调用
+        oaRenewService.deleteOaRenew(id);
+       // 校验数据不存在了
+       assertNull(oaRenewMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeleteOaRenew_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> oaRenewService.deleteOaRenew(id), OA_RENEW_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetOaRenewPage() {
+       // mock 数据
+       OaRenewDO dbOaRenew = randomPojo(OaRenewDO.class, o -> { // 等会查询到
+           o.setRenewId(null);
+           o.setEmployeeId(null);
+           o.setEmployeeUuid(null);
+           o.setEmployeeName(null);
+           o.setUserId(null);
+           o.setUserUuid(null);
+           o.setDeptId(null);
+           o.setDeptUuid(null);
+           o.setPosition(null);
+           o.setOldContractStartDate(null);
+           o.setOldContractEndDate(null);
+           o.setRenewPeriod(null);
+           o.setRenewContractStartDate(null);
+           o.setRenewContractEndDate(null);
+           o.setRenewReason(null);
+           o.setWorkPerformance(null);
+           o.setRemarks(null);
+           o.setProcInstId(null);
+           o.setAuditStatus(null);
+           o.setCurrentAuditUserId(null);
+           o.setCurrentAuditUserUuid(null);
+           o.setCurrentAuditEmployeeId(null);
+           o.setCurrentAuditEmployeeUuid(null);
+           o.setFinalAuditDate(null);
+           o.setInfoSource(null);
+           o.setCreateTime(null);
+       });
+       oaRenewMapper.insert(dbOaRenew);
+       // 测试 renewId 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setRenewId(null)));
+       // 测试 employeeId 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setEmployeeId(null)));
+       // 测试 employeeUuid 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setEmployeeUuid(null)));
+       // 测试 employeeName 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setEmployeeName(null)));
+       // 测试 userId 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setUserId(null)));
+       // 测试 userUuid 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setUserUuid(null)));
+       // 测试 deptId 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setDeptId(null)));
+       // 测试 deptUuid 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setDeptUuid(null)));
+       // 测试 position 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setPosition(null)));
+       // 测试 oldContractStartDate 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setOldContractStartDate(null)));
+       // 测试 oldContractEndDate 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setOldContractEndDate(null)));
+       // 测试 renewPeriod 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setRenewPeriod(null)));
+       // 测试 renewContractStartDate 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setRenewContractStartDate(null)));
+       // 测试 renewContractEndDate 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setRenewContractEndDate(null)));
+       // 测试 renewReason 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setRenewReason(null)));
+       // 测试 workPerformance 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setWorkPerformance(null)));
+       // 测试 remarks 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setRemarks(null)));
+       // 测试 procInstId 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setProcInstId(null)));
+       // 测试 auditStatus 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setAuditStatus(null)));
+       // 测试 currentAuditUserId 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setCurrentAuditUserId(null)));
+       // 测试 currentAuditUserUuid 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setCurrentAuditUserUuid(null)));
+       // 测试 currentAuditEmployeeId 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setCurrentAuditEmployeeId(null)));
+       // 测试 currentAuditEmployeeUuid 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setCurrentAuditEmployeeUuid(null)));
+       // 测试 finalAuditDate 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setFinalAuditDate(null)));
+       // 测试 infoSource 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setInfoSource(null)));
+       // 测试 createTime 不匹配
+       oaRenewMapper.insert(cloneIgnoreId(dbOaRenew, o -> o.setCreateTime(null)));
+       // 准备参数
+       OaRenewPageReqVO reqVO = new OaRenewPageReqVO();
+       reqVO.setRenewId(null);
+       reqVO.setEmployeeId(null);
+       reqVO.setEmployeeUuid(null);
+       reqVO.setEmployeeName(null);
+       reqVO.setUserId(null);
+       reqVO.setUserUuid(null);
+       reqVO.setDeptId(null);
+       reqVO.setDeptUuid(null);
+       reqVO.setPosition(null);
+       reqVO.setOldContractStartDate(null);
+       reqVO.setOldContractEndDate(null);
+       reqVO.setRenewPeriod(null);
+       reqVO.setRenewContractStartDate(null);
+       reqVO.setRenewContractEndDate(null);
+       reqVO.setRenewReason(null);
+       reqVO.setWorkPerformance(null);
+       reqVO.setRemarks(null);
+       reqVO.setProcInstId(null);
+       reqVO.setAuditStatus(null);
+       reqVO.setCurrentAuditUserId(null);
+       reqVO.setCurrentAuditUserUuid(null);
+       reqVO.setCurrentAuditEmployeeId(null);
+       reqVO.setCurrentAuditEmployeeUuid(null);
+       reqVO.setFinalAuditDate(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+       reqVO.setInfoSource(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+
+       // 调用
+       PageResult<OaRenewDO> pageResult = oaRenewService.getOaRenewPage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbOaRenew, pageResult.getList().get(0));
+    }
+
+}

+ 3 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/clean.sql

@@ -2,4 +2,6 @@ DELETE FROM "bpm_form";
 DELETE FROM "bpm_user_group";
 DELETE FROM "bpm_category";
 -- 将该删表 SQL 语句,添加到 yudao-module-bpm-biz 模块的 test/resources/sql/clean.sql 文件里
-DELETE FROM "bpm_oa_conversion";
+DELETE FROM "bpm_oa_conversion";
+-- 将该删表 SQL 语句,添加到 yudao-module-bpm-biz 模块的 test/resources/sql/clean.sql 文件里
+DELETE FROM "bpm_oa_renew";

+ 38 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/create_tables.sql

@@ -75,4 +75,41 @@ CREATE TABLE IF NOT EXISTS "bpm_oa_conversion" (
     `deleted` int NOT NULL DEFAULT 0,
     "tenant_id" bigint NOT NULL default 0,
     PRIMARY KEY ("id")
-    ) COMMENT '转正流程信息表';
+    ) COMMENT '转正流程信息表';
+
+-- 将该建表 SQL 语句,添加到 yudao-module-bpm-biz 模块的 test/resources/sql/create_tables.sql 文件里
+CREATE TABLE IF NOT EXISTS "bpm_oa_renew" (
+    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+    "renew_id" varchar,
+    "employee_id" bigint,
+    "employee_uuid" varchar,
+    "employee_name" varchar,
+    "user_id" bigint,
+    "user_uuid" varchar,
+    "dept_id" bigint,
+    "dept_uuid" varchar,
+    "position" varchar,
+    "old_contract_start_date" varchar,
+    "old_contract_end_date" varchar,
+    "renew_period" varchar,
+    "renew_contract_start_date" varchar,
+    "renew_contract_end_date" varchar,
+    "renew_reason" varchar,
+    "work_performance" varchar,
+    "remarks" varchar,
+    "proc_inst_id" varchar,
+    "audit_status" varchar,
+    "current_audit_user_id" bigint,
+    "current_audit_user_uuid" varchar,
+    "current_audit_employee_id" bigint,
+    "current_audit_employee_uuid" varchar,
+    "final_audit_date" varchar,
+    "info_source" varchar,
+    "creator" varchar DEFAULT '',
+    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    "updater" varchar DEFAULT '',
+    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+    `deleted` int NOT NULL DEFAULT 0,
+    "tenant_id" bigint NOT NULL default 0,
+    PRIMARY KEY ("id")
+    ) COMMENT '合同续签流程信息表';