Browse Source

1、出差接口员工化

dongpo 1 year ago
parent
commit
8aa7f45397

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

@@ -1,11 +1,13 @@
 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 io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
 import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -37,8 +39,8 @@ public class OaBusinessPageReqVO extends PageParam {
     @Schema(description = "部门id", example = "708")
     private Long deptId;
 
-    @Schema(description = "职位")
-    private String position;
+    @Schema(description = "职位id")
+    private Long postId;
 
     @Schema(description = "出差事由", example = "不香")
     private String reason;

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

@@ -1,16 +1,16 @@
 package cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo;
 
 import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
+import cn.iocoder.yudao.module.employee.api.dto.EmployeeRespDTO;
 import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
-import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.util.*;
-import java.util.*;
+import lombok.Data;
+
 import java.math.BigDecimal;
-import org.springframework.format.annotation.DateTimeFormat;
 import java.time.LocalDateTime;
-import com.alibaba.excel.annotation.*;
+import java.util.List;
 
 @Schema(description = "管理后台 - 出差流程信息 Response VO")
 @Data
@@ -45,6 +45,10 @@ public class OaBusinessRespVO {
     @ExcelProperty("部门名称")
     private String deptName;
 
+    @Schema(description = "职位id", example = "1")
+    @ExcelProperty("职位id")
+    private Long postId;
+
     @Schema(description = "职位")
     @ExcelProperty("职位")
     private String position;
@@ -104,7 +108,7 @@ public class OaBusinessRespVO {
     private List<BpmTaskRespVO> auditRecordList;
 
     @Schema(description = "审批人员列表")
-    private List<AdminUserRespDTO> auditUserList;
+    private List<EmployeeRespDTO> auditUserList;
 
     @Schema(description = "当前用户待处理的任务id")
     private String taskId;

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

@@ -1,13 +1,13 @@
 package cn.iocoder.yudao.module.bpm.dal.dataobject.oa.business;
 
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 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
@@ -65,6 +65,10 @@ public class OaBusinessDO extends BaseDO {
      * 部门uuid
      */
     private String deptUuid;
+    /**
+     * 职位id
+     */
+    private Long postId;
     /**
      * 职位
      */

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

@@ -24,7 +24,7 @@ public interface OaBusinessMapper extends BaseMapperX<OaBusinessDO> {
                 .eqIfPresent(OaBusinessDO::getEmployeePhone, reqVO.getEmployeePhone())
                 .eqIfPresent(OaBusinessDO::getUserId, reqVO.getUserId())
                 .eqIfPresent(OaBusinessDO::getDeptId, reqVO.getDeptId())
-                .eqIfPresent(OaBusinessDO::getPosition, reqVO.getPosition())
+                .eqIfPresent(OaBusinessDO::getPostId, reqVO.getPostId())
                 .eqIfPresent(OaBusinessDO::getReason, reqVO.getReason())
                 .eqIfPresent(OaBusinessDO::getDestination, reqVO.getDestination())
                 .betweenIfPresent(OaBusinessDO::getStartDate, reqVO.getStartDate())

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

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
 import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
 import cn.iocoder.yudao.framework.common.pojo.PageParam;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
 import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
@@ -22,12 +23,12 @@ import cn.iocoder.yudao.module.bpm.enums.DictDataConstants;
 import cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants;
 import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmConstants;
 import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
+import cn.iocoder.yudao.module.employee.api.EmployeeApi;
+import cn.iocoder.yudao.module.employee.api.dto.EmployeeRespDTO;
 import cn.iocoder.yudao.module.infra.api.file.FileApi;
 import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
 import cn.iocoder.yudao.module.system.api.dept.DeptApi;
 import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
-import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
-import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import org.apache.commons.lang3.StringUtils;
@@ -75,7 +76,7 @@ public class OaBusinessServiceImpl implements OaBusinessService {
     private FileApi fileApi;
 
     @Resource
-    private AdminUserApi adminUserApi;
+    private EmployeeApi employeeApi;
 
     @Resource
     private DeptApi deptApi;
@@ -85,10 +86,13 @@ public class OaBusinessServiceImpl implements OaBusinessService {
     public Long stagingOaBusiness(OaBusinessSaveReqVO stagingReqVO) {
         // 登录人信息
         Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
-        AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
-        Objects.requireNonNull(loginUser, "登录用户不能为空");
-        // 人信息
-        AdminUserRespDTO employee = adminUserApi.getUser(stagingReqVO.getEmployeeId());
+        // 登录员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        // 出差人信息
+        EmployeeRespDTO employee = employeeApi.getEmployeeById(stagingReqVO.getEmployeeId());
+        if (loginEmployee == null || employee == null) {
+            throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
+        }
 
         OaBusinessDO oaBusiness = BeanUtils.toBean(stagingReqVO, OaBusinessDO.class);
         if (StringUtils.isBlank(oaBusiness.getBusinessId())) {
@@ -96,18 +100,18 @@ public class OaBusinessServiceImpl implements OaBusinessService {
             String uuid = IdUtil.fastSimpleUUID();
             oaBusiness.setBusinessId(uuid);
         }
-        if (employee != null) {
-            oaBusiness.setEmployeeId(loginUser.getId());
-            oaBusiness.setEmployeeName(loginUser.getNickname());
-            oaBusiness.setEmployeePhone(loginUser.getMobile());
-            oaBusiness.setDeptId(loginUser.getDeptId());
-            oaBusiness.setPosition("员工职位");
-            oaBusiness.setUserId(loginUser.getId());
-        }
+        oaBusiness.setEmployeeId(employee.getId());
+        oaBusiness.setEmployeeName(employee.getName());
+        oaBusiness.setEmployeePhone(employee.getPhone());
+        oaBusiness.setDeptId(employee.getDeptId());
+        oaBusiness.setPostId(employee.getPostId());
+        oaBusiness.setPosition(employee.getPosition());
+        oaBusiness.setUserId(loginUserId);
         oaBusiness.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_STAGING);
         oaBusiness.setInfoSource("0");
-        oaBusiness.setApplyEmployeeId(loginUser.getId());
-        oaBusiness.setApplyEmployeeName(loginUser.getNickname());
+        oaBusiness.setApplyEmployeeId(loginEmployee.getId());
+        oaBusiness.setApplyEmployeeName(loginEmployee.getName());
+        oaBusiness.setCreator(String.valueOf(loginEmployee.getId()));
         // 暂存不保存审批人信息
         oaBusiness.setStartUserSelectAssignees(null);
         // 保存或更新表单信息
@@ -131,13 +135,11 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         }
         // 登录人信息
         Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
-        AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
-        if (loginUser == null) {
-            throw exception(ErrorCodeConstants.OA_LOGIN_USER_NOT_EXISTS);
-        }
-        // 人信息
-        AdminUserRespDTO employee = adminUserApi.getUser(commitReqVO.getEmployeeId());
-        if (employee == null) {
+        // 登录员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        // 出差人信息
+        EmployeeRespDTO employee = employeeApi.getEmployeeById(commitReqVO.getEmployeeId());
+        if (loginEmployee == null || employee == null) {
             throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
         }
 
@@ -149,14 +151,16 @@ public class OaBusinessServiceImpl implements OaBusinessService {
             oaBusiness.setBusinessId(uuid);
         }
         oaBusiness.setEmployeeId(employee.getId());
-        oaBusiness.setEmployeeName(employee.getNickname());
-        oaBusiness.setEmployeePhone(employee.getMobile());
+        oaBusiness.setEmployeeName(employee.getName());
+        oaBusiness.setEmployeePhone(employee.getPhone());
         oaBusiness.setDeptId(employee.getDeptId());
-        oaBusiness.setPosition("员工职位");
-        oaBusiness.setUserId(loginUser.getId());
+        oaBusiness.setPostId(employee.getPostId());
+        oaBusiness.setPosition(employee.getPosition());
+        oaBusiness.setUserId(loginUserId);
         oaBusiness.setInfoSource("0");
-        oaBusiness.setApplyEmployeeId(loginUser.getId());
-        oaBusiness.setApplyEmployeeName(loginUser.getNickname());
+        oaBusiness.setApplyEmployeeId(loginEmployee.getId());
+        oaBusiness.setApplyEmployeeName(loginEmployee.getName());
+        oaBusiness.setCreator(String.valueOf(loginEmployee.getId()));
         // 保存或更新表单信息
         if (oaBusiness.getId() == null) {
             oaBusinessMapper.insert(oaBusiness);
@@ -175,7 +179,7 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         List<Long> selectAssignees = commitReqVO.getStartUserSelectAssignees();
         startUserSelectAssignees.put("approver", selectAssignees);
         String processInstanceId = processInstanceApi
-                .createProcessInstance(loginUser.getId(),
+                .createProcessInstance(loginEmployee.getId(),
                         new BpmProcessInstanceCreateReqDTO()
                                 .setProcessDefinitionKey(PROCESS_KEY)
                                 .setVariables(processInstanceVariables)
@@ -192,14 +196,14 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         agreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_COMMITTED));
         taskService.setVariable(task.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_COMMITTED);
         taskService.setVariable(task.getId(), "auditPass", "true");
-        bpmTaskService.approveTask(loginUserId, agreeReqVO);
+        bpmTaskService.approveTask(loginEmployee.getId(), agreeReqVO);
 
         Task nextTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
         if (nextTask == null) {
             throw exception(ErrorCodeConstants.TASK_CREATE_FAIL_NO_START_SELECT_ASSIGNEE);
         }
         Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
-        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+        EmployeeRespDTO currentAuditEmployee = employeeApi.getEmployeeById(currentAuditEmployeeId);
 
 
         // 将工作流的流程实例ID、单据状态、最后一次审批时间、当前审批人更新到单据信息中
@@ -209,7 +213,7 @@ public class OaBusinessServiceImpl implements OaBusinessService {
                 .setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_COMMITTED)
                 .setFinalAuditDate(LocalDateTime.now())
                 .setCurrentAuditEmployeeId(currentAuditEmployeeId)
-                .setCurrentAuditEmployeeName(currentAuditEmployee.getNickname())
+                .setCurrentAuditEmployeeName(currentAuditEmployee.getName())
                 .setStartUserSelectAssignees(selectAssignees.stream().map(String::valueOf).collect(Collectors.joining(","))));
         // 保存业务uuid到附件中
         saveFileList(commitReqVO.getFileIdList(), oaBusiness.getBusinessId());
@@ -222,7 +226,11 @@ public class OaBusinessServiceImpl implements OaBusinessService {
     public Long agreeOaBusiness(BpmTaskApproveReqVO agreeReqVO) {
         // 登录人信息
         Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
-        // TODO DP 根据登录人查询出对应的员工信息
+        // 根据登录人查询出对应的员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        if (loginEmployee == null) {
+            throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
+        }
 
         Task currentTask = bpmTaskService.getTask(agreeReqVO.getId());
         if (currentTask == null) {
@@ -250,19 +258,19 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         agreeReqVO.setReason(reason);
         agreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_AUDITING));
         taskService.setVariable(agreeReqVO.getId(), "auditPass", "true");
-        bpmTaskService.approveTask(loginUserId, agreeReqVO);
+        bpmTaskService.approveTask(loginEmployee.getId(), agreeReqVO);
 
         Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
         OaBusinessDO oaBusinessDO = new OaBusinessDO();
         if (nextTask != null) {
             Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
-            AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+            EmployeeRespDTO currentAuditEmployee = employeeApi.getEmployeeById(currentAuditEmployeeId);
 
             // 如果审批人重复,实际未结束,再次更新为审核中
             taskService.setVariable(nextTask.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_AUDITING);
             oaBusinessDO.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_AUDITING)
                     .setCurrentAuditEmployeeId(currentAuditEmployeeId)
-                    .setCurrentAuditEmployeeName(currentAuditEmployee.getNickname())
+                    .setCurrentAuditEmployeeName(currentAuditEmployee.getName())
                     .setFinalAuditDate(LocalDateTime.now())
                     .setId(oaBusiness.getId());
 
@@ -273,7 +281,7 @@ public class OaBusinessServiceImpl implements OaBusinessService {
                     .setFinalAuditDate(LocalDateTime.now())
                     .setId(oaBusiness.getId());
 
-            // TODO 复制业务单据信息到业务模块单据表
+            // TODO DP 复制业务单据信息到业务模块单据表
 
         }
         oaBusinessMapper.updateById(oaBusinessDO);
@@ -288,7 +296,11 @@ public class OaBusinessServiceImpl implements OaBusinessService {
     public Long disagreeOaBusiness(BpmTaskReturnReqVO disagreeReqVO) {
         // 登录人信息
         Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
-        // TODO DP 根据登录人查询出对应的员工信息
+        // 根据登录人查询出对应的员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        if (loginEmployee == null) {
+            throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
+        }
 
         Task currentTask = bpmTaskService.getTask(disagreeReqVO.getId());
 
@@ -297,16 +309,16 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         disagreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_RETURNED));
         taskService.setVariable(disagreeReqVO.getId(), "auditPass", "false");
         taskService.setVariable(disagreeReqVO.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_RETURNED);
-        bpmTaskService.returnTask(loginUserId, disagreeReqVO);
+        bpmTaskService.returnTask(loginEmployee.getId(), disagreeReqVO);
 
         Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
         Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
-        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+        EmployeeRespDTO currentAuditEmployee = employeeApi.getEmployeeById(currentAuditEmployeeId);
 
         // 更新单据状态,当前处理人,最后处理时间
         LambdaUpdateWrapper<OaBusinessDO> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.set(OaBusinessDO::getCurrentAuditEmployeeId, currentAuditEmployeeId)
-                .set(OaBusinessDO::getCurrentAuditEmployeeName, currentAuditEmployee.getNickname())
+                .set(OaBusinessDO::getCurrentAuditEmployeeName, currentAuditEmployee.getName())
                 .set(OaBusinessDO::getFinalAuditDate, LocalDateTime.now())
                 .set(OaBusinessDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_RETURNED)
                 .eq(OaBusinessDO::getProcInstId, currentTask.getProcessInstanceId());
@@ -322,7 +334,11 @@ public class OaBusinessServiceImpl implements OaBusinessService {
     public Long revocationOaBusiness(BpmTaskApproveReqVO revocationReqVO) {
         // 登录人信息
         Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
-        // TODO DP 根据登录人查询出对应的员工信息
+        // 根据登录人查询出对应的员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        if (loginEmployee == null) {
+            throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
+        }
 
         Task currentTask = bpmTaskService.getTask(revocationReqVO.getId());
         if (currentTask == null) {
@@ -332,7 +348,7 @@ public class OaBusinessServiceImpl implements OaBusinessService {
                 .eq(OaBusinessDO::getProcInstId, currentTask.getProcessInstanceId());
         OaBusinessDO oaBusinessDO = oaBusinessMapper.selectOne(lambdaQueryWrapper);
         if (!DictDataConstants.OA_AUDIT_STATUS_COMMITTED.equals(oaBusinessDO.getAuditStatus())
-                || !Objects.equals(String.valueOf(loginUserId), oaBusinessDO.getCreator())) {
+                || !Objects.equals(String.valueOf(loginEmployee.getId()), oaBusinessDO.getCreator())) {
             throw ServiceExceptionUtil.exception(ErrorCodeConstants.TASK_REVOCATION_NOT_ALLOWED);
         }
 
@@ -345,16 +361,16 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         returnReqVO.setReason(reason);
         returnReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_RECALLED));
         taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_RECALLED);
-        bpmTaskService.revocationTask(loginUserId, returnReqVO);
+        bpmTaskService.revocationTask(loginEmployee.getId(), returnReqVO);
 
         Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
         Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
-        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+        EmployeeRespDTO currentAuditEmployee = employeeApi.getEmployeeById(currentAuditEmployeeId);
 
         // 更新单据状态,当前处理人,最后处理时间
         LambdaUpdateWrapper<OaBusinessDO> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.set(OaBusinessDO::getCurrentAuditEmployeeId, currentAuditEmployeeId)
-                .set(OaBusinessDO::getCurrentAuditEmployeeName, currentAuditEmployee.getNickname())
+                .set(OaBusinessDO::getCurrentAuditEmployeeName, currentAuditEmployee.getName())
                 .set(OaBusinessDO::getFinalAuditDate, LocalDateTime.now())
                 .set(OaBusinessDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_RECALLED)
                 .eq(OaBusinessDO::getProcInstId, currentTask.getProcessInstanceId());
@@ -373,13 +389,11 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         }
         // 登录人信息
         Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
-        AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
-        if (loginUser == null) {
-            throw exception(ErrorCodeConstants.OA_LOGIN_USER_NOT_EXISTS);
-        }
-        // 人信息
-        AdminUserRespDTO employee = adminUserApi.getUser(reCommitReqVO.getEmployeeId());
-        if (employee == null) {
+        // 登录员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        // 出差人信息
+        EmployeeRespDTO employee = employeeApi.getEmployeeById(reCommitReqVO.getEmployeeId());
+        if (loginEmployee == null || employee == null) {
             throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
         }
 
@@ -389,13 +403,14 @@ public class OaBusinessServiceImpl implements OaBusinessService {
                 .setProcInstId(oaBusinessOld.getProcInstId());
 
         oaBusinessNew.setEmployeeId(employee.getId());
-        oaBusinessNew.setEmployeeName(employee.getNickname());
-        oaBusinessNew.setEmployeePhone(employee.getMobile());
+        oaBusinessNew.setEmployeeName(employee.getName());
+        oaBusinessNew.setEmployeePhone(employee.getPhone());
         oaBusinessNew.setDeptId(employee.getDeptId());
-        oaBusinessNew.setPosition("员工职位");
-        oaBusinessNew.setUserId(loginUser.getId());
-        oaBusinessNew.setApplyEmployeeId(loginUser.getId());
-        oaBusinessNew.setApplyEmployeeName(loginUser.getNickname());
+        oaBusinessNew.setPostId(employee.getPostId());
+        oaBusinessNew.setPosition(employee.getPosition());
+        oaBusinessNew.setUserId(loginUserId);
+        oaBusinessNew.setApplyEmployeeId(loginEmployee.getId());
+        oaBusinessNew.setApplyEmployeeName(loginEmployee.getName());
 
         Task currentTask = taskService.createTaskQuery().processInstanceId(oaBusinessNew.getProcInstId()).singleResult();
         BpmTaskApproveReqVO approveReqVO = new BpmTaskApproveReqVO();
@@ -414,14 +429,14 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         taskService.setVariable(currentTask.getId(), "auditPass", "true");
         taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_COMMITTED);
         // 再次提交,和审批通过逻辑相同
-        bpmTaskService.approveTask(loginUserId, approveReqVO);
+        bpmTaskService.approveTask(loginEmployee.getId(), approveReqVO);
 
         Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
         Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
-        AdminUserRespDTO currentAuditEmployee = adminUserApi.getUser(currentAuditEmployeeId);
+        EmployeeRespDTO currentAuditEmployee = employeeApi.getEmployeeById(currentAuditEmployeeId);
         oaBusinessNew.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_COMMITTED)
                 .setCurrentAuditEmployeeId(currentAuditEmployeeId)
-                .setCurrentAuditEmployeeName(currentAuditEmployee.getNickname())
+                .setCurrentAuditEmployeeName(currentAuditEmployee.getName())
                 .setFinalAuditDate(LocalDateTime.now());
         oaBusinessMapper.updateById(oaBusinessNew);
 
@@ -439,7 +454,11 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         }
         // 登录人信息
         Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
-        // TODO DP 根据登录人查询出对应的员工信息
+        // 根据登录人查询出对应的员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        if (loginEmployee == null) {
+            throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
+        }
 
         OaBusinessDO oaBusinessDO = validateOaBusinessExists(id);
         if (!DictDataConstants.OA_AUDIT_STATUS_RETURNED.equals(oaBusinessDO.getAuditStatus())
@@ -455,7 +474,7 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         taskService.setVariable(currentTask.getId(), "auditPass", "false");
         taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_CLOSED);
         // 关闭,使用审批通过的方法实现
-        bpmTaskService.approveTask(loginUserId, approveReqVO);
+        bpmTaskService.approveTask(loginEmployee.getId(), approveReqVO);
 
         LambdaUpdateWrapper<OaBusinessDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
         lambdaUpdateWrapper.set(OaBusinessDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_CLOSED)
@@ -479,7 +498,11 @@ public class OaBusinessServiceImpl implements OaBusinessService {
     public OaBusinessRespVO getOaBusiness(Long id) {
         // 登录人信息
         Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
-        // TODO DP 根据登录人查询出对应的员工信息
+        // 根据登录人查询出对应的员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        if (loginEmployee == null) {
+            throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
+        }
 
         OaBusinessDO oaBusinessDO = oaBusinessMapper.selectById(id);
         OaBusinessRespVO oaBusinessRespVO = BeanUtils.toBean(oaBusinessDO, OaBusinessRespVO.class);
@@ -494,7 +517,7 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         if (StrUtil.isNotBlank(procInstId)) {
             Task task = taskService.createTaskQuery()
                     .processInstanceId(procInstId)
-                    .taskAssignee(String.valueOf(loginUserId))
+                    .taskAssignee(String.valueOf(loginEmployee.getId()))
                     .singleResult();
             if (DictDataConstants.OA_AUDIT_STATUS_COMMITTED.equals(oaBusinessDO.getAuditStatus())) {
                 // 如果是已提交,不限制任务处理人是当前登录人,用于直接撤回
@@ -520,16 +543,15 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         // 审批人
         String startUserSelectAssignees = oaBusinessDO.getStartUserSelectAssignees();
         if (StrUtil.isNotEmpty(startUserSelectAssignees)) {
-            List<Long> userIdList = Arrays.stream(startUserSelectAssignees.split(","))
+            List<Long> employeeIdList = Arrays.stream(startUserSelectAssignees.split(","))
                     .map(Long::valueOf).collect(Collectors.toList());
-            List<AdminUserRespDTO> userList = adminUserApi.getUserList(userIdList);
-            List<AdminUserRespDTO> auditUserList = new ArrayList<>();
-            for (Long userId : userIdList) {
-                for (AdminUserRespDTO adminUserRespDTO : userList) {
-                    if (Objects.equals(userId, adminUserRespDTO.getId())) {
-                        auditUserList.add(adminUserRespDTO);
-                        break;
-                    }
+            List<EmployeeRespDTO> employeeRespDTOList = employeeApi.getEmployeeListByIds(employeeIdList);
+            Map<Long, EmployeeRespDTO> longEmployeeRespDTOMap = CollectionUtils.convertMap(employeeRespDTOList, EmployeeRespDTO::getId);
+            List<EmployeeRespDTO> auditUserList = new ArrayList<>();
+            for (Long employeeId : employeeIdList) {
+                EmployeeRespDTO employeeRespDTO = longEmployeeRespDTOMap.get(employeeId);
+                if (employeeRespDTO != null) {
+                    auditUserList.add(employeeRespDTO);
                 }
             }
             oaBusinessRespVO.setAuditUserList(auditUserList);
@@ -562,16 +584,15 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         // 审批人
         String startUserSelectAssignees = oaBusinessDO.getStartUserSelectAssignees();
         if (StrUtil.isNotEmpty(startUserSelectAssignees)) {
-            List<Long> userIdList = Arrays.stream(startUserSelectAssignees.split(","))
+            List<Long> employeeIdList = Arrays.stream(startUserSelectAssignees.split(","))
                     .map(Long::valueOf).collect(Collectors.toList());
-            List<AdminUserRespDTO> userList = adminUserApi.getUserList(userIdList);
-            List<AdminUserRespDTO> auditUserList = new ArrayList<>();
-            for (Long userId : userIdList) {
-                for (AdminUserRespDTO adminUserRespDTO : userList) {
-                    if (Objects.equals(userId, adminUserRespDTO.getId())) {
-                        auditUserList.add(adminUserRespDTO);
-                        break;
-                    }
+            List<EmployeeRespDTO> employeeRespDTOList = employeeApi.getEmployeeListByIds(employeeIdList);
+            Map<Long, EmployeeRespDTO> longEmployeeRespDTOMap = CollectionUtils.convertMap(employeeRespDTOList, EmployeeRespDTO::getId);
+            List<EmployeeRespDTO> auditUserList = new ArrayList<>();
+            for (Long employeeId : employeeIdList) {
+                EmployeeRespDTO employeeRespDTO = longEmployeeRespDTOMap.get(employeeId);
+                if (employeeRespDTO != null) {
+                    auditUserList.add(employeeRespDTO);
                 }
             }
             oaBusinessRespVO.setAuditUserList(auditUserList);
@@ -588,13 +609,12 @@ public class OaBusinessServiceImpl implements OaBusinessService {
         List<OaBusinessRespVO> oaBusinessRespVOList = oaBusinessRespVOPageResult.getList();
         if (CollectionUtil.isNotEmpty(oaBusinessRespVOList)) {
             List<Long> employeeIdList = oaBusinessRespVOList.stream().map(OaBusinessRespVO::getCurrentAuditEmployeeId).collect(Collectors.toList());
-            List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
+            List<EmployeeRespDTO> employeeRespDTOList = employeeApi.getEmployeeListByIds(employeeIdList);
+            Map<Long, EmployeeRespDTO> longEmployeeRespDTOMap = CollectionUtils.convertMap(employeeRespDTOList, EmployeeRespDTO::getId);
             for (OaBusinessRespVO respVO : oaBusinessRespVOList) {
-                for (AdminUserRespDTO employee : employeeList) {
-                    if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
-                        respVO.setCurrentAuditEmployeeName(employee.getNickname());
-                        break;
-                    }
+                EmployeeRespDTO employeeRespDTO = longEmployeeRespDTOMap.get(respVO.getCurrentAuditEmployeeId());
+                if (employeeRespDTO != null) {
+                    respVO.setCurrentAuditEmployeeName(employeeRespDTO.getName());
                 }
             }