Browse Source

NullPointerEx fix trytry

dev_shibei_match
yinzuomei 4 years ago
parent
commit
68e27f881f
  1. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  2. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java

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

@ -468,18 +468,27 @@ public class AgencyServiceImpl implements AgencyService {
return agencysResultDTO;
}
private List<ParentListResultDTO> getParentListMultic(List<ParentListResultDTO> resList,ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) {
private List<ParentListResultDTO> getParentListMultic(List<ParentListResultDTO> resList, ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) {
ParentListResultDTO resultDTO = new ParentListResultDTO();
resultDTO.setId(firstParent.getAgencyId());
resultDTO.setName(firstParent.getAgencyName());
resultDTO.setLevel(firstParent.getLevel());
resultDTO.setAreaCode(firstParent.getAreaCode());
resList.add(resultDTO);
if (firstParent.getCustomerId().equals(currentUserCustomerId) && firstParent.getAgencyId().equals(rootAgencyId)) {
Collections.reverse(resList);
return resList;
} else {
ScreenCustomerAgencyDTO parentAgency = screenCustomerAgencyDao.selectByAreaCode(firstParent.getParentAreaCode());
return getParentListMultic(resList,parentAgency, currentUserCustomerId, rootAgencyId);
String parentAgencyAreaCode = firstParent.getParentAreaCode();
if (StringUtils.isNotBlank(parentAgencyAreaCode)) {
parentAgencyAreaCode = parentAgencyAreaCode.replaceAll("(0)+$", "");
}
ScreenCustomerAgencyDTO parentAgency = screenCustomerAgencyDao.selectByAreaCode(parentAgencyAreaCode);
if (null != parentAgency) {
return getParentListMultic(resList, parentAgency, currentUserCustomerId, rootAgencyId);
} else {
return resList;
}
}
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java

@ -46,4 +46,9 @@ public class ParentListResultDTO implements Serializable {
* 省级:province; 市级: city; 区县级: district ;街道:street ;社区级community
*/
private String level="";
/**
* 增加此返回值为了调试用
*/
private String areaCode;
}
Loading…
Cancel
Save