Browse Source

多元饼和地图分类颜色一致

dev
yinzuomei 3 years ago
parent
commit
04b7c2c4f3
  1. 59
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java
  3. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SelfOrgCategoryTotalResDTO.java
  4. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

59
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;
}
}

5
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 categoryName;
/**
* 分类的颜色 用于多元数据分析-地图
*/
private String color;
/** /**
* 服务事项 * 服务事项
*/ */

1
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 Integer total;
private String color;
} }

8
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.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum; 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.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ExceptionUtils;
@ -728,6 +729,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
resDTO.setCategoryCode(key); resDTO.setCategoryCode(key);
resDTO.setCategoryName(dictMapRes.getData().get(key)); resDTO.setCategoryName(dictMapRes.getData().get(key));
resDTO.setTotal(map.containsKey(key) ? map.get(key) : NumConstant.ZERO); resDTO.setTotal(map.containsKey(key) ? map.get(key) : NumConstant.ZERO);
resDTO.setColor(SelfOrgCategoryEnum.getEnum(key).getColor());
resultList.add(resDTO); resultList.add(resDTO);
} }
return resultList; return resultList;
@ -768,7 +770,11 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
formDTO.setAgencyId(staffInfo.getAgencyId()); formDTO.setAgencyId(staffInfo.getAgencyId());
PageInfo<CommunitySelfOrganizationListDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(), PageInfo<CommunitySelfOrganizationListDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCoordinateList(formDTO)); formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCoordinateList(formDTO));
return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); List<CommunitySelfOrganizationListDTO> list=pageInfo.getList();
for(CommunitySelfOrganizationListDTO dto:list){
dto.setColor(SelfOrgCategoryEnum.getEnum(dto.getCategoryCode()).getColor());
}
return new PageData<>(list, pageInfo.getTotal());
} }
} }

Loading…
Cancel
Save