Browse Source

Merge remote-tracking branch 'origin/dev_data_fusion' into develop

dev_shibei_match
yinzuomei 4 years ago
parent
commit
e9a7103705
  1. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  2. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  3. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  4. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  5. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
  6. 12
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

4
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<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerAgencyDTO> selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid);
List<ScreenCustomerAgencyDTO> selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid, @Param("allSubCustomerIds") List<String> allSubCustomerIds);
/**
* 查询当前组织的下面的网格可根据areaCode查询也可根据parentAgencyId查询
@ -189,7 +189,7 @@ public interface ScreenCustomerAgencyDao {
* @param parentAgencyId
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerGridDTO> selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId);
List<ScreenCustomerGridDTO> selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allSubCustomerIds") List<String> allSubCustomerIds);
List<ParentListResultDTO> selectPAgencyById(@Param("listStr")List<String> pidList);

6
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<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerAgencyDTO> queryNextAgencyList(String areaCode, String pid);
List<ScreenCustomerAgencyDTO> queryNextAgencyList(String areaCode, String pid,List<String> allSubCustomerIds);
/**
* 查询当前组织的下面的网格可根据areaCode查询也可根据parentAgencyId查询
*
* @param areaCode
* @param parentAgencyId
* @param allSubCustomerIds 当前客户的所有子客户
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerGridDTO> queryGridList(String areaCode, String parentAgencyId);
List<ScreenCustomerGridDTO> queryGridList(String areaCode, String parentAgencyId,List<String> allSubCustomerIds);
/**
* 工作端小程序-数据上面的 当前组织调用此接口

10
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<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
@Override
public List<ScreenCustomerAgencyDTO> queryNextAgencyList(String areaCode, String pid) {
return screenCustomerAgencyDao.selectNextAgencyList(areaCode,pid);
public List<ScreenCustomerAgencyDTO> queryNextAgencyList(String areaCode, String pid,List<String> 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<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
@Override
public List<ScreenCustomerGridDTO> queryGridList(String areaCode, String parentAgencyId) {
return screenCustomerAgencyDao.selectGridDTOList(areaCode,parentAgencyId);
public List<ScreenCustomerGridDTO> queryGridList(String areaCode, String parentAgencyId,List<String> allSubCustomerIds) {
return screenCustomerAgencyDao.selectGridDTOList(areaCode,parentAgencyId,allSubCustomerIds);
}
/**

8
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<ScreenCustomerGridDTO> 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 -> {

4
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'
<if test="areaCode != null and areaCode != ''">
and sdd1.AREA_CODE like concat(#{areaCode},'%')
and scg.AREA_CODE like concat(#{areaCode},'%')
</if>
<if test="areaCode == null || areaCode == ''">
<choose>
@ -310,7 +310,7 @@
and sca.DEL_FLAG='0'
and sdd2.ORG_TYPE='agency'
<if test="areaCode != null and areaCode != ''">
and sdd2.AREA_CODE like concat(#{areaCode},'%')
and sca.AREA_CODE like concat(#{areaCode},'%')
</if>
<if test="areaCode == null || areaCode == ''">
<choose>

12
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -355,6 +355,12 @@
<if test="areaCode != null and areaCode != ''">
AND sca.PARENT_AREA_CODE =#{areaCode}
</if>
<if test="allSubCustomerIds != null and allSubCustomerIds.size() > 0">
and sca.customer_id in
<foreach collection="allSubCustomerIds" item="customerId" open="(" separator="," close=" )">
#{customerId}
</foreach>
</if>
</select>
<!-- 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询 -->
@ -371,6 +377,12 @@
<if test="parentAgencyId != null and parentAgencyId != ''">
AND scg.PARENT_AGENCY_ID = #{parentAgencyId}
</if>
<if test="allSubCustomerIds != null and allSubCustomerIds.size() > 0">
and scg.customer_id in
<foreach collection="allSubCustomerIds" item="customerId" open="(" separator="," close=" )">
#{customerId}
</foreach>
</if>
</select>
<!-- 按照foreach中遍历的Id顺序排序(按组织机构自上而下排序) -->

Loading…
Cancel
Save