Commit 48079aa1 authored by Mr.Tang's avatar Mr.Tang

基本信息自动填入

parent 92dd23f0
...@@ -182,4 +182,10 @@ public class EmploymentApprovalController extends BaseController ...@@ -182,4 +182,10 @@ public class EmploymentApprovalController extends BaseController
{ {
return toAjax(employmentApprovalService.updateApproval2(employmentApproval)); return toAjax(employmentApprovalService.updateApproval2(employmentApproval));
} }
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager') or @ss.hasRole('common')")
@GetMapping("/listAll")
public AjaxResult listAll()
{
return AjaxResult.success(employmentApprovalService.getCurrentUserApproval());
}
} }
...@@ -121,7 +121,7 @@ public class EmploymentApproval extends BaseEntity ...@@ -121,7 +121,7 @@ public class EmploymentApproval extends BaseEntity
/** 入职岗位 */ /** 入职岗位 */
@Excel(name = "入职岗位 ") @Excel(name = "入职岗位 ")
private String entryPosition; private String position;
/** 聘用形式 0全职 1实习 2兼职 3劳务派遣 4其他 */ /** 聘用形式 0全职 1实习 2兼职 3劳务派遣 4其他 */
@Excel(name = "聘用形式",dictType = "employment_form") @Excel(name = "聘用形式",dictType = "employment_form")
...@@ -220,4 +220,6 @@ public class EmploymentApproval extends BaseEntity ...@@ -220,4 +220,6 @@ public class EmploymentApproval extends BaseEntity
private Long empId; private Long empId;
private Long userId;
} }
package com.ruoyi.employment.domain.dto;
import lombok.Data;
@Data
public class EmploymentApprovalDTO {
private String name;
private String idNumber;
private Integer gender;
private String phone;
private Integer serviceDepart;
private String position ;
private Integer employmentForm;
private Long userId;
private String userName;
}
\ No newline at end of file
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.employment.domain.ApprovalInstance; import com.ruoyi.employment.domain.ApprovalInstance;
import com.ruoyi.employment.domain.EmploymentApproval; import com.ruoyi.employment.domain.EmploymentApproval;
import com.ruoyi.employment.domain.dto.EmploymentApprovalDTO;
/** /**
* 入职审批Mapper接口 * 入职审批Mapper接口
...@@ -90,4 +91,7 @@ public interface EmploymentApprovalMapper ...@@ -90,4 +91,7 @@ public interface EmploymentApprovalMapper
public int updateApproval(EmploymentApproval employmentApproval); public int updateApproval(EmploymentApproval employmentApproval);
public int updateApproval2(EmploymentApproval employmentApproval); public int updateApproval2(EmploymentApproval employmentApproval);
public EmploymentApprovalDTO selectApprovalWithUser(Long userId);
} }
...@@ -2,6 +2,7 @@ package com.ruoyi.employment.service; ...@@ -2,6 +2,7 @@ package com.ruoyi.employment.service;
import java.util.List; import java.util.List;
import com.ruoyi.employment.domain.EmploymentApproval; import com.ruoyi.employment.domain.EmploymentApproval;
import com.ruoyi.employment.domain.dto.EmploymentApprovalDTO;
/** /**
* 入职审批Service接口 * 入职审批Service接口
...@@ -83,4 +84,7 @@ public interface IEmploymentApprovalService ...@@ -83,4 +84,7 @@ public interface IEmploymentApprovalService
public int updateApproval(EmploymentApproval employmentApproval); public int updateApproval(EmploymentApproval employmentApproval);
public int updateApproval2(EmploymentApproval employmentApproval); public int updateApproval2(EmploymentApproval employmentApproval);
public EmploymentApprovalDTO getCurrentUserApproval();
} }
...@@ -2,9 +2,12 @@ package com.ruoyi.employment.service.impl; ...@@ -2,9 +2,12 @@ package com.ruoyi.employment.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.employment.domain.ApprovalInstance; import com.ruoyi.employment.domain.ApprovalInstance;
import com.ruoyi.employment.domain.dto.EmploymentApprovalDTO;
import com.ruoyi.employment.mapper.ApprovalInstanceMapper; import com.ruoyi.employment.mapper.ApprovalInstanceMapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -173,4 +176,16 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService ...@@ -173,4 +176,16 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService
employmentApproval.setUpdateTime(DateUtils.getNowDate()); employmentApproval.setUpdateTime(DateUtils.getNowDate());
return employmentApprovalMapper.updateApproval2(employmentApproval); return employmentApprovalMapper.updateApproval2(employmentApproval);
} }
@Override
public EmploymentApprovalDTO getCurrentUserApproval() {
// 获取当前登录用户
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser == null) {
throw new ServiceException("未登录");
}
System.out.println("loginUser = " + loginUser.getUserId());
return employmentApprovalMapper.selectApprovalWithUser(loginUser.getUserId());
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment