From 2822de7c57174b8d75838fc73406bdfa9ac7e6b7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 27 Oct 2020 17:32:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E6=96=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/BranchCountResultDTO.java | 23 ++++-------- .../dto/result/SubBranchCountResultDTO.java | 37 +++++++++++++++++++ .../screen/ScreenCustomerGridDao.java | 2 +- .../screen/impl/DistributionServiceImpl.java | 8 +++- .../mapper/screen/ScreenCustomerGridDao.xml | 21 ++++++++--- 5 files changed, 66 insertions(+), 25 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java index 53dbb106c4..5a2c8cd391 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java @@ -1,8 +1,11 @@ package com.epmet.evaluationindex.screen.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * @Author zxc @@ -20,26 +23,14 @@ public class BranchCountResultDTO implements Serializable { */ private String name; - /** - * 中心点位 - */ - private String centerMark; + @JsonIgnore + private String level; - /** - * 社区下的党支部数 - */ - private Integer totalNum; - - /** - * 坐标区域 - */ - private String areaMarks; + private List partyDistribution; public BranchCountResultDTO() { this.agencyId = ""; this.name = ""; - this.centerMark = ""; - this.totalNum = 0; - this.areaMarks = ""; + this.partyDistribution = new ArrayList<>(); } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java new file mode 100644 index 0000000000..93466fedf4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/27 5:22 下午 + */ +@Data +public class SubBranchCountResultDTO implements Serializable { + + private static final long serialVersionUID = -4174988002147169566L; + + private String subId; + + /** + * 机关名称 + */ + private String name; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 社区下的党支部数 + */ + private Integer totalNum; + + /** + * 坐标区域 + */ + private String areaMarks; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 741a6956eb..a024d60791 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -55,7 +55,7 @@ public interface ScreenCustomerGridDao { * @date 2020/10/27 11:11 上午 */ BranchCountResultDTO selectAgencyInfo(@Param("agencyId")String agencyId); - Integer selectBranchCount(@Param("agencyId")String agencyId); + List selectBranchCount(@Param("agencyId")String agencyId); /** * @Description 查询子级用户分布【网格级别】 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index 766b92168c..af0ba2d939 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -14,6 +14,7 @@ import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; @@ -62,8 +63,11 @@ public class DistributionServiceImpl implements DistributionService { if (null == branchCountResultDTO){ return new BranchCountResultDTO(); } - Integer totalNum = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); - branchCountResultDTO.setTotalNum(null == totalNum ? NumConstant.ZERO : totalNum); + if (branchCountResultDTO.getLevel().equals(ScreenConstant.COMMUNITY)){ + return new BranchCountResultDTO(); + } + List subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId()); + branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(subList) ? new ArrayList<>() : subList); return branchCountResultDTO; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 39b4cd2153..ae272334e0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -91,7 +91,8 @@ AGENCY_ID, AGENCY_NAME AS name, IFNULL(PARTY_MARK,''), - IFNULL(CENTER_MARK,'') + IFNULL(CENTER_MARK,''), + level FROM screen_customer_agency WHERE @@ -100,14 +101,22 @@ AND AGENCY_ID = #{agencyId} - SELECT - COUNT( ID ) AS totalNum + COUNT( scg.ID ) AS totalNum, + sca.AGENCY_ID AS subId, + IFNULL(sca.CENTER_MARK,'') AS centerMark, + sca.AGENCY_NAME AS name, + IFNULL(sca.AREA_MARKS,'') AS areaMarks FROM - screen_customer_grid + screen_customer_grid scg + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scg.PARENT_AGENCY_ID WHERE - DEL_FLAG = 0 - AND all_parent_ids LIKE concat('%',#{agencyId}, '%') + scg.DEL_FLAG = 0 + AND sca.DEL_FLAG = 0 + AND sca.IS_DISPLAY = 1 + AND sca.PID = #{agencyId} + GROUP BY scg.PARENT_AGENCY_ID \ No newline at end of file