diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index b4076d39d6..bd7ab02cbd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -419,28 +419,34 @@ public class AgencyServiceImpl implements AgencyService { } if(agencysResultDTO.getHaveSubCustomer()){ - // 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop - log.info("多客户版本parentList、level要重新赋值"); - ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode()); - agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency)); - List temp = getParentListMultic(parentList,parentAgency,formDTO.getCustomerId(),agencysResultDTO.getRootAgencyId()); - agencysResultDTO.setParentList(temp); + if (StringUtils.isBlank(customerAgencyDTO.getPids())||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) { + log.info(String.format("1)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId())); + agencysResultDTO.setParentList(parentList); + }else{ + // 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop + log.info("多客户版本parentList、level要重新赋值"); + ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode()); + agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency)); + List temp = getParentListMultic(parentList,parentAgency,formDTO.getCustomerId(),agencysResultDTO.getRootAgencyId()); + agencysResultDTO.setParentList(temp); + } }else{ //单客户 //6:查询当前组织的所有上级组织,按自上而下层级顺序 - if (StringUtils.isBlank(customerAgencyDTO.getPids())) { + if (StringUtils.isBlank(customerAgencyDTO.getPids())||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) { + log.info(String.format("2)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId())); agencysResultDTO.setParentList(parentList); - return agencysResultDTO; - } - List pidList =new ArrayList<>(); - if(customerAgencyDTO.getPids().contains(StrConstant.COLON)){ - pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON)); - }else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){ - pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA)); - } - if(!CollectionUtils.isEmpty(pidList)){ - //单客户,存在上级时查询... - agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList)); + }else{ + List pidList =new ArrayList<>(); + if(customerAgencyDTO.getPids().contains(StrConstant.COLON)){ + pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON)); + }else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){ + pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA)); + } + if(!CollectionUtils.isEmpty(pidList)){ + //单客户,存在上级时查询... + agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList)); + } } } dataReportRedis.setAgencyDetailMulticResultDTO(formDTO.getCustomerId(),formDTO.getAgencyId(),agencysResultDTO);