diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index aed418f5ab..915f8e4d11 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -180,7 +180,7 @@ public interface ScreenCustomerAgencyDao { * @param pid * @return java.util.List */ - List selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid); + List selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid, @Param("allSubCustomerIds") List allSubCustomerIds); /** * 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询 @@ -189,7 +189,7 @@ public interface ScreenCustomerAgencyDao { * @param parentAgencyId * @return java.util.List */ - List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId); + List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allSubCustomerIds") List allSubCustomerIds); List selectPAgencyById(@Param("listStr")List pidList); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index e780570be1..aa142bed95 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -82,18 +82,20 @@ public interface AgencyService { * * @param areaCode * @param pid + * @param allSubCustomerIds 当前客户的所有子客户 * @return java.util.List */ - List queryNextAgencyList(String areaCode, String pid); + List queryNextAgencyList(String areaCode, String pid,List allSubCustomerIds); /** * 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询 * * @param areaCode * @param parentAgencyId + * @param allSubCustomerIds 当前客户的所有子客户 * @return java.util.List */ - List queryGridList(String areaCode, String parentAgencyId); + List queryGridList(String areaCode, String parentAgencyId,List allSubCustomerIds); /** * 工作端小程序-数据上面的 当前组织调用此接口 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index bd7ab02cbd..5f2272ea26 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -346,11 +346,12 @@ public class AgencyServiceImpl implements AgencyService { * * @param areaCode * @param pid + * @param allSubCustomerIds 当前客户的所有子客户 * @return java.util.List */ @Override - public List queryNextAgencyList(String areaCode, String pid) { - return screenCustomerAgencyDao.selectNextAgencyList(areaCode,pid); + public List queryNextAgencyList(String areaCode, String pid,List allSubCustomerIds) { + return screenCustomerAgencyDao.selectNextAgencyList(areaCode,pid,allSubCustomerIds); } /** @@ -358,11 +359,12 @@ public class AgencyServiceImpl implements AgencyService { * * @param areaCode * @param parentAgencyId + * @param allSubCustomerIds 当前客户的所有子客户 * @return java.util.List */ @Override - public List queryGridList(String areaCode, String parentAgencyId) { - return screenCustomerAgencyDao.selectGridDTOList(areaCode,parentAgencyId); + public List queryGridList(String areaCode, String parentAgencyId,List allSubCustomerIds) { + return screenCustomerAgencyDao.selectGridDTOList(areaCode,parentAgencyId,allSubCustomerIds); } /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 0f00b17bb8..b1b07eec4d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -472,10 +472,10 @@ public class ProjectServiceImpl implements ProjectService { if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { log.warn("❤当前客户存在子客户❤"); //如果包含子客户,则根据areaCode查询下一级 - agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); + agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR,crmRes.getData()); } else { //当前客户没有子客户,根据agencyId查询下一级组织 - agencyDTOList = screenAgencyService.queryNextAgencyList(StrConstant.EPMETY_STR, staffResult.getData().getId()); + agencyDTOList = screenAgencyService.queryNextAgencyList(StrConstant.EPMETY_STR, staffResult.getData().getId(),null); } if (CollectionUtils.isNotEmpty(agencyDTOList)) { agencyDTOList.forEach(agencyDTO -> { @@ -494,10 +494,10 @@ public class ProjectServiceImpl implements ProjectService { List gridList = new ArrayList<>(); if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { //如果包含子客户,则根据areaCode查询下一级网格 - gridList=screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); + gridList=screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR,crmRes.getData()); } else { //当前客户没有子客户,根据agencyId查询下一级网格 - gridList=screenAgencyService.queryGridList(StrConstant.EPMETY_STR,staffResult.getData().getId()); + gridList=screenAgencyService.queryGridList(StrConstant.EPMETY_STR,staffResult.getData().getId(),null); } if (CollectionUtils.isNotEmpty(gridList)) { gridList.forEach(gridDTO -> { diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index b7ea753131..dce166ad17 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -287,7 +287,7 @@ and scg.DEL_FLAG='0' and sdd1.ORG_TYPE='grid' - and sdd1.AREA_CODE like concat(#{areaCode},'%') + and scg.AREA_CODE like concat(#{areaCode},'%') @@ -310,7 +310,7 @@ and sca.DEL_FLAG='0' and sdd2.ORG_TYPE='agency' - and sdd2.AREA_CODE like concat(#{areaCode},'%') + and sca.AREA_CODE like concat(#{areaCode},'%') diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 0a076134ef..5a2d013d19 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -355,6 +355,12 @@ AND sca.PARENT_AREA_CODE =#{areaCode} + + and sca.customer_id in + + #{customerId} + + @@ -371,6 +377,12 @@ AND scg.PARENT_AGENCY_ID = #{parentAgencyId} + + and scg.customer_id in + + #{customerId} + +