generated from dxfeng/secondev-wugang-dxfeng
经理门户 绩效看板接口
This commit is contained in:
parent
7ca4617134
commit
1661fced35
|
|
@ -2,6 +2,7 @@ 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.entity.component.Option;
|
||||
import com.weaver.seconddev.portal.service.ManagerPortalService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -56,4 +58,9 @@ public class ManagerPortalController {
|
|||
return managerPortalService.getTeamEmployee(params);
|
||||
}
|
||||
|
||||
@PostMapping("/getEbFieldOptions")
|
||||
private WeaResult<List<Option>> getEbFieldOptions(@RequestBody Map<String, String> params) {
|
||||
return managerPortalService.getEbFieldOptions(params);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.weaver.seconddev.portal.entity.component;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class Option {
|
||||
private String id;
|
||||
private String content;
|
||||
}
|
||||
|
|
@ -16,4 +16,5 @@ public class BaseParam {
|
|||
private String eteams = "eteams";
|
||||
|
||||
private String table_dept_cus = "ft_1154218872715993098";
|
||||
private String tenantKey;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ public class BasicPersonnelParam extends BaseParam {
|
|||
private String searchType;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private String tenantKey;
|
||||
private String pieType;
|
||||
private Integer startIndex;
|
||||
private Integer endIndex;
|
||||
private String belongYear;
|
||||
|
||||
/*分页查询*/
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,5 @@ import java.util.Set;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class HrbpParam extends BaseParam{
|
||||
private String tenantKey;
|
||||
private Set<Long> departmentIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import java.util.Set;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SearchConditionParam extends BaseParam{
|
||||
private String tenantKey;
|
||||
private String departmentId;
|
||||
private Set<Long> departmentIdList;
|
||||
private String searchDate;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import java.util.Set;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SscParam extends BaseParam {
|
||||
private String tenantKey;
|
||||
private Set<Long> departmentIdList;
|
||||
private String currentDate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
package com.weaver.seconddev.portal.mapper;
|
||||
|
||||
import com.weaver.common.form.datasource.FormdataTemplateDetails;
|
||||
import com.weaver.common.form.metadata.field.FormField;
|
||||
import com.weaver.seconddev.portal.entity.param.BaseParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface EbuilderBaseMapper {
|
||||
/**
|
||||
* 根据表名获取表ID
|
||||
*
|
||||
* @param param
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
long getFormIdByTableName(@Param("param") BaseParam param, @Param("tableName") String tableName);
|
||||
|
||||
/**
|
||||
* 根据表ID和字段名获取字段信息
|
||||
*
|
||||
* @param param
|
||||
* @param formId
|
||||
* @param fieldName
|
||||
* @return
|
||||
*/
|
||||
FormField getFormFieldByFieldName(@Param("param") BaseParam param, @Param("formId") long formId, @Param("fieldName") String fieldName);
|
||||
|
||||
/**
|
||||
* 根据模板ID获取模板详情
|
||||
*
|
||||
* @param param
|
||||
* @param templateId
|
||||
* @return
|
||||
*/
|
||||
List<FormdataTemplateDetails> getFormdataTemplateDetails(@Param("param") BaseParam param, @Param("templateId") long templateId);
|
||||
}
|
||||
|
|
@ -99,6 +99,8 @@ public interface ManagerPortalMapper {
|
|||
*/
|
||||
List<PortalPO> getEducationInfo(BasicPersonnelParam param);
|
||||
|
||||
List<PortalPO> getPerformanceInfo(BasicPersonnelParam param);
|
||||
|
||||
/**
|
||||
* 获取年龄统计数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.weaver.seconddev.portal.service;
|
||||
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.seconddev.portal.entity.component.Option;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -63,5 +65,11 @@ public interface ManagerPortalService {
|
|||
*/
|
||||
WeaResult<Map<String, Object>> getTeamEmployee(Map<String, String> params);
|
||||
|
||||
|
||||
/**
|
||||
* 获取EB表单字段下拉选项
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
WeaResult<List<Option>> getEbFieldOptions(Map<String, String> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@ package com.weaver.seconddev.portal.service.impl;
|
|||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.common.form.datasource.FormdataTemplateDetails;
|
||||
import com.weaver.common.form.metadata.field.FormField;
|
||||
import com.weaver.common.hrm.cache.HrmDepartmentComInfo;
|
||||
import com.weaver.common.hrm.dao.HrmCommonDepartmentDao;
|
||||
import com.weaver.common.hrm.manage.HrmComInfoCacheHandler;
|
||||
import com.weaver.seconddev.portal.entity.component.Option;
|
||||
import com.weaver.seconddev.portal.entity.param.BasicPersonnelParam;
|
||||
import com.weaver.seconddev.portal.entity.po.PieChartConfig;
|
||||
import com.weaver.seconddev.portal.entity.po.PortalPO;
|
||||
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
||||
import com.weaver.seconddev.portal.entity.po.TeamEmployeePo;
|
||||
import com.weaver.seconddev.portal.mapper.EbuilderBaseMapper;
|
||||
import com.weaver.seconddev.portal.mapper.LeaderCockpitMapper;
|
||||
import com.weaver.seconddev.portal.mapper.ManagerPortalMapper;
|
||||
import com.weaver.seconddev.portal.mapper.PortalMapper;
|
||||
|
|
@ -53,6 +57,8 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
HrmCommonDepartmentDao hrmCommonDepartmentDao;
|
||||
@Autowired
|
||||
HrmComInfoCacheHandler hrmComInfoCacheHandler;
|
||||
@Autowired
|
||||
EbuilderBaseMapper ebuilderBaseMapper;
|
||||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object>> getMangerInfo(Map<String, String> params) {
|
||||
|
|
@ -183,6 +189,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
public WeaResult<Map<String, Object>> getEducationInfo(Map<String, String> params) {
|
||||
|
||||
String type = params.get("type");
|
||||
String searchKey = params.get("searchKey");
|
||||
if (StringUtils.isBlank(type)) {
|
||||
// 默认学历信息
|
||||
type = "education";
|
||||
|
|
@ -194,6 +201,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
// 设置部门范围ID集合
|
||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||
basicPersonnelParam.setPieType(type);
|
||||
basicPersonnelParam.setSearchKey(searchKey);
|
||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(currentUser.getTenantKey(), PORTAL_KEY, "getEducationInfo");
|
||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||
List<PortalPO> returnList = new ArrayList<>();
|
||||
|
|
@ -221,6 +229,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
break;
|
||||
case "performance":
|
||||
// 绩效
|
||||
dealPerformanceInfo(basicPersonnelParam, returnList);
|
||||
returnMap.put("url", urlMap.get("performance"));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -258,6 +267,27 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
return WeaResult.success(returnMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeaResult<List<Option>> getEbFieldOptions(Map<String, String> params) {
|
||||
String tableName = params.get("tableName");
|
||||
String fieldName = params.get("fieldName");
|
||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||
User currentUser = UserContext.getCurrentUser();
|
||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
// 查询考核周期选项
|
||||
long formId = ebuilderBaseMapper.getFormIdByTableName(basicPersonnelParam, StringUtils.isBlank(tableName) ? "uf_jxsjtz" : tableName);
|
||||
FormField formField = ebuilderBaseMapper.getFormFieldByFieldName(basicPersonnelParam, formId, StringUtils.isBlank(fieldName) ? "khzq" : fieldName);
|
||||
List<FormdataTemplateDetails> templateDetails = ebuilderBaseMapper.getFormdataTemplateDetails(basicPersonnelParam, formField.getDataTemplateId());
|
||||
|
||||
List<Option> optionList = new ArrayList<>();
|
||||
for (FormdataTemplateDetails templateDetail : templateDetails) {
|
||||
// 构建选项
|
||||
optionList.add(Option.builder().id(templateDetail.getValueKey()).content(templateDetail.getName()).build());
|
||||
}
|
||||
|
||||
return WeaResult.success(optionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 学历分布数据
|
||||
*
|
||||
|
|
@ -325,6 +355,18 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param basicPersonnelParam
|
||||
* @param returnList
|
||||
*/
|
||||
private void dealPerformanceInfo(BasicPersonnelParam basicPersonnelParam, List<PortalPO> returnList) {
|
||||
// 指定查询当前年份数据
|
||||
basicPersonnelParam.setBelongYear(DateUtil.getCurrentYearStr());
|
||||
// 按照考核周期、查询绩效数据
|
||||
returnList.addAll(managerPortalMapper.getPerformanceInfo(basicPersonnelParam));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户当前所负责的所有的部门以及下级部门
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
<?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.EbuilderBaseMapper">
|
||||
|
||||
<select id="getFormIdByTableName" resultType="java.lang.Long">
|
||||
select t.form_id from ${param.e10_common}.form_table t where
|
||||
t.tenant_key = #{param.tenantKey} and t.delete_type = 0
|
||||
and t.table_name = #{tableName}
|
||||
</select>
|
||||
|
||||
<select id="getFormFieldByFieldName" resultType="com.weaver.common.form.metadata.field.FormField">
|
||||
select t.* from ${param.e10_common}.form_field t
|
||||
where t.tenant_key = #{param.tenantKey} and t.delete_type = 0
|
||||
and t.form_id = #{formId} and t.data_key = #{fieldName}
|
||||
</select>
|
||||
|
||||
<select id="getFormdataTemplateDetails"
|
||||
resultType="com.weaver.common.form.datasource.FormdataTemplateDetails">
|
||||
select t.* from ${param.e10_common}.formdata_template_details t
|
||||
where t.tenant_key = #{param.tenantKey} and t.delete_type = 0
|
||||
and t.template_id = #{templateId}
|
||||
order by t.`order`
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -247,6 +247,19 @@
|
|||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getPerformanceInfo" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
||||
select count(t.id) as value , t.ppdj as id
|
||||
from ${e10_common}.uf_jxsjtz t
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
and t.khnf = #{belongYear} and t.khzq = #{searchKey}
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.bm IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by t.ppdj
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue