Browse Source

1、出差流程代码生成

dongpo 1 year ago
parent
commit
af492089e6

+ 3 - 1
yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java

@@ -99,8 +99,10 @@ public interface ErrorCodeConstants {
     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 ==========
     // ========== 离职流程信息 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 ==========
+    // ========== 请假流程信息 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, "出差流程信息不存在");
 
 
 
 
     // ========== 员工信息 1_009_018_000 ==========
     // ========== 员工信息 1_009_018_000 ==========

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

@@ -0,0 +1,96 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.business;
+
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo.OaBusinessPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo.OaBusinessRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo.OaBusinessSaveReqVO;
+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.business.OaBusinessDO;
+import cn.iocoder.yudao.module.bpm.service.oa.business.OaBusinessService;
+
+@Tag(name = "管理后台 - 出差流程信息")
+@RestController
+@RequestMapping("/bpm/oa-business")
+@Validated
+public class OaBusinessController {
+
+    @Resource
+    private OaBusinessService oaBusinessService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建出差流程信息")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-business:create')")
+    public CommonResult<Long> createOaBusiness(@Valid @RequestBody OaBusinessSaveReqVO createReqVO) {
+        return success(oaBusinessService.createOaBusiness(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新出差流程信息")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-business:update')")
+    public CommonResult<Boolean> updateOaBusiness(@Valid @RequestBody OaBusinessSaveReqVO updateReqVO) {
+        oaBusinessService.updateOaBusiness(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除出差流程信息")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('bpm:oa-business:delete')")
+    public CommonResult<Boolean> deleteOaBusiness(@RequestParam("id") Long id) {
+        oaBusinessService.deleteOaBusiness(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得出差流程信息")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-business:query')")
+    public CommonResult<OaBusinessRespVO> getOaBusiness(@RequestParam("id") Long id) {
+        OaBusinessDO oaBusiness = oaBusinessService.getOaBusiness(id);
+        return success(BeanUtils.toBean(oaBusiness, OaBusinessRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得出差流程信息分页")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-business:query')")
+    public CommonResult<PageResult<OaBusinessRespVO>> getOaBusinessPage(@Valid OaBusinessPageReqVO pageReqVO) {
+        PageResult<OaBusinessDO> pageResult = oaBusinessService.getOaBusinessPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, OaBusinessRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出出差流程信息 Excel")
+    @PreAuthorize("@ss.hasPermission('bpm:oa-business:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportOaBusinessExcel(@Valid OaBusinessPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<OaBusinessDO> list = oaBusinessService.getOaBusinessPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "出差流程信息.xls", "数据", OaBusinessRespVO.class,
+                        BeanUtils.toBean(list, OaBusinessRespVO.class));
+    }
+
+}

+ 98 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/business/vo/OaBusinessPageReqVO.java

@@ -0,0 +1,98 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import java.math.BigDecimal;
+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 OaBusinessPageReqVO extends PageParam {
+
+    @Schema(description = "出差表单主键", example = "1")
+    private Long id;
+
+    @Schema(description = "uuid", example = "7614")
+    private String businessId;
+
+    @Schema(description = "出差人id", example = "1")
+    private Long employeeId;
+
+    @Schema(description = "出差员工姓名", example = "赵六")
+    private String employeeName;
+
+    @Schema(description = "出差员工手机号")
+    private String employeePhone;
+
+    @Schema(description = "用户账号id", example = "13581")
+    private Long userId;
+
+    @Schema(description = "部门id", example = "708")
+    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 = "出差天数(d)")
+    private String day;
+
+    @Schema(description = "出差预算费用,单位(元)")
+    private BigDecimal estimatedCost;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "流程实例id", example = "30698")
+    private String procInstId;
+
+    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回、6已撤回)", example = "1")
+    private String auditStatus;
+
+    @Schema(description = "当前审核人员工id", example = "1086")
+    private Long currentAuditEmployeeId;
+
+    @Schema(description = "当前审核人员工姓名", example = "芋艿")
+    private String currentAuditEmployeeName;
+
+    @Schema(description = "当前审核人用户id", example = "12947")
+    private Long currentAuditUserId;
+
+    @Schema(description = "最后审核时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] finalAuditDate;
+
+    @Schema(description = "发起人选择的审批人")
+    private String startUserSelectAssignees;
+
+    @Schema(description = "申请人员工id", example = "12667")
+    private Long applyEmployeeId;
+
+    @Schema(description = "申请人员工姓名", example = "芋艿")
+    private String applyEmployeeName;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 89 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/business/vo/OaBusinessRespVO.java

@@ -0,0 +1,89 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 出差流程信息 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class OaBusinessRespVO {
+
+    @Schema(description = "出差表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("出差表单主键")
+    private Long id;
+
+    @Schema(description = "出差人id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("出差人id")
+    private Long employeeId;
+
+    @Schema(description = "出差员工姓名", example = "赵六")
+    @ExcelProperty("出差员工姓名")
+    private String employeeName;
+
+    @Schema(description = "出差员工手机号")
+    @ExcelProperty("出差员工手机号")
+    private String employeePhone;
+
+    @Schema(description = "用户账号id", example = "13581")
+    @ExcelProperty("用户账号id")
+    private Long userId;
+
+    @Schema(description = "部门id", example = "708")
+    @ExcelProperty("部门id")
+    private Long deptId;
+
+    @Schema(description = "职位")
+    @ExcelProperty("职位")
+    private String position;
+
+    @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 = "出差天数(d)")
+    @ExcelProperty("出差天数(d)")
+    private String day;
+
+    @Schema(description = "出差预算费用,单位(元)", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("出差预算费用,单位(元)")
+    private BigDecimal estimatedCost;
+
+    @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回、6已撤回)", example = "1")
+    @ExcelProperty("审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回、6已撤回)")
+    private String auditStatus;
+
+    @Schema(description = "当前审核人员工姓名", example = "芋艿")
+    @ExcelProperty("当前审核人员工姓名")
+    private String currentAuditEmployeeName;
+
+    @Schema(description = "最后审核时间")
+    @ExcelProperty("最后审核时间")
+    private LocalDateTime finalAuditDate;
+
+    @Schema(description = "发起人选择的审批人", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("发起人选择的审批人")
+    private String startUserSelectAssignees;
+
+    @Schema(description = "申请人员工姓名", example = "芋艿")
+    @ExcelProperty("申请人员工姓名")
+    private String applyEmployeeName;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 51 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/business/vo/OaBusinessSaveReqVO.java

@@ -0,0 +1,51 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 出差流程信息新增/修改 Request VO")
+@Data
+public class OaBusinessSaveReqVO {
+
+    @Schema(description = "出差表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    private Long id;
+
+    @Schema(description = "出差人id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @NotNull(message = "出差人id不能为空")
+    private Long employeeId;
+
+    @Schema(description = "出差事由", requiredMode = Schema.RequiredMode.REQUIRED, example = "不香")
+    @NotEmpty(message = "出差事由不能为空")
+    private String reason;
+
+    @Schema(description = "出差目的地", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "出差目的地不能为空")
+    private String destination;
+
+    @Schema(description = "出差开始日期", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "出差开始日期不能为空")
+    private String startDate;
+
+    @Schema(description = "出差结束日期", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "出差结束日期不能为空")
+    private String endDate;
+
+    @Schema(description = "出差天数(d)")
+    private String day;
+
+    @Schema(description = "出差预算费用,单位(元)", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "出差预算费用,单位(元)不能为空")
+    private BigDecimal estimatedCost;
+
+    @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "备注不能为空")
+    private String remarks;
+
+    @Schema(description = "发起人选择的审批人", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "发起人选择的审批人不能为空")
+    private String startUserSelectAssignees;
+
+}

+ 149 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/business/OaBusinessDO.java

@@ -0,0 +1,149 @@
+package cn.iocoder.yudao.module.bpm.dal.dataobject.oa.business;
+
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+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_business")
+@KeySequence("bpm_oa_business_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class OaBusinessDO extends BaseDO {
+
+    /**
+     * 出差表单主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * uuid
+     */
+    private String businessId;
+    /**
+     * 出差人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;
+    /**
+     * 出差天数(d)
+     */
+    private String day;
+    /**
+     * 出差预算费用,单位(元)
+     */
+    private BigDecimal estimatedCost;
+    /**
+     * 备注
+     */
+    private String remarks;
+    /**
+     * 流程实例id
+     */
+    private String procInstId;
+    /**
+     * 审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5已驳回、6已撤回)
+     */
+    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;
+
+}

+ 48 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/business/OaBusinessMapper.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.bpm.dal.mysql.oa.business;
+
+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.business.vo.OaBusinessPageReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.business.OaBusinessDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 出差流程信息 Mapper
+ *
+ * @author dp
+ */
+@Mapper
+public interface OaBusinessMapper extends BaseMapperX<OaBusinessDO> {
+
+    default PageResult<OaBusinessDO> selectPage(OaBusinessPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<OaBusinessDO>()
+                .eqIfPresent(OaBusinessDO::getId, reqVO.getId())
+                .eqIfPresent(OaBusinessDO::getBusinessId, reqVO.getBusinessId())
+                .eqIfPresent(OaBusinessDO::getEmployeeId, reqVO.getEmployeeId())
+                .likeIfPresent(OaBusinessDO::getEmployeeName, reqVO.getEmployeeName())
+                .eqIfPresent(OaBusinessDO::getEmployeePhone, reqVO.getEmployeePhone())
+                .eqIfPresent(OaBusinessDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(OaBusinessDO::getDeptId, reqVO.getDeptId())
+                .eqIfPresent(OaBusinessDO::getPosition, reqVO.getPosition())
+                .eqIfPresent(OaBusinessDO::getReason, reqVO.getReason())
+                .eqIfPresent(OaBusinessDO::getDestination, reqVO.getDestination())
+                .betweenIfPresent(OaBusinessDO::getStartDate, reqVO.getStartDate())
+                .betweenIfPresent(OaBusinessDO::getEndDate, reqVO.getEndDate())
+                .eqIfPresent(OaBusinessDO::getDay, reqVO.getDay())
+                .eqIfPresent(OaBusinessDO::getEstimatedCost, reqVO.getEstimatedCost())
+                .eqIfPresent(OaBusinessDO::getRemarks, reqVO.getRemarks())
+                .eqIfPresent(OaBusinessDO::getProcInstId, reqVO.getProcInstId())
+                .eqIfPresent(OaBusinessDO::getAuditStatus, reqVO.getAuditStatus())
+                .eqIfPresent(OaBusinessDO::getCurrentAuditEmployeeId, reqVO.getCurrentAuditEmployeeId())
+                .likeIfPresent(OaBusinessDO::getCurrentAuditEmployeeName, reqVO.getCurrentAuditEmployeeName())
+                .eqIfPresent(OaBusinessDO::getCurrentAuditUserId, reqVO.getCurrentAuditUserId())
+                .betweenIfPresent(OaBusinessDO::getFinalAuditDate, reqVO.getFinalAuditDate())
+                .eqIfPresent(OaBusinessDO::getStartUserSelectAssignees, reqVO.getStartUserSelectAssignees())
+                .eqIfPresent(OaBusinessDO::getApplyEmployeeId, reqVO.getApplyEmployeeId())
+                .likeIfPresent(OaBusinessDO::getApplyEmployeeName, reqVO.getApplyEmployeeName())
+                .betweenIfPresent(OaBusinessDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(OaBusinessDO::getId));
+    }
+
+}

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

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.bpm.service.oa.business;
+
+import javax.validation.*;
+
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo.OaBusinessPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo.OaBusinessSaveReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.business.OaBusinessDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+
+/**
+ * 出差流程信息 Service 接口
+ *
+ * @author dp
+ */
+public interface OaBusinessService {
+
+    /**
+     * 创建出差流程信息
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createOaBusiness(@Valid OaBusinessSaveReqVO createReqVO);
+
+    /**
+     * 更新出差流程信息
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateOaBusiness(@Valid OaBusinessSaveReqVO updateReqVO);
+
+    /**
+     * 删除出差流程信息
+     *
+     * @param id 编号
+     */
+    void deleteOaBusiness(Long id);
+
+    /**
+     * 获得出差流程信息
+     *
+     * @param id 编号
+     * @return 出差流程信息
+     */
+    OaBusinessDO getOaBusiness(Long id);
+
+    /**
+     * 获得出差流程信息分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 出差流程信息分页
+     */
+    PageResult<OaBusinessDO> getOaBusinessPage(OaBusinessPageReqVO pageReqVO);
+
+}

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

@@ -0,0 +1,72 @@
+package cn.iocoder.yudao.module.bpm.service.oa.business;
+
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo.OaBusinessPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo.OaBusinessSaveReqVO;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.business.OaBusinessDO;
+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.business.OaBusinessMapper;
+
+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 OaBusinessServiceImpl implements OaBusinessService {
+
+    @Resource
+    private OaBusinessMapper oaBusinessMapper;
+
+    @Override
+    public Long createOaBusiness(OaBusinessSaveReqVO createReqVO) {
+        // 插入
+        OaBusinessDO oaBusiness = BeanUtils.toBean(createReqVO, OaBusinessDO.class);
+        oaBusinessMapper.insert(oaBusiness);
+        // 返回
+        return oaBusiness.getId();
+    }
+
+    @Override
+    public void updateOaBusiness(OaBusinessSaveReqVO updateReqVO) {
+        // 校验存在
+        validateOaBusinessExists(updateReqVO.getId());
+        // 更新
+        OaBusinessDO updateObj = BeanUtils.toBean(updateReqVO, OaBusinessDO.class);
+        oaBusinessMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteOaBusiness(Long id) {
+        // 校验存在
+        validateOaBusinessExists(id);
+        // 删除
+        oaBusinessMapper.deleteById(id);
+    }
+
+    private void validateOaBusinessExists(Long id) {
+        if (oaBusinessMapper.selectById(id) == null) {
+            throw exception(OA_BUSINESS_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public OaBusinessDO getOaBusiness(Long id) {
+        return oaBusinessMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<OaBusinessDO> getOaBusinessPage(OaBusinessPageReqVO pageReqVO) {
+        return oaBusinessMapper.selectPage(pageReqVO);
+    }
+
+}

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