Browse Source

智慧社区的tree

dev_shibei_match
zxc 5 years ago
parent
commit
eba00a4d1c
  1. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  2. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  3. 17
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java

@ -33,6 +33,13 @@ public class AgencyController {
return new Result<TreeResultDTO>().ok(agencyService.tree(customerId)); return new Result<TreeResultDTO>().ok(agencyService.tree(customerId));
} }
/**
* @Description 智慧社区的tree
* @Param customerId
* @Param bizType
* @author zxc
* @date 2020/10/21 2:49 下午
*/
@PostMapping("treebytype") @PostMapping("treebytype")
public Result<TreeResultDTO> treeByType(@RequestHeader("CustomerId") String customerId,@RequestParam("bizType")String bizType){ public Result<TreeResultDTO> treeByType(@RequestHeader("CustomerId") String customerId,@RequestParam("bizType")String bizType){
return new Result<TreeResultDTO>().ok(agencyService.treeByType(customerId,bizType)); return new Result<TreeResultDTO>().ok(agencyService.treeByType(customerId,bizType));

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java

@ -20,6 +20,13 @@ public interface AgencyService {
*/ */
TreeResultDTO tree(String customerId); TreeResultDTO tree(String customerId);
/**
* @Description 智慧社区的tree
* @Param customerId
* @Param bizType
* @author zxc
* @date 2020/10/21 2:49 下午
*/
TreeResultDTO treeByType(String customerId,String bizType); TreeResultDTO treeByType(String customerId,String bizType);
/** /**

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

@ -66,6 +66,13 @@ public class AgencyServiceImpl implements AgencyService {
return rootAgency; return rootAgency;
} }
/**
* @Description 智慧社区的tree
* @Param customerId
* @Param bizType
* @author zxc
* @date 2020/10/21 2:49 下午
*/
@Override @Override
public TreeResultDTO treeByType(String customerId, String bizType) { public TreeResultDTO treeByType(String customerId, String bizType) {
TreeResultDTO rootAgency = null; TreeResultDTO rootAgency = null;
@ -141,6 +148,12 @@ public class AgencyServiceImpl implements AgencyService {
return subAgencyList; return subAgencyList;
} }
/**
* @Description 智慧社区的tree
* @Param subAgencyPids
* @author zxc
* @date 2020/10/21 2:49 下午
*/
public List<TreeResultDTO> getDepartmentListByBiz(String subAgencyPids) { public List<TreeResultDTO> getDepartmentListByBiz(String subAgencyPids) {
List<TreeResultDTO> subAgencyList = screenCustomerAgencyDao.selectSubAgencyListByBizType(subAgencyPids); List<TreeResultDTO> subAgencyList = screenCustomerAgencyDao.selectSubAgencyListByBizType(subAgencyPids);
if (subAgencyList.size() > NumConstant.ZERO) { if (subAgencyList.size() > NumConstant.ZERO) {
@ -157,9 +170,9 @@ public class AgencyServiceImpl implements AgencyService {
}else { }else {
List<TreeResultDTO> subAgency = new ArrayList<>(); List<TreeResultDTO> subAgency = new ArrayList<>();
if (sub.getPids().contains(ScreenConstant.COMMA)){ if (sub.getPids().contains(ScreenConstant.COMMA)){
subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue()); subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COMMA + sub.getValue());
}else { }else {
subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COLON + sub.getValue()); subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue());
} }
sub.setChildren(subAgency); sub.setChildren(subAgency);
} }

Loading…
Cancel
Save