HRBP门户

This commit is contained in:
dxfeng 2025-07-11 10:13:34 +08:00
parent b5a7c535da
commit 985711fb66
7 changed files with 431 additions and 0 deletions

View File

@ -0,0 +1,45 @@
package com.weaver.seconddev.portal.controller;
import com.weaver.common.authority.annotation.WeaPermission;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.seconddev.portal.service.HrbpPortalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2025/07/10
* @version: 1.0
*/
@Slf4j
@RestController
@RequestMapping("/api/secondev/portal/hrbp")
@WeaPermission(publicPermission = true)
public class HrbpPortalController {
@Autowired
HrbpPortalService hrPortalService;
@PostMapping("/getToDo")
private WeaResult<Map<String, Object>> getToDo(@RequestBody Map<String, String> params) {
return hrPortalService.getToDo(params);
}
@PostMapping("/getEmployeeData")
private WeaResult<Map<String, Object>> getEmployeeData(@RequestBody Map<String, String> params) {
return hrPortalService.getEmployeeData(params);
}
@PostMapping("/getTodayOverview")
private WeaResult<Map<String, Object>> getTodayOverview(@RequestBody Map<String, String> params) {
return hrPortalService.getTodayOverview(params);
}
}

View File

@ -0,0 +1,16 @@
package com.weaver.seconddev.portal.entity.param;
import lombok.Data;
import java.util.Set;
/**
* @author:dxfeng
* @createTime: 2025/07/10
* @version: 1.0
*/
@Data
public class HrbpParam {
private String tenantKey;
private Set<Long> departmentIdList;
}

View File

@ -0,0 +1,126 @@
package com.weaver.seconddev.portal.mapper;
import com.weaver.seconddev.portal.entity.param.HrbpParam;
import org.apache.ibatis.annotations.Mapper;
/**
* @author:dxfeng
* @createTime: 2025/07/10
* @version: 1.0
*/
@Mapper
public interface HrbpPortalMapper {
/**
* 待入职
*
* @param param
* @return
*/
int getToEntryCount(HrbpParam param);
/**
* 待转正
*
* @param param
* @return
*/
int getToRegularCount(HrbpParam param);
/**
* 待离职
*
* @param param
* @return
*/
int getToLeaveCount(HrbpParam param);
/**
* 待签订
*
* @param param
* @return
*/
int getToSignCount(HrbpParam param);
/**
* 代理期转正
*
* @param param
* @return
*/
int getToProxyCount(HrbpParam param);
/**
* 员工人数
*
* @param param
* @return
*/
int getAllEmployeeCount(HrbpParam param);
/**
* 正式员工
*
* @param param
* @return
*/
int getFormalEmployeeCount(HrbpParam param);
/**
* 实习生
*
* @param param
* @return
*/
int getInternEmployeeCount(HrbpParam param);
/**
* 外包
*
* @param param
* @return
*/
int getOutsourcingCount(HrbpParam param);
/**
* 劳务
*
* @param param
* @return
*/
int getLaborCount(HrbpParam param);
/**
* 试用
*
* @param param
* @return
*/
int getProbationCount(HrbpParam param);
/**
* 正式
*
* @param param
* @return
*/
int getFormalCount(HrbpParam param);
/**
* 实习
*
* @param param
* @return
*/
int getInternCount(HrbpParam param);
/**
* 离职
*
* @param param
* @return
*/
int getLeaveCount(HrbpParam param);
}

View File

@ -0,0 +1,37 @@
package com.weaver.seconddev.portal.service;
import com.weaver.common.base.entity.result.WeaResult;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2025/07/10
* @version: 1.0
*/
public interface HrbpPortalService {
/**
* 获取待办事项
*
* @param params
* @return
*/
WeaResult<Map<String, Object>> getToDo(Map<String, String> params);
/**
* 获取员工数据
*
* @param params
* @return
*/
WeaResult<Map<String, Object>> getEmployeeData(Map<String, String> params);
/**
* 今日概况
*
* @param params
* @return
*/
WeaResult<Map<String, Object>> getTodayOverview(Map<String, String> params);
}

View File

