diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java new file mode 100644 index 0000000000..e08af03017 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java @@ -0,0 +1,59 @@ +package com.epmet.commons.tools.enums; + +/** + * 社区自组织增加分类:文化队伍、楼委会、老友俱乐部、治安巡逻队、其他 + */ +public enum SelfOrgCategoryEnum { + + /** + * 环境变量枚举 + */ + + WHDW("whdw", "文化队伍", "#0091ed", 1), + LWH("lwh", "楼委会", "#0091ed", 2), + LYJLB("lyjlb", "老友俱乐部", "#0091ed", 3), + ZAXLD("zaxld", "治安巡逻队", "#0091ed", 4), + OTHER("other", "其他", "#0091ed", 5), + ; + + private final String code; + private final String name; + private final String color; + private final Integer sort; + + + SelfOrgCategoryEnum(String code, String name, String color, Integer sort) { + this.code = code; + this.name = name; + this.color = color; + this.sort = sort; + } + + public static SelfOrgCategoryEnum getEnum(String code) { + SelfOrgCategoryEnum[] values = SelfOrgCategoryEnum.values(); + for (SelfOrgCategoryEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return SelfOrgCategoryEnum.OTHER; + + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public String getColor() { + return color; + } + + public Integer getSort() { + return sort; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java index 6ca4a94d25..563ccf0928 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java @@ -42,6 +42,11 @@ public class CommunitySelfOrganizationListDTO implements Serializable { */ private String categoryName; + /** + * 分类的颜色 用于多元数据分析-地图 + */ + private String color; + /** * 服务事项 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SelfOrgCategoryTotalResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SelfOrgCategoryTotalResDTO.java index b79436c9d0..c99e723d0f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SelfOrgCategoryTotalResDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SelfOrgCategoryTotalResDTO.java @@ -17,4 +17,5 @@ public class SelfOrgCategoryTotalResDTO implements Serializable { * 当前分类下的社区自组织数量 */ private Integer total; + private String color; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java index 11bfd15d36..7a70df7777 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.SelfOrgCategoryEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -728,6 +729,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl pageInfo= PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCoordinateList(formDTO)); - return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); + List list=pageInfo.getList(); + for(CommunitySelfOrganizationListDTO dto:list){ + dto.setColor(SelfOrgCategoryEnum.getEnum(dto.getCategoryCode()).getColor()); + } + return new PageData<>(list, pageInfo.getTotal()); } }