|
|
@ -1,6 +1,19 @@ |
|
|
|
package com.epmet.service.screen.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.screen.ScreenCustomerAgencyDao; |
|
|
|
import com.epmet.dto.result.AgencySubResultDTO; |
|
|
|
import com.epmet.dto.result.ProcessorListResultDTO; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.screen.dto.form.CompartmentFormDTO; |
|
|
|
import com.epmet.screen.dto.result.CompartmentResultDTO; |
|
|
|
import com.epmet.screen.dto.result.TreeResultDTO; |
|
|
|
import com.epmet.service.screen.AgencyService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* 组织相关api |
|
|
@ -9,4 +22,44 @@ import com.epmet.service.screen.AgencyService; |
|
|
|
* @date 2020/8/18 10:18 |
|
|
|
*/ |
|
|
|
public class AgencyServiceImpl implements AgencyService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private ScreenCustomerAgencyDao screenCustomerAgencyDao; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 1、组织机构树 |
|
|
|
* @param tokenDto |
|
|
|
* @author zxc |
|
|
|
* @date 2020/8/18 2:04 下午 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<TreeResultDTO> tree(TokenDto tokenDto) { |
|
|
|
// 1. 查询客户根组织ID
|
|
|
|
TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(tokenDto.getCustomerId()); |
|
|
|
return this.getDepartmentList(("".equals(rootAgency.getPids()) ? "" : rootAgency.getPids() + ":") + rootAgency.getValue()); |
|
|
|
} |
|
|
|
|
|
|
|
private List<TreeResultDTO> getDepartmentList(String subAgencyPids) { |
|
|
|
List<TreeResultDTO> subAgencyList = screenCustomerAgencyDao.selectSubAgencyList(subAgencyPids); |
|
|
|
if (subAgencyList.size() > NumConstant.ZERO) { |
|
|
|
for (TreeResultDTO sub : subAgencyList) { |
|
|
|
List<TreeResultDTO> subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); |
|
|
|
sub.setChildren(subAgency); |
|
|
|
} |
|
|
|
} |
|
|
|
return subAgencyList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 2、组织区域查询 |
|
|
|
* @param compartmentFormDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2020/8/18 2:33 下午 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|