Browse Source

党支部新接口添加

dev_shibei_match
zxc 5 years ago
parent
commit
4208adc393
  1. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java

@ -61,10 +61,10 @@ public class DistributionServiceImpl implements DistributionService {
* @author zxc
* @date 2020/10/27 11:11 上午
*/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO) {
BranchCountResultDTO branchCountResultDTO = screenCustomerGridDao.selectAgencyInfo(branchCountFormDTO.getAgencyId());
log.info("本级机关信息"+branchCountResultDTO.toString());
if (null == branchCountResultDTO){
return new BranchCountResultDTO();
}
@ -72,9 +72,7 @@ public class DistributionServiceImpl implements DistributionService {
return new BranchCountResultDTO();
}
List<SubBranchCountResultDTO> agencyIds = screenCustomerAgencyDao.selectSubAgencyId(branchCountFormDTO.getAgencyId());
log.info("下级机关信息:"+agencyIds.toString());
List<SubBranchCountResultDTO> subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId());
log.info("党支部数"+subList.toString());
if (!CollectionUtils.isEmpty(subList)){
subList.forEach(sub -> {
agencyIds.forEach(agencyId -> {
@ -84,9 +82,7 @@ public class DistributionServiceImpl implements DistributionService {
});
});
}
log.info("给党支部赋值subAgencyId"+subList.toString());
Map<String, List<SubBranchCountResultDTO>> groupBySubAgency = subList.stream().collect(Collectors.groupingBy(sub -> sub.getSubAgencyId()));
log.info("subList分组"+groupBySubAgency.toString());
agencyIds.forEach(a -> {
groupBySubAgency.forEach((agencyId,value) -> {
if (a.getSubId().equals(agencyId)){
@ -94,9 +90,7 @@ public class DistributionServiceImpl implements DistributionService {
}
});
});
log.info("赋值之后的"+agencyIds.toString());
branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(agencyIds) ? new ArrayList<>() : agencyIds);
log.info("最后结果:"+branchCountResultDTO);
return branchCountResultDTO;
}

Loading…
Cancel
Save