Browse Source

agencydetail-multic

dev_shibei_match
yinzuomei 4 years ago
parent
commit
eb1e19a13a
  1. 42
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

42
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()){ if(agencysResultDTO.getHaveSubCustomer()){
// 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop if (StringUtils.isBlank(customerAgencyDTO.getPids())||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid())) {
log.info("多客户版本parentList、level要重新赋值"); log.info(String.format("1)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId()));
ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode()); agencysResultDTO.setParentList(parentList);
agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency)); }else{
List<ParentListResultDTO> temp = getParentListMultic(parentList,parentAgency,formDTO.getCustomerId(),agencysResultDTO.getRootAgencyId()); // 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop
agencysResultDTO.setParentList(temp); log.info("多客户版本parentList、level要重新赋值");
ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode());
agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency));
List<ParentListResultDTO> temp = getParentListMultic(parentList,parentAgency,formDTO.getCustomerId(),agencysResultDTO.getRootAgencyId());
agencysResultDTO.setParentList(temp);
}
}else{ }else{
//单客户 //单客户
//6:查询当前组织的所有上级组织,按自上而下层级顺序 //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); agencysResultDTO.setParentList(parentList);
return agencysResultDTO; }else{
} List<String> pidList =new ArrayList<>();
List<String> pidList =new ArrayList<>(); if(customerAgencyDTO.getPids().contains(StrConstant.COLON)){
if(customerAgencyDTO.getPids().contains(StrConstant.COLON)){ pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON));
pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON)); }else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){
}else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){ pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA));
pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA)); }
} if(!CollectionUtils.isEmpty(pidList)){
if(!CollectionUtils.isEmpty(pidList)){ //单客户,存在上级时查询...
//单客户,存在上级时查询... agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList));
agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList)); }
} }
} }
dataReportRedis.setAgencyDetailMulticResultDTO(formDTO.getCustomerId(),formDTO.getAgencyId(),agencysResultDTO); dataReportRedis.setAgencyDetailMulticResultDTO(formDTO.getCustomerId(),formDTO.getAgencyId(),agencysResultDTO);

Loading…
Cancel
Save