Browse Source

Merge remote-tracking branch 'origin/dev_pyscreen' into dev_temp

master
yinzuomei 5 years ago
parent
commit
e56d9fed17
  1. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java
  2. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java
  3. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java
  4. 51
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  5. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  6. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java
  7. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java
  8. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java
  9. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java
  10. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  11. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  12. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  13. 27
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java
  14. 75
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java
  15. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java
  16. 30
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  17. 32
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml
  18. 37
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml
  19. 33
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml
  20. 15
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

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

@ -25,4 +25,9 @@ public class AgencyAndNumFormDTO implements Serializable {
* */
@NotBlank(message = "机关Id不能为空" , groups = AgencyFormDTO.CommonAgencyIdGroup.class)
private String agencyId;
/**
* 目前只有平阴在传默认赋值370124
*/
private String areaCode;
}

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

@ -21,4 +21,9 @@ public class ContactMassLineChartFormDTO implements Serializable {
*/
@NotBlank(message = "机关ID不能为空",groups = {ContactMassLineChart.class})
private String agencyId;
/**
* 目前只有平阴在传默认赋值370124
*/
private String areaCode;
}

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

@ -21,4 +21,9 @@ public class ParymemberFormDTO implements Serializable {
*/
@NotBlank(message = "机关ID不能为空",groups = {Parymember.class})
private String agencyId;
/**
* 目前只有平阴在传默认赋值370124
*/
private String areaCode;
}

51
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -2,9 +2,17 @@ package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO;
import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO;
import com.epmet.dto.form.screen.ScreenCommonFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO;
import com.epmet.dto.result.screen.ProjectQuantityResultDTO;
import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
@ -29,7 +37,10 @@ public class ScreenProjectController {
@Autowired
private ScreenProjectService screenProjectService;
@Autowired
private ScreenProjectOrgDailyService projectOrgDailyService;
@Autowired
private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService;
/**
* @Description 3项目详情
* @param projectDetailFormDTO
@ -77,4 +88,42 @@ public class ScreenProjectController {
return new Result<List<CategoryAnalysisResultDTO>>().ok(screenProjectService.categoryAnalysis(customerId, formDTO));
}
/**
* @param customerId
* @param formDTO
* @description 事件分析数量统计查询 平阴大屏
**/
@PostMapping("queryquantity")
public Result<ProjectQuantityResultDTO> queryQuantity(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCommonFormDTO formDTO){
formDTO.setCustomerId(customerId);
return new Result().ok(projectOrgDailyService.queryQuantity(formDTO));
}
/**
* @param customerId
* @param formDTO
* @author yinzuomei
* @description 近12个月事件分析月度数量分析 平阴大屏
**/
@PostMapping("queryquantity-monthly")
public Result<QueryQuantityMonthlyResultDTO> queryQuantityMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody QueryQuantityMonthlyFormDTO formDTO) {
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<QueryQuantityMonthlyResultDTO>().ok(projectQuantityOrgMonthlyService.queryQuantityMonthly(formDTO));
}
/**
* @param customerId
* @param formDTO
* @author yinzuomei
* @description 事件分析效率分析 平阴大屏
**/
@PostMapping("efficiency-analysis")
public Result<List<EfficiencyAnalysisResultDTO>> efficiencyAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody EfficiencyAnalysisFormDTO formDTO){
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<List<EfficiencyAnalysisResultDTO>>().ok(projectOrgDailyService.efficiencyAnalysis(formDTO));
}
}

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

@ -150,4 +150,5 @@ public interface ScreenCustomerAgencyDao {
**/
List<GridNodeDTO> selectGridList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId);
List<String> getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
}

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

@ -42,4 +42,6 @@ public interface ScreenOrgRankDataDao{
**/
List<OrgRankDataResultDTO> selectGridDataMonthly(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
List<OrgRankDataResultDTO> selectGridDataMonthlyAreaCode(@Param("monthId") String monthId,
@Param("areaCode")String areaCode);
}

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

@ -39,5 +39,6 @@ public interface ScreenPartyLinkMassesDataDao {
* @date 2020/8/20 2:48 下午
*/
List<ContactMassLineChartResult> selectContactMassLineChart(@Param("agencyId")String agencyId);
List<ContactMassLineChartResult> selectContactMassLineChartByAgencyIds(@Param("agencyIdList")List<String> agencyIdList);
}

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

@ -71,4 +71,8 @@ public interface ScreenPartyUserRankDataDao{
* @author sun
*/
List<PartIndexScroeRankResultDTO> selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO);
List<PartyUserPointResultDTO> selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode);
List<UserPointResultDTO> selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode);
}

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

