diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index 6c8f4271ce..f552db723a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -26,6 +26,7 @@ public enum DictTypeEnum { SELF_ORG_CATEGORY("self_org_category","社区自组织分类",15), IC_EVENT_SOURCE_TYPE("ic_event_source_type","事件管理",19), IC_SERVICE_TYPE("ic_service_type","服务类别",20), + IC_DANGER_TYPE("ic_danger_type","危化品种类",24), ; private final String code; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java index a90d710b90..aa6f0f2a45 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java @@ -15,17 +15,21 @@ import com.epmet.dto.IcCityManagementDTO; import com.epmet.dto.form.IcCityManagementAddEditFormDTO; import com.epmet.dto.form.IcCityManagementListFormDTO; import com.epmet.dto.result.IcCityManagementListResultDTO; +import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; import com.epmet.entity.IcCityManagementEntity; +import com.epmet.service.CoverageService; import com.epmet.service.IcCityManagementService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 城市管理图层 @@ -36,6 +40,9 @@ import java.util.Map; @Service public class IcCityManagementServiceImpl extends BaseServiceImpl implements IcCityManagementService { + @Autowired + private CoverageService coverageService; + @Override public PageData list(IcCityManagementListFormDTO formDTO) { @@ -52,13 +59,13 @@ public class IcCityManagementServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); - Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List dictList = coverageService.dictMap(formDTO.getCustomerId(), "city_management"); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getCategoryKey, IcCoverageCategoryDictListResultDTO::getCategoryName)); for (IcCityManagementListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { - v.setCategoryName(statusMap.get(v.getCategory())); + v.setCategoryName(dictMap.get(v.getCategory())); } - }*/ + } } return new PageData<>(list, pageInfo.getTotal()); @@ -142,13 +149,13 @@ public class IcCityManagementServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); - Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List dictList = coverageService.dictMap(formDTO.getCustomerId(), "city_management"); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getCategoryKey, IcCoverageCategoryDictListResultDTO::getCategoryName)); for (IcCityManagementListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { - v.setCategoryName(statusMap.get(v.getCategory())); + v.setCategoryName(dictMap.get(v.getCategory())); } - }*/ + } } return resultDTO; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java index 6744a3bb3c..2b55ec4150 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java @@ -5,27 +5,37 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcDangerousChemicalsDao; import com.epmet.dto.IcDangerousChemicalsDTO; import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; +import com.epmet.dto.result.IcCityManagementListResultDTO; +import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.entity.IcDangerousChemicalsEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.CoverageService; import com.epmet.service.IcDangerousChemicalsService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 重点危化品企业 @@ -36,6 +46,10 @@ import java.util.Map; @Service public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl implements IcDangerousChemicalsService { + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + @Autowired + private CoverageService coverageService; @Override public PageData list(IcDangerousChemicalsListFormDTO formDTO) { @@ -52,20 +66,27 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + //危化品种类字典 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode()); Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + //企业类别字典数据 + List dictList = coverageService.dictMap(formDTO.getCustomerId(), "city_management"); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getCategoryKey, IcCoverageCategoryDictListResultDTO::getCategoryName)); for (IcDangerousChemicalsListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { - v.setCategoryName(statusMap.get(v.getCategory())); + v.setCategoryName(dictMap.get(v.getCategory())); } - }*/ + if (StringUtils.isNotBlank(v.getDangerType())) { + v.setDangerTypeName(statusMap.get(v.getDangerType())); + } + } } return new PageData<>(list, pageInfo.getTotal()); } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -142,13 +163,20 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + //危化品种类字典 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode()); Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + //企业类别字典数据 + List dictList = coverageService.dictMap(formDTO.getCustomerId(), "city_management"); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getCategoryKey, IcCoverageCategoryDictListResultDTO::getCategoryName)); for (IcDangerousChemicalsListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { - v.setCategoryName(statusMap.get(v.getCategory())); + v.setCategoryName(dictMap.get(v.getCategory())); + } + if (StringUtils.isNotBlank(v.getDangerType())) { + v.setDangerTypeName(statusMap.get(v.getDangerType())); } - }*/ + } } return resultDTO; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java index e26a033a01..13630ad5aa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java @@ -14,18 +14,23 @@ import com.epmet.dao.IcPublicServiceDao; import com.epmet.dto.IcPublicServiceDTO; import com.epmet.dto.form.IcPublicServiceAddEditFormDTO; import com.epmet.dto.form.IcPublicServiceListFormDTO; +import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; import com.epmet.dto.result.IcPublicServiceListResultDTO; +import com.epmet.dto.result.IcSuperiorResourceListResultDTO; import com.epmet.entity.IcPublicServiceEntity; +import com.epmet.service.CoverageService; import com.epmet.service.IcPublicServiceService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 公共服务图层 @@ -36,6 +41,9 @@ import java.util.Map; @Service public class IcPublicServiceServiceImpl extends BaseServiceImpl implements IcPublicServiceService { + @Autowired + private CoverageService coverageService; + @Override public PageData list(IcPublicServiceListFormDTO formDTO) { @@ -52,13 +60,13 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); - Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List dictList = coverageService.dictMap(formDTO.getCustomerId(), "public_service"); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getCategoryKey, IcCoverageCategoryDictListResultDTO::getCategoryName)); for (IcPublicServiceListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { - v.setCategoryName(statusMap.get(v.getCategory())); + v.setCategoryName(dictMap.get(v.getCategory())); } - }*/ + } } return new PageData<>(list, pageInfo.getTotal()); @@ -142,13 +150,13 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); - Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List dictList = coverageService.dictMap(formDTO.getCustomerId(), "public_service"); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getCategoryKey, IcCoverageCategoryDictListResultDTO::getCategoryName)); for (IcPublicServiceListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { - v.setCategoryName(statusMap.get(v.getCategory())); + v.setCategoryName(dictMap.get(v.getCategory())); } - }*/ + } } return resultDTO; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java index 2939f13d68..3e306a1826 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java @@ -14,18 +14,23 @@ import com.epmet.dao.IcSuperiorResourceDao; import com.epmet.dto.IcSuperiorResourceDTO; import com.epmet.dto.form.IcSuperiorResourceAddEditFormDTO; import com.epmet.dto.form.IcSuperiorResourceListFormDTO; +import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; import com.epmet.dto.result.IcSuperiorResourceListResultDTO; +import com.epmet.dto.result.StaffRoleResultDTO; import com.epmet.entity.IcSuperiorResourceEntity; +import com.epmet.service.CoverageService; import com.epmet.service.IcSuperiorResourceService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 优势资源管理 @@ -36,6 +41,9 @@ import java.util.Map; @Service public class IcSuperiorResourceServiceImpl extends BaseServiceImpl implements IcSuperiorResourceService { + @Autowired + private CoverageService coverageService; + @Override public PageData list(IcSuperiorResourceListFormDTO formDTO) { @@ -52,13 +60,13 @@ public class IcSuperiorResourceServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); - Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List dictList = coverageService.dictMap(formDTO.getCustomerId(), "superior_resource"); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getCategoryKey, IcCoverageCategoryDictListResultDTO::getCategoryName)); for (IcSuperiorResourceListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { - v.setCategoryName(statusMap.get(v.getCategory())); + v.setCategoryName(dictMap.get(v.getCategory())); } - }*/ + } } return new PageData<>(list, pageInfo.getTotal()); @@ -142,13 +150,13 @@ public class IcSuperiorResourceServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); - Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List dictList = coverageService.dictMap(formDTO.getCustomerId(), "superior_resource"); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getCategoryKey, IcCoverageCategoryDictListResultDTO::getCategoryName)); for (IcSuperiorResourceListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { - v.setCategoryName(statusMap.get(v.getCategory())); + v.setCategoryName(dictMap.get(v.getCategory())); } - }*/ + } } return resultDTO;