团队成员信息接口

This commit is contained in:
dxfeng 2025-07-16 14:34:41 +08:00
parent eb3edfeca8
commit aff2a549b1
7 changed files with 170 additions and 1 deletions

View File

@ -51,4 +51,9 @@ public class ManagerPortalController {
return managerPortalService.getEducationInfo(params); return managerPortalService.getEducationInfo(params);
} }
@PostMapping("/getTeamEmployee")
private WeaResult<Map<String, Object>> getTeamEmployee(@RequestBody Map<String, String> params) {
return managerPortalService.getTeamEmployee(params);
}
} }

View File

@ -12,7 +12,7 @@ import java.util.Set;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
public class BasicPersonnelParam extends BaseParam{ public class BasicPersonnelParam extends BaseParam {
private Set<Long> departmentIdList; private Set<Long> departmentIdList;
private String searchType; private String searchType;
private String startDate; private String startDate;
@ -21,4 +21,16 @@ public class BasicPersonnelParam extends BaseParam{
private String pieType; private String pieType;
private Integer startIndex; private Integer startIndex;
private Integer endIndex; private Integer endIndex;
/*分页查询*/
private String searchKey;
private String departmentId;
private Integer current;
private Integer offset;
private Integer pageSize;
public Integer getOffset() {
return (current - 1) * pageSize;
}
} }

View File

@ -0,0 +1,52 @@
package com.weaver.seconddev.portal.entity.po;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
/**
* @author:dxfeng
* @createTime: 2025/07/15
* @version: 1.0
*/
@Data
public class TeamEmployeePo {
/**
* 姓名
*/
private String userName;
/**
* 部门
*/
private String departmentName;
/**
* 岗位
*/
private String jobPositionName;
/**
* 职级
*/
private String jobLevelName;
/**
* 入职日期
*/
private String hireDate;
/**
* 学校
*/
private String schoolName;
/**
* 学历
*/
private String educationName;
/**
* 年龄
*/
private String age;
public String getAge() {
if (StringUtils.isNotBlank(age)) {
return age + "";
}
return age;
}
}

View File

@ -3,6 +3,7 @@ package com.weaver.seconddev.portal.mapper;
import com.weaver.seconddev.portal.entity.param.BasicPersonnelParam; import com.weaver.seconddev.portal.entity.param.BasicPersonnelParam;
import com.weaver.seconddev.portal.entity.po.PieChartConfig; import com.weaver.seconddev.portal.entity.po.PieChartConfig;
import com.weaver.seconddev.portal.entity.po.PortalPO; import com.weaver.seconddev.portal.entity.po.PortalPO;
import com.weaver.seconddev.portal.entity.po.TeamEmployeePo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -128,4 +129,20 @@ public interface ManagerPortalMapper {
*/ */
List<PieChartConfig> getPieTypeConfig(BasicPersonnelParam param); List<PieChartConfig> getPieTypeConfig(BasicPersonnelParam param);
/**
* 获取团队成员信息
*
* @param param
* @return
*/
List<TeamEmployeePo> getTeamEmployee(BasicPersonnelParam param);
/**
* 获取团队成员总数
*
* @param param
* @return
*/
int getTeamEmployeeTotal(BasicPersonnelParam param);
} }

View File

@ -55,5 +55,13 @@ public interface ManagerPortalService {
*/ */
WeaResult<Map<String, Object>> getEducationInfo(Map<String, String> params); WeaResult<Map<String, Object>> getEducationInfo(Map<String, String> params);
/**
* 团队员工
*
* @param params
* @return
*/
WeaResult<Map<String, Object>> getTeamEmployee(Map<String, String> params);
} }

View File

@ -9,6 +9,7 @@ import com.weaver.seconddev.portal.entity.param.BasicPersonnelParam;
import com.weaver.seconddev.portal.entity.po.PieChartConfig; import com.weaver.seconddev.portal.entity.po.PieChartConfig;
import com.weaver.seconddev.portal.entity.po.PortalPO; import com.weaver.seconddev.portal.entity.po.PortalPO;
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail; import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
import com.weaver.seconddev.portal.entity.po.TeamEmployeePo;
import com.weaver.seconddev.portal.mapper.LeaderCockpitMapper; import com.weaver.seconddev.portal.mapper.LeaderCockpitMapper;
import com.weaver.seconddev.portal.mapper.ManagerPortalMapper; import com.weaver.seconddev.portal.mapper.ManagerPortalMapper;
import com.weaver.seconddev.portal.mapper.PortalMapper; import com.weaver.seconddev.portal.mapper.PortalMapper;
@ -229,6 +230,34 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
return WeaResult.success(returnMap); return WeaResult.success(returnMap);
} }
@Override
public WeaResult<Map<String, Object>> getTeamEmployee(Map<String, String> params) {
String searchKey = params.get("searchKey");
String departmentId = params.get("departmentId");
int pageSize = Convert.toInt(params.get("pageSize"), 1);
int current = Convert.toInt(params.get("current"), 10);
User currentUser = UserContext.getCurrentUser();
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
basicPersonnelParam.setCurrent(current);
basicPersonnelParam.setPageSize(pageSize);
basicPersonnelParam.setSearchKey(searchKey);
basicPersonnelParam.setDepartmentId(departmentId);
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
List<TeamEmployeePo> teamEmployee = managerPortalMapper.getTeamEmployee(basicPersonnelParam);
int total = managerPortalMapper.getTeamEmployeeTotal(basicPersonnelParam);
Map<String, Object> returnMap = new HashMap<>();
returnMap.put("list", teamEmployee);
returnMap.put("total", total);
return WeaResult.success(returnMap);
}
/** /**
* 学历分布数据 * 学历分布数据
* *

View File

@ -201,6 +201,52 @@
and t.sl &gt; #{startIndex} and t.sl &gt; #{startIndex}
and t.sl &lt;= #{endIndex} and t.sl &lt;= #{endIndex}
</select> </select>
<select id="getTeamEmployee" resultType="com.weaver.seconddev.portal.entity.po.TeamEmployeePo">
select t.id,t.username as userName ,t1.NAME as departmentName,t2.NAME as jobPositionName,t3.jobset_levelname as
jobLevelName,t.graduate_school as schoolName,t4.name as educationName,t.age as age,t.hiredate as hireDate from
${e10_common}.uf_jcl_employee_information t
left join ${eteams}.department t1 on t.DEPARTMENT = t1.ID
left join ${eteams}.`position` t2 on t.`POSITION` =t2.id
left join ${eteams}.hrm_jobset_level t3 on t.jobset_level = t3.id
left join ${e10_other_business}.hr_dictionary_setting t4 on t.education =t4.id
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and (t.zhgzr is null or t.zhgzr = '' or zhgzr >current_date())
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
</if>
<if test="departmentId != null and departmentId != ''">
and t.department = #{departmentId}
</if>
<if test="searchKey != null and searchKey != ''">
and (t.username like concat('%',#{searchKey},'%') or t.job_num like concat('%',#{searchKey},'%'))
</if>
<!--分页-->
limit #{offset},#{pageSize}
</select>
<select id="getTeamEmployeeTotal" resultType="java.lang.Integer">
select count(t.id) as value from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and (t.zhgzr is null or t.zhgzr = '' or zhgzr >current_date())
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
</if>
<if test="departmentId != null and departmentId != ''">
and t.department = #{departmentId}
</if>
<if test="searchKey != null and searchKey != ''">
and (t.username like concat('%',#{searchKey},'%') or t.job_num like concat('%',#{searchKey},'%'))
</if>
</select>
</mapper> </mapper>