@ -22,6 +22,8 @@ import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
*
@ -56,5 +58,6 @@ public interface ScreenUserTotalDataDao {
* @date 2020.08.20 14:54
**/
int selectAvgIssue(@Param("agencyId")String agencyId);
PartymemberPercentResultDTO selectAgencyPartymemberPercentByIds(@Param("orgIds") List<String> orgIds);
}

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

@ -61,4 +61,13 @@ public interface AgencyService {
AgencyNodeDTO queryStaffAgencyTree(String agencyId);
ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId);
/**
* @return java.util.List<java.lang.String>
* @param agencyId
* @author yinzuomei
* @description 获取当前组织的下级组织集合
* @Date 2021/2/25 16:52
**/
List<String> getNextAgencyIds(String areaCode,String agencyId);
}

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

@ -297,4 +297,17 @@ public class AgencyServiceImpl implements AgencyService {
public ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId) {
return screenCustomerAgencyDao.selectByAgencyId(agencyId);
}
/**
* @param agencyId
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 获取当前组织的下级组织集合
* @Date 2021/2/25 16:52
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<String> getNextAgencyIds(String areaCode,String agencyId) {
return screenCustomerAgencyDao.getNextAgencyIds(areaCode,agencyId);
}
}

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

@ -18,6 +18,7 @@ import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -36,6 +37,7 @@ import java.util.stream.Collectors;
* @author yinzuomei@elink-cn.com
* @date 2020/8/18 10:20
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@ -73,7 +75,13 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
param.setTopNum(NumConstant.FIVE);
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
List<UserPointResultDTO> userPointList = screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId());
List<UserPointResultDTO> userPointList = new ArrayList<>();
if(StringUtils.isNotBlank(param.getAreaCode())){
log.info("热心市民积分排行按照areaCode查询"+param.getAreaCode());
userPointList=screenPartyUserRankDataDao.selectUserPointOrderByAreaCode(param.getAreaCode());
}else{
userPointList=screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId());
}
UserPointRankResultDTO result = new UserPointRankResultDTO();
result.setNameData(userPointList.stream().map(UserPointResultDTO::getName).collect(Collectors.toList()));
result.setPointsData(userPointList.stream().map(UserPointResultDTO::getPoint).collect(Collectors.toList()));

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

@ -8,6 +8,7 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCpcBaseDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyBranchDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant;
@ -50,7 +51,8 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
private DateUtils dateUtils;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private AgencyService screenCustomerAgencyService;
/**
* @Description 1党员基本情况-饼状图概况
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324
@ -62,10 +64,29 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) {
if(StringUtils.isNotBlank(param.getAreaCode())){
logger.info(String.format("党员基本情况-饼状图概况按照areaCode查询:%s",param.getAreaCode()));
List<String> ids=screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(),param.getAgencyId());
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(ids)){
PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercentByIds(ids);
if(null == result){
logger.warn("selectAgencyPartymemberPercentByIds is null");
result = new PartymemberPercentResultDTO();
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
return result;
}
if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
}else{
result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue()))));
}
return result;
}
logger.warn("当前组织没有下级getNextAgencyIds is empty");
return new PartymemberPercentResultDTO();
}
PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId());
if(null == result){
result = new PartymemberPercentResultDTO();
logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId());
result = new PartymemberPercentResultDTO();
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));

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

@ -1,5 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
@ -7,6 +8,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.*;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant;
@ -56,6 +58,9 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
private ScreenCustomerAgencyDao customerAgencyDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private AgencyService screenCustomerAgencyService;
/**
* @Description 1先锋模范
* @param fineExampleFormDTO
@ -117,8 +122,14 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) {
List<String> subAgencyIdorGridIdList=screenCustomerAgencyService.getNextAgencyIds(contactMassLineChartFormDTO.getAreaCode(),contactMassLineChartFormDTO.getAgencyId());
log.info("当前组织的下级id:"+JSON.toJSONString(subAgencyIdorGridIdList));
ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO();
List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId());
// List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId());
//多客户版修改如下:
List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChartByAgencyIds(subAgencyIdorGridIdList);
if (contactMassLineChartResults.size() == NumConstant.ZERO){
result.setXAxis(new ArrayList<>());
result.setGroupMemberData(new ArrayList<>());
@ -247,6 +258,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<AdvanceBranchRankResultDTO> advancedBranchRank(AgencyAndNumFormDTO param) {
List<AdvanceBranchRankResultDTO> result = new LinkedList<>();
if(null == param.getTopNum()){
param.setTopNum(NumConstant.FIVE);
}else if(NumConstant.ZERO == param.getTopNum()){
@ -254,24 +266,43 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
String monthId = dateUtils.getCurrentMonthId();
List<OrgRankDataResultDTO> gridData =
screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId);
int time = NumConstant.TWELVE;
while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId);
if(StringUtils.isNotBlank(param.getAreaCode())){
log.info("先进排行榜单-先进支部排行入参"+JSON.toJSONString(param));
//areaCode不为空,按照areaCode查询
List<OrgRankDataResultDTO> gridData =
screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode());
int time = NumConstant.TWELVE;
while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
gridData = screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode());
}
if(null == gridData || gridData.isEmpty()) return result;
gridData.forEach( data -> {
AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class);
o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio()));
o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio()));
result.add(o);
});
}else{
List<OrgRankDataResultDTO> gridData =
screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId);
int time = NumConstant.TWELVE;
while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId);
}
if(null == gridData || gridData.isEmpty()) return result;
gridData.forEach( data -> {
AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class);
o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio()));
o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio()));
result.add(o);
});
}
List<AdvanceBranchRankResultDTO> result = new LinkedList<>();
if(null == gridData || gridData.isEmpty()) return result;
gridData.forEach( data -> {
AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class);
o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio()));
o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio()));
result.add(o);
});
return result;
}
@ -288,7 +319,13 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
public List<PartyUserPointResultDTO> advancedPartymemberRank(AgencyAndNumFormDTO param) {
if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
List<PartyUserPointResultDTO> result = screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId());
List<PartyUserPointResultDTO> result=new ArrayList<>();
if(StringUtils.isNotBlank(param.getAreaCode())){
log.info("先进排行榜单-先进党员排行按照areaCode查询入参:"+param.getAreaCode());
result=screenPartyUserRankDataDao.selectPartymemberPointOrderByAreaCode(param.getAreaCode());
}else{
result=screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId());
}
if(null == result) return new ArrayList<>();
return result;
}

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

@ -32,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -74,20 +71,27 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl implements ScreenProject
Map<String, ScreenProjectQuantityOrgMonthlyDTO> dtoMap = new HashMap<>();
if (!CollectionUtils.isEmpty(dtoList)) {
dtoMap = dtoList.stream().collect(Collectors.toMap(ScreenProjectQuantityOrgMonthlyDTO::getMonthId, Function.identity(), (key1, key2) -> key2));
List<String> blank = dtoMap.keySet().stream().filter(query -> !monthIdList.contains(query)).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(blank)){
for(int i = NumConstant.ZERO; i < blank.size(); i++){dtoMap.put(blank.get(i),null);}
}
}else{
for(int i = NumConstant.ZERO; i < monthIdList.size(); i++){dtoMap.put(monthIdList.get(i),null);}
}
for (String monthId : monthIdList) {
//202101=>01月
xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH));
if (!CollectionUtils.isEmpty(dtoList)) {
ScreenProjectQuantityOrgMonthlyDTO en = dtoMap.get(monthId);
if ("incr".equals(formDTO.getType())) {
yAxis.add(dtoMap.get(monthId).getProjectIncr());
yAxis.add( null == en ? NumConstant.ZERO : en.getProjectIncr());
} else if ("sum".equals(formDTO.getType())) {
yAxis.add(dtoMap.get(monthId).getProjectTotal());
yAxis.add( null == en ? NumConstant.ZERO : en.getProjectTotal() );
}
continue;
}
//没有数据默认赋值0
yAxis.add(0);
//yAxis.add(0);
}
resultDTO.setXAxis(xAxis);
resultDTO.setYAxis(yAxis);

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

@ -272,4 +272,34 @@
and grid.PARENT_AGENCY_ID=#{agencyId}
</select>
<select id="getNextAgencyIds" parameterType="map" resultType="java.lang.String">
SELECT
sca.AGENCY_ID as orgId
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
AND sca.PARENT_AREA_CODE = #{areaCode}
</when>
<otherwise>
and sca.PID=#{agencyId}
</otherwise>
</choose>
union
SELECT
m.GRID_ID as orgId
FROM
screen_customer_grid m
where m.DEL_FLAG = '0'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
and m.AREA_CODE=#{areaCode}
</when>
<otherwise>
m.PARENT_AGENCY_ID=#{agencyId}
</otherwise>
</choose>
</select>
</mapper>

32
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml

@ -34,4 +34,36 @@
</select>
<select id="selectGridDataMonthlyAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.OrgRankDataResultDTO">
SELECT
rankData.ORG_NAME AS NAME,
rankData.PARTY_TOTAL AS partyMemberNum,
rankData.GROUP_TOTAL AS branchNum,
rankData.ISSUE_TOTAL AS issueNum,
rankData.PROJECT_TOTAL AS projectNum,
rankData.CLOSE_PROJECT_RATIO AS closedProjectRatio,
rankData.SATISFACTION_RATIO AS satisfactionRatio,
agency.AGENCY_NAME AS parentAgencyName
FROM
screen_org_rank_data rankData
left join screen_customer_grid scg on(
rankData.ORG_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
)
LEFT JOIN screen_customer_agency agency
ON (scg.PARENT_AGENCY_ID = agency.AGENCY_ID AND agency.DEL_FLAG = '0')
WHERE
rankData.DEL_FLAG = '0'
AND rankData.ORG_TYPE = 'grid'
and scg.AREA_CODE like CONCAT('%',#{areaCode},'%')
AND rankData.MONTH_ID = #{monthId}
ORDER BY
(rankData.PARTY_TOTAL + rankData.GROUP_TOTAL + rankData.ISSUE_TOTAL + rankData.PROJECT_TOTAL + rankData.CLOSE_PROJECT_RATIO + rankData.SATISFACTION_RATIO) DESC,
rankData.PARTY_TOTAL DESC,
rankData.GROUP_TOTAL DESC,
rankData.ISSUE_TOTAL DESC,
rankData.PROJECT_TOTAL DESC,
rankData.CLOSE_PROJECT_RATIO DESC,
rankData.SATISFACTION_RATIO DESC
</select>
</mapper>

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

@ -19,4 +19,41 @@
AND md.ORG_TYPE =
CASE WHEN sca.LEVEL = 'community' THEN 'grid' ELSE 'agency' END
</select>
<select id="selectContactMassLineChartByAgencyIds" resultType="com.epmet.evaluationindex.screen.dto.result.ContactMassLineChartResult">
SELECT
sca.agency_id as orgId,
sca.AGENCY_NAME AS orgName,
IFNULL(md.create_group_total,0) AS groupTotal,
IFNULL(md.group_user_total,0)AS userTotal
FROM
screen_customer_agency sca
LEFT JOIN screen_party_link_masses_data md
ON ( sca.agency_id = md.ORG_ID AND md.del_flag = '0' )
WHERE SCA.DEL_FLAG='0'
AND sca.is_display = '1'
<if test="agencyIdList != null and agencyIdList.size() > 0">
AND sca.agency_id in
<foreach item="agencyId" collection="agencyIdList" open="(" separator="," close=")">
#{agencyId}
</foreach>
</if>
union
SELECT
scg.GRID_ID as orgId,
scg.GRID_NAME AS orgName,
IFNULL(md.create_group_total,0) AS groupTotal,
IFNULL(md.group_user_total,0)AS userTotal
FROM
screen_customer_grid scg
LEFT JOIN screen_party_link_masses_data md
ON ( scg.GRID_ID = md.ORG_ID AND md.del_flag = '0' )
WHERE scg.DEL_FLAG='0'
<if test="agencyIdList != null and agencyIdList.size() > 0">
AND scg.GRID_ID in
<foreach item="agencyId" collection="agencyIdList" open="(" separator="," close=")">
#{agencyId}
</foreach>
</if>
</select>
</mapper>

33
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -98,4 +98,37 @@
LIMIT #{topNum}
</select>
<select id="selectPartymemberPointOrderByAreaCode" resultType="com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO">
SELECT
m.USER_ID,
concat( m.surname, CASE char_length( m.NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name,
m.POINT_TOTAL AS point
FROM
screen_party_user_rank_data m
left join screen_customer_grid scg
on(m.GRID_ID=scg.GRID_ID and scg.DEL_FLAG='0')
WHERE
m.DEL_FLAG = '0'
AND PARTY_FLAG = '1'
and scg.AREA_CODE like CONCAT(#{areaCode},'%')
ORDER BY
m.POINT_TOTAL DESC
</select>
<select id="selectUserPointOrderByAreaCode" resultType="com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO">
SELECT
m.USER_ID,
concat( m.surname, CASE char_length( m.NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name,
m.POINT_TOTAL AS point
FROM
screen_party_user_rank_data m
left join screen_customer_grid scg
on(m.GRID_ID=scg.GRID_ID and scg.DEL_FLAG='0')
WHERE
m.DEL_FLAG = '0'
and scg.AREA_CODE like CONCAT(#{areaCode},'%')
ORDER BY
m.POINT_TOTAL DESC
m.user_name
</select>
</mapper>

15
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

@ -15,6 +15,21 @@
AND PARENT_ID = #{agencyId}
</select>
<select id="selectAgencyPartymemberPercentByIds" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO">
SELECT
SUM( PARTY_TOTAL ) AS partyMemberTotal,
SUM( USER_TOTAL ) AS platFormTotal
FROM
screen_user_total_data m
WHERE
DEL_FLAG = '0'
<if test="orgIds != null and orgIds.size() > 0">
AND m.ORG_ID IN
<foreach item="orgId" collection="orgIds" open="(" separator="," close=")">
#{orgId}
</foreach>
</if>
</select>
<!-- 查询top区概况 -->
<select id="selectTopProfile" resultType="com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO">
SELECT

Loading…
Cancel
Save