forked from rongchao/epmet-cloud-rizhao
12 changed files with 284 additions and 107 deletions
@ -1,70 +0,0 @@ |
|||
package com.epmet.commons.tools.enums; |
|||
|
|||
import com.epmet.commons.tools.utils.SpringContextUtils; |
|||
import org.springframework.core.env.Environment; |
|||
|
|||
/** |
|||
* 系统环境变量枚举类 |
|||
* dev|test|prod |
|||
* |
|||
* @author jianjun liu |
|||
* @date 2020-07-03 11:14 |
|||
**/ |
|||
public enum KongCunCustomerEnvEnum { |
|||
/** |
|||
* 环境变量枚举 |
|||
*/ |
|||
DEV("dev", "开发环境", "613cc61a6b8ce4c70d21bd413dac72cc"), |
|||
TEST("test", "体验环境", "b272625617e53620b2b3cbc65d1ecbbb"), |
|||
PROD("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80"), |
|||
UN_KNOWN("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80") |
|||
; |
|||
|
|||
private String code; |
|||
private String name; |
|||
private String customerId; |
|||
|
|||
|
|||
|
|||
KongCunCustomerEnvEnum(String code, String name, String customerId) { |
|||
this.code = code; |
|||
this.name = name; |
|||
this.customerId = customerId; |
|||
} |
|||
|
|||
public static KongCunCustomerEnvEnum getEnum(String code) { |
|||
KongCunCustomerEnvEnum[] values = KongCunCustomerEnvEnum.values(); |
|||
for (KongCunCustomerEnvEnum value : values) { |
|||
if (value.getCode().equals(code)) { |
|||
return value; |
|||
} |
|||
} |
|||
return KongCunCustomerEnvEnum.UN_KNOWN; |
|||
} |
|||
|
|||
public static KongCunCustomerEnvEnum getCurrentEnv(){ |
|||
try { |
|||
Environment environment = SpringContextUtils.getBean(Environment.class); |
|||
String[] activeProfiles = environment.getActiveProfiles(); |
|||
if (activeProfiles.length > 0) { |
|||
return getEnum(activeProfiles[0]); |
|||
} |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return KongCunCustomerEnvEnum.UN_KNOWN; |
|||
} |
|||
|
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public String getCustomerId(){ |
|||
return customerId; |
|||
} |
|||
} |
@ -0,0 +1,38 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.epmet.commons.tools.utils; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 树节点,所有需要实现树节点的,都需要继承该类 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@Data |
|||
public class TreeAreaCodeNode<T> extends TreeStringNode<T> implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String areaCode; |
|||
/** |
|||
* 上级ID |
|||
*/ |
|||
private String parentAreaCode; |
|||
/** |
|||
* 子节点列表 |
|||
*/ |
|||
private List<T> children = new ArrayList<>(); |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.dto.form.govOrg; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 各机关注册用户数入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:47 |
|||
*/ |
|||
@Data |
|||
public class OrgTreeFormDTO implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = 6649155066499141632L; |
|||
|
|||
private String mobile; |
|||
|
|||
private String customerId; |
|||
} |
@ -1,13 +1,18 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import com.epmet.commons.tools.utils.TreeAreaCodeNode; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class OrgTreeNode { |
|||
public class OrgTreeNode extends TreeAreaCodeNode<OrgTreeNode> { |
|||
private String id; |
|||
private String pid; |
|||
private String orgId; |
|||
private String orgName; |
|||
private String orgType; |
|||
private List<OrgTreeNode> subOrgs; |
|||
private String level; |
|||
|
|||
private List<OrgTreeNode> children=new ArrayList<>(); |
|||
} |
|||
|
Loading…
Reference in new issue