Browse Source

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

dev_shibei_match
jianjun 5 years ago
parent
commit
75a87e21f7
  1. 24
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchCountFormDTO.java
  2. 6
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java
  3. 36
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchCountResultDTO.java
  4. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java
  5. 52
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubBranchCountResultDTO.java
  6. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java
  7. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  8. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  9. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java
  10. 44
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java
  11. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  12. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml
  13. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml
  14. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml
  15. 19
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  16. 51
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
  17. 13
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml

24
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchCountFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/10/27 11:08 上午
*/
@Data
public class BranchCountFormDTO implements Serializable {
private static final long serialVersionUID = -4869326660700557193L;
public interface BranchCount{}
/**
* 机关ID
*/
@NotBlank(message = "机关ID不能为空",groups = {BranchCount.class})
private String agencyId;
}

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

@ -3,6 +3,7 @@ package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 按月查询各项指标数据--接口返参
@ -30,4 +31,9 @@ public class AblityListResultDTO implements Serializable {
*/
private String showType;
/**
* 指标对应的权重
*/
private BigDecimal weight;
}

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

@ -0,0 +1,36 @@
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
* @DateTime 2020/10/27 11:03 上午
*/
@Data
public class BranchCountResultDTO implements Serializable {
private static final long serialVersionUID = -5915969126291502360L;
private String agencyId;
/**
* 机关名称
*/
private String name;
@JsonIgnore
private String level;
private List<SubBranchCountResultDTO> partyDistribution;
public BranchCountResultDTO() {
this.agencyId = "";
this.name = "";
this.partyDistribution = new ArrayList<>();
}
}

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

@ -2,6 +2,7 @@ package com.epmet.evaluationindex.screen.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@ -12,6 +13,7 @@ import java.util.List;
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DepartmentNameListResultDTO implements Serializable {
private static final long serialVersionUID = -801407836277197080L;

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

@ -0,0 +1,52 @@
package com.epmet.evaluationindex.screen.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
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;
@JsonIgnore
private String allParentIds;
@JsonIgnore
private String subAgencyId;
public SubBranchCountResultDTO() {
this.subId = "";
this.name = "";
this.centerMark = "";
this.totalNum = 0;
this.areaMarks = "";
this.subAgencyId = "";
}
}

18
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java