@ -0,0 +1,102 @@
package com.weaver.seconddev.portal.service.impl;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.seconddev.portal.entity.param.HrbpParam;
import com.weaver.seconddev.portal.mapper.HrbpPortalMapper;
import com.weaver.seconddev.portal.service.HrbpPortalService;
import com.weaver.teams.security.context.UserContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2025/07/10
* @version: 1.0
*/
@Slf4j
@Service
public class HrbpPortalServiceImpl implements HrbpPortalService {
@Autowired
HrbpPortalMapper hrbpPortalMapper;
@Override
public WeaResult<Map<String, Object>> getToDo(Map<String, String> params) {
Map<String, Object> map = new HashMap<>();
HrbpParam hrbpParam = new HrbpParam();
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
// 权限条件
int toEntryCount = hrbpPortalMapper.getToEntryCount(hrbpParam);
int toRegularCount = hrbpPortalMapper.getToRegularCount(hrbpParam);
int toLeaveCount = hrbpPortalMapper.getToLeaveCount(hrbpParam);
int toSignCount = hrbpPortalMapper.getToSignCount(hrbpParam);
int toProxyCount = hrbpPortalMapper.getToProxyCount(hrbpParam);
// 待入职
map.put("entry", toEntryCount);
map.put("entryUrl", "");
// 待转正
map.put("regular", toRegularCount);
map.put("regularUrl", "");
// 待离职
map.put("leave", toLeaveCount);
map.put("leaveUrl", "");
// 待签订
map.put("sign", toSignCount);
map.put("signUrl", "");
// 代理期转正
map.put("proxy", toProxyCount);
map.put("proxyUrl", "");
return WeaResult.success(map);
}
@Override
public WeaResult<Map<String, Object>> getEmployeeData(Map<String, String> params) {
Map<String, Object> map = new HashMap<>();
HrbpParam hrbpParam = new HrbpParam();
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
// 员工人数
int allEmployeeCount = hrbpPortalMapper.getAllEmployeeCount(hrbpParam);
map.put("allEmployee", allEmployeeCount);
map.put("allEmployeeUrl", "");
// 正式员工
int formalEmployeeCount = hrbpPortalMapper.getFormalEmployeeCount(hrbpParam);
map.put("formalEmployee", formalEmployeeCount);
map.put("formalEmployeeUrl", "");
// 实习生
map.put("internEmployee", hrbpPortalMapper.getInternEmployeeCount(hrbpParam));
map.put("internEmployeeUrl", "");
// 外包
map.put("outsourcing", hrbpPortalMapper.getOutsourcingCount(hrbpParam));
map.put("outsourcingUrl", "");
// 劳务
map.put("labor", hrbpPortalMapper.getLaborCount(hrbpParam));
map.put("laborUrl", "");
// 试用
map.put("probation", hrbpPortalMapper.getProbationCount(hrbpParam));
map.put("probationUrl", "");
// 正式
map.put("formal", hrbpPortalMapper.getFormalCount(hrbpParam));
map.put("formalUrl", "");
// 实习
map.put("intern", hrbpPortalMapper.getInternCount(hrbpParam));
map.put("internUrl", "");
// 离职
map.put("leave", hrbpPortalMapper.getLeaveCount(hrbpParam));
map.put("leaveUrl", "");
return WeaResult.success(map);
}
@Override
public WeaResult<Map<String, Object>> getTodayOverview(Map<String, String> params) {
return null;
}
}

View File

@ -33,6 +33,7 @@ import java.util.stream.Collectors;
@Slf4j
@Service
public class ManagerPortalServiceImpl implements ManagerPortalService {
private static final String URL_UID = "";
@Autowired
ManagerPortalMapper managerPortalMapper;

View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.weaver.seconddev.portal.mapper.HrbpPortalMapper">
<select id="getToEntryCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.rzzt = 0
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
</if>
</select>
<select id="getToRegularCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status in(1,3)
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
</if>
</select>
<select id="getToLeaveCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_lzsq t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.flow_status in (1, 2, 3)
and (t.zhgzr is null or t.zhgzr = '' or zhgzr >current_date())
</select>
<select id="getToSignCount" resultType="java.lang.Integer">
<!--TODO-->
select -1
</select>
<select id="getToProxyCount" resultType="java.lang.Integer">
<!--TODO-->
select -1
</select>
<select id="getAllEmployeeCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
</select>
<select id="getFormalEmployeeCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
and t.yglx=1109770887364624394
</select>
<select id="getInternEmployeeCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
and t.yglx=1109772927499255817
</select>
<select id="getOutsourcingCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
and t.yglx=1109775968260603906
</select>
<select id="getLaborCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
and t.yglx=1109776092848209920
</select>
<select id="getProbationCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status = 1
</select>
<select id="getFormalCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status = 2
</select>
<select id="getInternCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status = 4
</select>
<select id="getLeaveCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status = 5
</select>
</mapper>