Browse Source

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

dev_shibei_match
zxc 5 years ago
parent
commit
bcf937dd2a
  1. 15
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java
  2. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  3. 22
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java
  4. 14
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  5. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml

15
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.evaluationindex.screen.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -34,4 +35,18 @@ public class SubBranchCountResultDTO implements Serializable {
* 坐标区域
*/
private String areaMarks;
@JsonIgnore
private String allParentIds;
@JsonIgnore
private String subAgencyId;
public SubBranchCountResultDTO() {
this.subId = "";
this.name = "";
this.centerMark = "";
this.totalNum = 0;
this.areaMarks = "";
this.subAgencyId = "";
}
}

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -104,4 +104,12 @@ public interface ScreenCustomerAgencyDao {
* @date 2020/10/23 3:54 下午
*/
CompartmentResultDTO getAgencyInfoByAegncyId(@Param("agencyId") String agencyId);
/**
* @Description 查询组织的下级组织ID
* @Param agencyId
* @author zxc
* @date 2020/10/28 10:33 上午
*/
List<SubBranchCountResultDTO> selectSubAgencyId(@Param("agencyId") String agencyId);
}

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

@ -18,6 +18,8 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 中央区相关各指标查询
@ -66,8 +68,26 @@ public class DistributionServiceImpl implements DistributionService {
if (branchCountResultDTO.getLevel().equals(ScreenConstant.COMMUNITY)){
return new BranchCountResultDTO();
}
List<SubBranchCountResultDTO> agencyIds = screenCustomerAgencyDao.selectSubAgencyId(branchCountFormDTO.getAgencyId());
List<SubBranchCountResultDTO> subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId());
branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(subList) ? new ArrayList<>() : subList);
if (!CollectionUtils.isEmpty(subList)){
subList.forEach(sub -> {
agencyIds.forEach(agencyId -> {
if (sub.getAllParentIds().contains(agencyId.getSubId())){
sub.setSubAgencyId(agencyId.getSubId());
}
});
});
}
Map<String, List<SubBranchCountResultDTO>> groupBySubAgency = subList.stream().collect(Collectors.groupingBy(sub -> sub.getSubAgencyId()));
agencyIds.forEach(a -> {
groupBySubAgency.forEach((agencyId,value) -> {
if (a.getSubId().equals(agencyId)){
a.setTotalNum(value.stream().collect(Collectors.summingInt(v -> v.getTotalNum())));
}
});
});
branchCountResultDTO.setPartyDistribution(CollectionUtils.isEmpty(agencyIds) ? new ArrayList<>() : agencyIds);
return branchCountResultDTO;
}

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

@ -197,4 +197,18 @@
del_flag = 0
AND agency_id = #{agencyId}
</select>
<!-- 查询组织的下级组织ID -->
<select id="selectSubAgencyId" resultType="com.epmet.evaluationindex.screen.dto.result.SubBranchCountResultDTO">
SELECT
AGENCY_ID AS subId,
AGENCY_NAME AS name,
IFNULL(CENTER_MARK,'') AS centerMark ,
IFNULL(AREA_MARKS,'') AS areaMarks
FROM
screen_customer_agency
WHERE
DEL_FLAG = 0
AND pid = #{agencyId}
</select>
</mapper>

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml

@ -107,7 +107,9 @@
sca.AGENCY_ID AS subId,
IFNULL(sca.CENTER_MARK,'') AS centerMark,
sca.AGENCY_NAME AS name,
IFNULL(sca.AREA_MARKS,'') AS areaMarks
IFNULL(sca.AREA_MARKS,'') AS areaMarks,
scg.ALL_PARENT_IDS,
sca.PID
FROM
screen_customer_grid scg
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scg.PARENT_AGENCY_ID

Loading…
Cancel
Save