@ -27,8 +27,8 @@ public class DistributionController {
private DistributionService distributionService;
/**
* @Description 1党支部
* @param formDTO
* @Description 1党支部分布 只显示 screen_customer_biz_org 表中存在的orgId的数据
* @author zxc
* @date 2020/8/18 10:59 上午
*/
@ -39,7 +39,19 @@ public class DistributionController {
}
/**
* @Description 2用户分布
* @Description 查询机关下的党支部
* @Param branchCountFormDTO
* @author zxc
* @date 2020/10/27 11:11 上午
*/
@PostMapping("branchcount")
public Result<BranchCountResultDTO> branchCount(@RequestBody BranchCountFormDTO branchCountFormDTO){
ValidatorUtils.validateEntity(branchCountFormDTO, BranchCountFormDTO.BranchCount.class);
return new Result<BranchCountResultDTO>().ok(distributionService.branchCount(branchCountFormDTO));
}
/**
* @Description 2用户分布 只显示 is_display = 1 的数据
* @param userFormDTO
* @author zxc
* @date 2020/8/18 11:10 上午
@ -51,7 +63,7 @@ public class DistributionController {
}
/**
* @Description 3党员分布
* @Description 3党员分布 只显示 is_display = 1 的数据
* @param parymemberFormDTO
* @author zxc
* @date 2020/8/18 11:20 上午

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

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

@ -48,6 +48,15 @@ public interface ScreenCustomerGridDao {
*/
List<BranchResultDTO> selectBranch(@Param("agencyId")String agencyId);
/**
* @Description 查询机关下的党支部
* @Param branchCountFormDTO
* @author zxc
* @date 2020/10/27 11:11 上午
*/
BranchCountResultDTO selectAgencyInfo(@Param("agencyId")String agencyId);
List<SubBranchCountResultDTO> selectBranchCount(@Param("agencyId")String agencyId);
/**
* @Description 查询子级用户分布网格级别
* @param parentId

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

@ -21,6 +21,14 @@ public interface DistributionService {
*/
List<BranchResultDTO> branch(BranchFormDTO formDTO);
/**
* @Description 查询机关下的党支部
* @Param branchCountFormDTO
* @author zxc
* @date 2020/10/27 11:11 上午
*/
BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO);
/**
* @Description 2用户分布
* @param userFormDTO

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

@ -11,12 +11,16 @@ import com.epmet.datareport.service.evaluationindex.screen.DistributionService;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import lombok.extern.slf4j.Slf4j;
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;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 中央区相关各指标查询
@ -24,6 +28,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/8/18 10:19
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class DistributionServiceImpl implements DistributionService {
@ -50,6 +55,45 @@ public class DistributionServiceImpl implements DistributionService {
return branchResultDTOS;
}
/**
* @Description 查询机关下的党支部
* @Param branchCountFormDTO
* @author zxc
* @date 2020/10/27 11:11 上午
*/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public BranchCountResultDTO branchCount(BranchCountFormDTO branchCountFormDTO) {
BranchCountResultDTO branchCountResultDTO = screenCustomerGridDao.selectAgencyInfo(branchCountFormDTO.getAgencyId());
if (null == branchCountResultDTO){
return new BranchCountResultDTO();
}
if (branchCountResultDTO.getLevel().equals(ScreenConstant.COMMUNITY)){
return new BranchCountResultDTO();
}
List<SubBranchCountResultDTO> agencyIds = screenCustomerAgencyDao.selectSubAgencyId(branchCountFormDTO.getAgencyId());
List<SubBranchCountResultDTO> subList = screenCustomerGridDao.selectBranchCount(branchCountFormDTO.getAgencyId());
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;
}
/**
* @Description 2用户分布
* @param userFormDTO

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java

@ -207,7 +207,7 @@ public class ProjectServiceImpl implements ProjectService {
ProcessAndCurrentDeptResultDTO data = processList.getData();
List<ProjectProcessResultDTO> processResultDTOS = ConvertUtils.sourceToTarget(data.getProcessList(), ProjectProcessResultDTO.class);
projectDetailResultDTO.setProcessList(processResultDTOS);
List<DepartmentNameListResultDTO> departmentNameListResultDTOS = ConvertUtils.sourceToTarget(data.getProcessList(), DepartmentNameListResultDTO.class);
List<DepartmentNameListResultDTO> departmentNameListResultDTOS = ConvertUtils.sourceToTarget(data.getDepartmentList(), DepartmentNameListResultDTO.class);
projectDetailResultDTO.setDepartmentList(departmentNameListResultDTOS);
projectDetailResultDTO.setDepartmentNameList(data.getDepartmentNameList());
return projectDetailResultDTO;

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml

@ -7,7 +7,8 @@
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
dict.index_name AS "name",
round(fact.WEIGHT,2) AS weight
FROM
fact_index_agency_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml

@ -7,7 +7,8 @@
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
dict.index_name AS "name",
round(fact.WEIGHT,2) AS weight
FROM
fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml

@ -7,7 +7,8 @@
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
dict.index_name AS "name",
round(fact.WEIGHT,2) AS weight
FROM
fact_index_grid_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

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

@ -80,7 +80,7 @@
sutd.org_type AS type
FROM
screen_user_total_data sutd
LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id
LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id AND sca.is_display = 1
WHERE
sutd.del_flag = '0'
AND sca.del_flag = 0
@ -98,7 +98,7 @@
sutd.org_type AS type
FROM
screen_user_total_data sutd
LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id
LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id AND sca.is_display = 1
WHERE
sutd.del_flag = '0'
AND sca.del_flag = 0
@ -197,4 +197,19 @@
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 IS_DISPLAY = 1
AND pid = #{agencyId}
</select>
</mapper>

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

@ -21,14 +21,16 @@
<!-- 查询党支部信息 -->
<select id="selectBranch" resultType="com.epmet.evaluationindex.screen.dto.result.BranchResultDTO">
SELECT
grid_id AS gridId,
grid_name AS gridName,
party_mark AS partyMark
scg.grid_id AS gridId,
scg.grid_name AS gridName,
scg.party_mark AS partyMark
FROM
screen_customer_grid
screen_customer_grid scg
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scg.PARENT_AGENCY_ID AND sca.IS_DISPLAY = 1
WHERE
del_flag = 0
AND all_parent_ids LIKE concat('%', #{agencyId}, '%')
scg.del_flag = 0
AND sca.DEL_FLAG = 0
AND scg.all_parent_ids LIKE concat('%', #{agencyId}, '%')
</select>
<!-- 查询子级用户分布【网格级别】 -->
@ -82,4 +84,41 @@
ORDER BY
created_time DESC
</select>
<!-- 查询机关下的党支部 -->
<select id="selectAgencyInfo" resultType="com.epmet.evaluationindex.screen.dto.result.BranchCountResultDTO">
SELECT
AGENCY_ID,
AGENCY_NAME AS name,
IFNULL(PARTY_MARK,''),
IFNULL(CENTER_MARK,''),
level
FROM
screen_customer_agency
WHERE
DEL_FLAG = 0
AND IS_DISPLAY = 1
AND AGENCY_ID = #{agencyId}
</select>
<select id="selectBranchCount" resultType="com.epmet.evaluationindex.screen.dto.result.SubBranchCountResultDTO">
SELECT
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,
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
WHERE
scg.DEL_FLAG = 0
AND sca.DEL_FLAG = 0
AND sca.IS_DISPLAY = 1
AND scg.all_parent_ids LIKE concat('%', #{agencyId}, '%')
GROUP BY scg.PARENT_AGENCY_ID
</select>
</mapper>

13
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml

@ -6,13 +6,14 @@
<!-- 查询党员联系群众 -->
<select id="selectContactMassLineChart" resultType="com.epmet.evaluationindex.screen.dto.result.ContactMassLineChartResult">
SELECT
org_name AS orgName,
create_group_total AS groupTotal,
group_user_total AS userTotal
md.org_name AS orgName,
md.create_group_total AS groupTotal,
md.group_user_total AS userTotal
FROM
screen_party_link_masses_data
screen_party_link_masses_data md
left join screen_customer_agency sca on sca.agency_id = md.parent_id and is_display = 1
WHERE
del_flag = '0'
AND parent_id = #{agencyId}
md.del_flag = '0'
AND md.parent_id = #{agencyId}
</select>
</mapper>
Loading…
Cancel
Save