Commit 762aa9fe by 张富康

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

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