|
|
@ -2,11 +2,14 @@ package com.epmet.dataaggre.service.govproject.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
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.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
@ -46,6 +49,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
@ -357,6 +361,46 @@ public class GovProjectServiceImpl implements GovProjectService { |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<ProjectCategoryTotalResultDTO> projectCategoryListV2(ProjectCategoryTotalFormDTO formDTO) { |
|
|
|
//1.查询客户下一级分类信息
|
|
|
|
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), "1", "enable"); |
|
|
|
if (CollectionUtils.isEmpty(categoryList)){ |
|
|
|
log.warn("projectCategoryListV2 项目分类字典表 一级分类配置不正确"); |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); |
|
|
|
if (agencyInfo == null){ |
|
|
|
log.warn("projectCategoryListV2 组织信息获取失败"); |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
Map<String, IssueProjectCategoryDictDTO> levelOneCategoryMap = categoryList.stream().collect(Collectors.toMap(IssueProjectCategoryDictDTO::getCategoryCode, Function.identity())); |
|
|
|
|
|
|
|
int length = categoryList.get(NumConstant.ZERO).getCategoryCode().length(); |
|
|
|
formDTO.setCategoryOneLength(length); |
|
|
|
formDTO.setFullOrgIds(formDTO.getAgencyId()); |
|
|
|
if (StringUtils.isNotBlank(agencyInfo.getPids())){ |
|
|
|
formDTO.setFullOrgIds(agencyInfo.getPids().concat(StrConstant.COLON).concat(formDTO.getAgencyId())); |
|
|
|
} |
|
|
|
|
|
|
|
List<ProjectCategoryTotalResultDTO> categoryCount = projectDao.getCategoryCount(formDTO); |
|
|
|
Iterator<ProjectCategoryTotalResultDTO> iterator = categoryCount.iterator(); |
|
|
|
while (iterator.hasNext()){ |
|
|
|
ProjectCategoryTotalResultDTO next = iterator.next(); |
|
|
|
IssueProjectCategoryDictDTO dto = levelOneCategoryMap.get(next.getCategoryCode()); |
|
|
|
if (dto == null){ |
|
|
|
log.warn("projectCategoryListV2 项目分类code已删除,不返回,code:{}", next.getCategoryCode()); |
|
|
|
iterator.remove(); |
|
|
|
continue; |
|
|
|
} |
|
|
|
next.setCategoryName(dto.getCategoryName()); |
|
|
|
next.setColor(dto.getColor()); |
|
|
|
next.setAgencyId(formDTO.getAgencyId()); |
|
|
|
} |
|
|
|
|
|
|
|
return categoryCount; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 赋能平台【项目处理分析】分类下项目列表 |
|
|
|
* @author sun |
|
|
|