Commit 762aa9fe by 张富康

feat(talentAnalysis): 实现基于角色和省份权限的人才分析数据筛选

- 新增hutool依赖用于便捷的集合和字符串操作
- 扩展QuerySql.getTalentAnalysisBasicData01方法,增加手机号码过滤条件
- 优化TalentAnalysisService服务,支持多角色权限控制及省份筛选
- 实现角色(含区域运营、大区经理、管理层等)对应数据可见范围限制
- 通过多表联查获取角色可见员工手机号列表,用于精准数据过滤
- TalentAnalysisBasicDataReq新增provinceId字段以支持省份权限过滤
- TalentAnalysisBasicDataList统一使用lombok @Data简化代码
- 适配权限判断,返回权限不足提示,避免越权访问
- 完善数据库资源关闭,避免潜在连接泄漏
- 统一接口参数检查,增强参数校验准确性与完整性
- 更新登录角色注释,明确角色编码及含义说明
1 parent 921bf04a
......@@ -210,6 +210,11 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.38</version>
</dependency>
<dependency>
......
......@@ -6,8 +6,6 @@ import com.glsk.util.MysqlUtils;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.stream.Collectors;
/**
* @author fangfang
......@@ -1063,30 +1061,23 @@ public class QuerySql {
}
public static String getTalentAnalysisBasicData01(String wherebusinesstypexxxxxx,String whereentry_datexxxxxx, Connection connInsert){
String sql01="";
public static String getTalentAnalysisBasicData01(String wherebusinesstypexxxxxx, String whereentry_datexxxxxx, String wheremobliePhonexxxxxx, Connection connInsert) {
String sql01 = "";
try {
String sql ="select querysql from business_analysis_query_sql where deleted_flag='N'\n" +
String sql = "select querysql from business_analysis_query_sql where deleted_flag='N'\n" +
"and sqlname='getTalentAnalysisBasicData01'";
PreparedStatement st = connInsert.prepareStatement(sql);
// 执行查询并获取结果
ResultSet rs = st.executeQuery(sql);
while (rs.next()) {
sql01= rs.getString("querysql");
sql01 = rs.getString("querysql");
}
}catch (Exception e){
} catch (Exception e) {
System.out.println(e);
}
sql01=sql01.replace("businesstypexxxxxx",wherebusinesstypexxxxxx).replace("entry_datexxxxxx",whereentry_datexxxxxx);
sql01 = sql01.replace("businesstypexxxxxx", wherebusinesstypexxxxxx)
.replace("entry_datexxxxxx", whereentry_datexxxxxx)
.replace("mobliePhonexxxxxx", wheremobliePhonexxxxxx);
return sql01;
}
......
......@@ -6,7 +6,6 @@ import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.sql.Date;
import java.util.List;
@SuppressWarnings("serial")
......@@ -1311,27 +1310,30 @@ public class ReqRet {
@Data
@ToString
public static class TalentAnalysisBasicDataReq implements Serializable {
@ApiModelProperty(notes = "业务场景", required = true, example="all")
@ApiModelProperty(notes = "业务场景", required = true, example = "all")
private BusinessType businessType;
@ApiModelProperty(notes = "查询类型:日、周、月、自定义", required = true, example="year")
@ApiModelProperty(notes = "查询类型:日、周、月、自定义", required = true, example = "year")
private QueryType queryType;
@ApiModelProperty(notes = "开始时间", required = true, example="2025-01-01")
String startDay;
@ApiModelProperty(notes = "结束时间", required = true, example="2025-12-31")
String endDay;
@ApiModelProperty(notes = "分析岗位的岗位名称", required = true, example="retailsalesman")
JobNameEnum jobName;
@ApiModelProperty(notes = "员工id" ,required = true, example="1111")
String staffId;
@ApiModelProperty(notes = "员工姓名" ,required = true, example="张三")
String staffName;
@ApiModelProperty(notes = "员工手机" ,required = true, example="13112341524")
String staffPhone;
@ApiModelProperty(notes = "角色" ,required = true, example="1")
Integer role;
@ApiModelProperty(notes = "门店ids" ,required = true, example="1")
List<Integer> merchantIds;
@ApiModelProperty(notes = "开始时间", required = true, example = "2025-01-01")
private String startDay;
@ApiModelProperty(notes = "结束时间", required = true, example = "2025-12-31")
private String endDay;
@ApiModelProperty(notes = "分析岗位的岗位名称", required = true, example = "retailsalesman")
private JobNameEnum jobName;
@ApiModelProperty(notes = "员工id", required = true, example = "1111")
private String staffId;
@ApiModelProperty(notes = "员工姓名", required = true, example = "张三")
private String staffName;
@ApiModelProperty(notes = "员工手机", required = true, example = "13112341524")
private String staffPhone;
@ApiModelProperty(notes = "省份id", required = true, example = "120000")
private Integer provinceId;
@ApiModelProperty(notes = "登录角色 1-其他角色 2-服务商老板 3-区域运营 4-广联销售(业务负责人) 5-飞行督导 6-线上运营 7-区域运营大区经理 8-销售大区经理 9-管理层及总部运营",
required = true, example = "3")
private Integer role;
@ApiModelProperty(notes = "区域运营大区经理、销售大区经理可见门店ids", required = true)
private List<Integer> merchantIds;
}
//汇总留存分析
......
package com.glsk.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
......@@ -1694,88 +1695,23 @@ public class ResponseDTO {
}
/*人才分析*/
/*人才分析*/
@Data
public static class TalentAnalysisBasicDataList {
@ApiModelProperty(value = "在职人员总数",required=true )
@ApiModelProperty(value = "在职人员总数", required = true)
private Integer activePersonnelTotalNum;
@ApiModelProperty(value = "入职人员总数",required=true )
@ApiModelProperty(value = "入职人员总数", required = true)
private Integer newEmployeeTotalNum;
@ApiModelProperty(value = "当前在职人数",required=true )
@ApiModelProperty(value = "当前在职人数", required = true)
private Integer currentActivePersonnelNum;
@ApiModelProperty(value = "离职总人数",required=true )
@ApiModelProperty(value = "离职总人数", required = true)
private Integer resignEmployeelTotalNum;
@ApiModelProperty(value = "留存率",required=true )
@ApiModelProperty(value = "留存率", required = true)
private Double retentionRate;
@ApiModelProperty(value = "离职率",required=true )
@ApiModelProperty(value = "离职率", required = true)
private Double resignRate;
public Integer getActivePersonnelTotalNum() {
return activePersonnelTotalNum;
}
public void setActivePersonnelTotalNum(Integer activePersonnelTotalNum) {
this.activePersonnelTotalNum = activePersonnelTotalNum;
}
public Integer getNewEmployeeTotalNum() {
return newEmployeeTotalNum;
}
public void setNewEmployeeTotalNum(Integer newEmployeeTotalNum) {
this.newEmployeeTotalNum = newEmployeeTotalNum;
}
public Integer getCurrentActivePersonnelNum() {
return currentActivePersonnelNum;
}
public void setCurrentActivePersonnelNum(Integer currentActivePersonnelNum) {
this.currentActivePersonnelNum = currentActivePersonnelNum;
}
public Integer getResignEmployeelTotalNum() {
return resignEmployeelTotalNum;
}
public void setResignEmployeelTotalNum(Integer resignEmployeelTotalNum) {
this.resignEmployeelTotalNum = resignEmployeelTotalNum;
}
public Double getRetentionRate() {
return retentionRate;
}
public void setRetentionRate(Double retentionRate) {
this.retentionRate = retentionRate;
}
public Double getResignRate() {
return resignRate;
}
public void setResignRate(Double resignRate) {
this.resignRate = resignRate;
}
}
public static class SummaryRetentionAnalysisList {
@ApiModelProperty(value = "学历分析",required=true )
private List<AcademicQualificationAnalysisList> xueliList;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!