Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_temp

master
zxc 5 years ago
parent
commit
0dad1e23ac
  1. 23
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java
  2. 37
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java
  3. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  4. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java
  5. 21
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml

23
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<SubBranchCountResultDTO> partyDistribution;
public BranchCountResultDTO() {
this.agencyId = "";
this.name = "";
this.centerMark = "";
this.totalNum = 0;
this.areaMarks = "";
this.partyDistribution = new ArrayList<>();
}
}

37
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;
}

2
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<SubBranchCountResultDTO> selectBranchCount(@Param("agencyId")String agencyId);
/**
* @Description 查询子级用户分布网格级别

8
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<SubBranchCountResultDTO> subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId());
branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(subList) ? new ArrayList<>() : subList);
return branchCountResultDTO;
}

21
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>
<select id="selectBranchCount" resultType="integer" parameterType="string">
<select id="selectBranchCount" resultType="com.epmet.evaluationindex.screen.dto.result.SubBranchCountResultDTO">
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
</select>
</mapper>
Loading…
Cancel
Save