Browse Source

Merge branch 'dev_py_platform' of http://git.elinkit.com.cn:7070/r/epmet-cloud into develop

dev_shibei_match
jianjun 4 years ago
parent
commit
6c26afa70c
  1. 35
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

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

@ -477,7 +477,6 @@ public class AgencyServiceImpl implements AgencyService {
@Override
public OrgTreeNode getStaffAgencyTree(OrgTreeFormDTO formDTO) {
//todo 获取客户的所有组织 然后遍历剔除 再构建出一颗树 咋样
//获取工作人员信息
CustomerStaffFormDTO staffParam = new CustomerStaffFormDTO();
staffParam.setMobile(formDTO.getMobile());
@ -500,25 +499,29 @@ public class AgencyServiceImpl implements AgencyService {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
List<OrgTreeNode> nodes = new ArrayList<>();
ScreenCustomerAgencyDTO parentAgencyDTO = null;
List<OrgTreeNode> nodeList = new ArrayList<>();
//单客户
if (CollectionUtils.isEmpty(crmRes.getData())){
//todo 暂不处理 有时间再说
String parentId = staffAgencyDTO.getPid();
do {
parentAgencyDTO = screenCustomerAgencyDao.selectByAgencyId(parentId);
if (parentAgencyDTO == null){
break;
}
convertOrgTreeNode(nodeList, parentAgencyDTO);
if (parentAgencyDTO.getPid() == null || NumConstant.ZERO_STR.equals(parentAgencyDTO.getPid())){
break;
}
parentId = parentAgencyDTO.getAreaCode();
} while (true);
//多客户 获取所有下级
List<ScreenCustomerAgencyDTO> agencyNodeDTOS = screenCustomerAgencyDao.selectAllSubAgencyList(staffAgencyDTO.getPids(),null);
agencyNodeDTOS.forEach(agency->convertOrgTreeNode(nodeList, agency));
nodes = TreeUtils.buildTreeByAreaCode(nodeList);
}else {
ScreenCustomerAgencyDTO parentAgencyDTO = null;
String parentAreaCode = staffAgencyDTO.getParentAreaCode();
List<OrgTreeNode> nodeList = new ArrayList<>();
/*ScreenCustomerAgencyDTO currentAgency = new ScreenCustomerAgencyDTO();
currentAgency.setCustomerId(staffAgencyDTO.getCustomerId());
currentAgency.setAgencyId(staffAgencyDTO.getId());
currentAgency.setAgencyName(staffAgencyDTO.getOrganizationName());
currentAgency.setLevel(staffAgencyDTO.getLevel());
currentAgency.setAreaCode(staffAgencyDTO.getAreaCode());
currentAgency.setParentAreaCode(staffAgencyDTO.getParentAreaCode());
currentAgency.setPid(staffAgencyDTO.getPid());
currentAgency.setPids(staffAgencyDTO.getPids());
convertOrgTreeNode(nodeList, currentAgency);*/
//多客户 获取所有直线上级
do {
parentAgencyDTO = screenCustomerAgencyDao.selectByAreaCode(parentAreaCode);

Loading…
Cancel
Save