Browse Source

1、入职添加申请人名字

dongpo 1 year ago
parent
commit
c628c0ae6f

+ 0 - 32
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/entry/vo/OaEntryPageReqVO.java

@@ -14,9 +14,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
 @ToString(callSuper = true)
 public class OaEntryPageReqVO extends PageParam {
 
-    @Schema(description = "uuid", example = "13471")
-    private String entryId;
-
     @Schema(description = "入职人", example = "李四")
     private String entryName;
 
@@ -32,47 +29,18 @@ public class OaEntryPageReqVO extends PageParam {
     @Schema(description = "性别")
     private String gender;
 
-    @Schema(description = "出生日期")
-    private String birthday;
-
     @Schema(description = "联系电话")
     private String contactNumber;
 
-    @Schema(description = "电子邮箱")
-    private String email;
-
-    @Schema(description = "教育背景")
-    private String education;
-
-    @Schema(description = "工作经验")
-    private String workExperience;
-
     @Schema(description = "入职日期")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private String[] entryDate;
 
-    @Schema(description = "备注")
-    private String remarks;
-
-    @Schema(description = "最后审核时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private String[] finalAuditDate;
-
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
-
-    @Schema(description = "流程实例id", example = "9407")
-    private String procInstId;
-
     @Schema(description = "审核状态(0暂存、1已提交、2审核中、3已审核、4已关闭、5驳回)", example = "2")
     private String auditStatus;
 
-    @Schema(description = "当前审核人编号", example = "29870")
-    private String currentAuditEmployeeId;
-
-    @Schema(description = "数据来源,0流程添加、1手动添加")
-    private String infoSource;
-
 }

+ 8 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/entry/vo/OaEntryRespVO.java

@@ -114,6 +114,14 @@ public class OaEntryRespVO {
     @ExcelProperty("数据来源,0流程添加、1手动添加")
     private String infoSource;
 
+    @Schema(description = "申请人id")
+    @ExcelProperty("申请人id")
+    private Long applyEmployeeId;
+
+    @Schema(description = "申请人姓名")
+    @ExcelProperty("申请人姓名")
+    private String applyEmployeeName;
+
     @Schema(description = "创建者")
     @ExcelProperty("创建者")
     private String creator;

+ 4 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/entry/vo/OaEntrySaveReqVO.java

@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
 import java.util.List;
 
 @Schema(description = "管理后台 - 入职流程信息新增/修改 Request VO")
@@ -59,10 +60,11 @@ public class OaEntrySaveReqVO {
     @NotBlank(message = "入职日期不能为空")
     private String entryDate;
 
-    @Schema(description = "发起人自选审批人 Map", example = " [100, 1]")
+    @Schema(description = "发起人自选审批人", example = " [100, 1]")
+    @NotEmpty(message = "发起人自选审批人不能为空")
     private List<Long> startUserSelectAssignees;
 
-    @Schema(description = "附件主键id", example = "[1, 2]")
+    @Schema(description = "附件", example = "[1, 2]")
     private List<Long> fileIdList;
 
 }

+ 10 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/entry/OaEntryDO.java

@@ -1,9 +1,11 @@
 package cn.iocoder.yudao.module.bpm.dal.dataobject.oa.entry;
 
 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotation.KeySequence;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 
 import java.time.LocalDateTime;
@@ -110,6 +112,14 @@ public class OaEntryDO extends BaseDO {
      * 当前审核人员工uuid
      */
     private String currentAuditEmployeeUuid;
+    /**
+     * 申请人员工id
+     */
+    private Long applyEmployeeId;
+    /**
+     * 申请人员工姓名
+     */
+    private String applyEmployeeName;
     /**
      * 申请人选择的审批人
      */

+ 1 - 11
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/entry/OaEntryMapper.java

@@ -17,25 +17,15 @@ public interface OaEntryMapper extends BaseMapperX<OaEntryDO> {
 
     default PageResult<OaEntryDO> selectPage(OaEntryPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<OaEntryDO>()
-                .eqIfPresent(OaEntryDO::getEntryId, reqVO.getEntryId())
+                .likeIfPresent(OaEntryDO::getEntryName, reqVO.getEntryName())
                 .eqIfPresent(OaEntryDO::getDeptId, reqVO.getDeptId())
                 .eqIfPresent(OaEntryDO::getPosition, reqVO.getPosition())
                 .eqIfPresent(OaEntryDO::getEmployeeType, reqVO.getEmployeeType())
                 .eqIfPresent(OaEntryDO::getGender, reqVO.getGender())
-                .eqIfPresent(OaEntryDO::getBirthday, reqVO.getBirthday())
                 .eqIfPresent(OaEntryDO::getContactNumber, reqVO.getContactNumber())
-                .eqIfPresent(OaEntryDO::getEmail, reqVO.getEmail())
-                .eqIfPresent(OaEntryDO::getEducation, reqVO.getEducation())
-                .eqIfPresent(OaEntryDO::getWorkExperience, reqVO.getWorkExperience())
-                .eqIfPresent(OaEntryDO::getRemarks, reqVO.getRemarks())
-                .betweenIfPresent(OaEntryDO::getFinalAuditDate, reqVO.getFinalAuditDate())
                 .betweenIfPresent(OaEntryDO::getCreateTime, reqVO.getCreateTime())
-                .likeIfPresent(OaEntryDO::getEntryName, reqVO.getEntryName())
                 .betweenIfPresent(OaEntryDO::getEntryDate, reqVO.getEntryDate())
-                .eqIfPresent(OaEntryDO::getProcInstId, reqVO.getProcInstId())
                 .eqIfPresent(OaEntryDO::getAuditStatus, reqVO.getAuditStatus())
-                .eqIfPresent(OaEntryDO::getCurrentAuditEmployeeId, reqVO.getCurrentAuditEmployeeId())
-                .eqIfPresent(OaEntryDO::getInfoSource, reqVO.getInfoSource())
                 .orderByDesc(OaEntryDO::getId));
     }
 

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

@@ -30,6 +30,7 @@ import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
 import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import liquibase.pro.packaged.L;
 import org.apache.commons.lang3.StringUtils;
 import org.flowable.engine.TaskService;
 import org.flowable.task.api.Task;
@@ -88,7 +89,7 @@ public class OaEntryServiceImpl implements OaEntryService {
         AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
         Objects.requireNonNull(loginUser, "登录用户不能为空");
         // TODO DP 根据登录人查询出对应的员工信息
-
+        AdminUserRespDTO applyEmployee = loginUser;
         OaEntryDO oaEntry = BeanUtils.toBean(stagingReqVO, OaEntryDO.class);
         if (StringUtils.isBlank(oaEntry.getEntryId())) {
             // 创建单据uuid
@@ -97,6 +98,8 @@ public class OaEntryServiceImpl implements OaEntryService {
         }
         oaEntry.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_STAGING);
         oaEntry.setInfoSource("0");
+        oaEntry.setApplyEmployeeId(applyEmployee.getId());
+        oaEntry.setApplyEmployeeName(applyEmployee.getNickname());
         // 暂存不保存审批人信息
         oaEntry.setStartUserSelectAssignees(null);
         // 保存或更新表单信息
@@ -122,6 +125,7 @@ public class OaEntryServiceImpl implements OaEntryService {
         AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
         Objects.requireNonNull(loginUser, "登录用户不能为空");
         // TODO DP 根据登录人查询出对应的员工信息
+        AdminUserRespDTO applyEmployee = loginUser;
 
         OaEntryDO oaEntry = BeanUtils.toBean(commitReqVO, OaEntryDO.class);
         if (StringUtils.isBlank(oaEntry.getEntryId())) {
@@ -130,6 +134,8 @@ public class OaEntryServiceImpl implements OaEntryService {
             oaEntry.setEntryId(uuid);
         }
         oaEntry.setInfoSource("0");
+        oaEntry.setApplyEmployeeId(applyEmployee.getId());
+        oaEntry.setApplyEmployeeName(applyEmployee.getNickname());
         // 保存或更新表单信息
         if (oaEntry.getId() == null) {
             oaEntryMapper.insert(oaEntry);