feat(bpm): 新增名片定制和招聘申请功能
- 添加名片定制和招聘申请相关的控制器、服务、DAO和DTO - 实现名片定制和招聘申请的创建、查询和更新功能 -集成工作流引擎,支持名片定制和招聘申请的流程管理- 新增错误码和关联流程VO
This commit is contained in:
parent
f8caf631b8
commit
33eb8af885
@ -39,6 +39,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode OA_SALARY_NOT_EXISTS = new ErrorCode(1_009_001_113, "薪资付款申请不存在");
|
||||
ErrorCode OA_ASSET_NOT_EXISTS = new ErrorCode(1_009_001_114, "资产申领不存在");
|
||||
ErrorCode OA_PETITION_NOT_EXISTS = new ErrorCode(1_009_001_115, "签呈申请不存在");
|
||||
ErrorCode OA_BUSINESS_CARD_NOT_EXISTS = new ErrorCode(1_009_001_116, "名片定制申请不存在");
|
||||
ErrorCode OA_HIRE_NOT_EXISTS = new ErrorCode(1_009_001_117, "招聘申请不存在");
|
||||
|
||||
// ========== 流程模型 1-009-002-000 ==========
|
||||
ErrorCode MODEL_KEY_EXISTS = new ErrorCode(1_009_002_000, "已经存在流程标识为【{}】的流程");
|
||||
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.businessCard.BpmOABusinessCardCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.businessCard.BpmOABusinessCardRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOABusinessCardDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOABusinessCardService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
/**
|
||||
* OA 名片定制 Controller
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Tag(name = "管理后台 - OA 名片定制")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/oa/business-card")
|
||||
@Validated
|
||||
public class BpmOABusinessCardController {
|
||||
|
||||
@Resource
|
||||
private BpmOABusinessCardService bpmOABusinessCardService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createBusinessCard(@Valid @RequestBody BpmOABusinessCardCreateReqVO createReqVO) {
|
||||
|
||||
return success(bpmOABusinessCardService.createBusinessCard(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得名片定制申请")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOABusinessCardRespVO> getBusinessCard(@RequestParam("id") Long id) {
|
||||
|
||||
BpmOABusinessCardDO bpmOABusinessCardDO = bpmOABusinessCardService.getBusinessCard(id);
|
||||
|
||||
return success(BeanUtils.toBean(bpmOABusinessCardDO, BpmOABusinessCardRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@Operation(summary = "获得名片定制申请")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOABusinessCardRespVO> getCashByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
|
||||
BpmOABusinessCardDO bpmOABusinessCardDO = bpmOABusinessCardService.getByProcessInstanceId(processInstanceId);
|
||||
|
||||
return success(BeanUtils.toBean(bpmOABusinessCardDO, BpmOABusinessCardRespVO.class));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.hire.BpmOAHireCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.hire.BpmOAHireRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAHireDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAHireService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
/**
|
||||
* OA 招聘申请 Controller
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Tag(name = "管理后台 - OA 招聘申请")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/oa/hire")
|
||||
@Validated
|
||||
public class BpmOAHireController {
|
||||
|
||||
@Resource
|
||||
private BpmOAHireService bpmOAHireService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createHire(@Valid @RequestBody BpmOAHireCreateReqVO createReqVO) {
|
||||
|
||||
return success(bpmOAHireService.createHire(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得招聘申请")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOAHireRespVO> getHire(@RequestParam("id") Long id) {
|
||||
|
||||
BpmOAHireDO bpmOAHireDO = bpmOAHireService.getHire(id);
|
||||
|
||||
return success(BeanUtils.toBean(bpmOAHireDO, BpmOAHireRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@Operation(summary = "获得招聘申请")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOAHireRespVO> getCashByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
|
||||
BpmOAHireDO bpmOAHireDO = bpmOAHireService.getByProcessInstanceId(processInstanceId);
|
||||
|
||||
return success(BeanUtils.toBean(bpmOAHireDO, BpmOAHireRespVO.class));
|
||||
}
|
||||
}
|
@ -58,4 +58,5 @@ public class BpmOAPetitionController {
|
||||
|
||||
return success(BeanUtils.toBean(petitionDO, BpmOAPetitionRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.businessCard;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 现金支出 创建 Request VO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 名片定制 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOABusinessCardCreateReqVO {
|
||||
|
||||
@Schema(description = "中文名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "中文名不能为空")
|
||||
private String chineseName;
|
||||
|
||||
@Schema(description = "英文名")
|
||||
private String englishName;
|
||||
|
||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "公司名称不能为空")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
@Schema(description = "电话号码")
|
||||
private String phoneNumber;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.businessCard;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 名片定制 请求Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOABusinessCardRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "中文名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "中文名不能为空")
|
||||
private String chineseName;
|
||||
|
||||
@Schema(description = "英文名")
|
||||
private String englishName;
|
||||
|
||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "公司名称不能为空")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
@Schema(description = "电话号码")
|
||||
private String phoneNumber;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.hire;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 备用金申请 创建 Request VO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 备用金申请创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOAHireCreateReqVO {
|
||||
|
||||
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请事由不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "需求部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "需求部门编号不能为空")
|
||||
private Long demandDeptId;
|
||||
|
||||
@Schema(description = "需求岗位编号")
|
||||
@NotNull(message = "需求岗位编号不能为空")
|
||||
private Long demandPositionId;
|
||||
|
||||
@Schema(description = "招聘性质 | 字典值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.hire;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 名片定制 请求Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOAHireRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请事由不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "需求部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "需求部门编号不能为空")
|
||||
private Long demandDeptId;
|
||||
|
||||
@Schema(description = "需求岗位编号")
|
||||
@NotNull(message = "需求岗位编号不能为空")
|
||||
private Long demandPositionId;
|
||||
|
||||
@Schema(description = "招聘性质 | 字典值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -1,15 +1,31 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.petition;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import liquibase.pro.packaged.L;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "关联流程 VO")
|
||||
@Data
|
||||
public class AssociationVO {
|
||||
|
||||
@Schema(description = "id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "流程名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
@Schema(description = "提交时间")
|
||||
private Long createTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private Long endTime;
|
||||
|
||||
@Schema(description = "明细")
|
||||
private String detailInfo;
|
||||
}
|
||||
|
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OA 名片定制 DO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@TableName(value ="bpm_oa_business_card", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOABusinessCardDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 出差表单主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
* 关联 AdminUserDO 的 id 属性
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 中文名
|
||||
*/
|
||||
private String chineseName;
|
||||
|
||||
/**
|
||||
* 英文名
|
||||
*/
|
||||
private String englishName;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 名片数量
|
||||
*/
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 申请的结果
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||
*/
|
||||
private Integer result;
|
||||
|
||||
/**
|
||||
* 对应的流程编号
|
||||
* 关联 ProcessInstance 的 id 属性
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 附件基本信息
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OA 招聘申请 DO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@TableName(value ="bpm_oa_hire", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOAHireDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 招聘表单主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
* 关联 AdminUserDO 的 id 属性
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 申请事由
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 需求部门编号
|
||||
*/
|
||||
private Long demandDeptId;
|
||||
|
||||
/**
|
||||
* 需求岗位编号
|
||||
*/
|
||||
private Long demandPositionId;
|
||||
|
||||
/**
|
||||
* 招聘性质
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 拟聘数量
|
||||
*/
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 到岗时间
|
||||
*/
|
||||
private LocalDate arrivalDate;
|
||||
|
||||
/**
|
||||
* 岗位职责
|
||||
*/
|
||||
private String jobResponsibilities;
|
||||
|
||||
/**
|
||||
* 任职要求
|
||||
*/
|
||||
private String jobRequirements;
|
||||
|
||||
/**
|
||||
* 申请的结果
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||
*/
|
||||
private Integer result;
|
||||
|
||||
/**
|
||||
* 对应的流程编号
|
||||
* 关联 ProcessInstance 的 id 属性
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 附件基本信息
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOABusinessCardDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BpmOABusinessCardMapper extends BaseMapperX<BpmOABusinessCardDO> {
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAHireDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BpmOAHireMapper extends BaseMapperX<BpmOAHireDO> {
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.businessCard.BpmOABusinessCardCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOABusinessCardDO;
|
||||
|
||||
public interface BpmOABusinessCardService {
|
||||
|
||||
/**
|
||||
* 创建名片定制
|
||||
* @param userId 用户id
|
||||
* @param createReqVO 创建信息
|
||||
* @return 名片id
|
||||
*/
|
||||
Long createBusinessCard(Long userId, BpmOABusinessCardCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 获得名片定制
|
||||
* @param id 编号
|
||||
* @return 名片定制详情
|
||||
*/
|
||||
BpmOABusinessCardDO getBusinessCard(Long id);
|
||||
|
||||
/**
|
||||
* 获得名片定制
|
||||
* @param processInstanceId 流程实例编号
|
||||
* @return 名片定制详情
|
||||
*/
|
||||
BpmOABusinessCardDO getByProcessInstanceId(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 更新名片定制申请的状态
|
||||
*
|
||||
* @param id 编号
|
||||
* @param result 结果
|
||||
*/
|
||||
void updateBusinessCardResult(Long id, Integer result);
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.businessCard.BpmOABusinessCardCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOABusinessCardDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOABusinessCardMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_BUSINESS_CARD_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* OA 名片定制 Service 实现类
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BpmOABusinessCardServiceImpl extends BpmOABaseService implements BpmOABusinessCardService{
|
||||
|
||||
/**
|
||||
* OA 名片定制对应的流程定义 KEY
|
||||
*/
|
||||
public static final String PROCESS_KEY = "oa_business_card_2";
|
||||
|
||||
@Resource
|
||||
private BpmOABusinessCardMapper bpmOABusinessCardMapper;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
@Resource
|
||||
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
||||
|
||||
@Override
|
||||
public Long createBusinessCard(Long userId, BpmOABusinessCardCreateReqVO createReqVO) {
|
||||
|
||||
//插入OA 名片定制申请
|
||||
BpmOABusinessCardDO bpmOABusinessCardDO = BeanUtils.toBean(createReqVO, BpmOABusinessCardDO.class)
|
||||
.setUserId(userId)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
bpmOABusinessCardMapper.insert(bpmOABusinessCardDO);
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(bpmOABusinessCardDO.getId())));
|
||||
|
||||
// 将工作流的编号,更新到 OA 现金支出单中
|
||||
bpmOABusinessCardMapper.updateById(new BpmOABusinessCardDO()
|
||||
.setId(bpmOABusinessCardDO.getId())
|
||||
.setProcessInstanceId(processInstanceId));
|
||||
|
||||
// 判断是否为重新发起的流程
|
||||
if (createReqVO.getProcessInstanceId() != null && createReqVO.getResult() == 3) {
|
||||
|
||||
historyProcessInstanceService.createHistoryProcessInstance(processInstanceId, createReqVO.getProcessInstanceId());
|
||||
}
|
||||
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems();
|
||||
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||
if (fileItems != null && !fileItems.isEmpty()) {
|
||||
uploadBpmFileProcessInstanceId(processInstanceId, fileItems);
|
||||
}
|
||||
return bpmOABusinessCardDO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOABusinessCardDO getBusinessCard(Long id) {
|
||||
return bpmOABusinessCardMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOABusinessCardDO getByProcessInstanceId(String processInstanceId) {
|
||||
return bpmOABusinessCardMapper.selectOne(BpmOABusinessCardDO::getProcessInstanceId, processInstanceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBusinessCardResult(Long id, Integer result) {
|
||||
|
||||
validateLeaveExists(id);
|
||||
bpmOABusinessCardMapper.updateById(new BpmOABusinessCardDO().setId(id).setResult(result));
|
||||
}
|
||||
|
||||
private void validateLeaveExists(Long id) {
|
||||
if (bpmOABusinessCardMapper.selectById(id) == null) {
|
||||
throw exception(OA_BUSINESS_CARD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.hire.BpmOAHireCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAHireDO;
|
||||
|
||||
public interface BpmOAHireService {
|
||||
|
||||
/**
|
||||
* 创建名片定制
|
||||
* @param userId 用户id
|
||||
* @param createReqVO 创建信息
|
||||
* @return 名片id
|
||||
*/
|
||||
Long createHire(Long userId, BpmOAHireCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 获得名片定制
|
||||
* @param id 编号
|
||||
* @return 名片定制详情
|
||||
*/
|
||||
BpmOAHireDO getHire(Long id);
|
||||
|
||||
/**
|
||||
* 获得名片定制
|
||||
* @param processInstanceId 流程实例编号
|
||||
* @return 名片定制详情
|
||||
*/
|
||||
BpmOAHireDO getByProcessInstanceId(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 更新名片定制申请的状态
|
||||
*
|
||||
* @param id 编号
|
||||
* @param result 结果
|
||||
*/
|
||||
void updateHireResult(Long id, Integer result);
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.hire.BpmOAHireCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAHireDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAHireMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_HIRE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* OA 招聘申请 Service 实现类
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BpmOAHireServiceImpl extends BpmOABaseService implements BpmOAHireService{
|
||||
|
||||
/**
|
||||
* OA 招聘申请对应的流程定义 KEY
|
||||
*/
|
||||
public static final String PROCESS_KEY = "oa_hire_2";
|
||||
|
||||
@Resource
|
||||
private BpmOAHireMapper bpmOAHireMapper;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
@Resource
|
||||
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
||||
|
||||
@Override
|
||||
public Long createHire(Long userId, BpmOAHireCreateReqVO createReqVO) {
|
||||
|
||||
//插入OA 招聘申请
|
||||
BpmOAHireDO bpmOAHireDO = BeanUtils.toBean(createReqVO, BpmOAHireDO.class)
|
||||
.setUserId(userId)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
bpmOAHireMapper.insert(bpmOAHireDO);
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(bpmOAHireDO.getId())));
|
||||
|
||||
// 将工作流的编号,更新到 OA 招聘申请中
|
||||
bpmOAHireMapper.updateById(new BpmOAHireDO()
|
||||
.setId(bpmOAHireDO.getId())
|
||||
.setProcessInstanceId(processInstanceId));
|
||||
|
||||
// 判断是否为重新发起的流程
|
||||
if (createReqVO.getProcessInstanceId() != null && createReqVO.getResult() == 3) {
|
||||
|
||||
historyProcessInstanceService.createHistoryProcessInstance(processInstanceId, createReqVO.getProcessInstanceId());
|
||||
}
|
||||
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems();
|
||||
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||
if (fileItems != null && !fileItems.isEmpty()) {
|
||||
uploadBpmFileProcessInstanceId(processInstanceId, fileItems);
|
||||
}
|
||||
return bpmOAHireDO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOAHireDO getHire(Long id) {
|
||||
|
||||
return bpmOAHireMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOAHireDO getByProcessInstanceId(String processInstanceId) {
|
||||
|
||||
return bpmOAHireMapper.selectOne(BpmOAHireDO::getProcessInstanceId, processInstanceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHireResult(Long id, Integer result) {
|
||||
|
||||
validateLeaveExists(id);
|
||||
}
|
||||
|
||||
private void validateLeaveExists(Long id) {
|
||||
if (bpmOAHireMapper.selectById(id) == null) {
|
||||
throw exception(OA_HIRE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa.listener;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOABusinessCardService;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOABusinessCardServiceImpl;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashService;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashServiceImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* OA 名片定制的结果的监听器实现类
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Component
|
||||
public class BpmOABusinessCardResultListener extends BpmProcessInstanceResultEventListener {
|
||||
@Resource
|
||||
private BpmOABusinessCardService businessCardService;
|
||||
|
||||
@Override
|
||||
protected String getProcessDefinitionKey() {
|
||||
|
||||
return BpmOABusinessCardServiceImpl.PROCESS_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||
|
||||
businessCardService.updateBusinessCardResult(Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||
}
|
||||
}
|
@ -115,18 +115,6 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
@Resource
|
||||
private BpmProcessInstanceExtMapper processInstanceExtMapper;
|
||||
|
||||
@Resource
|
||||
private BpmOAEntryService bpmOAEntryService;
|
||||
|
||||
@Resource
|
||||
private BpmOASealService bpmOASealService;
|
||||
|
||||
@Resource
|
||||
private BpmOASalaryService bpmOASalaryService;
|
||||
|
||||
@Resource
|
||||
private BpmOARegularService bpmOARegularService;
|
||||
|
||||
@Override
|
||||
public PageResult<BpmTaskCCPageItemRespVO> getCCTaskPage(Long userId, BpmTaskDonePageReqVO pageVO) {
|
||||
// 查询被抄送的Task
|
||||
|
Loading…
Reference in New Issue
Block a user