From 0563e65ff9217c14475ed9e2110bd5d23b06d5a1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 17:50:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E7=BE=A4=E4=BC=97=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/ContactMassLineChartFormDTO.java | 5 +++ .../screen/ScreenCustomerAgencyDao.java | 1 + .../screen/ScreenPartyLinkMassesDataDao.java | 3 +- .../evaluationindex/screen/AgencyService.java | 9 +++++ .../screen/impl/AgencyServiceImpl.java | 13 ++++++++ .../impl/PartyMemberLeadServiceImpl.java | 13 +++++++- .../mapper/screen/ScreenCustomerAgencyDao.xml | 30 +++++++++++++++++ .../screen/ScreenPartyLinkMassesDataDao.xml | 33 +++++++++++++++++++ 8 files changed, 105 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java index c2deeac60b..b696426a2e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java +++ b/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; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index af4b0b7af2..d0a4f459a6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/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 selectGridList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + List getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 1ca974982f..30094b7225 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/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 selectContactMassLineChart(@Param("agencyId")String agencyId); - + + List selectContactMassLineChartByAgencyIds(@Param("agencyIdList")List agencyIdList); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index 8e265fb34b..f637a0e942 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/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 + * @param agencyId + * @author yinzuomei + * @description 获取当前组织的下级组织集合 + * @Date 2021/2/25 16:52 + **/ + List getNextAgencyIds(String areaCode,String agencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 23d960354f..9731353c92 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/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 + * @author yinzuomei + * @description 获取当前组织的下级组织集合 + * @Date 2021/2/25 16:52 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public List getNextAgencyIds(String areaCode,String agencyId) { + return screenCustomerAgencyDao.getNextAgencyIds(areaCode,agencyId); + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 073f26ef94..67911d8185 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java +++ b/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 subAgencyIdorGridIdList=screenCustomerAgencyService.getNextAgencyIds(contactMassLineChartFormDTO.getAreaCode(),contactMassLineChartFormDTO.getAgencyId()); + log.info("当前组织的下级id:"+JSON.toJSONString(subAgencyIdorGridIdList)); + ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); - List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + // List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + //多客户版修改如下: + List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChartByAgencyIds(subAgencyIdorGridIdList); if (contactMassLineChartResults.size() == NumConstant.ZERO){ result.setXAxis(new ArrayList<>()); result.setGroupMemberData(new ArrayList<>()); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index cf3b1a7631..04dabd6847 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -272,4 +272,34 @@ and grid.PARENT_AGENCY_ID=#{agencyId} + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index 7f4520f8ff..29c20cb493 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -19,4 +19,37 @@ AND md.ORG_TYPE = CASE WHEN sca.LEVEL = 'community' THEN 'grid' ELSE 'agency' END + + \ No newline at end of file From c054afee8573d1694c5e9111c8d2c4456e06ca53 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 25 Feb 2021 18:25:30 +0800 Subject: [PATCH 2/5] =?UTF-8?q?screen/project=20=E6=9C=88=E5=BA=A6?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=88=86=E6=9E=90=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenProjectController.java | 51 ++++++++++++++++++- ...nProjectQuantityOrgMonthlyServiceImpl.java | 18 ++++--- 2 files changed, 61 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 2b5dea4b2d..2d2c1e79a0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/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>().ok(screenProjectService.categoryAnalysis(customerId, formDTO)); } + + /** + * @param customerId + * @param formDTO + * @description 【事件分析】数量统计查询 平阴大屏 + **/ + @PostMapping("queryquantity") + public Result 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 queryQuantityMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody QueryQuantityMonthlyFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(projectQuantityOrgMonthlyService.queryQuantityMonthly(formDTO)); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【事件分析】效率分析 平阴大屏 + **/ + @PostMapping("efficiency-analysis") + public Result> efficiencyAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody EfficiencyAnalysisFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(projectOrgDailyService.efficiencyAnalysis(formDTO)); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java index 1e4855604d..72cc5f40cc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java +++ b/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 dtoMap = new HashMap<>(); if (!CollectionUtils.isEmpty(dtoList)) { dtoMap = dtoList.stream().collect(Collectors.toMap(ScreenProjectQuantityOrgMonthlyDTO::getMonthId, Function.identity(), (key1, key2) -> key2)); + List 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); From 87a22641ffc6c3a70a169420833707507e8e7cd2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 18:34:03 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=94=AF=E9=83=A8?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/AgencyAndNumFormDTO.java | 5 ++ .../screen/ScreenOrgRankDataDao.java | 2 + .../impl/PartyMemberLeadServiceImpl.java | 54 +++++++++++++------ .../mapper/screen/ScreenOrgRankDataDao.xml | 32 +++++++++++ 4 files changed, 76 insertions(+), 17 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java index cd31c9688b..9410dda13a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java +++ b/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; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java index 2b9bdba497..1e9a5efe09 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java +++ b/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 selectGridDataMonthly(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + List selectGridDataMonthlyAreaCode(@Param("monthId") String monthId, + @Param("areaCode")String areaCode); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 67911d8185..5a125e55cd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -258,6 +258,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List advancedBranchRank(AgencyAndNumFormDTO param) { + List result = new LinkedList<>(); if(null == param.getTopNum()){ param.setTopNum(NumConstant.FIVE); }else if(NumConstant.ZERO == param.getTopNum()){ @@ -265,24 +266,43 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); String monthId = dateUtils.getCurrentMonthId(); - List 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 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 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 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; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index bc1fa8f0aa..5d2be597be 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -34,4 +34,36 @@ + \ No newline at end of file From b68d7062be16856cb2bd1edbed7fc7fec0939f72 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 18:46:04 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=85=88=E8=BF=9B=E5=85=9A=E5=91=98?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenPartyUserRankDataDao.java | 2 ++ .../screen/impl/PartyMemberLeadServiceImpl.java | 8 +++++++- .../mapper/screen/ScreenPartyUserRankDataDao.xml | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index 0f442931b5..5a22e7511b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -71,4 +71,6 @@ public interface ScreenPartyUserRankDataDao{ * @author sun */ List selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO); + + List selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 5a125e55cd..ce075165b6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -319,7 +319,13 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { public List advancedPartymemberRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId()); + List 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; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index ed4cf4c4d1..525d52f207 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -98,4 +98,20 @@ LIMIT #{topNum} + \ No newline at end of file From 179e2d69a4c9d3b0691d86e757486ea727b7a765 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 19:18:32 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=83=AD=E5=BF=83=E5=B8=82=E6=B0=91?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/ParymemberFormDTO.java | 5 ++++ .../screen/ScreenPartyUserRankDataDao.java | 2 ++ .../screen/ScreenUserTotalDataDao.java | 5 +++- .../impl/GrassRootsGovernServiceImpl.java | 10 ++++++- .../impl/GrassrootsPartyDevServiceImpl.java | 27 ++++++++++++++++--- .../screen/ScreenPartyLinkMassesDataDao.xml | 4 +++ .../screen/ScreenPartyUserRankDataDao.xml | 17 ++++++++++++ .../mapper/screen/ScreenUserTotalDataDao.xml | 15 +++++++++++ 8 files changed, 80 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java index fdf525f37b..15b3e36477 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java +++ b/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; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index 5a22e7511b..fe5adc1a77 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -73,4 +73,6 @@ public interface ScreenPartyUserRankDataDao{ List selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO); List selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode); + + List selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index 653cf3f606..8de5eaadfc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java +++ b/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 orgIds); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index 8dc27f6d18..081f7aa28e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/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 userPointList = screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId()); + List 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())); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index 30e3d5d32e..6285e007f4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/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 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)); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index 29c20cb493..0db5e467e1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -32,10 +32,12 @@ ON ( sca.agency_id = md.ORG_ID AND md.del_flag = '0' ) WHERE SCA.DEL_FLAG='0' AND sca.is_display = '1' + AND sca.agency_id in #{agencyId} + union SELECT scg.GRID_ID as orgId, @@ -47,9 +49,11 @@ 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' + AND scg.GRID_ID in #{agencyId} + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 525d52f207..f6d5c66ca4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -114,4 +114,21 @@ ORDER BY m.POINT_TOTAL DESC + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index 57b2959430..d2040d3e13 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -15,6 +15,21 @@ AND PARENT_ID = #{agencyId} +