|
|
@ -45,9 +45,7 @@ import com.epmet.dto.form.demand.*; |
|
|
|
import com.epmet.dto.result.AllGridsByUserIdResultDTO; |
|
|
|
import com.epmet.dto.result.IcResiUserBriefDTO; |
|
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
import com.epmet.dto.result.demand.DemandRecResultDTO; |
|
|
|
import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO; |
|
|
|
import com.epmet.dto.result.demand.IcResiUserReportDemandRes; |
|
|
|
import com.epmet.dto.result.demand.*; |
|
|
|
import com.epmet.entity.*; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
@ -239,9 +237,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
//3、查询志愿者
|
|
|
|
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
|
|
|
|
Map<String,String> userInfoMap=new HashMap<>(); |
|
|
|
List<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toList()); |
|
|
|
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); |
|
|
|
if(CollectionUtils.isNotEmpty(userIdList)){ |
|
|
|
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); |
|
|
|
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); |
|
|
|
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ |
|
|
|
throw new RenException("查询志愿者信息异常"); |
|
|
|
} |
|
|
@ -654,9 +652,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
//3、查询志愿者
|
|
|
|
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
|
|
|
|
Map<String,String> userInfoMap=new HashMap<>(); |
|
|
|
List<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toList()); |
|
|
|
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); |
|
|
|
if(CollectionUtils.isNotEmpty(userIdList)){ |
|
|
|
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); |
|
|
|
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); |
|
|
|
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ |
|
|
|
throw new RenException("查询志愿者信息异常"); |
|
|
|
} |
|
|
@ -696,6 +694,79 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
return new PageData<>(list, total); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 数据分析-服务措施分析-柱状图 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public CategoryAnalysisResDTO categoryAnalysis(CategoryAnalysisFormDTO formDTO) { |
|
|
|
//1、一级分类字典,没有分类直接退出
|
|
|
|
SubCodeFormDTO subCodeFormDTO=new SubCodeFormDTO(); |
|
|
|
subCodeFormDTO.setCustomerId(formDTO.getCusotmerId()); |
|
|
|
subCodeFormDTO.setParentCategoryCode(NumConstant.ZERO_STR); |
|
|
|
List<OptionDTO> firstCategoryList=demandDictService.querySubCodeList(subCodeFormDTO); |
|
|
|
if(CollectionUtils.isEmpty(firstCategoryList)){ |
|
|
|
return new CategoryAnalysisResDTO(Collections.EMPTY_LIST,Collections.EMPTY_LIST); |
|
|
|
} |
|
|
|
//2、没有服务类型直接退出
|
|
|
|
Result<Map<String, String>> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); |
|
|
|
if(!serviceTypeRes.success()||MapUtils.isEmpty(serviceTypeRes.getData())){ |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询服务方类型异常,请检查是否已经配置字典信息"); |
|
|
|
} |
|
|
|
List<LegendDTO> legend=new ArrayList<>(); |
|
|
|
serviceTypeRes.getData().forEach((code,name)->{ |
|
|
|
LegendDTO legendDTO=new LegendDTO(code,name); |
|
|
|
legend.add(legendDTO); |
|
|
|
}); |
|
|
|
LegendDTO unfinishLegend = new LegendDTO("unfinished", "未完成"); |
|
|
|
legend.add(unfinishLegend); |
|
|
|
// 3、传进来的是组织id的话,查询出全路径
|
|
|
|
if("agency".equals(formDTO.getOrgType())){ |
|
|
|
if(NumConstant.ZERO_STR.equals(formDTO.getPid())){ |
|
|
|
//当前传入的组织id=客户的根组织
|
|
|
|
formDTO.setGridPids(formDTO.getOrgId()); |
|
|
|
}else{ |
|
|
|
//找到当前组织的所有上级,再拼接上自己
|
|
|
|
Result<CustomerAgencyDTO> customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); |
|
|
|
if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); |
|
|
|
} |
|
|
|
formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 4、查询出有数据的一级分类
|
|
|
|
// 4、sql计算出detail
|
|
|
|
List<CategoryAnalysisDTO> haveDemandList=baseDao.selectListCategoryAnalysisDTO(firstCategoryList, |
|
|
|
formDTO.getCusotmerId(), |
|
|
|
formDTO.getOrgId(), |
|
|
|
formDTO.getOrgType(), |
|
|
|
formDTO.getGridPids(), |
|
|
|
formDTO.getStartDateId(), |
|
|
|
formDTO.getEndDateId()); |
|
|
|
if(!CollectionUtils.isEmpty(haveDemandList)){ |
|
|
|
for(CategoryAnalysisDTO analysisRes:haveDemandList){ |
|
|
|
//todo
|
|
|
|
//List<CategoryAnalysisDetail> detail=
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//构造最后的反参
|
|
|
|
List<CategoryAnalysisDTO> list=new ArrayList<>(); |
|
|
|
// firstCategoryList是所有的一级分类字典
|
|
|
|
firstCategoryList.forEach(firstCategory->{ |
|
|
|
CategoryAnalysisDTO categoryAnalysisDTO=new CategoryAnalysisDTO(firstCategory.getValue(),firstCategory.getLabel(),NumConstant.ZERO,Collections.EMPTY_LIST); |
|
|
|
list.add(categoryAnalysisDTO); |
|
|
|
}); |
|
|
|
|
|
|
|
CategoryAnalysisResDTO result=new CategoryAnalysisResDTO(); |
|
|
|
result.setLegend(legend); |
|
|
|
result.setCategoryList(list); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |