add interface
This commit is contained in:
@@ -87,8 +87,6 @@
|
|||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
||||||
@@ -109,5 +107,10 @@
|
|||||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用类型
|
|
||||||
*/
|
|
||||||
public enum AppTypeEnum {
|
|
||||||
// 数智门店-钉钉
|
|
||||||
DING_DING("dingding","数智门店-钉钉"),
|
|
||||||
|
|
||||||
//酷店掌-钉钉
|
|
||||||
DING_DING2("dingding2","酷店掌-钉钉"),
|
|
||||||
|
|
||||||
// 企业微信-数智门店
|
|
||||||
WX_APP("qw","数智门店-企业微信"),
|
|
||||||
|
|
||||||
// 企业微信-酷店掌
|
|
||||||
WX_APP2("qw2","酷店掌-企业微信"),
|
|
||||||
|
|
||||||
//用户自己添加 独立app
|
|
||||||
APP("app","数智门店-客户端"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 酷店掌-自建企业微信
|
|
||||||
*/
|
|
||||||
WX_SELF_APP("qw_self", "酷店掌-自建企业微信"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 酷店掌-自建企业微信代开发
|
|
||||||
*/
|
|
||||||
WX_SELF_DKF("qw_self_dkf", "酷店掌--自建企业微信代开发"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 酷店掌-企业微信私服
|
|
||||||
*/
|
|
||||||
WX_PRIVATE_APP("qw_private", "酷店掌-企业微信私服"),
|
|
||||||
|
|
||||||
WX_PRIVATE_ZHOU("qw_private_zdf","酷店掌-企业微信私服-周大福"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 门店通应用
|
|
||||||
*/
|
|
||||||
ONE_PARTY_APP("one_party", "门店通-钉钉"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 飞书
|
|
||||||
*/
|
|
||||||
FEI_SHU("fei_shu", "飞书")
|
|
||||||
|
|
||||||
;
|
|
||||||
private String value;
|
|
||||||
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
private static final Map<String, AppTypeEnum> map = Arrays.stream(values()).collect(Collectors.toMap(AppTypeEnum::getValue, Function.identity()));
|
|
||||||
|
|
||||||
AppTypeEnum(String value, String message) {
|
|
||||||
this.value = value;
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getMessage(String value){
|
|
||||||
if(StringUtils.isBlank(value)){
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
|
||||||
if(appTypeEnum.value.equals(value)){
|
|
||||||
return appTypeEnum.message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AppTypeEnum getAppType(String appType){
|
|
||||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
|
||||||
if(appTypeEnum.value.equals(appType)){
|
|
||||||
return appTypeEnum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(appType.startsWith(WX_SELF_APP.getValue())) {
|
|
||||||
return WX_SELF_APP;
|
|
||||||
}
|
|
||||||
if(appType.startsWith(WX_PRIVATE_APP.getValue())) {
|
|
||||||
return WX_PRIVATE_APP;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否是钉钉平台
|
|
||||||
* @param value
|
|
||||||
* @author: xugangkun
|
|
||||||
* @return java.lang.Boolean
|
|
||||||
* @date: 2021/10/26 15:03
|
|
||||||
*/
|
|
||||||
public static Boolean isDingType(String value) {
|
|
||||||
if (DING_DING.getValue().equals(value) || DING_DING2.getValue().equals(value) || ONE_PARTY_APP.getValue().equals(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否是企业微信平台
|
|
||||||
* @param value
|
|
||||||
* @author: xugangkun
|
|
||||||
* @return java.lang.Boolean
|
|
||||||
* @date: 2021/10/26 15:03
|
|
||||||
*/
|
|
||||||
public static Boolean isQwType(String value) {
|
|
||||||
if (WX_APP.getValue().equals(value) || WX_APP2.getValue().equals(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否是飞书
|
|
||||||
* @param value
|
|
||||||
* @author: xugangkun
|
|
||||||
* @return java.lang.Boolean
|
|
||||||
* @date: 2021/10/26 15:03
|
|
||||||
*/
|
|
||||||
public static Boolean isFsType(String value) {
|
|
||||||
if (FEI_SHU.getValue().equals(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否是酷店掌
|
|
||||||
* @param value
|
|
||||||
* @author: xugangkun
|
|
||||||
* @return java.lang.Boolean
|
|
||||||
* @date: 2021/10/26 15:03
|
|
||||||
*/
|
|
||||||
public static Boolean isCoolStore(String value) {
|
|
||||||
if (WX_APP2.getValue().equals(value) || DING_DING2.getValue().equals(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否是数智门店
|
|
||||||
* @param value
|
|
||||||
* @author: xugangkun
|
|
||||||
* @return java.lang.Boolean
|
|
||||||
* @date: 2021/10/26 15:03
|
|
||||||
*/
|
|
||||||
public static Boolean isCoolCollege(String value) {
|
|
||||||
if (WX_APP.getValue().equals(value) || DING_DING.getValue().equals(value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否是企微自建应用或者企微私服
|
|
||||||
* @param appType
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static boolean isWxSelfAndPrivateType(String appType) {
|
|
||||||
if(StringUtils.isBlank(appType)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return appType.startsWith(AppTypeEnum.WX_SELF_APP.getValue())
|
|
||||||
|| appType.startsWith(AppTypeEnum.WX_PRIVATE_APP.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean qwIsGetUserName(String appType){
|
|
||||||
if(StringUtils.isBlank(appType) || isDingType(appType)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return appType.startsWith(AppTypeEnum.WX_SELF_APP.getValue()) || appType.startsWith(AppTypeEnum.WX_PRIVATE_APP.getValue())
|
|
||||||
|| appType.startsWith(AppTypeEnum.WX_SELF_DKF.getValue()) || appType.startsWith(AppTypeEnum.WX_PRIVATE_ZHOU.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getCode(String value){
|
|
||||||
if(StringUtils.isBlank(value)){
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
|
||||||
if(appTypeEnum.message.equals(value)){
|
|
||||||
return appTypeEnum.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AppTypeEnum parseValue(String value) {
|
|
||||||
return map.get(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe:
|
|
||||||
*
|
|
||||||
* @author zhouyiping
|
|
||||||
* @date 2020/10/13
|
|
||||||
*/
|
|
||||||
public enum AuthRoleEnum {
|
|
||||||
/**
|
|
||||||
* 全企业数据
|
|
||||||
*/
|
|
||||||
ALL("all", "全企业数据"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所在组织架构包含下级
|
|
||||||
*/
|
|
||||||
INCLUDE_SUBORDINATE("include_subordinate","所在组织架构包含下级"),
|
|
||||||
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 所在的组织架构不包含下级
|
|
||||||
// */
|
|
||||||
NOT_INCLUDE_SUBORDINATE("not_include_subordinate","所在的组织架构不包含下级"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 仅自己的数据
|
|
||||||
*/
|
|
||||||
PERSONAL("personal","仅自己的数据");
|
|
||||||
|
|
||||||
private String code;
|
|
||||||
private String msg;
|
|
||||||
|
|
||||||
protected static final Map<String, AuthRoleEnum> map = Arrays.stream(values()).collect(
|
|
||||||
Collectors.toMap(AuthRoleEnum::getCode, Function.identity()));
|
|
||||||
|
|
||||||
AuthRoleEnum(String code, String msg){
|
|
||||||
this.code=code;
|
|
||||||
this.msg=msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMsg() {
|
|
||||||
return msg;
|
|
||||||
}
|
|
||||||
public static AuthRoleEnum getByCode(String code) {
|
|
||||||
return map.get(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @FileName: EnterpriseStatusEnum
|
|
||||||
* @Description:
|
|
||||||
* @date 2021-09-17 15:53
|
|
||||||
*/
|
|
||||||
public enum EnterpriseStatusEnum {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态-1 已删除 0初始 1正常 100冻结 88创建失败
|
|
||||||
*/
|
|
||||||
|
|
||||||
DELETED(-1,"已删除"),
|
|
||||||
INIT(0,"初始"),
|
|
||||||
NORMAL(1,"正常"),
|
|
||||||
FREEZE(100,"冻结"),
|
|
||||||
CREATE_FAIL(88,"创建失败"),
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
private int code;
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
EnterpriseStatusEnum(int code, String message) {
|
|
||||||
this.code = code;
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getMessage(Integer code){
|
|
||||||
if(Objects.isNull(code)){
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
for (EnterpriseStatusEnum value : EnterpriseStatusEnum.values()) {
|
|
||||||
if(code.equals(value.code)){
|
|
||||||
return value.message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Aaron
|
|
||||||
* @Description 业务统一返回码
|
|
||||||
* @date 2019/12/20
|
|
||||||
*/
|
|
||||||
public enum RegionTypeEnum {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
ROOT("root", "根节点"),
|
|
||||||
|
|
||||||
|
|
||||||
PATH("path", "区域"),
|
|
||||||
|
|
||||||
|
|
||||||
STORE("store", "门店");
|
|
||||||
|
|
||||||
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
|
|
||||||
private String desc;
|
|
||||||
|
|
||||||
RegionTypeEnum(String type, String desc) {
|
|
||||||
this.type = type;
|
|
||||||
this.desc = desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDesc() {
|
|
||||||
return desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import javax.management.relation.Role;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public enum RoleEnum {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 管理员
|
|
||||||
*/
|
|
||||||
MASTER("20000000", "管理员", 1,"master"),
|
|
||||||
/**
|
|
||||||
* 子管理员
|
|
||||||
*/
|
|
||||||
SUB_MASTER("80000000", "子管理员", 2,"sub_master"),
|
|
||||||
/**
|
|
||||||
* 普通员工
|
|
||||||
*/
|
|
||||||
EMPLOYEE("30000000", "未分配", 99999999,"employee"),
|
|
||||||
/**
|
|
||||||
* 部门负责人
|
|
||||||
*/
|
|
||||||
DEPT_LEADER("40000000", "部门负责人", 10,"dept_leader"),
|
|
||||||
/**
|
|
||||||
* 店长
|
|
||||||
*/
|
|
||||||
SHOPOWNER("50000000", "店长", 3,"shopowner"),
|
|
||||||
/**
|
|
||||||
* 运营
|
|
||||||
*/
|
|
||||||
OPERATOR("60000000", "运营", 4,"operator"),
|
|
||||||
/**
|
|
||||||
* 店员
|
|
||||||
*/
|
|
||||||
CLERK("70000000", "店员", 5,"clerk");
|
|
||||||
|
|
||||||
|
|
||||||
private static final Map<String, RoleEnum> MAP = Arrays.stream(values()).collect(
|
|
||||||
Collectors.toMap(RoleEnum::getRoleEnum, Function.identity()));
|
|
||||||
|
|
||||||
private static final Map<String, RoleEnum> ROLE_ID_MAP = Arrays.stream(values()).collect(
|
|
||||||
Collectors.toMap(RoleEnum::getId, Function.identity()));
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
private String name;
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
private Integer priority;
|
|
||||||
|
|
||||||
private String roleEnum;
|
|
||||||
|
|
||||||
|
|
||||||
RoleEnum(String id, String name, Integer priority, String roleEnum) {
|
|
||||||
this.id = id;
|
|
||||||
this.name = name;
|
|
||||||
this.priority = priority;
|
|
||||||
this.roleEnum=roleEnum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRoleEnum() {
|
|
||||||
return roleEnum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RoleEnum getByCode(String code) {
|
|
||||||
return MAP.get(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否是管理员 及 子管理员
|
|
||||||
* @param code
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static boolean isAdmin(String code){
|
|
||||||
if(MASTER.getRoleEnum().equals(code) || SUB_MASTER.getRoleEnum().equals(code)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id 判断 是否是管理员 及 子管理员
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static boolean isAdminById(String id){
|
|
||||||
if(MASTER.getId().equals(id) || SUB_MASTER.getId().equals(id)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否包含角色id
|
|
||||||
* @param roleId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static boolean isContainsRoleId(String roleId){
|
|
||||||
return ROLE_ID_MAP.containsKey(roleId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 门店删除状态枚举
|
|
||||||
*/
|
|
||||||
public enum StoreIsDeleteEnum {
|
|
||||||
EFFECTIVE("effective"),//有效
|
|
||||||
|
|
||||||
INVALID("invalid"),//无效
|
|
||||||
|
|
||||||
IGNORED("ignored"), //忽略
|
|
||||||
|
|
||||||
UN_SYNC("unSync"); // 未同步
|
|
||||||
|
|
||||||
private final String value;
|
|
||||||
|
|
||||||
private static final Map<String, StoreIsDeleteEnum> map = Arrays.stream(values()).collect(Collectors.toMap(StoreIsDeleteEnum::getValue, Function.identity()));
|
|
||||||
|
|
||||||
StoreIsDeleteEnum(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static StoreIsDeleteEnum parse(int value) {
|
|
||||||
return map.get(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author wxp
|
|
||||||
* @FileName: SubordinateSourceEnum
|
|
||||||
* @Description: auto自动关联 select手动选择
|
|
||||||
* @date 2022-12-30 17:12
|
|
||||||
*/
|
|
||||||
public enum SubordinateSourceEnum {
|
|
||||||
|
|
||||||
AUTO("auto", "关联区域门店权限"),
|
|
||||||
SELECT("select", "手动选择");
|
|
||||||
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
private String msg;
|
|
||||||
|
|
||||||
protected static final Map<String, SubordinateSourceEnum> map = Arrays.stream(values()).collect(
|
|
||||||
Collectors.toMap(SubordinateSourceEnum::getCode, Function.identity()));
|
|
||||||
|
|
||||||
SubordinateSourceEnum(String code, String msg) {
|
|
||||||
this.code = code;
|
|
||||||
this.msg = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMsg() {
|
|
||||||
return msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SubordinateSourceEnum getByCode(String code) {
|
|
||||||
return map.get(code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zyp
|
|
||||||
*/
|
|
||||||
public enum UserAuthMappingTypeEnum {
|
|
||||||
/**
|
|
||||||
* 区域
|
|
||||||
*/
|
|
||||||
REGION("region","区域"),
|
|
||||||
/**
|
|
||||||
* 门店
|
|
||||||
*/
|
|
||||||
STORE("store","门店");
|
|
||||||
|
|
||||||
private String code;
|
|
||||||
private String desc;
|
|
||||||
public static final Map<String, UserAuthMappingTypeEnum> map = Arrays.stream(values()).collect(
|
|
||||||
Collectors.toMap(UserAuthMappingTypeEnum::getCode, Function.identity()));
|
|
||||||
|
|
||||||
UserAuthMappingTypeEnum(String code, String desc) {
|
|
||||||
this.code = code;
|
|
||||||
this.desc = desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDesc() {
|
|
||||||
return desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UserAuthMappingTypeEnum getByCode(String code) {
|
|
||||||
return map.get(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: UserPositionEnum
|
||||||
|
* @Description:用户身份
|
||||||
|
* @date 2023-06-19 16:37
|
||||||
|
*/
|
||||||
|
public enum UserPositionEnum {
|
||||||
|
|
||||||
|
INVESTMENT_MANAGER("investment_manager", "招商经理"),
|
||||||
|
INVESTMENT_LEADER("investment_leader", "招商负责人"),
|
||||||
|
DEVELOPMENT_DIRECTOR("development_director", "开发主管"),
|
||||||
|
DEVELOPMENT_MANAGER("development_manager", "开发经理"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
UserPositionEnum(String code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package com.cool.store.enums;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author wxp
|
|
||||||
* @FileName: UserSelectRangeEnum
|
|
||||||
* @Description: 用户选取范围 共同编辑人范围:self-仅自己,all-全部人员,define-自定义
|
|
||||||
* @date 2022-12-30 17:12
|
|
||||||
*/
|
|
||||||
public enum UserSelectRangeEnum {
|
|
||||||
|
|
||||||
SELF("self", "仅自己"),
|
|
||||||
ALL("all", "全部人员"),
|
|
||||||
DEFINE("define", "自定义");
|
|
||||||
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
private String msg;
|
|
||||||
|
|
||||||
protected static final Map<String, UserSelectRangeEnum> map = Arrays.stream(values()).collect(
|
|
||||||
Collectors.toMap(UserSelectRangeEnum::getCode, Function.identity()));
|
|
||||||
|
|
||||||
UserSelectRangeEnum(String code, String msg) {
|
|
||||||
this.code = code;
|
|
||||||
this.msg = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMsg() {
|
|
||||||
return msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UserSelectRangeEnum getByCode(String code) {
|
|
||||||
return map.get(code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -110,8 +110,6 @@
|
|||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
||||||
@@ -131,6 +129,11 @@
|
|||||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||||
|
|||||||
@@ -64,4 +64,23 @@ public class EnterpriseUserDAO {
|
|||||||
public List<EnterpriseUserDO> searchUserByRegionIdsAndKeyword(List<String> regionIds, String keyword, boolean isLeader){
|
public List<EnterpriseUserDO> searchUserByRegionIdsAndKeyword(List<String> regionIds, String keyword, boolean isLeader){
|
||||||
return enterpriseUserMapper.searchUserByRegionIdsAndKeyword(regionIds, keyword, isLeader);
|
return enterpriseUserMapper.searchUserByRegionIdsAndKeyword(regionIds, keyword, isLeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExistDeptUser(String regionId){
|
||||||
|
if(StringUtils.isBlank(regionId)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return enterpriseUserMapper.getUserCountByRegionId(regionId) > CommonConstants.ZERO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门负责人
|
||||||
|
* @param regionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<EnterpriseUserDO> getUserListByDeptLeader(String regionId){
|
||||||
|
if(StringUtils.isBlank(regionId)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
return enterpriseUserMapper.getUserListByDeptLeader(regionId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,8 @@ import com.cool.store.entity.HyOpenAreaInfoDO;
|
|||||||
import com.cool.store.mapper.HyIntendDevZoneInfoMapper;
|
import com.cool.store.mapper.HyIntendDevZoneInfoMapper;
|
||||||
import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -48,4 +50,16 @@ public class HyIntendDevZoneInfoDAO {
|
|||||||
return hyIntendDevZoneInfoMapper.getHyIntendDevZoneInfoList(type);
|
return hyIntendDevZoneInfoMapper.getHyIntendDevZoneInfoList(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据组织架构获取配置信息
|
||||||
|
* @param regionIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<HyIntendDevZoneInfoDO> getZoneInfoByRegionIds(List<String> regionIds){
|
||||||
|
if(CollectionUtils.isEmpty(regionIds)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
return hyIntendDevZoneInfoMapper.getZoneInfoByRegionIds(regionIds);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,4 +96,16 @@ public class RegionDAO {
|
|||||||
return regionMapper.deleteRegionByRegionId(regionId);
|
return regionMapper.deleteRegionByRegionId(regionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的子节点
|
||||||
|
* @param leadDeptIds
|
||||||
|
*/
|
||||||
|
public List<String> getSubRegionIds(List<String> leadDeptIds) {
|
||||||
|
if(CollectionUtils.isEmpty(leadDeptIds)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
List<RegionDO> regionList = getRegionByRegionIds(leadDeptIds);
|
||||||
|
List<String> regionPathList = regionList.stream().map(RegionDO::getRegionPath).collect(Collectors.toList());
|
||||||
|
return regionMapper.getSubRegionIds(regionPathList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,4 +84,16 @@ public class UserRegionMappingDAO {
|
|||||||
return userRegionMappingMapper.getRegionIdsByUserId(userId);
|
return userRegionMappingMapper.getRegionIdsByUserId(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户列表
|
||||||
|
* @param regionIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<String> getUserListByRegionIds(List<String> regionIds){
|
||||||
|
if(CollectionUtils.isEmpty(regionIds)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
return userRegionMappingMapper.getUserListByRegionIds(regionIds);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,4 +61,20 @@ public interface EnterpriseUserMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<EnterpriseUserDO> searchUserByRegionIdsAndKeyword(@Param("regionIds") List<String> regionIds, @Param("keyword") String keyword, @Param("isLeader") boolean isLeader);
|
List<EnterpriseUserDO> searchUserByRegionIdsAndKeyword(@Param("regionIds") List<String> regionIds, @Param("keyword") String keyword, @Param("isLeader") boolean isLeader);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门用户数
|
||||||
|
* @param regionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer getUserCountByRegionId(@Param("regionId") String regionId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门负责人用户列表
|
||||||
|
* @param regionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EnterpriseUserDO> getUserListByDeptLeader(String regionId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -39,4 +39,11 @@ public interface HyIntendDevZoneInfoMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type);
|
List<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据组织架构获取配置信息
|
||||||
|
* @param regionIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<HyIntendDevZoneInfoDO> getZoneInfoByRegionIds(@Param("regionIds") List<String> regionIds);
|
||||||
}
|
}
|
||||||
@@ -71,4 +71,11 @@ public interface RegionMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer deleteRegionByRegionId(@Param("regionId") String regionId);
|
Integer deleteRegionByRegionId(@Param("regionId") String regionId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取子节点
|
||||||
|
* @param regionPathList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getSubRegionIds(@Param("regionPathList") List<String> regionPathList);
|
||||||
}
|
}
|
||||||
@@ -68,4 +68,11 @@ public interface UserRegionMappingMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> getRegionIdsByUserId(@Param("userId") String userId);
|
List<String> getRegionIdsByUserId(@Param("userId") String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户列表
|
||||||
|
* @param regionIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getUserListByRegionIds(@Param("regionIds") List<String> regionIds);
|
||||||
}
|
}
|
||||||
@@ -280,4 +280,12 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserCountByRegionId" resultType="integer">
|
||||||
|
select count(1) from enterprise_user where deleted = 0 and user_region_ids like concat("%", #{regionId}, "%")
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserListByDeptLeader" resultMap="BaseResultMap">
|
||||||
|
select user_id, leader_dept_ids from enterprise_user where leader_dept_ids like concat("%", #{regionId}, "%") and deleted = 0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -128,4 +128,13 @@
|
|||||||
where type = #{type}
|
where type = #{type}
|
||||||
and deleted = 0
|
and deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getZoneInfoByRegionIds" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from
|
||||||
|
hy_intend_dev_zone_info
|
||||||
|
where
|
||||||
|
deleted = 0 and <foreach collection="regionIds" separator="or" open="(" close=")" item="regionId">associated_region_id like concat("%", #{regionId}, "%")</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -204,4 +204,8 @@
|
|||||||
<update id="deleteRegionByRegionId">
|
<update id="deleteRegionByRegionId">
|
||||||
update region set deleted = 1 where region_id = #{regionId}
|
update region set deleted = 1 where region_id = #{regionId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getSubRegionIds" resultType="string">
|
||||||
|
select region_id from region where deleted = 0 and <foreach collection="regionPathList" item="regionPath" open="(" close=")" separator="or"> region_path like (#{regionPath, '%'})</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -131,4 +131,8 @@
|
|||||||
select region_id from user_region_mapping where user_id = #{userId}
|
select region_id from user_region_mapping where user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserListByRegionIds" resultType="string">
|
||||||
|
select user_id from user_region_mapping where region_id in <foreach collection="regionIds" item="regionId" open="(" close=")" separator=",">#{regionId}</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -88,8 +88,6 @@
|
|||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
||||||
@@ -110,6 +108,11 @@
|
|||||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.cool.store.dto.buser;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: UserPositionAndUserScopeDTO
|
||||||
|
* @Description: 员工角色&获取线索范围
|
||||||
|
* @date 2023-06-19 16:33
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserPositionAndUserScopeDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty("招商经理用户ids")
|
||||||
|
private List<String> investmentUserIds;
|
||||||
|
|
||||||
|
@ApiModelProperty("开发经理用户ids")
|
||||||
|
private List<String> developmentUserIds;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
import com.cool.store.dto.buser.UserPositionAndUserScopeDTO;
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.request.EnterpriseUserRequest;
|
|
||||||
import com.cool.store.vo.EnterpriseUserSingleInfoVO;
|
import com.cool.store.vo.EnterpriseUserSingleInfoVO;
|
||||||
import com.cool.store.vo.buser.EnterpriseUserPageVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
@@ -25,4 +23,16 @@ public interface EnterpriseUserService {
|
|||||||
*/
|
*/
|
||||||
List<EnterpriseUserSingleInfoVO> getInvestmentManagerList(String type,String userId,String keyword);
|
List<EnterpriseUserSingleInfoVO> getInvestmentManagerList(String type,String userId,String keyword);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户角色已用户管辖的员工范围
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
UserPositionAndUserScopeDTO getUserIdsByScope(String userId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<EnterpriseUserSingleInfoVO> getDevelopmentDirectorList(String wantShopArea);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,9 +243,20 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
|||||||
break;
|
break;
|
||||||
case DEPARTMENT_DELETED:
|
case DEPARTMENT_DELETED:
|
||||||
boolean leafNode = regionDAO.isLeafNode(departmentDetail.getId());
|
boolean leafNode = regionDAO.isLeafNode(departmentDetail.getId());
|
||||||
if(leafNode){
|
boolean isExistUser = enterpriseUserDAO.isExistDeptUser(departmentDetail.getId());
|
||||||
|
if(leafNode && !isExistUser){
|
||||||
//叶子节点的时候会删除部门
|
//叶子节点的时候会删除部门
|
||||||
regionDAO.deleteRegionByRegionId(departmentDetail.getId());
|
regionDAO.deleteRegionByRegionId(departmentDetail.getId());
|
||||||
|
//清除负责人信息
|
||||||
|
List<EnterpriseUserDO> leaderUserList = enterpriseUserDAO.getUserListByDeptLeader(departmentDetail.getId());
|
||||||
|
for (EnterpriseUserDO enterpriseUser : leaderUserList) {
|
||||||
|
List<String> existDeptIds = JSONObject.parseArray(enterpriseUser.getLeaderDeptIds()).stream().map(String::valueOf).collect(Collectors.toList());
|
||||||
|
if(CollectionUtils.isNotEmpty(existDeptIds)){
|
||||||
|
existDeptIds.remove(departmentDetail.getId());
|
||||||
|
}
|
||||||
|
enterpriseUser.setLeaderDeptIds(JSONObject.toJSONString(existDeptIds));
|
||||||
|
}
|
||||||
|
enterpriseUserDAO.batchInsertOrUpdate(leaderUserList);
|
||||||
}else{
|
}else{
|
||||||
syncAll();
|
syncAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
|
import com.cool.store.dto.buser.UserPositionAndUserScopeDTO;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.UserPositionEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.service.EnterpriseUserService;
|
import com.cool.store.service.EnterpriseUserService;
|
||||||
import com.cool.store.service.ZoneService;
|
import com.cool.store.service.ZoneService;
|
||||||
import com.cool.store.vo.EnterpriseUserSingleInfoVO;
|
import com.cool.store.vo.EnterpriseUserSingleInfoVO;
|
||||||
@@ -10,10 +15,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
import java.util.stream.Collectors;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
@@ -31,11 +34,13 @@ public class EnterpriseUserServiceImpl implements EnterpriseUserService {
|
|||||||
@Resource
|
@Resource
|
||||||
private EnterpriseUserRoleDAO enterpriseUserRoleDAO;
|
private EnterpriseUserRoleDAO enterpriseUserRoleDAO;
|
||||||
@Resource
|
@Resource
|
||||||
ZoneService zoneService;
|
private ZoneService zoneService;
|
||||||
@Resource
|
@Resource
|
||||||
RegionDAO regionDAO;
|
private RegionDAO regionDAO;
|
||||||
@Resource
|
@Resource
|
||||||
UserRegionMappingDAO userRegionMappingDAO;
|
private UserRegionMappingDAO userRegionMappingDAO;
|
||||||
|
@Resource
|
||||||
|
private HyIntendDevZoneInfoDAO hyIntendDevZoneInfoDAO;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -87,4 +92,52 @@ public class EnterpriseUserServiceImpl implements EnterpriseUserService {
|
|||||||
});
|
});
|
||||||
return enterpriseUserSingleInfoVOS;
|
return enterpriseUserSingleInfoVOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserPositionAndUserScopeDTO getUserIdsByScope(String userId) {
|
||||||
|
EnterpriseUserDO userInfo = enterpriseUserDAO.getUserInfoById(userId);
|
||||||
|
if(Objects.isNull(userInfo)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.USER_NOT_EXIST);
|
||||||
|
}
|
||||||
|
UserPositionAndUserScopeDTO result = new UserPositionAndUserScopeDTO();
|
||||||
|
if(!userInfo.getIsLeader()){
|
||||||
|
result.setDevelopmentUserIds(Arrays.asList(userId));
|
||||||
|
result.setInvestmentUserIds(Arrays.asList(userId));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
List<String> leadDeptIds = JSONObject.parseArray(userInfo.getLeaderDeptIds()).stream().map(String::valueOf).collect(Collectors.toList());
|
||||||
|
//获取这些区域的子节点
|
||||||
|
List<String> subRegionIds = regionDAO.getSubRegionIds(leadDeptIds);
|
||||||
|
//这些部门是否关联了意向区域
|
||||||
|
List<HyIntendDevZoneInfoDO> zoneInfoList = hyIntendDevZoneInfoDAO.getZoneInfoByRegionIds(subRegionIds);
|
||||||
|
if(CollectionUtils.isEmpty(zoneInfoList)){
|
||||||
|
result.setDevelopmentUserIds(Arrays.asList(userId));
|
||||||
|
result.setInvestmentUserIds(Arrays.asList(userId));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//意向区域
|
||||||
|
List<String> intendList = zoneInfoList.stream().filter(o -> "intent".equals(o.getType())).flatMap(o->JSONObject.parseArray(o.getAssociatedRegionId(), String.class).stream()).collect(Collectors.toList());
|
||||||
|
if(CollectionUtils.isNotEmpty(intendList)){
|
||||||
|
//获取负责的区域
|
||||||
|
intendList.retainAll(subRegionIds);
|
||||||
|
List<String> userList = userRegionMappingDAO.getUserListByRegionIds(intendList);
|
||||||
|
userList.add(userId);
|
||||||
|
result.setInvestmentUserIds(userList);
|
||||||
|
}
|
||||||
|
//开发区域
|
||||||
|
List<String> developementList = zoneInfoList.stream().filter(o -> "developement".equals(o.getType())).flatMap(o->JSONObject.parseArray(o.getAssociatedRegionId(), String.class).stream()).collect(Collectors.toList());
|
||||||
|
if(CollectionUtils.isNotEmpty(developementList)){
|
||||||
|
//获取负责的区域
|
||||||
|
developementList.retainAll(subRegionIds);
|
||||||
|
List<String> userList = userRegionMappingDAO.getUserListByRegionIds(developementList);
|
||||||
|
userList.add(userId);
|
||||||
|
result.setDevelopmentUserIds(userList);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EnterpriseUserSingleInfoVO> getDevelopmentDirectorList(String wantShopArea) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,11 @@
|
|||||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||||
@@ -88,8 +93,6 @@
|
|||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:tea:1.2.7" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:tea:1.2.7" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.7" level="project" />
|
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.7" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.cool.store.controller;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.dao.EnterpriseUserDAO;
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
|
import com.cool.store.dto.buser.UserPositionAndUserScopeDTO;
|
||||||
import com.cool.store.dto.calendar.CreateCalendarEventDTO;
|
import com.cool.store.dto.calendar.CreateCalendarEventDTO;
|
||||||
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
|
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
|
||||||
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
|
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
|
||||||
@@ -223,4 +224,9 @@ public class TestController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("getUserIdsByScope")
|
||||||
|
public ResponseResult getUserIdsByScope(@RequestParam("userId") String userId){
|
||||||
|
return ResponseResult.success(enterpriseUserService.getUserIdsByScope(userId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,11 @@
|
|||||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||||
@@ -88,8 +93,6 @@
|
|||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.aliyun:tea:1.2.7" level="project" />
|
<orderEntry type="library" name="Maven: com.aliyun:tea:1.2.7" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.7" level="project" />
|
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.7" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
||||||
|
|||||||
Reference in New Issue
Block a user