Commit b9272893 by 张富康

refactor(usedcar): 优化二手车数据权限控制和角色调整

- 将登录角色LoginRoleEnum迁移至peanalysis模块,修正SALE角色命名错误
- 新增OperationStatusRequest等请求参数中大区ID字段
- usedCarDataStatsController中API调用增加角色和大区ID校验和设置
- UsedCarDataStatsService针对销售大区经理和区域运营经理角色,增加商户ID权限交集筛选逻辑
- 修改相关请求DTO增加role和regionId字段,支持权限过滤
- 清理原LoginRoleEnum冗余枚举类,统一枚举来源
- 修复权限检查逻辑,防止无权限用户访问数据,提升安全性
1 parent 412da7be
...@@ -61,5 +61,16 @@ public class CycleDataReq implements Serializable { ...@@ -61,5 +61,16 @@ public class CycleDataReq implements Serializable {
@NotNull @NotNull
private String endTime; private String endTime;
/**
* 权限角色
*/
private Integer role;
/**
* 大区ID
*/
@ApiModelProperty(notes = "大区ID(仅大区经理角色才有,销售人员有所属大区才有)")
private String regionId;
} }
...@@ -52,6 +52,13 @@ public class FlowContributionRankingReq implements Serializable { ...@@ -52,6 +52,13 @@ public class FlowContributionRankingReq implements Serializable {
*/ */
private Integer role; private Integer role;
/**
* 大区ID
*/
@ApiModelProperty(notes = "大区ID(仅大区经理角色才有,销售人员有所属大区才有)")
private String regionId;
/** /**
* 用户id * 用户id
*/ */
......
...@@ -37,6 +37,12 @@ public class OperationStatusReq implements Serializable { ...@@ -37,6 +37,12 @@ public class OperationStatusReq implements Serializable {
private Integer role; private Integer role;
/** /**
* 大区ID
*/
@ApiModelProperty(notes = "大区ID(仅大区经理角色才有,销售人员有所属大区才有)")
private String regionId;
/**
* 用户id * 用户id
*/ */
private String userUuid; private String userUuid;
......
...@@ -52,6 +52,12 @@ public class RegionDistributionReq implements Serializable { ...@@ -52,6 +52,12 @@ public class RegionDistributionReq implements Serializable {
private Integer role; private Integer role;
/** /**
* 大区ID
*/
@ApiModelProperty(notes = "大区ID(仅大区经理角色才有,销售人员有所属大区才有)")
private String regionId;
/**
* 用户id * 用户id
*/ */
private String userUuid; private String userUuid;
......
...@@ -58,6 +58,12 @@ public class StockStoreAnalysisReq implements Serializable { ...@@ -58,6 +58,12 @@ public class StockStoreAnalysisReq implements Serializable {
private Integer role; private Integer role;
/** /**
* 大区ID
*/
@ApiModelProperty(notes = "大区ID(仅大区经理角色才有,销售人员有所属大区才有)")
private String regionId;
/**
* 用户id * 用户id
*/ */
private String userUuid; private String userUuid;
......
...@@ -78,6 +78,13 @@ public class StoreListCountReq implements Serializable { ...@@ -78,6 +78,13 @@ public class StoreListCountReq implements Serializable {
*/ */
private Integer role; private Integer role;
/**
* 大区ID
*/
@ApiModelProperty(notes = "大区ID(仅大区经理角色才有,销售人员有所属大区才有)")
private String regionId;
/** /**
* 用户id * 用户id
*/ */
......
...@@ -96,6 +96,13 @@ public class StoreListReq implements Serializable { ...@@ -96,6 +96,13 @@ public class StoreListReq implements Serializable {
*/ */
private Integer role; private Integer role;
/**
* 大区ID
*/
@ApiModelProperty(notes = "大区ID(仅大区经理角色才有,销售人员有所属大区才有)")
private String regionId;
/** /**
* 用户id * 用户id
*/ */
......
package cn.com.glsx.dj.peanalysis.enums;
public enum LoginRoleEnum {
OTHER(1,"其他角色"),
SERVICE_BOSS(2,"服务商老板"),
AREA_SUPERVISION(3,"区域运营"),
SALE(4,"广联销售"),
FLIGHT_SUPERVISION(5,"飞行督导"),
ONLINE_SUPERVISION(6,"线上运营"),
AREA_SUPERVISION_LEADER(7,"区域运营经理"),
SALE_LEADER(8,"销售大区经理"),
NONE(0,"没有角色信息"),
;
private final int value;
private final String name;
LoginRoleEnum(int value,String name){
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
public static LoginRoleEnum getByValue(Integer value) {
if(value == null) {
return null;
}
for(LoginRoleEnum e:LoginRoleEnum.values()) {
if(e.getValue() == value) {
return e;
}
}
return null;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!