Commit 1e4809d7 authored by hongguangwu's avatar hongguangwu

离职库

parent 0aefb5a8
......@@ -37,6 +37,9 @@ public class EmployeeExportVO extends BaseEntity {
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "id")
private String id;
@ExcelProperty(value = "员工主码")
private String empCode;
......
......@@ -150,6 +150,83 @@ public class TEmployeeInfoController {
return R.ok(tEmployeeInfoService.getPage(page, tEmployeeInfo, null));
}
/**
* 分页查询
*
* @param page 分页对象
* @param tEmployeeInfo 人员档案表
* @return
*/
@Operation(summary = "离职库分页查询", description = "离职库分页查询")
@GetMapping("/getLeavePage")
public R<IPage<TEmployeeInfo>> getLeavePage(Page<TEmployeeInfo> page, TEmployeeInfo tEmployeeInfo) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
// 普通用户:
if (CommonConstants.ONE_STRING.equals(user.getSystemFlag())) {
// 菜单id
String menuId = "1536922631616278529";
String linkId = user.getId();
int linkType = 1; // 用户
SysDataAuth sysDataAuth = new SysDataAuth();
sysDataAuth.setLinkId(linkId);
sysDataAuth.setLinkType(linkType);
// 获取缓存菜单权限的步骤:
Cache cache = cacheManager.getCache(CacheConstants.DATA_AUTH_DETAILS + linkType);
Object obj = null;
if (cache != null) {
obj = cache.get(linkId + CommonConstants.DOWN_LINE_STRING + menuId);
if (Common.isEmpty(obj)) {
HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dataAuth/refreshAuth", sysDataAuth, TEmployeeInfo.class, SecurityConstants.FROM_IN);
obj = cache.get(linkId + CommonConstants.DOWN_LINE_STRING + menuId);
if (Common.isEmpty(obj)) {
linkId = user.getUserGroup();
linkType = 0; // 用户组
cache = cacheManager.getCache(CacheConstants.DATA_AUTH_DETAILS + linkType);
if (cache != null) {
obj = cache.get(linkId + CommonConstants.DOWN_LINE_STRING + menuId);
if (Common.isEmpty(obj)) {
sysDataAuth.setLinkId(linkId);
sysDataAuth.setLinkType(linkType);
HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dataAuth/refreshAuth", sysDataAuth, TEmployeeInfo.class, SecurityConstants.FROM_IN);
obj = cache.get(linkId + CommonConstants.DOWN_LINE_STRING + menuId);
}
}
}
}
}
if (Common.isNotNull(obj)) {
SimpleValueWrapper objs = (SimpleValueWrapper) obj;
if (objs != null) {
String sql = String.valueOf(objs.get());
if (sql.contains("#deptId")) {
// TODO - 需要关联部门表
}
if (sql.contains("#create_by")) {
sql = sql.replace("#create_by", user.getId());
}
if (sql.contains("#settleDomainId")) {
// TODO - 获取人员结算主体权限
// sql = sql.replace("#settleDomainId", ",'1','2' ")
sql = sql.replace("or a.settle_domain_id in ('0'#settleDomainId) ", "");
}
if (sql.contains("#deptId")) {
// TODO - 获取人员部门权限
// sql = sql.replace("#settleDomainId", ",'1','2' ")
sql = sql.replace(" or dept.dept_id = #deptId ", "");
}
return R.ok(tEmployeeInfoService.getLeavePage(page, tEmployeeInfo, sql));
}
}
}
return R.ok(tEmployeeInfoService.getLeavePage(page, tEmployeeInfo, null));
}
/**
* 通过id查询人员档案表
......
......@@ -39,6 +39,8 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, @Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo, @Param("sql") String sql);
IPage<TEmployeeInfo> getLeavePage(Page<TEmployeeInfo> page, @Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo, @Param("sql") String sql);
List<TEmployeeInfo> getList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
// hgw 2022-6-22 15:32:39 根据身份证查询一批档案
......
......@@ -50,6 +50,14 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
**/
IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql);
/**
* @Description: 离职库分页
* @Author: hgw
* @Date: 2022/7/4 17:38
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo>
**/
IPage<TEmployeeInfo> getLeavePage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql);
/**
* @param employeeInfo
* @Description: 获取list
......
......@@ -86,6 +86,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return baseMapper.getPage(page, employeeInfo, sql);
}
@Override
public IPage<TEmployeeInfo> getLeavePage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql) {
return baseMapper.getLeavePage(page, employeeInfo, sql);
}
@Override
public List<TEmployeeInfo> getList(TEmployeeInfo employeeInfo) {
return baseMapper.getList(employeeInfo);
......
......@@ -77,6 +77,7 @@
</resultMap>
<resultMap id="tEmployeeExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeExportVO">
<id property="id" column="ID"/>
<result property="empCode" column="EMP_CODE"/>
<result property="empNatrue" column="EMP_NATRUE"/>
<result property="empName" column="EMP_NAME"/>
......@@ -418,7 +419,24 @@
<include refid="employeeInfo_where"/>
${sql}
group by a.id order by a.CREATE_TIME desc
</select>
<!-- hgw 分页查询 -->
<select id="getLeavePage" resultMap="tEmployeeExportMap">
SELECT
a.ID,
<include refid="Base_Export_List"/>
,GROUP_CONCAT(b.unit_name) UNIT_NAME
,GROUP_CONCAT(b.unit_no) UNIT_NO
,a.LEAVE_TIME
,a.LEAVE_USER
,a.LEAVE_REASON
from t_employee_info a
left join t_employee_project b on a.id = b.EMP_ID
where a.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/>
${sql}
GROUP BY a.idgroup by a.id order by a.CREATE_TIME desc
</select>
<!-- hgw list查询 -->
......
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