|
@ -66,6 +66,29 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
return rootAgency; |
|
|
return rootAgency; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public TreeResultDTO treeByType(String customerId, String bizType) { |
|
|
|
|
|
TreeResultDTO rootAgency = null; |
|
|
|
|
|
try { |
|
|
|
|
|
rootAgency = screenCustomerAgencyDao.selectRootAgencyIdByBizType(customerId,bizType); |
|
|
|
|
|
if (null == rootAgency) { |
|
|
|
|
|
return new TreeResultDTO(); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (TooManyResultsException e) { |
|
|
|
|
|
throw new RenException("根组织结构数据有误"); |
|
|
|
|
|
} |
|
|
|
|
|
List<Double> centerMark = this.getCenterMark(rootAgency.getCenterMarkA()); |
|
|
|
|
|
rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); |
|
|
|
|
|
if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)) { |
|
|
|
|
|
List<TreeResultDTO> treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue()); |
|
|
|
|
|
rootAgency.setChildren(treeResultDTOS); |
|
|
|
|
|
} else { |
|
|
|
|
|
List<TreeResultDTO> departmentList = this.getDepartmentListByBiz(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue())); |
|
|
|
|
|
rootAgency.setChildren(departmentList); |
|
|
|
|
|
} |
|
|
|
|
|
return rootAgency; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 处理centerMark |
|
|
* @Description 处理centerMark |
|
|
* @param centerMark |
|
|
* @param centerMark |
|
@ -113,6 +136,28 @@ public class AgencyServiceImpl implements AgencyService { |
|
|
return subAgencyList; |
|
|
return subAgencyList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<TreeResultDTO> getDepartmentListByBiz(String subAgencyPids) { |
|
|
|
|
|
List<TreeResultDTO> subAgencyList = screenCustomerAgencyDao.selectSubAgencyListByBizType(subAgencyPids); |
|
|
|
|
|
if (subAgencyList.size() > NumConstant.ZERO) { |
|
|
|
|
|
subAgencyList.forEach(sub -> { |
|
|
|
|
|
List<Double> centerMark = this.getCenterMark(sub.getCenterMarkA()); |
|
|
|
|
|
sub.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); |
|
|
|
|
|
if (sub.getLevel().equals(ScreenConstant.COMMUNITY)){ |
|
|
|
|
|
List<TreeResultDTO> treeResultDTOS = screenCustomerGridDao.selectGridInfo(sub.getValue()); |
|
|
|
|
|
treeResultDTOS.forEach(tree -> { |
|
|
|
|
|
List<Double> centerMarkTree = this.getCenterMark(tree.getCenterMarkA()); |
|
|
|
|
|
tree.setCenterMark(centerMarkTree.size() == NumConstant.ZERO ? new ArrayList<>() : centerMarkTree); |
|
|
|
|
|
}); |
|
|
|
|
|
sub.setChildren(treeResultDTOS); |
|
|
|
|
|
}else { |
|
|
|
|
|
List<TreeResultDTO> subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); |
|
|
|
|
|
sub.setChildren(subAgency); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
return subAgencyList; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 2、组织区域查询 |
|
|
* @Description 2、组织区域查询 |
|
|
* @param compartmentFormDTO |
|
|
* @param compartmentFormDTO |
|
|