From 1d0f29b3fafe48814fa666ec728c4b2ac39b2ac3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 12 May 2021 11:05:01 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E7=BE=A4=E7=BB=84=E6=95=B0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 18 +++++ .../dto/group/form/GroupTotalFormDTO.java | 4 +- .../extract/FactOriginGroupMainDailyDao.java | 6 ++ .../com/epmet/dao/group/GroupDataDao.java | 5 -- .../FactOriginGroupMainDailyEntity.java | 5 ++ .../com/epmet/service/StatsGroupService.java | 2 + .../FactOriginGroupMainDailyService.java | 6 ++ .../FactOriginGroupMainDailyServiceImpl.java | 9 +++ .../epmet/service/group/GroupDataService.java | 5 -- .../group/impl/GroupDataServiceImpl.java | 11 --- .../service/impl/StatsGroupServiceImpl.java | 69 +++++++++++-------- .../extract/FactOriginGroupMainDailyDao.xml | 11 +++ .../resources/mapper/group/GroupDataDao.xml | 10 --- 13 files changed, 100 insertions(+), 61 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index c79f891d7c..a2f88e4133 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -800,4 +800,22 @@ public class DateUtils { } return date; } + + /** + * 格式化日期 + * @param dateStr String 字符型日期 + * @param format String 格式 + * @return Date 日期 + */ + public static Date parseDate(String dateStr, String format) { + Date date = null; + try { + DateFormat dateFormat = new SimpleDateFormat(format); + date = dateFormat.parse(dateStr); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java index ce3c23761d..7d91c9c3fc 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java @@ -18,7 +18,7 @@ public class GroupTotalFormDTO implements Serializable { */ private String customerId = ""; /** - * 需要执行的日期(格式:yyyy-MM-dd)2020-01-01 + * 需要执行的日期(格式:yyyyMMdd) */ - private String date = ""; + private String dateId = ""; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 911d8b7993..7ffdf0c1f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -199,4 +199,10 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); + + /** + * @Author sun + * @Description 查询客户小组维度下有效群组列表 + **/ + List selectCustomerGroupList(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index 0e29f1530a..bf35e1fe88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -92,9 +92,4 @@ public interface GroupDataDao { **/ List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); - /** - * @Author sun - * @Description 查询客户下有效群组列表 - **/ - List selectCustomerGroupList(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java index 8bb0ba12a1..34b01407d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java @@ -116,4 +116,9 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 */ private Integer isOwnerParty; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java index 1fcb3da75b..c6019d1490 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -3,6 +3,8 @@ package com.epmet.service; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; +import java.text.ParseException; + /** * @Author zxc * @CreateTime 2020/6/16 14:14 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index 730acde2c8..9b4350b1fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -105,4 +105,10 @@ public interface FactOriginGroupMainDailyService extends BaseService */ List getOrgGroupCount(String customerId, String monthId, String level); + + /** + * @Author sun + * @Description 查询客户小组维度下有效群组列表 + **/ + List getGroupListByCustomerId(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index 94fadea5fe..718a045131 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -136,4 +136,13 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl getGroupListByCustomerId(String customerId, String dateId) { + return baseDao.selectCustomerGroupList(customerId, dateId); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index e971566233..76865ba242 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -67,9 +67,4 @@ public interface GroupDataService { **/ List extractGroupData(Boolean isFirst,String customerId,String dateId); - /** - * @Author sun - * @Description 查询客户下有效群组列表 - **/ - List getGroupListByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index ca2c54b87d..93d6b4a7db 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -211,15 +211,4 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.groupExtracting(customerId,isFirst?null:dateId); } - - /** - * @Author sun - * @Description 查询客户下有效群组列表 - **/ - @Override - public List getGroupListByCustomerId(String customerId) { - return groupDataDao.selectCustomerGroupList(customerId); - } - - } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 4be803a4a6..f222a9ee8e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.convert.DateConverter; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; @@ -9,24 +10,29 @@ import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; import com.epmet.service.StatsGroupService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import com.epmet.service.group.GroupDataService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; @@ -63,6 +69,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { private FactGroupTotalGridDailyService factGroupTotalGridDailyService; @Autowired private FactGroupTotalAgencyDailyService factGroupTotalAgencyDailyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; /** * @param @@ -352,15 +360,16 @@ public class StatsGroupServiceImpl implements StatsGroupService { **/ @Override public void gridGroupTotal(GroupTotalFormDTO formDTO) { - Date date = DateUtils.yesterDay(); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 - if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { - date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); } //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { log.info("单独统计客户网格-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); - gridGroupStats(formDTO.getCustomerId(), date); + gridGroupStats(formDTO.getCustomerId(), formDTO.getDateId()); } else { int pageNo = 1; int pageSize = 100; @@ -373,7 +382,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { try { log.info("for循环统计网格-小组总数日统计数据,当前统计的客户Id:" + customerId); //遍历统计每一个客户数据 - gridGroupStats(customerId, date); + gridGroupStats(customerId, formDTO.getDateId()); } catch (Exception e) { log.error("小组总数-网格日统计-程序错误,对应客户Id:" + customerId, e); log.error("Error creating model JSON", e); @@ -389,8 +398,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @Author sun * @Description 小组总数-网格日统计数据 **/ - private void gridGroupStats(String customerId, Date date) { + private void gridGroupStats(String customerId, String dateId) { //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询网格维度表数据 @@ -399,18 +409,18 @@ public class StatsGroupServiceImpl implements StatsGroupService { //3.根据客户Id查询客户下有效的群组列表数据 log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); - List groupList = groupDataService.getGroupListByCustomerId(customerId); + List groupList = factOriginGroupMainDailyService.getGroupListByCustomerId(customerId, dateId); //4.分别计算每个网格下审核通过的小组数据 List list = new ArrayList<>(); + DimIdGenerator.DimIdBean finalDimId = dimId; dimGridList.forEach(grid -> { FactGroupTotalGridDailyEntity entity = new FactGroupTotalGridDailyEntity(); AtomicInteger total = new AtomicInteger(0); AtomicInteger ordinary = new AtomicInteger(0); AtomicInteger branch = new AtomicInteger(0); groupList.forEach(group -> { - if (grid.getId().equals(group.getGridId()) && "approved".equals(group.getState())) { - + if (grid.getId().equals(group.getGridId()) && "approved".equals(group.getGroupState())) { total.addAndGet(1); if ("ordinary".equals(group.getGroupType())) { ordinary.addAndGet(1); @@ -424,11 +434,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { entity.setCustomerId(grid.getCustomerId()); entity.setAgencyId(grid.getAgencyId()); entity.setGridId(grid.getId()); - entity.setDateId(dimId.getDateId()); - entity.setWeekId(dimId.getWeekId()); - entity.setMonthId(dimId.getMonthId()); - entity.setQuarterId(dimId.getQuarterId()); - entity.setYearId(dimId.getYearId()); + entity.setDateId(finalDimId.getDateId()); + entity.setWeekId(finalDimId.getWeekId()); + entity.setMonthId(finalDimId.getMonthId()); + entity.setQuarterId(finalDimId.getQuarterId()); + entity.setYearId(finalDimId.getYearId()); entity.setGroupTotal(total.get()); entity.setOrdinaryTotal(ordinary.get()); entity.setBranchTotal(branch.get()); @@ -457,15 +467,16 @@ public class StatsGroupServiceImpl implements StatsGroupService { **/ @Override public void agencyGroupTotal(GroupTotalFormDTO formDTO) { - Date date = DateUtils.yesterDay(); - //入参有时间的则按具体时间执行,没有的则按当前时间前一天执行 - if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { - date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); } //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { log.info("单独统计客户组织下-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); - agencyGroupStats(formDTO.getCustomerId(), date); + agencyGroupStats(formDTO.getCustomerId(), formDTO.getDateId()); } else { int pageNo = 1; int pageSize = 100; @@ -477,7 +488,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { try { log.info("for循环统计机关-小组总数日统计数据,当前统计的客户Id:" + customerId); //遍历统计每一个客户数据 - agencyGroupStats(customerId, date); + agencyGroupStats(customerId, formDTO.getDateId()); } catch (Exception e) { log.error("小组总数-机关日统计程序错误,对应客户Id:" + customerId, e); log.error("Error creating model JSON", e); @@ -493,8 +504,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @Author sun * @Description 小组总数-机关日统计数据 **/ - private void agencyGroupStats(String customerId, Date date) { + private void agencyGroupStats(String customerId, String dateId) { //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询机关维度表数据 @@ -508,10 +520,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { //4.根据客户Id查询客户下有效的群组列表数据 log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); - List groupList = groupDataService.getGroupListByCustomerId(customerId); + List groupList = factOriginGroupMainDailyService.getGroupListByCustomerId(customerId, dateId); List list = new ArrayList<>(); //5.遍历组织维度数据分别计算每个组织下群组数据 + DimIdGenerator.DimIdBean finalDimId = dimId; agencyList.forEach(agency->{ FactGroupTotalAgencyDailyEntity entity = new FactGroupTotalAgencyDailyEntity(); //5-1.汇总组织及所有下级组织列表 @@ -538,7 +551,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { //5-3.根据汇总的网格列表统计对应的群组数据 agencyGridList.forEach(gridId -> { groupList.forEach(group -> { - if (gridId.equals(group.getGridId()) && "approved".equals(group.getState())) { + if (gridId.equals(group.getGridId()) && "approved".equals(group.getGroupState())) { total.addAndGet(1); if ("ordinary".equals(group.getGroupType())) { ordinary.addAndGet(1); @@ -553,11 +566,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { entity.setCustomerId(agency.getCustomerId()); entity.setAgencyId(agency.getId()); entity.setPid(agency.getPid()); - entity.setDateId(dimId.getDateId()); - entity.setWeekId(dimId.getWeekId()); - entity.setMonthId(dimId.getMonthId()); - entity.setQuarterId(dimId.getQuarterId()); - entity.setYearId(dimId.getYearId()); + entity.setDateId(finalDimId.getDateId()); + entity.setWeekId(finalDimId.getWeekId()); + entity.setMonthId(finalDimId.getMonthId()); + entity.setQuarterId(finalDimId.getQuarterId()); + entity.setYearId(finalDimId.getYearId()); entity.setGroupTotal(total.get()); entity.setOrdinaryTotal(ordinary.get()); entity.setBranchTotal(branch.get()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index 3107a108d9..2f40e1de70 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -340,4 +340,15 @@ AND f.GROUP_STATE = 'approved' GROUP BY f.AGENCY_ID + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 1bf3357347..a1b2b223ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -228,14 +228,4 @@ - - \ No newline at end of file From 9108b5ef31596db5cdc3054b439605b8be1f5c5c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 May 2021 14:10:18 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=9A=E5=8F=82=E5=8A=A0=E4=B8=89=E4=B8=80=E4=BC=9A=E4=B8=80?= =?UTF-8?q?=E8=AF=BE=E6=AC=A1=E6=95=B0joinThreeMeetsCount=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/group/GroupDataDao.java | 10 +++++- .../impl/CalCpcIndexServiceImpl.java | 31 +++++++++++++++++-- .../epmet/service/group/GroupDataService.java | 10 +++++- .../group/impl/GroupDataServiceImpl.java | 22 ++++++++++--- .../resources/mapper/group/GroupDataDao.xml | 24 +++++++------- 5 files changed, 75 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index bf35e1fe88..8d4fb6f16a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -6,7 +6,7 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -92,4 +92,12 @@ public interface GroupDataDao { **/ List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectUserSignedCount(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 6c7fad11c7..5a30c84911 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthly import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import com.epmet.service.group.GroupDataService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -43,6 +44,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService; @Autowired private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Autowired + private GroupDataService groupDataService; /** * @param customerId 客户id @@ -54,7 +57,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { **/ @Override public void calCpcPartyAbility(String customerId, String monthId) { - //1、构造初始值 + //1、构造初始值 当前客户下所有的党员 List indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { log.info("dim_customer_partymember do not any records customerId="+customerId); @@ -71,7 +74,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map shiftIssueCountMap = calShiftIssueCount(customerId, monthId); //4、党员提出的议题转项目数 Map shiftProjectCountMap = calShiftProjectCount(customerId, monthId); - //5、参加“三会一课”次数 默认0 + //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 + Map joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId); //可以先查询出每个党员的 自建群 Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); @@ -105,7 +109,10 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); } - //5、参加“三会一课”次数 目前没有此业务,默认0 + //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 + if(joinThreeMeetsCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ + indexPartyAblityCpcEntity.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } //6、党员自建群群众人数 if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); @@ -220,6 +227,24 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { return resultMap; } + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 5:参加“三会一课”次数 : 当前用户在本月内活动签到次数 + * @Date 2021/5/12 13:38 + **/ + private Map calJoinThreeMeetsCount(String customerId, String monthId) { + //查询小组活动签到表,计算用户在本月内签到的活动次数 + List list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { + resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + /** * @param customerId * @param monthId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index 76865ba242..6be5b22324 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -2,7 +2,7 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -67,4 +67,12 @@ public interface GroupDataService { **/ List extractGroupData(Boolean isFirst,String customerId,String dateId); + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectJoinThreeMeetsCount(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 93d6b4a7db..20927df80a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -10,16 +10,12 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; -import com.epmet.entity.stats.DimGridEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.util.StringUtil; 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.*; import java.util.stream.Collectors; @@ -139,6 +135,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ + @Override public List getAgencyGroupTotalCount(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -164,6 +161,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ + @Override public List selectAgencyEveryGroupPeopleCount(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -177,6 +175,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param dateId * @author zxc */ + @Override public List selectAgencyGroupIncr(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -211,4 +210,17 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.groupExtracting(customerId,isFirst?null:dateId); } + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + @Override + public List selectJoinThreeMeetsCount(String customerId, String monthId) { + return groupDataDao.selectUserSignedCount(customerId,monthId); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index a1b2b223ab..08b32f97fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -214,18 +214,18 @@ - - SELECT - - ATTACHMENT_URL AS eventImgUrl, - SORT - - FROM - resi_topic_attachment - WHERE - DEL_FLAG = '0' - + m.SIGN_USER_ID AS userId, + count( DISTINCT m.GROUP_ACT_ID ) AS indexValue + FROM + act_sign_in_record m + WHERE + m.DEL_FLAG = '0' + AND m.CUSTOMER_ID = #{customerId} + AND DATE_FORMAT( m.CREATED_TIME, '%Y%m')= #{monthId} + GROUP BY + m.SIGN_USER_ID - \ No newline at end of file From 3640f3740b5306c652d0000dbd49a9c47103f28d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 May 2021 14:18:22 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=9A=E5=8F=82=E5=8A=A0=E4=B8=89=E4=B8=80=E4=BC=9A=E4=B8=80?= =?UTF-8?q?=E8=AF=BE=E6=AC=A1=E6=95=B0joinThreeMeetsCount=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=B5=8B=E5=80=BC=20sql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dao/group/GroupDataDao.java | 2 +- .../dataToIndex/impl/CalCpcIndexServiceImpl.java | 6 +++--- .../epmet/service/group/impl/GroupDataServiceImpl.java | 2 +- .../src/main/resources/mapper/group/GroupDataDao.xml | 10 ++++++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index 8d4fb6f16a..fae2cfd223 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -93,7 +93,7 @@ public interface GroupDataDao { List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); /** - * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * 查询小组活动签到表,计算用户在本月内签到的活动次数 限制活动分类编码100001 三会一课 * * @param customerId * @param monthId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 5a30c84911..353c3ad882 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -74,7 +74,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map shiftIssueCountMap = calShiftIssueCount(customerId, monthId); //4、党员提出的议题转项目数 Map shiftProjectCountMap = calShiftProjectCount(customerId, monthId); - //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 + //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 Map joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId); //可以先查询出每个党员的 自建群 @@ -109,7 +109,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); } - //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 + //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 if(joinThreeMeetsCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ indexPartyAblityCpcEntity.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(indexPartyAblityCpcEntity.getUserId())); } @@ -232,7 +232,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @param customerId * @param monthId * @author yinzuomei - * @description 5:参加“三会一课”次数 : 当前用户在本月内活动签到次数 + * @description 5:参加“三会一课”次数 : 当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 * @Date 2021/5/12 13:38 **/ private Map calJoinThreeMeetsCount(String customerId, String monthId) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 20927df80a..550c0d73e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -211,7 +211,7 @@ public class GroupDataServiceImpl implements GroupDataService { } /** - * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * 查询小组活动签到表,计算用户在本月内签到的活动次数 限制活动分类编码100001 三会一课 * * @param customerId * @param monthId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 08b32f97fe..a5de0e01ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -214,17 +214,23 @@ - + From 6cf0f40b6df066572bd1d91583bd94c541f7cc2b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 12 May 2021 15:49:01 +0800 Subject: [PATCH 04/17] =?UTF-8?q?dada=5Faggregator=E5=BC=95=E5=85=A5data?= =?UTF-8?q?=5Fstatistical=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/DataSourceConstant.java | 2 ++ .../data-aggregator-server/pom.xml | 28 ++++++++++++++++++ .../controller/DataStatsController.java | 20 +++++++++++++ .../dataaggre/dao/datastats/DataStatsDao.java | 29 +++++++++++++++++++ .../service/datastats/DataStatsService.java | 9 ++++++ .../datastats/impl/DataStatsServiceImpl.java | 22 ++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ .../mapper/datastats/DatsStatsDao.xml | 7 +++++ 8 files changed, 122 insertions(+) create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java index 07604c401d..b5395e65b6 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java @@ -26,4 +26,6 @@ public interface DataSourceConstant { String EPMET_COMMON_SERVICE="commonservice"; String OPER_CRM="opercrm"; + + String DATA_STATISTICAL="datastatistical"; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 7b74f08a23..604d182cb8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -157,6 +157,13 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -238,6 +245,13 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -319,6 +333,13 @@ epmet elink@833066 + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -400,6 +421,13 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java new file mode 100644 index 0000000000..2b2abc3b51 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.dataaggre.service.datastats.DataStatsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@RestController +@RequestMapping("datastats") +public class DataStatsController { + + @Autowired + private DataStatsService dataStatsService; + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java new file mode 100644 index 0000000000..475f62cdea --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -0,0 +1,29 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.datastats; + +import org.apache.ibatis.annotations.Mapper; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@Mapper +public interface DataStatsDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java new file mode 100644 index 0000000000..fca91d972e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -0,0 +1,9 @@ +package com.epmet.dataaggre.service.datastats; + +/** + * @Author sun + * @Description 数据统计服务 + */ +public interface DataStatsService { + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java new file mode 100644 index 0000000000..d83e73545e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -0,0 +1,22 @@ +package com.epmet.dataaggre.service.datastats.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@Service +@DataSource(DataSourceConstant.DATA_STATISTICAL) +@Slf4j +public class DataStatsServiceImpl implements DataStatsService { + @Autowired + private DataStatsDao dataStatsDao; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index 6e27140e97..cd8b7b8ef1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -129,6 +129,11 @@ dynamic: url: @datasource.druid.opercrm.url@ username: @datasource.druid.opercrm.username@ password: @datasource.druid.opercrm.password@ + datastatistical: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.opercrm.url@ + username: @datasource.druid.opercrm.username@ + password: @datasource.druid.opercrm.password@ feign: hystrix: enabled: true diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml new file mode 100644 index 0000000000..8360ef814e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From bb2b3eede94da2570d885a42aabd6b83a3f42ce4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 May 2021 09:11:35 +0800 Subject: [PATCH 05/17] zancun --- .../impl/CalGridIndexServiceImpl.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index fc3c7532d1..474456ec41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -130,6 +130,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { }); } + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + Map createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); + Map joinThreeMeetsCountMap=getJoinThreeMeetsCountMap(customerId,monthId); + String quarterId = DateUtils.getQuarterId(monthId); String yearId = DateUtils.getYearId(monthId); result.forEach(r -> { @@ -217,6 +222,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } }); } + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + if (createThreeMeetsCountMap.containsKey(r.getGridId())) { + r.setCreateThreeMeetsCount(createThreeMeetsCountMap.get(r.getGridId())); + } + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + if (joinThreeMeetsCountMap.containsKey(r.getGridId())) { + r.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(r.getGridId())); + } }); delPartyAbility(customerId, monthId); List> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED); @@ -226,6 +239,19 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return true; } + + private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + // todo + return null; + } + + private Map getCreateThreeMeetsCountMap(String customerId, String monthId) { + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + // todo + return null; + } + /** * @Description 计算网格指标治理能力 * @param customerId From 3b9ca27d03a19872e8ee4851f60feed93c2e8f2c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 May 2021 10:11:06 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=9A=E7=BB=84=E7=BB=87=E2=80=9D=E4=B8=89=E4=BC=9A=E4=B8=80?= =?UTF-8?q?=E8=AF=BE=E2=80=9C=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/group/GroupDataDao.java | 10 +++++++ .../impl/CalGridIndexServiceImpl.java | 26 ++++++++++++++----- .../epmet/service/group/GroupDataService.java | 10 +++++++ .../group/impl/GroupDataServiceImpl.java | 13 ++++++++++ .../resources/mapper/group/GroupDataDao.xml | 18 +++++++++++++ 5 files changed, 70 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index fae2cfd223..80776d8798 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -7,6 +7,7 @@ import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -100,4 +101,13 @@ public interface GroupDataDao { * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO */ List selectUserSignedCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectCountGridCreateThreeMeets(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index 474456ec41..ef869f7941 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -15,6 +16,7 @@ import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthl import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.group.GroupDataService; import com.epmet.service.heart.ActInfoService; import com.epmet.service.partymember.PartyMemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; @@ -29,7 +31,10 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -71,6 +76,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private PartyMemberService partyMemberService; @Autowired private ScreenCustomerGridService gridService; + @Autowired + private GroupDataService groupDataService; /** * @Description 计算网格指标党建能力 @@ -131,8 +138,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 - // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 Map createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 Map joinThreeMeetsCountMap=getJoinThreeMeetsCountMap(customerId,monthId); String quarterId = DateUtils.getQuarterId(monthId); @@ -239,19 +246,24 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return true; } - - private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { + private Map getCreateThreeMeetsCountMap(String customerId, String monthId) { // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 - // todo - return null; + //查询小组活动签到表,计算用户在本月内签到的活动次数 + List list=groupDataService.selectCountGridCreateThreeMeets(customerId,monthId); + Map resultMap = new HashMap<>(); + for (GridIndexCommonDTO gridIndexCommonDTO : list) { + resultMap.put(gridIndexCommonDTO.getGridId(), gridIndexCommonDTO.getIndexValue()); + } + return resultMap; } - private Map getCreateThreeMeetsCountMap(String customerId, String monthId) { + private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 // todo return null; } + /** * @Description 计算网格指标治理能力 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index 6be5b22324..b1a07d9941 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -3,6 +3,7 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -75,4 +76,13 @@ public interface GroupDataService { * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO */ List selectJoinThreeMeetsCount(String customerId, String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectCountGridCreateThreeMeets(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 550c0d73e8..d0a87ed295 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; import org.springframework.beans.BeanUtils; @@ -222,5 +223,17 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.selectUserSignedCount(customerId,monthId); } + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + @Override + public List selectCountGridCreateThreeMeets(String customerId, String monthId) { + return groupDataDao.selectCountGridCreateThreeMeets(customerId,monthId); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index a5de0e01ab..d8ed5a56df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -234,4 +234,22 @@ GROUP BY m.SIGN_USER_ID + + + \ No newline at end of file From 827b66b4cc7353af00361e04e1e7a90f3b46b6d4 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 13 May 2021 10:47:02 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=88=90=E5=91=98?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=AF=E5=90=A6=E5=85=9A=E5=91=98=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactOriginGroupMemberDailyDTO.java | 146 ++++++++++++++ .../FactAgencyOriginProjectDailyDTO.java | 187 ++++++++++++++++++ .../FactAgencyOriginProjectMonthlyDTO.java | 172 ++++++++++++++++ .../FactOriginExtractController.java | 4 +- .../FactOriginGroupMemberDailyDao.java | 33 ++++ .../FactAgencyOriginProjectDailyDao.java | 33 ++++ .../FactAgencyOriginProjectMonthlyDao.java | 33 ++++ .../FactOriginGroupMemberDailyEntity.java | 116 +++++++++++ .../FactAgencyOriginProjectDailyEntity.java | 157 +++++++++++++++ .../FactAgencyOriginProjectMonthlyEntity.java | 142 +++++++++++++ .../FactOriginGroupMainDailyService.java | 3 +- .../FactOriginGroupMemberDailyService.java | 95 +++++++++ .../FactOriginGroupMainDailyServiceImpl.java | 18 +- ...FactOriginGroupMemberDailyServiceImpl.java | 101 ++++++++++ .../todata/impl/GroupExtractServiceImpl.java | 7 +- .../FactAgencyOriginProjectDailyService.java | 95 +++++++++ ...FactAgencyOriginProjectMonthlyService.java | 95 +++++++++ ...ctAgencyOriginProjectDailyServiceImpl.java | 101 ++++++++++ ...AgencyOriginProjectMonthlyServiceImpl.java | 101 ++++++++++ .../extract/FactOriginGroupMemberDailyDao.xml | 32 +++ .../stats/FactAgencyOriginProjectDailyDao.xml | 40 ++++ .../FactAgencyOriginProjectMonthlyDao.xml | 37 ++++ 22 files changed, 1740 insertions(+), 8 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java new file mode 100644 index 0000000000..42ec5cd2b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class FactOriginGroupMemberDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 组Id + */ + private String groupId; + + /** + * 小组所在的网格id + */ + private String gridId; + + /** + * 小组所在的社区id + */ + private String agencyId; + + /** + * 小组所在的街道id + */ + private String parentId; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 成员Id(userId) + */ + private String memberId; + + /** + * 客户Id + */ + private String customerId; + + /** + * leader(群主) member(成员) + */ + private String leaderFlag; + + /** + * 入群审核通过或自动加入群的日期 yyyyMMdd + */ + private String dateId; + + /** + * 入群周 2020W15 + */ + private String weekId; + + /** + * 入群月 202004 + */ + private String monthId; + + /** + * 入群季 2020Q2 + */ + private String quarterId; + + /** + * 入群年 2020 + */ + private String yearId; + + /** + * join(入群),群主建群自己入群也是join + */ + private String actionCode; + + /** + * 是否是党员 + */ + private Integer isParty; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java new file mode 100644 index 0000000000..89809107e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java @@ -0,0 +1,187 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class FactAgencyOriginProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 项目来源 来源:议题issue 组织agency + */ + private String origin; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【0.未删除 1.已删除】 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java new file mode 100644 index 0000000000..b35d5f30dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java @@ -0,0 +1,172 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class FactAgencyOriginProjectMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【0.未删除 1.已删除】 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index 9542bdc580..2cce1d4a19 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -126,7 +126,9 @@ public class FactOriginExtractController { paramNew.setDateId(dateDimId); groupExtractService.extractGroupData(paramNew); } - }else groupExtractService.extractGroupData(param); + }else { + groupExtractService.extractGroupData(param); + } return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java new file mode 100644 index 0000000000..662f2a14c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface FactOriginGroupMemberDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java new file mode 100644 index 0000000000..6428ba8104 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface FactAgencyOriginProjectDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java new file mode 100644 index 0000000000..2848f6e90b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface FactAgencyOriginProjectMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java new file mode 100644 index 0000000000..97317f5868 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_group_member_daily") +public class FactOriginGroupMemberDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 组Id + */ + private String groupId; + + /** + * 小组所在的网格id + */ + private String gridId; + + /** + * 小组所在的社区id + */ + private String agencyId; + + /** + * 小组所在的街道id + */ + private String parentId; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 成员Id(userId) + */ + private String memberId; + + /** + * 客户Id + */ + private String customerId; + + /** + * leader(群主) member(成员) + */ + private String leaderFlag; + + /** + * 入群审核通过或自动加入群的日期 yyyyMMdd + */ + private String dateId; + + /** + * 入群周 2020W15 + */ + private String weekId; + + /** + * 入群月 202004 + */ + private String monthId; + + /** + * 入群季 2020Q2 + */ + private String quarterId; + + /** + * 入群年 2020 + */ + private String yearId; + + /** + * join(入群),群主建群自己入群也是join + */ + private String actionCode; + + /** + * 是否是党员 + */ + private Integer isParty; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java new file mode 100644 index 0000000000..cb239df727 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java @@ -0,0 +1,157 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_origin_project_daily") +public class FactAgencyOriginProjectDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 项目来源 来源:议题issue 组织agency + */ + private String origin; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java new file mode 100644 index 0000000000..2acda24617 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_origin_project_monthly") +public class FactAgencyOriginProjectMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index 9b4350b1fb..21d55ac87e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -64,7 +64,8 @@ public interface FactOriginGroupMainDailyService extends BaseService originGroupData, List memberList, List missing); + boolean insertExtractedData(boolean isFirst, String customerId, String dateId, List originGroupData, + List memberList, List missing, List partyIds); /** * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java new file mode 100644 index 0000000000..618c340d66 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactOriginGroupMemberDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactOriginGroupMemberDailyDTO + * @author generator + * @date 2021-05-12 + */ + FactOriginGroupMemberDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactOriginGroupMemberDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactOriginGroupMemberDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index 718a045131..d7819f31b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -18,15 +18,21 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMemberDailyService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -45,6 +51,8 @@ import java.util.stream.Collectors; @Service public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMainDailyService { + @Autowired + private FactOriginGroupMemberDailyService factOriginGroupMemberDailyService; /** * @return java.util.List @@ -84,7 +92,7 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl originGroupData, List memberList,List missing) { + public boolean insertExtractedData(boolean isFirst, String customerId, String dateId,List originGroupData, List memberList,List missing, List partyIds) { if(!CollectionUtils.isEmpty(originGroupData)) { if (isFirst) { //isFirst @@ -96,9 +104,15 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl members = ConvertUtils.sourceToTarget(memberList, FactOriginGroupMemberDailyEntity.class); + members.forEach(item -> { + if (partyIds.contains(item.getMemberId())) { + item.setIsParty(NumConstant.ONE); + } + }); baseDao.insertBatchMain(originGroupData); - baseDao.insertBatchMembers(memberList); + factOriginGroupMemberDailyService.insertBatch(members); } if(!CollectionUtils.isEmpty(missing)){ baseDao.deleteBatchByGroupId(customerId,missing); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java new file mode 100644 index 0000000000..aea9baa4bc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; +import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMemberDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactOriginGroupMemberDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMemberDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactOriginGroupMemberDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactOriginGroupMemberDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactOriginGroupMemberDailyDTO get(String id) { + FactOriginGroupMemberDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactOriginGroupMemberDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactOriginGroupMemberDailyDTO dto) { + FactOriginGroupMemberDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginGroupMemberDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactOriginGroupMemberDailyDTO dto) { + FactOriginGroupMemberDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginGroupMemberDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index 6f6451114d..209588d464 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -89,7 +89,7 @@ public class GroupExtractServiceImpl implements GroupExtractService { List memberList = new LinkedList<>(); if (!CollectionUtils.isEmpty(originGroupData)) { List gridList = dimGridService.getGridAttributes(param.getCustomerId(),null); - + List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); if (!CollectionUtils.isEmpty(gridList)) { Map gridMap = gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2)); @@ -166,14 +166,13 @@ public class GroupExtractServiceImpl implements GroupExtractService { param.getDateId(), originGroupData, memberList, - missingGroups + missingGroups, + partyIds ); } - - List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); List heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId()); if(!partyIds.isEmpty()) { factOriginGroupMainDailyDao.updatePartyFlag(partyIds, param.getCustomerId()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java new file mode 100644 index 0000000000..6a3e24b5f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyOriginProjectDailyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactAgencyOriginProjectDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactAgencyOriginProjectDailyDTO + * @author generator + * @date 2021-05-12 + */ + FactAgencyOriginProjectDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactAgencyOriginProjectDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactAgencyOriginProjectDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java new file mode 100644 index 0000000000..5d3a4fdb19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyOriginProjectMonthlyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactAgencyOriginProjectMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactAgencyOriginProjectMonthlyDTO + * @author generator + * @date 2021-05-12 + */ + FactAgencyOriginProjectMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactAgencyOriginProjectMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactAgencyOriginProjectMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java new file mode 100644 index 0000000000..ef08dc5cbf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactAgencyOriginProjectDailyDao; +import com.epmet.dto.stats.FactAgencyOriginProjectDailyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; +import com.epmet.service.stats.FactAgencyOriginProjectDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactAgencyOriginProjectDailyServiceImpl extends BaseServiceImpl implements FactAgencyOriginProjectDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactAgencyOriginProjectDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactAgencyOriginProjectDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactAgencyOriginProjectDailyDTO get(String id) { + FactAgencyOriginProjectDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactAgencyOriginProjectDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactAgencyOriginProjectDailyDTO dto) { + FactAgencyOriginProjectDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactAgencyOriginProjectDailyDTO dto) { + FactAgencyOriginProjectDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java new file mode 100644 index 0000000000..55a965b5d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactAgencyOriginProjectMonthlyDao; +import com.epmet.dto.stats.FactAgencyOriginProjectMonthlyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; +import com.epmet.service.stats.FactAgencyOriginProjectMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactAgencyOriginProjectMonthlyServiceImpl extends BaseServiceImpl implements FactAgencyOriginProjectMonthlyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactAgencyOriginProjectMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactAgencyOriginProjectMonthlyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactAgencyOriginProjectMonthlyDTO get(String id) { + FactAgencyOriginProjectMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactAgencyOriginProjectMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactAgencyOriginProjectMonthlyDTO dto) { + FactAgencyOriginProjectMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactAgencyOriginProjectMonthlyDTO dto) { + FactAgencyOriginProjectMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml new file mode 100644 index 0000000000..1c0a1d4edb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml new file mode 100644 index 0000000000..bcc0f98ef5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml new file mode 100644 index 0000000000..8fd44cba67 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From df72dae3658534416016361b34503d824082c419 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 May 2021 11:07:23 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E5=88=86=E6=95=B0DTO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/ProjectEvaluateScoreFormDTO.java | 22 +++++++++++++++++++ .../result/ProjectEvaluateScoreResultDTO.java | 21 ++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java new file mode 100644 index 0000000000..df4c02015d --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/13 11:05 上午 + * @DESC + */ +@Data +public class ProjectEvaluateScoreFormDTO implements Serializable { + + private static final long serialVersionUID = -8126781510521211570L; + + public interface ProjectEvaluateScoreForm{} + + @NotBlank(message = "projectId不能为空",groups = ProjectEvaluateScoreForm.class) + private String projectId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java new file mode 100644 index 0000000000..6d92acd594 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/13 10:57 上午 + * @DESC + */ +public class ProjectEvaluateScoreResultDTO implements Serializable { + + private static final long serialVersionUID = 3317308221138082162L; + + /** + * 项目评价分数 + */ + private Integer score = NumConstant.ZERO; + +} From ca96a3f34874ff134c2257018150c723598dd9d0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 May 2021 11:18:48 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=9A=E5=85=9A=E5=91=98=E5=8F=82=E5=8A=A0=E2=80=9C=E4=B8=89?= =?UTF-8?q?=E4=BC=9A=E4=B8=80=E8=AF=BE=E2=80=9D=E4=BA=BA=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/PartyMemberInfoResultDTO.java | 5 +++ .../result/PartyJoinThreeMeetDTO.java | 20 +++++++++ .../dao/stats/DimCustomerPartymemberDao.java | 8 ++++ .../impl/CalGridIndexServiceImpl.java | 41 +++++++++++++++---- .../stats/DimCustomerPartymemberService.java | 8 ++++ .../DimCustomerPartymemberServiceImpl.java | 11 +++++ .../stats/DimCustomerPartymemberDao.xml | 12 ++++++ 7 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java index 24e5ec021a..d0f56ff909 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java @@ -48,4 +48,9 @@ public class PartyMemberInfoResultDTO implements Serializable { * 机关名称 */ private String agencyName; + + /** + * 党员的用户id + */ + private String userId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java new file mode 100644 index 0000000000..b59fd8a969 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格相关:党员参加“三会一课”人次 用 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/13 10:50 + */ +@Data +public class PartyJoinThreeMeetDTO implements Serializable { + private static final long serialVersionUID = 3027535602832948917L; + private String gridId; + private String userId; + private Integer joinThreeMeetsCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index 0d614b2e4a..3e69bc2837 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -100,4 +100,12 @@ public interface DimCustomerPartymemberDao extends BaseDao selectPartyMemberUserIdsByPids(@Param("customerId") String customerId, @Param("pids")String pids); + + /** + * 查询当前客户下所有注册的党员 + * + * @param customerId + * @return 返回网格id、用户id + */ + List selectPartyMemberInfoByCustomerId(@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index ef869f7941..f0c009064f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ExtractConstant; import com.epmet.constant.ProjectEvaluateConstant; @@ -8,7 +9,9 @@ import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.dto.indexcollect.result.PartyJoinThreeMeetDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -19,6 +22,7 @@ import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.group.GroupDataService; import com.epmet.service.heart.ActInfoService; import com.epmet.service.partymember.PartyMemberService; +import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; import com.epmet.service.user.UserService; @@ -78,6 +82,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private ScreenCustomerGridService gridService; @Autowired private GroupDataService groupDataService; + @Autowired + private DimCustomerPartymemberService dimCustomerPartymemberService; /** * @Description 计算网格指标党建能力 @@ -140,7 +146,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 Map createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - Map joinThreeMeetsCountMap=getJoinThreeMeetsCountMap(customerId,monthId); + List joinThreeMeetsCountList=getJoinThreeMeetsCountMap(customerId,monthId); String quarterId = DateUtils.getQuarterId(monthId); String yearId = DateUtils.getYearId(monthId); @@ -234,8 +240,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { r.setCreateThreeMeetsCount(createThreeMeetsCountMap.get(r.getGridId())); } // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - if (joinThreeMeetsCountMap.containsKey(r.getGridId())) { - r.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(r.getGridId())); + if (!CollectionUtils.isEmpty(joinThreeMeetsCountList)) { + Integer joinThreeMeetsCount = NumConstant.ZERO; + for (PartyJoinThreeMeetDTO dto : joinThreeMeetsCountList) { + if (dto.getGridId().equals(r.getGridId())) { + joinThreeMeetsCount += dto.getJoinThreeMeetsCount(); + } + } + r.setJoinThreeMeetsCount(joinThreeMeetsCount); } }); delPartyAbility(customerId, monthId); @@ -257,13 +269,28 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return resultMap; } - private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { + private List getJoinThreeMeetsCountMap(String customerId, String monthId) { + List partyJoinThreeMeetDTOList = new ArrayList<>(); // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - // todo - return null; + //1、查询出当前客户下注册的党员 + List list = dimCustomerPartymemberService.selectPartyMemberInfoByCustomerId(customerId); + if (!CollectionUtils.isEmpty(list)) { + partyJoinThreeMeetDTOList = ConvertUtils.sourceToTarget(list, PartyJoinThreeMeetDTO.class); + //2、查询出所有用户本月签到次数 + List userList = groupDataService.selectJoinThreeMeetsCount(customerId, monthId); + for (PartyJoinThreeMeetDTO partyJoinThreeMeetDTO : partyJoinThreeMeetDTOList) { + partyJoinThreeMeetDTO.setJoinThreeMeetsCount(NumConstant.ZERO); + for (CpcIndexCommonDTO cpcIndexCommonDTO : userList) { + if (partyJoinThreeMeetDTO.getUserId().equals(cpcIndexCommonDTO.getUserId())) { + partyJoinThreeMeetDTO.setJoinThreeMeetsCount(cpcIndexCommonDTO.getIndexValue()); + break; + } + } + } + } + return partyJoinThreeMeetDTOList; } - /** * @Description 计算网格指标治理能力 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index d231065d66..d93248f4f5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -131,4 +131,12 @@ public interface DimCustomerPartymemberService extends BaseService getPartyMemberUserIds(String customerId, String type,String orgId); + + /** + * 查询当前客户下所有注册的党员 + * + * @param customerId + * @return 返回网格id、用户id + */ + List selectPartyMemberInfoByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index 5aa8fb1d26..cec5da65e6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -246,4 +246,15 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl selectPartyMemberInfoByCustomerId(String customerId) { + return baseDao.selectPartyMemberInfoByCustomerId(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index 2d92d5d61b..564aca5628 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -140,4 +140,16 @@ AND dcp.CUSTOMER_ID =#{customerId} and dcp.PIDS LIKE CONCAT(#{pids},'%') + + + + \ No newline at end of file From 3b36db48a350237c17bf0118d8f784887f24456a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 13 May 2021 13:40:05 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E4=BA=94=E9=A1=B9=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgenctBasicDataFormDTO.java | 29 ++++++ .../result/AgencyBasicDataResultDTO.java | 96 +++++++++++++++++++ .../controller/DataStatsController.java | 21 +++- .../dataaggre/dao/datastats/DataStatsDao.java | 40 ++++++++ .../service/datastats/DataStatsService.java | 10 ++ .../datastats/impl/DataStatsServiceImpl.java | 94 +++++++++++++++++- .../mapper/datastats/DatsStatsDao.xml | 89 +++++++++++++++++ 7 files changed, 377 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java new file mode 100644 index 0000000000..0b79c2da2c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织各种数据汇总-接口入参 + * @Auth sun + */ +@Data +public class AgenctBasicDataFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = AgenctBasicDataFormDTO.Agency.class) + private String agencyId; + /** + * 客户Id + */ + private String customerId; + public interface Agency extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java new file mode 100644 index 0000000000..25509719c4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-组织各种数据汇总-接口返参 + * @Auth sun + */ +@Data +public class AgencyBasicDataResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + BigDecimal bi = new BigDecimal(0); + /** + * 客户Id + */ + private String customerId; + /** + * 组织Id + */ + private String agencyId; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + + + @Data + public static class Topic implements Serializable { + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + //数据更新至 时间 + private String deadline; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 2b2abc3b51..f5919caac5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -1,13 +1,21 @@ package com.epmet.dataaggre.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; import com.epmet.dataaggre.service.datastats.DataStatsService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Author sun - * @Description 数据统计服务 + * @Description 数据统计服务 */ @RestController @RequestMapping("datastats") @@ -16,5 +24,16 @@ public class DataStatsController { @Autowired private DataStatsService dataStatsService; + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + @PostMapping("agencybasicdata") + public Result agencyBasicData(@LoginUser TokenDto tokenDto, @RequestBody AgenctBasicDataFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgenctBasicDataFormDTO.Agency.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(dataStatsService.agencyBasicData(formDTO)); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 475f62cdea..7918222a52 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -17,7 +17,11 @@ package com.epmet.dataaggre.dao.datastats; +import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @Author sun @@ -26,4 +30,40 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DataStatsDao { + /** + * @Description 查询组织下注册用户最新日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新群组日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新状态话题-机关日统计数据表 + * @author sun + */ + List getAgencyTopic(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新转议题话题-机关日统计数据表 + * @author sun + */ + AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新议题日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新项目日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index fca91d972e..566d849255 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -1,9 +1,19 @@ package com.epmet.dataaggre.service.datastats; +import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; + /** * @Author sun * @Description 数据统计服务 */ public interface DataStatsService { + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index d83e73545e..688a2d6a91 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,16 +1,25 @@ package com.epmet.dataaggre.service.datastats.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; import com.epmet.dataaggre.service.datastats.DataStatsService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + /** * @Author sun - * @Description 数据统计服务 + * @Description 数据统计服务 */ @Service @DataSource(DataSourceConstant.DATA_STATISTICAL) @@ -19,4 +28,87 @@ public class DataStatsServiceImpl implements DataStatsService { @Autowired private DataStatsDao dataStatsDao; + + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + @Override + public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) { + AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); + resultDTO.setCustomerId(formDTO.getCustomerId()); + resultDTO.setAgencyId(formDTO.getAgencyId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 + AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId()); + if (null != user) { + resultDTO.setUserTotal(user.getUserTotal()); + resultDTO.setResiTotal(user.getResiTotal()); + resultDTO.setResiRatio(user.getResiTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getResiTotal() / (float) user.getUserTotal()))); + resultDTO.setPartyMemberTotal(user.getPartyMemberTotal()); + resultDTO.setPartyMemberRatio(user.getPartyMemberTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getPartyMemberTotal() / (float) user.getUserTotal()))); + } + + //2.查询组织下最新群组日统计数据 + AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId()); + if (null != user) { + resultDTO.setGroupTotal(group.getGroupTotal()); + resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); + resultDTO.setOrdinaryRatio(group.getOrdinaryTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getOrdinaryTotal() / (float) group.getGroupTotal()))); + resultDTO.setBranchTotal(group.getBranchTotal()); + resultDTO.setBranchRatio(group.getBranchTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getBranchTotal() / (float) group.getGroupTotal()))); + } + + //3.查询组织下最新话题日统计数据 + //状态话题-机关日统计数据表最新日期三种状态数据 + //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId()); + //转议题话题-机关日统计数据表 + AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId()); + AtomicReference closedTotal = new AtomicReference<>(0); + AtomicReference hiddenTotal = new AtomicReference<>(0); + if (topic.size()>NumConstant.ZERO) { + resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); + topic.forEach(t -> { + if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + }); + } + if (null != topicSHiftIssue) { + resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + } + resultDTO.setDiscussingTotal(resultDTO.getTopicTotal()-closedTotal.get()-hiddenTotal.get()-resultDTO.getShiftIssueTotal()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + + //4.查询组织下最新议题日统计数据 + AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId()); + if (null != issue) { + resultDTO.setIssueTotal(issue.getIssueTotal()); + resultDTO.setVotingTotal(issue.getVotingTotal()); + resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setClosedIssueTotal(issue.getClosedIssueTotal()); + resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setShiftProjectTotal(issue.getShiftProjectTotal()); + resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal()))); + } + + //5.查询组织下最新项目日统计数据 + AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId()); + if (null != project) { + resultDTO.setProjectTotal(project.getProjectTotal()); + resultDTO.setPendingTotal(project.getPendingTotal()); + resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal()))); + resultDTO.setClosedProjectTotal(project.getClosedProjectTotal()); + resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal()))); + } + + return resultDTO; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 8360ef814e..07f4f4b448 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -3,5 +3,94 @@ + + + + + + + + + + + \ No newline at end of file From 356451982ccaf4ca040ec28fa2b02edc188098bf Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 May 2021 15:59:50 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E6=9F=A5=E8=AF=A2=E9=A1=B9=E7=9B=AE=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/ProjectEvaluateScoreResultDTO.java | 6 +++++ ...ojectSatisfactionStatisticsController.java | 14 +++++++++++ .../dao/ProjectSatisfactionStatisticsDao.java | 11 ++++++++- .../ProjectSatisfactionStatisticsEntity.java | 13 ++++++++++ .../ProjectSatisfactionStatisticsService.java | 10 ++++++++ ...jectSatisfactionStatisticsServiceImpl.java | 24 +++++++++++++++++++ .../ProjectSatisfactionStatisticsDao.xml | 17 ++++--------- 7 files changed, 81 insertions(+), 14 deletions(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java index 6d92acd594..06bf349809 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java @@ -1,6 +1,9 @@ package com.epmet.dto.result; import com.epmet.commons.tools.constant.NumConstant; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; @@ -9,6 +12,9 @@ import java.io.Serializable; * @DateTime 2021/5/13 10:57 上午 * @DESC */ +@Data +@AllArgsConstructor +@NoArgsConstructor public class ProjectEvaluateScoreResultDTO implements Serializable { private static final long serialVersionUID = 3317308221138082162L; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java index 8857e92695..78fed6b459 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java @@ -26,6 +26,8 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.excel.ProjectSatisfactionStatisticsExcel; import com.epmet.service.ProjectSatisfactionStatisticsService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +93,16 @@ public class ProjectSatisfactionStatisticsController { ExcelUtils.exportExcelToTarget(response, null, list, ProjectSatisfactionStatisticsExcel.class); } + /** + * @Description 项目评价分数 + * @Param formDTO + * @author zxc + * @date 2021/5/13 11:18 上午 + */ + @PostMapping("projectevaluatescore") + public Result projectEvaluateScore(@RequestBody ProjectEvaluateScoreFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ProjectEvaluateScoreFormDTO.ProjectEvaluateScoreForm.class); + return new Result().ok(projectSatisfactionStatisticsService.projectEvaluateScore(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java index 1b05ef5788..60a2852e8f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 项目满意度调查统计表 @@ -29,5 +30,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ProjectSatisfactionStatisticsDao extends BaseDao { - + + /** + * @Description 根据项目ID查询此项目评价信息 + * @Param projectId + * @author zxc + * @date 2021/5/13 1:28 下午 + */ + ProjectSatisfactionStatisticsEntity selectInfoByProjectId(@Param("projectId")String projectId); + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java index 5474b38c88..d943a4a6cf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import lombok.EqualsAndHashCode; @@ -60,9 +61,21 @@ public class ProjectSatisfactionStatisticsEntity extends BaseEpmetEntity { */ private Integer badCount; + /** + * 应评价人数【等于实际表决人数】 + */ + private Integer shouldEvaluateCount; + /** * 客户ID */ @TableField(fill = FieldFill.INSERT) private String customerId; + + public ProjectSatisfactionStatisticsEntity() { + this.goodCount = NumConstant.ZERO; + this.perfectCount = NumConstant.ZERO; + this.badCount = NumConstant.ZERO; + this.shouldEvaluateCount = NumConstant.ZERO; + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java index 770a98d174..fa035d53f6 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java @@ -20,6 +20,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import java.util.List; @@ -92,4 +94,12 @@ public interface ProjectSatisfactionStatisticsService extends BaseService - - - - - - - - - - - - - + + \ No newline at end of file From 4ca51fec88d79b51d6bdd4953b24a9396ff19580 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 13 May 2021 17:27:58 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E7=BB=84=E7=BB=87=E3=80=81=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=B1=82=E7=BA=A7=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgenctBasicDataFormDTO.java | 4 - .../dto/datastats/form/SubAgencyFormDTO.java | 28 ++++++ .../dto/datastats/form/SubGridFormDTO.java | 28 ++++++ .../result/AgencyBasicDataResultDTO.java | 6 +- .../result/SubAgencyUserResultDTO.java | 33 +++++++ .../result/SubGridUserResultDTO.java | 33 +++++++ .../controller/DataStatsController.java | 33 ++++++- .../dataaggre/dao/datastats/DataStatsDao.java | 27 ++++++ .../entity/datastats/DimAgencyEntity.java | 78 +++++++++++++++ .../entity/datastats/DimCustomerEntity.java | 49 ++++++++++ .../entity/datastats/DimGridEntity.java | 59 +++++++++++ .../service/datastats/DataStatsService.java | 19 ++++ .../datastats/impl/DataStatsServiceImpl.java | 97 ++++++++++++++++++- .../mapper/datastats/DatsStatsDao.xml | 57 +++++++++++ 14 files changed, 538 insertions(+), 13 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java index 0b79c2da2c..609cf1729a 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java @@ -20,10 +20,6 @@ public class AgenctBasicDataFormDTO implements Serializable { */ @NotBlank(message = "组织ID不能为空",groups = AgenctBasicDataFormDTO.Agency.class) private String agencyId; - /** - * 客户Id - */ - private String customerId; public interface Agency extends CustomerClientShowGroup{} } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java new file mode 100644 index 0000000000..c70db44b6e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织直属下级数据汇总-接口入参 + * @Auth sun + */ +@Data +public class SubAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = SubAgencyFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + public interface Agency extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java new file mode 100644 index 0000000000..e21141e22a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织直属网格数据汇总-接口入参 + * @Auth sun + */ +@Data +public class SubGridFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = SubGridFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + public interface Agency extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java index 25509719c4..ad7869fd0b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.dto.datastats.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -12,11 +13,8 @@ import java.math.BigDecimal; @Data public class AgencyBasicDataResultDTO implements Serializable { private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore BigDecimal bi = new BigDecimal(0); - /** - * 客户Id - */ - private String customerId; /** * 组织Id */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java new file mode 100644 index 0000000000..a60c3ad76b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织用户数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyUserResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java new file mode 100644 index 0000000000..243ae23961 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表用户数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridUserResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index f5919caac5..81188aee40 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -1,11 +1,13 @@ package com.epmet.dataaggre.controller; -import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; import com.epmet.dataaggre.service.datastats.DataStatsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -13,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @Author sun * @Description 数据统计服务 @@ -30,10 +34,31 @@ public class DataStatsController { * @author sun */ @PostMapping("agencybasicdata") - public Result agencyBasicData(@LoginUser TokenDto tokenDto, @RequestBody AgenctBasicDataFormDTO formDTO) { + public Result agencyBasicData(@RequestBody AgenctBasicDataFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AgenctBasicDataFormDTO.Agency.class); - formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(dataStatsService.agencyBasicData(formDTO)); } + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + @PostMapping("subagencyuser") + public Result> subAgencyUser(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyUser(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + @PostMapping("subgriduser") + public Result> subGridUser(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridUser(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 7918222a52..cfc28bc839 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -18,6 +18,10 @@ package com.epmet.dataaggre.dao.datastats; import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; +import com.epmet.dataaggre.entity.datastats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -66,4 +70,27 @@ public interface DataStatsDao { */ AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId); + /** + * @Description 查询当前组织的直属下级组织信息 + * @author sun + */ + List getSubAgencyList(@Param("pid") String pid); + + /** + * @Description 查询当前组织的直属下级组织信息 + * @author sun + */ + List getSubAgencyUser(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询组织下网格列表 + * @author sun + */ + List getSubGridList(@Param("agencyId") String agencyId); + + /** + * @Description 查询网格层级注册用户日统计数据 + * @author sun + */ + List getSubGridUser(@Param("gridIds") List gridIds, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java new file mode 100644 index 0000000000..efec2115db --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_agency") +public class DimAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等 + */ + private String agencyDimType; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + private String level; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java new file mode 100644 index 0000000000..7037fe122a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_customer") +public class DimCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ + private String areaCode; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java new file mode 100644 index 0000000000..fcb170a9e2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_grid") +public class DimGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 566d849255..a69361e18a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -1,7 +1,13 @@ package com.epmet.dataaggre.service.datastats; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; + +import java.util.List; /** * @Author sun @@ -16,4 +22,17 @@ public interface DataStatsService { */ AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO); + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + List subAgencyUser(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + List subGridUser(SubGridFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 688a2d6a91..1587588412 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,18 +1,30 @@ package com.epmet.dataaggre.service.datastats.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.datastats.DataStatsDao; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; +import com.epmet.dataaggre.entity.datastats.DimGridEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -37,7 +49,6 @@ public class DataStatsServiceImpl implements DataStatsService { @Override public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) { AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); - resultDTO.setCustomerId(formDTO.getCustomerId()); resultDTO.setAgencyId(formDTO.getAgencyId()); NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(NumConstant.SIX); @@ -111,4 +122,88 @@ public class DataStatsServiceImpl implements DataStatsService { return resultDTO; } + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + @Override + public List subAgencyUser(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 + resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); + re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); + subAgencyList.forEach(sub->{ + if(re.getAgencyId().equals(sub.getId())){ + re.setAgencyName(sub.getAgencyName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + @Override + public List subGridUser(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级注册用户日统计数据,默认按用户总数降序 + resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); + re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); + gridList.forEach(sub->{ + if(re.getGridId().equals(sub.getId())){ + re.setGridName(sub.getGridName()); + } + }); + }); + + return resultList; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 07f4f4b448..b07c649371 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -93,4 +93,61 @@ LIMIT 1 + + + + + + + + \ No newline at end of file From 183977481f50b760c5b746fde6cd5232bd8ca15b Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 13 May 2021 18:10:08 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98=20?= =?UTF-8?q?=E6=80=95=E4=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/GeneratorApplication.java | 1 + .../index/dto/IndexExplainDTO.java | 122 ++++++++++++ .../index/dto/IndexExplainTreeDTO.java | 97 ++++++++++ .../index/form/IndexExplainFormDTO.java | 52 +++++ .../index/result/IndexExplainChildResult.java | 25 +++ .../index/result/IndexExplainResult.java | 48 +++++ .../index/result/IndexGroupDetailResult.java | 92 +++++++++ .../index/result/IndexScoreDetailResult.java | 44 +++++ .../datareport/constant/IndexConstant.java | 74 +++++++ .../index/IndexExplainController.java | 62 ++++++ .../java/com/epmet/datareport/dao/.gitignore | 0 .../index/IndexExplainDao.java | 36 ++++ .../evaluationindex/index/IndexGroupDao.java | 33 ++++ .../index/IndexGroupDetailDao.java | 45 +++++ .../IndexGroupDetailEntity.java | 90 +++++++++ .../evaluationindex/IndexGroupEntity.java | 68 +++++++ .../index/IndexExplainService.java | 42 ++++ .../index/impl/IndexExplainServiceImpl.java | 181 ++++++++++++++++++ .../mapper/{fact => index}/IndexDictDao.xml | 0 .../mapper/index/IndexExplainDao.xml | 41 ++++ .../resources/mapper/index/IndexGroupDao.xml | 23 +++ .../mapper/index/IndexGroupDetailDao.xml | 36 ++++ 22 files changed, 1212 insertions(+) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java rename epmet-module/data-report/data-report-server/src/main/resources/mapper/{fact => index}/IndexDictDao.xml (100%) create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml diff --git a/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java b/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java index 143c4bda3a..caad8b0869 100644 --- a/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java +++ b/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java @@ -8,5 +8,6 @@ public class GeneratorApplication { public static void main(String[] args) { SpringApplication.run(GeneratorApplication.class, args); + System.out.println("http://localhost:8070/epmet-cloud-generator/#generator.html"); } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java new file mode 100644 index 0000000000..9980f5500d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.evaluationindex.index.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 指标code + */ + private String indexCode; + + /** + * 含义 + */ + private String meaning; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 父ID + */ + private String pid; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否需要查询;1有;0:无; + */ + private Integer isSearch; + + /** + * 数据类型:none;本级:self;下级:sub + */ + private String type; + + /** + * 是否下钻:1 是;0否;eg:网格的下级分数 下钻到党员 + */ + private Integer goDown; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java new file mode 100644 index 0000000000..e50b466e9d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.evaluationindex.index.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainTreeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 含义 + */ + private String meaning; + + /** + * 指标code + */ + private String indexCode; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 父ID + */ + private String pid; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否需要查询;1有;0:无; + */ + private Integer isSearch; + + /** + * 数据类型:none;本级:self;下级:sub + */ + private String type; + + /** + * 是否下钻:1 是;0否;eg:网格的下级分数 下钻到党员 + */ + private Integer goDown; + + /** + * 子节点 + */ + List children; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java new file mode 100644 index 0000000000..7d17b128d1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.evaluationindex.index.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 指标说明文案查询参数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 客户id + */ + private String customerId; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 组织id + */ + private String orgId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java new file mode 100644 index 0000000000..261c8b775d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java @@ -0,0 +1,25 @@ +package com.epmet.evaluationindex.index.result; + +import com.epmet.evaluationindex.index.dto.IndexExplainDTO; +import lombok.Data; + +import java.util.List; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexExplainChildResult extends IndexExplainDTO { + + private static final long serialVersionUID = -3997821113617472317L; + + + + + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java new file mode 100644 index 0000000000..5e37adf827 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java @@ -0,0 +1,48 @@ +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexExplainResult { + + /** + * 标题 + */ + private String title; + + /** + * 含义 + */ + private String meaning; + + /** + * 子节点 list + */ + private List children = new ArrayList<>(); + + /** + * 子节点data list + */ + private List tableDataList = new ArrayList<>(); + /** + * 子节点标题 list + */ + private List tableTileList = new ArrayList<>(); + + /** + * 阈值说明列表 + */ + private List thresholdList = new ArrayList<>(); + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java new file mode 100644 index 0000000000..170aed8ec9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data + +public class IndexGroupDetailResult implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 指标名称 + */ + private String indexName; + + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值 + */ + private BigDecimal threshold; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java new file mode 100644 index 0000000000..8eb5fb8ecb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java @@ -0,0 +1,44 @@ +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexScoreDetailResult implements Serializable { + + private static final long serialVersionUID = -3997821113617472317L; + /** + * 指标code + */ + private String indexCode; + /** + * 指标名称 + */ + private String indexName; + + /** + * 原始值(如果是平均分的话 则为 参与平均的个数) + */ + private String originValue; + + /** + * 分值 + */ + private String score; + + /** + * 分值 + */ + private String weight; + + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java new file mode 100644 index 0000000000..df3239962b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java @@ -0,0 +1,74 @@ +package com.epmet.datareport.constant; + +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author sun + * @dscription 数据 + */ +public class IndexConstant { + + /** + * 评价指标类型-百分比 + */ + public static final List ScoreLastHeader = Arrays.asList("指标值", "得分", "权重"); + public static final List QuantityLastHeader = Arrays.asList("数量", "平均值", "权重"); + + private static final String DJZS_CN = "党建指数"; + private static final String FWZS_CN = "服务指数"; + private static final String ZLZS_CN = "治理指数"; + private static final String ZB_CN = "指标"; + private static final String BEN_JI = "本级"; + private static final String XIA_JI = "下级"; + + + /** + * desc: 根据indexCode 获取表格表头 + * + * @param allIndexCode + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 11:06 上午 + */ + public static List getStandardSelfHeaders(String allIndexCode) { + List result = new ArrayList<>(8); + if (StringUtils.isBlank(allIndexCode)) { + return null; + } + + if (allIndexCode.contains(FactConstant.DJNL)) { + result.add(BEN_JI + DJZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.FWNL)) { + result.add(BEN_JI + FWZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.ZLNL)) { + result.add(BEN_JI + ZLZS_CN + ZB_CN); + } + result.addAll(ScoreLastHeader); + return result; + } + + /** + * desc: 根据indexCode 获取表格表头 + * + * @param allIndexCode + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 11:06 上午 + */ + public static List getStandardSubHeaders(String allIndexCode) { + List result = new ArrayList<>(8); + if (allIndexCode.contains(FactConstant.DJNL)) { + result.add(XIA_JI + DJZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.FWNL)) { + result.add(XIA_JI + FWZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.ZLNL)) { + result.add(XIA_JI + ZLZS_CN + ZB_CN); + } + result.addAll(QuantityLastHeader); + return result; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java new file mode 100644 index 0000000000..14ab225481 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.controller.index; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@RestController +@RequestMapping("indexexplain") +public class IndexExplainController { + + @Autowired + private IndexExplainService indexExplainService; + + + /** + * desc: 获取得分说明明细 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/5/12 4:12 下午 + */ + @PostMapping("detail") + public Result> getScoreDetail(@RequestBody IndexExplainFormDTO formDTO){ + Result> ok = new Result>().ok(indexExplainService.getScoreDetail(formDTO)); + return ok; + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java new file mode 100644 index 0000000000..64fc30bac1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.index; + +import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface IndexExplainDao { + + List getIndexExplainTreeByOrgType(@Param("orgLevel") String orgLevel); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java new file mode 100644 index 0000000000..31a4dd6030 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.index; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.IndexGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface IndexGroupDao extends BaseDao { + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java new file mode 100644 index 0000000000..06cfac4493 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.index; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.IndexGroupDetailEntity; +import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface IndexGroupDetailDao extends BaseDao { + + /** + * desc: 根据客户Id获取客户所有指标数据 + * + * @param customerId + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 2:41 下午 + */ + List getAllIndexByCId(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java new file mode 100644 index 0000000000..9e73f700a7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_detail") +public class IndexGroupDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值 + */ + private BigDecimal threshold; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java new file mode 100644 index 0000000000..31716ee9ec --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group") +public class IndexGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java new file mode 100644 index 0000000000..54c12aed09 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.index; + +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; + +import java.util.List; + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface IndexExplainService { + + /** + * desc: 获取指标得分说明 + * + * @param formDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/12 4:38 下午 + */ + List getScoreDetail(IndexExplainFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java new file mode 100644 index 0000000000..b21d3f0ec4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -0,0 +1,181 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.index.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.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.constant.IndexConstant; +import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; +import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; +import com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao; +import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; +import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; +import com.epmet.evaluationindex.index.result.IndexScoreDetailResult; +import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexExplainServiceImpl implements IndexExplainService { + + @Autowired + private IndexExplainDao indexExplainDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + @Autowired + private FactIndexGridSubScoreDao gridSubScoreDao; + + + @Override + public List getScoreDetail(IndexExplainFormDTO formDTO) { + List results = new ArrayList<>(); + List explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel()); + if (CollectionUtils.isEmpty(explainDTOList)) { + return null; + } + List groupDetailEntities = indexGroupDetailDao.getAllIndexByCId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(groupDetailEntities)) { + return null; + } + Map> detailEntityMap = groupDetailEntities.stream().collect(Collectors.groupingBy(IndexGroupDetailResult::getAllParentIndexCode)); + + + for (IndexExplainTreeDTO explainDTO : explainDTOList) { + //根节点 + IndexExplainResult result = new IndexExplainResult(); + results.add(result); + result.setTitle(explainDTO.getTitle()); + result.setMeaning(explainDTO.getMeaning()); + + setTableData(formDTO, detailEntityMap, explainDTO, result); + + + setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren()); + System.out.println(JSON.toJSONString(result)); + } + + + return results; + } + + private void setTableData(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) { + Integer goDown = explainDTO.getGoDown(); + if (NumConstant.ONE == explainDTO.getIsSearch()) { + List tableHeaders = getTableHeaders(explainDTO); + result.setTableTileList(tableHeaders); + switch (explainDTO.getOrgLevel()) { + case "grid": + String type = explainDTO.getType(); + String allIndexCodePath = explainDTO.getIndexCode(); + List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); + List tableList = new ArrayList<>(); + indexGroupDetailEntities.forEach(index -> { + //设置默认值 + if (!index.getAllIndexCodePath().contains(type)) { + return; + } + IndexScoreDetailResult table = new IndexScoreDetailResult(); + table.setIndexCode(index.getIndexCode()); + table.setIndexName(index.getIndexName()); + table.setOriginValue(NumConstant.ZERO_STR); + table.setScore(NumConstant.ZERO_STR); + table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + tableList.add(table); + + + }); + result.setTableDataList(tableList); + //set Target value + if (goDown == 1) { + AblityListFormDTO ablityListFormDTO = new AblityListFormDTO(); + ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); + ablityListFormDTO.setOrgId(formDTO.getOrgId()); + ablityListFormDTO.setOrgType(formDTO.getOrgLevel()); + ablityListFormDTO.setMonthId(DateUtils.getCurrentTimeBeforeMonthId()); + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + + List scoreList = gridSubScoreDao.selectGridAblityList(ablityListFormDTO); + scoreList.forEach(score -> { + for (IndexScoreDetailResult tb : tableList) { + if (tb.getIndexCode().equals(score.getKey())) { + tb.setOriginValue(score.getValue()); + tb.setScore(String.valueOf(score.getScore())); + tb.setWeight(score.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + } + } + }); + } + break; + default: + + } + } + } + + private void setChildren(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List children) { + List childrenList = new ArrayList<>(); + children.forEach(child -> { + IndexExplainResult ch = new IndexExplainResult(); + ch.setTitle(child.getTitle()); + ch.setMeaning(child.getMeaning()); + if (CollectionUtils.isNotEmpty(child.getChildren())) { + setChildren(formDTO, detailEntityMap, ch, child, child.getChildren()); + } + setTableData(formDTO, detailEntityMap, child, ch); + childrenList.add(ch); + }); + result.setChildren(childrenList); + } + + public static void main(String[] args) { + + } + + private List getTableHeaders(IndexExplainTreeDTO explain) { + String type = explain.getType(); + List headers = new ArrayList<>(); + if ("zishen".equals(type)) { + headers = IndexConstant.getStandardSelfHeaders(explain.getIndexCode()); + + } else if ("xiaji".equals(type)) { + headers = IndexConstant.getStandardSubHeaders(explain.getIndexCode()); + } + return headers; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml rename to epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml new file mode 100644 index 0000000000..392ba21ddd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml new file mode 100644 index 0000000000..e91cf12796 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml new file mode 100644 index 0000000000..741df34cfb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + From 443a1a26a4261af7b3f401c96a9645f0509dda0c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 14 May 2021 10:01:59 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgenctBasicDataFormDTO.java | 4 ++++ .../dataaggre/dao/datastats/DataStatsDao.java | 12 ++++++------ .../datastats/impl/DataStatsServiceImpl.java | 19 +++++++++++++------ .../mapper/datastats/DatsStatsDao.xml | 18 ++++++------------ 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java index 609cf1729a..9f8c5fd1b1 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java @@ -20,6 +20,10 @@ public class AgenctBasicDataFormDTO implements Serializable { */ @NotBlank(message = "组织ID不能为空",groups = AgenctBasicDataFormDTO.Agency.class) private String agencyId; + /** + * 日维度Id + */ + private String dateId; public interface Agency extends CustomerClientShowGroup{} } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index cfc28bc839..c0ef0d6e14 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -38,37 +38,37 @@ public interface DataStatsDao { * @Description 查询组织下注册用户最新日统计数据 * @author sun */ - AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新群组日统计数据 * @author sun */ - AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新状态话题-机关日统计数据表 * @author sun */ - List getAgencyTopic(@Param("agencyId") String agencyId); + List getAgencyTopic(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新转议题话题-机关日统计数据表 * @author sun */ - AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新议题日统计数据 * @author sun */ - AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新项目日统计数据 * @author sun */ - AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询当前组织的直属下级组织信息 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 1587588412..0c4465b7fe 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -53,8 +53,15 @@ public class DataStatsServiceImpl implements DataStatsService { NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(NumConstant.SIX); + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 - AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId()); + AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId(), formDTO.getDateId()); if (null != user) { resultDTO.setUserTotal(user.getUserTotal()); resultDTO.setResiTotal(user.getResiTotal()); @@ -64,7 +71,7 @@ public class DataStatsServiceImpl implements DataStatsService { } //2.查询组织下最新群组日统计数据 - AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId()); + AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId(), formDTO.getDateId()); if (null != user) { resultDTO.setGroupTotal(group.getGroupTotal()); resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); @@ -76,9 +83,9 @@ public class DataStatsServiceImpl implements DataStatsService { //3.查询组织下最新话题日统计数据 //状态话题-机关日统计数据表最新日期三种状态数据 //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 - List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId()); + List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId()); //转议题话题-机关日统计数据表 - AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId()); + AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId()); AtomicReference closedTotal = new AtomicReference<>(0); AtomicReference hiddenTotal = new AtomicReference<>(0); if (topic.size()>NumConstant.ZERO) { @@ -98,7 +105,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); //4.查询组织下最新议题日统计数据 - AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId()); + AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId(), formDTO.getDateId()); if (null != issue) { resultDTO.setIssueTotal(issue.getIssueTotal()); resultDTO.setVotingTotal(issue.getVotingTotal()); @@ -110,7 +117,7 @@ public class DataStatsServiceImpl implements DataStatsService { } //5.查询组织下最新项目日统计数据 - AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId()); + AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId(), formDTO.getDateId()); if (null != project) { resultDTO.setProjectTotal(project.getProjectTotal()); resultDTO.setPendingTotal(project.getPendingTotal()); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index b07c649371..43ea7b7e85 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -13,8 +13,7 @@ WHERE del_flag = '0' AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 @@ -28,8 +27,7 @@ WHERE del_flag = '0' AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 @@ -43,8 +41,7 @@ del_flag = '0' AND topic_status_id in('discussing','closed','hidden') AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 3 @@ -57,8 +54,7 @@ WHERE del_flag = '0' AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 @@ -73,8 +69,7 @@ WHERE del_flag = '0' AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 @@ -88,8 +83,7 @@ WHERE del_flag = '0' AND agency_id = '8631fa4b22e88fdc259b3f51b5de2be2' - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 From 5cd2ff433fea9563f7c5146ca443b5281f9f5152 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 14 May 2021 14:48:21 +0800 Subject: [PATCH 15/17] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E6=98=8E=E7=BB=86=20=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/form/IndexScoreFormDTO.java | 40 ++++++++ .../index/result/IndexScoreDetailResult.java | 5 + .../index/result/IndexScoreResult.java | 40 ++++++++ .../dao/fact/FactIndexCpcScoreDao.java | 33 +++++++ .../dao/fact/FactIndexCpcSubScoreDao.java | 38 +++++++ .../dao/fact/FactIndexGridSubScoreDao.java | 12 +++ .../FactIndexCpcScoreEntity.java | 98 +++++++++++++++++++ .../FactIndexCpcSubScoreEntity.java | 98 +++++++++++++++++++ .../index/impl/IndexExplainServiceImpl.java | 96 ++++++++++-------- .../mapper/fact/FactIndexCpcScoreDao.xml | 28 ++++++ .../mapper/fact/FactIndexCpcSubScoreDao.xml | 43 ++++++++ .../mapper/fact/FactIndexGridSubScoreDao.xml | 32 ++++++ 12 files changed, 520 insertions(+), 43 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java new file mode 100644 index 0000000000..0ee464a9b5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.evaluationindex.index.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 指标分数 返回结果 + * @Author sun + */ +@Data +public class IndexScoreFormDTO implements Serializable { + + + private static final long serialVersionUID = 6225580299239889980L; + + private String customerId; + /** + * 组织或网格Id + */ + private String orgId; + /** + * 组织或网格类型 + */ + private String orgType; + + /** + * 月份Id(格式:202009) + */ + private String monthId; + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + private String indexCode; + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java index 8eb5fb8ecb..8b30af940f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java @@ -39,6 +39,11 @@ public class IndexScoreDetailResult implements Serializable { */ private String weight; + /** + * 数量 + */ + private String quantity; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java new file mode 100644 index 0000000000..c817b5de55 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java @@ -0,0 +1,40 @@ +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 指标分数 返回结果 + * @Author sun + */ +@Data +public class IndexScoreResult implements Serializable { + + + private static final long serialVersionUID = -8458272574625683349L; + /** + * 指标code + */ + private String indexCode; + /** + * 指标对应值(数值或百分比)原始值 + */ + private BigDecimal score; + + /** + * 指标对应的权重 + */ + private BigDecimal weight; + + /** + * 原始值 + */ + private String originValue; + /** + * 数量 + */ + private String quantity; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java new file mode 100644 index 0000000000..1bd10bd84c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.FactIndexCpcScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Mapper +public interface FactIndexCpcScoreDao extends BaseDao { + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java new file mode 100644 index 0000000000..cc59f410ba --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.FactIndexCpcSubScoreEntity; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Mapper +public interface FactIndexCpcSubScoreDao extends BaseDao { + + List selecCpcAvgScore(IndexScoreFormDTO ablityListFormDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java index 8900171322..b71adcdd4e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java @@ -17,6 +17,8 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; @@ -48,4 +50,14 @@ public interface FactIndexGridSubScoreDao { * @author sun */ LinkedList selectGridMonthAblityList(MonthAblityListFormDTO formDTO); + + /** + * desc: 查询分数 + * + * @param ablityListFormDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/14 2:07 下午 + */ + List selectGridSubScore(IndexScoreFormDTO ablityListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java new file mode 100644 index 0000000000..5a4455b069 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_cpc_score") +public class FactIndexCpcScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 1:总分;0不是 默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 参与议事分值:canyuyishi; +党务活动分值:dangwuhuodong; +联系群众分值:lianxiqunzhong; +党建能力分值:dangjiannengli + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java new file mode 100644 index 0000000000..737633648c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_cpc_sub_score") +public class FactIndexCpcSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 计算指标时的原始值 字符串类型 + */ + private String originValue; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 参与议事分值:canyuyishi; +党务活动分值:dangwuhuodong; +联系群众分值:lianxiqunzhong; +党建能力分值:dangjiannengli + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index b21d3f0ec4..ac2e998e2e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -17,7 +17,6 @@ package com.epmet.datareport.service.evaluationindex.index.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.utils.DateUtils; @@ -25,15 +24,16 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.constant.IndexConstant; import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; +import com.epmet.datareport.dao.fact.FactIndexCpcSubScoreDao; import com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.result.IndexExplainResult; import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; import com.epmet.evaluationindex.index.result.IndexScoreDetailResult; -import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; -import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -60,6 +60,8 @@ public class IndexExplainServiceImpl implements IndexExplainService { private IndexGroupDetailDao indexGroupDetailDao; @Autowired private FactIndexGridSubScoreDao gridSubScoreDao; + @Autowired + private FactIndexCpcSubScoreDao factIndexCpcSubScoreDao; @Override @@ -82,15 +84,12 @@ public class IndexExplainServiceImpl implements IndexExplainService { results.add(result); result.setTitle(explainDTO.getTitle()); result.setMeaning(explainDTO.getMeaning()); - + //设置表格数据 setTableData(formDTO, detailEntityMap, explainDTO, result); - - + //子节点 setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren()); - System.out.println(JSON.toJSONString(result)); } - return results; } @@ -102,44 +101,40 @@ public class IndexExplainServiceImpl implements IndexExplainService { switch (explainDTO.getOrgLevel()) { case "grid": String type = explainDTO.getType(); - String allIndexCodePath = explainDTO.getIndexCode(); - List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); - List tableList = new ArrayList<>(); - indexGroupDetailEntities.forEach(index -> { - //设置默认值 - if (!index.getAllIndexCodePath().contains(type)) { - return; - } - IndexScoreDetailResult table = new IndexScoreDetailResult(); - table.setIndexCode(index.getIndexCode()); - table.setIndexName(index.getIndexName()); - table.setOriginValue(NumConstant.ZERO_STR); - table.setScore(NumConstant.ZERO_STR); - table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); - tableList.add(table); - - - }); - result.setTableDataList(tableList); + String allIndexCodePath = null; + List tableList = null; + if ("zishen".equals(type)) { + allIndexCodePath = "wanggexiangguan:dangjiannengli"; + tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); + result.setTableDataList(tableList); + } else if ("xiaji".equals(type)) { + allIndexCodePath = "dangyuanxiangguan:lianxiqunzhong"; + tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); + result.setTableDataList(tableList); + } //set Target value + IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO(); + ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); + ablityListFormDTO.setOrgId(formDTO.getOrgId()); + ablityListFormDTO.setMonthId(DateUtils.getCurrentTimeBeforeMonthId()); + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + //下钻到党员 + List scoreList = null; if (goDown == 1) { - AblityListFormDTO ablityListFormDTO = new AblityListFormDTO(); - ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); - ablityListFormDTO.setOrgId(formDTO.getOrgId()); - ablityListFormDTO.setOrgType(formDTO.getOrgLevel()); - ablityListFormDTO.setMonthId(DateUtils.getCurrentTimeBeforeMonthId()); - ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); - - List scoreList = gridSubScoreDao.selectGridAblityList(ablityListFormDTO); - scoreList.forEach(score -> { - for (IndexScoreDetailResult tb : tableList) { - if (tb.getIndexCode().equals(score.getKey())) { - tb.setOriginValue(score.getValue()); - tb.setScore(String.valueOf(score.getScore())); - tb.setWeight(score.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); - } + scoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); + } else { + //不下钻 + scoreList = gridSubScoreDao.selectGridSubScore(ablityListFormDTO); + } + for (IndexScoreResult score : scoreList) { + for (IndexScoreDetailResult tb : tableList) { + if (tb.getIndexCode().equals(score.getIndexCode())) { + tb.setOriginValue(score.getOriginValue()); + tb.setScore(String.valueOf(score.getScore())); + tb.setQuantity(score.getQuantity()); + tb.setWeight(score.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); } - }); + } } break; default: @@ -148,6 +143,21 @@ public class IndexExplainServiceImpl implements IndexExplainService { } } + private List setDefaultTableData(Map> detailEntityMap, String type, String allIndexCodePath) { + List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); + List tableList = new ArrayList<>(); + indexGroupDetailEntities.forEach(index -> { + IndexScoreDetailResult table = new IndexScoreDetailResult(); + table.setIndexCode(index.getIndexCode()); + table.setIndexName(index.getIndexName()); + table.setOriginValue(NumConstant.ZERO_STR); + table.setScore(NumConstant.ZERO_STR); + table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + tableList.add(table); + }); + return tableList; + } + private void setChildren(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List children) { List childrenList = new ArrayList<>(); children.forEach(child -> { diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml new file mode 100644 index 0000000000..316e2f60e3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml new file mode 100644 index 0000000000..acf9b5a874 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index eda1991759..eb2312455a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -40,5 +40,37 @@ ORDER BY fact.month_id ASC + From b666def7083ba7e47677567951bc9e76767652fa Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 14 May 2021 15:44:54 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=8C=89=E5=A4=A9=E7=B4=AF=E8=AE=A1=E5=80=BC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/Constant.java | 3 + .../epmet/dto/group/ActCategoryDictDTO.java | 70 ++++++++ .../com/epmet/controller/DemoController.java | 9 + .../extract/FactGroupActDailyDao.java | 38 ++++ .../extract/FactGroupActMonthlyDao.java | 33 ++++ .../com/epmet/dao/group/GroupDataDao.java | 28 +++ .../epmet/dao/org/StatsCustomerAgencyDao.java | 2 + .../extract/FactGroupActDailyEntity.java | 100 +++++++++++ .../extract/FactGroupActMonthlyEntity.java | 100 +++++++++++ .../todata/FactGroupActDailyService.java | 48 +++++ .../todata/FactGroupActMonthlyService.java | 31 ++++ .../impl/FactGroupActDailyServiceImpl.java | 165 ++++++++++++++++++ .../impl/FactGroupActMonthlyServiceImpl.java | 41 +++++ .../impl/FactOriginExtractServiceImpl.java | 42 +++++ .../epmet/service/group/GroupDataService.java | 30 ++++ .../group/impl/GroupDataServiceImpl.java | 53 ++++++ .../service/org/CustomerAgencyService.java | 3 + .../org/impl/CustomerAgencyServiceImpl.java | 5 + .../extract/FactGroupActDailyDao.xml | 15 ++ .../extract/FactGroupActMonthlyDao.xml | 8 + .../resources/mapper/group/GroupDataDao.xml | 61 +++++++ .../mapper/org/StatsCustomerAgencyDao.xml | 7 + 22 files changed, 892 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 3636e2942d..9ff138efe7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -8,6 +8,7 @@ package com.epmet.commons.tools.constant; + /** * 常量 * @@ -133,4 +134,6 @@ public interface Constant { * 创建时间字段名 */ String CREATED_TIME = "created_time"; + + String DEFAULT_CUSTOMER = "default"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java new file mode 100644 index 0000000000..f75e5dc1b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.group; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 活动类别字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-16 + */ +@Data +public class ActCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 类别编码 + */ + private String categoryCode; + + /** + * 活动类别名称;eg:支部建设、联建共建 + */ + private String categoryName; + + /** + * 等级1,2...... + */ + private Integer level; + + /** + * 排序 + */ + private Integer sort; + + /** + * 上级类别编码 + */ + private String parentCode; +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index b47d3cc8ef..1037de6af4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -35,6 +35,7 @@ import com.epmet.entity.stats.DimDateEntity; import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; import com.epmet.service.evaluationindex.extract.dataToIndex.*; +import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.*; @@ -109,6 +110,8 @@ public class DemoController { private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; @Autowired private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; + @Autowired + private FactGroupActDailyService factGroupActDailyService; @GetMapping("testAlarm") public void testAlarm() { @@ -870,4 +873,10 @@ public class DemoController { return new Result().ok(ndddYhjfService.difficultyDataExtract(param)); } + @PostMapping("extractgroupact") + public Result extractGroupAct(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){ + factGroupActDailyService.extractGridGroupActDaily(customerId,dateId); + factGroupActDailyService.extractAgencyGroupActDaily(customerId,dateId); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java new file mode 100644 index 0000000000..37d3d4e144 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactGroupActDailyDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("limit") Integer limit, + @Param("orgType")String orgType); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java new file mode 100644 index 0000000000..e7b179ef70 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactGroupActMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index 80776d8798..2cbd65788c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -1,6 +1,7 @@ package com.epmet.dao.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.group.ActCategoryDictDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; @@ -8,6 +9,7 @@ import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -110,4 +112,30 @@ public interface GroupDataDao { * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO */ List selectCountGridCreateThreeMeets(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @return com.epmet.dto.group.ActCategoryDictDTO + */ + List queryCustomerActCategoryDict(String customerId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * + * @param customerId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountGridGroupActDaily(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("categoryCode") String categoryCode, + @Param("gridId")String gridId); + + List selectCountAgencyGroupActDaily(@Param("customerId") String customerId, + @Param("agencyId")String agencyId, + @Param("dateId") String dateId, + @Param("categoryCode") String categoryCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 05a85d3d7c..aa0f78f087 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -33,4 +33,6 @@ public interface StatsCustomerAgencyDao extends BaseDao { List selectCustomerAreaCodeById(@Param("customerIds") List customerIds); CustomerAgencyEntity getRootAgencyInfo(String customerId); + + List queryAgencyListByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java new file mode 100644 index 0000000000..f128f25d3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_act_daily") +public class FactGroupActDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 数据更新至日期Id:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String orgId; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * 1)orgType=grid: pid=网格所属组织id; +2)orgType=agency: pid=当前组织的上级组织 + */ + private String pid; + + /** + * 1)orgType=grid: pids=网格所有上级组织,包括pid; +2)orgType=agency: pids=当前组织的所有上级组织,包括pid. + */ + private String pids; + + /** + * 活动分类编码 + */ + private String categoryCode; + + /** + * 上级分类编码 + */ + private String parentCode; + + /** + * 分类等级 + */ + private Integer level; + + /** + * 截止到dateId: 组织次数;包含dateId这一天的数据 + */ + private Integer organizeTotal; + + /** + * 截止到dateId: 参加人数;包含dateId这一天的数据 + */ + private Integer participateUserTotal; + + /** + * 截止到dateId: 平均参加人数;包含dateId这一天的数据 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java new file mode 100644 index 0000000000..d90918a643 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_act_monthly") +public class FactGroupActMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 数据维度:yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String orgId; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * 1)orgType=grid: pid=网格所属组织id; +2)orgType=agency: pid=当前组织的上级组织 + */ + private String pid; + + /** + * 1)orgType=grid: pids=网格所有上级组织,包括pid; +2)orgType=agency: pids=当前组织的所有上级组织,包括pid. + */ + private String pids; + + /** + * 活动分类编码 + */ + private String categoryCode; + + /** + * 上级分类编码 + */ + private String parentCode; + + /** + * 分类等级 + */ + private Integer level; + + /** + * 本月内:活动组织次数 + */ + private Integer organizeIncr; + + /** + * 本月内:活动签到人数参加人数 + */ + private Integer participateUserIncr; + + /** + * 本月内:平均参加人数 + */ + private Integer avgParticipateUserIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java new file mode 100644 index 0000000000..6c8ee23cd7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactGroupActDailyService extends BaseService { + + /** + * 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + void extractGridGroupActDaily(String customerId, String dateId); + + /** + * 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + void extractAgencyGroupActDaily(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java new file mode 100644 index 0000000000..1d7391b8b4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactGroupActMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java new file mode 100644 index 0000000000..3212ad6dc0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.extract.FactGroupActDailyDao; +import com.epmet.dto.group.ActCategoryDictDTO; +import com.epmet.dto.org.GridInfoDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerGridService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Slf4j +@DataSource(DataSourceConstant.STATS) +@Service +public class FactGroupActDailyServiceImpl extends BaseServiceImpl implements FactGroupActDailyService { + + @Autowired + private GroupDataService groupDataService; + @Autowired + private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerGridService customerGridService; + + /** + * 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public void extractGridGroupActDaily(String customerId, String dateId) { + if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){ + return; + } + // 1、查询出当前客户的组织分类;如果没有直接返回 + List actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); + if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { + return; + } + + // 2、当前客户下所有的网格 + List gridInfoDTOList=customerGridService.queryGridInfoList(customerId); + // 2、遍历每个分类,查询组织次数、参与人数、平均参与人数 + List insertList = new ArrayList<>(); + for(GridInfoDTO gridInfoDTO:gridInfoDTOList){ + + for (ActCategoryDictDTO actCategoryDictDTO : actCategoryDictDTOList) { + List list = groupDataService.selectCountGridGroupActDaily(customerId, dateId, actCategoryDictDTO.getCategoryCode(),gridInfoDTO.getGridId()); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(dto->{ + dto.setCategoryCode(actCategoryDictDTO.getCategoryCode()); + dto.setParentCode(actCategoryDictDTO.getParentCode()); + dto.setLevel(actCategoryDictDTO.getLevel()); + dto.setOrgType("grid"); + dto.setDateId(dateId); + }); + insertList.addAll(list); + } + } + } + + // 3、批量删除 + int deleteNum; + do { + deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"grid"); + } while (deleteNum > NumConstant.ZERO); + + // 4、插入数据 + insertList.forEach(insertEntity -> { + baseDao.insert(insertEntity); + }); + log.info("extractGridGroupActDaily completed"); + } + + /** + * 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public void extractAgencyGroupActDaily(String customerId, String dateId) { + // 1、查询出当前客户的组织分类;如果没有直接返回 + List actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); + if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { + return; + } + // 2、当前客户下所有的组织 + List agencyEntityList=customerAgencyService.queryAgencyListByCustomerId(customerId); + List insertList = new ArrayList<>(); + for(CustomerAgencyEntity agencyEntity:agencyEntityList){ + for(ActCategoryDictDTO categoryDict:actCategoryDictDTOList){ + List list = groupDataService.selectCountAgencyGroupActDaily(customerId, + agencyEntity.getId(), + dateId, + categoryDict.getCategoryCode()); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(dto->{ + dto.setCategoryCode(categoryDict.getCategoryCode()); + dto.setParentCode(categoryDict.getParentCode()); + dto.setLevel(categoryDict.getLevel()); + dto.setOrgId(agencyEntity.getId()); + dto.setOrgType("agency"); + dto.setPid(agencyEntity.getPid()); + dto.setPids(agencyEntity.getPids()); + dto.setDateId(dateId); + }); + insertList.addAll(list); + } + } + } + + // 3、批量删除 + int deleteNum; + do { + deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"agency"); + } while (deleteNum > NumConstant.ZERO); + + // 4、插入数据 + insertList.forEach(insertEntity->{ + baseDao.insert(insertEntity); + }); + log.info("extractAgencyGroupActDaily completed"); + } + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java new file mode 100644 index 0000000000..3cb14a7e31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.extract.FactGroupActMonthlyDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactGroupActMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@DataSource(DataSourceConstant.STATS) +@Slf4j +@Service +public class FactGroupActMonthlyServiceImpl extends BaseServiceImpl implements FactGroupActMonthlyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 1cd62fd24a..9b8a74548e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -48,6 +48,9 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { private DimCustomerPartymemberService dimCustomerPartymemberService; @Autowired private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; + @Autowired + private FactGroupActDailyService factGroupActDailyService; + @Override public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) { @@ -188,6 +191,45 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } } }); + //小组活动 + threadPool.submit(() -> { + ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + //截止到当前dateId + try { + factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + try { + factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + } else { + //参数指定日期内,比如startDate=20210501,endDate=20210513;依次计算截止到20210501的数据.....截止到20210513的数据 + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + extractOriginFormDTO.setDateId(dateDimId); + factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + extractOriginFormDTO.setDateId(dateDimId); + factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + } + }); + + submitProjectRelationData(param, finalDaysBetween); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index b1a07d9941..89cc949ea6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -1,9 +1,11 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.group.ActCategoryDictDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -85,4 +87,32 @@ public interface GroupDataService { * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO */ List selectCountGridCreateThreeMeets(String customerId, String monthId); + + /** + * 查询出当前客户的组织分类;如果没有直接返回 + * + * @param customerId + */ + List queryCustomerActCategoryDict(String customerId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 网格按天 + * @param customerId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountGridGroupActDaily(String customerId, String dateId, String categoryCode,String gridId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 组织按天 + * @param customerId + * @param agencyId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountAgencyGroupActDaily(String customerId, String agencyId, String dateId, String categoryCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index d0a87ed295..a7a596ca10 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -1,10 +1,12 @@ package com.epmet.service.group.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.group.GroupDataDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.group.ActCategoryDictDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; @@ -12,8 +14,11 @@ import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,6 +30,7 @@ import java.util.stream.Collectors; * @Author zxc * @CreateTime 2020/6/16 13:23 */ +@Slf4j @Service @DataSource(DataSourceConstant.RESI_GROUP) public class GroupDataServiceImpl implements GroupDataService { @@ -235,5 +241,52 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.selectCountGridCreateThreeMeets(customerId,monthId); } + /** + * 查询出当前客户的组织分类;如果没有直接返回 + * + * @param customerId + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List queryCustomerActCategoryDict(String customerId) { + List resultList=groupDataDao.queryCustomerActCategoryDict(customerId); + if(CollectionUtils.isNotEmpty(resultList)){ + log.info("当前客户下有自己的项目分类"); + return resultList; + } + log.info("----------------------------------------------------"); + return groupDataDao.queryCustomerActCategoryDict(Constant.DEFAULT_CUSTOMER); + } + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * + * @param customerId + * @param dateId + * @param categoryCode + * @return + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List selectCountGridGroupActDaily(String customerId, String dateId, String categoryCode,String gridId) { + return groupDataDao.selectCountGridGroupActDaily(customerId,dateId,categoryCode,gridId); + } + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 组织按天 + * + * @param customerId + * @param agencyId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List selectCountAgencyGroupActDaily(String customerId, String agencyId, String dateId, String categoryCode) { + return groupDataDao.selectCountAgencyGroupActDaily(customerId,agencyId,dateId,categoryCode); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index b3aa943ada..fd611edf23 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -20,4 +20,7 @@ public interface CustomerAgencyService { List selectCustomerAreaCodeById(List customerIds); CustomerAgencyEntity getRootAgencyInfo(String customerId); + + + List queryAgencyListByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 8a8fae83b8..5c6b5175b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -50,4 +50,9 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { public CustomerAgencyEntity getRootAgencyInfo(String customerId) { return customerAgencyDao.getRootAgencyInfo(customerId); } + + @Override + public List queryAgencyListByCustomerId(String customerId) { + return customerAgencyDao.queryAgencyListByCustomerId(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml new file mode 100644 index 0000000000..91897851f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + delete from fact_group_act_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + and org_type=#{orgType} + limit #{limit} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml new file mode 100644 index 0000000000..085c49ab2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index d8ed5a56df..ebd75dc9dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -252,4 +252,65 @@ GROUP BY ga.GRID_ID + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index d5ead92c47..a7b6c09ae2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -125,4 +125,11 @@ and ca.pid='0' and ca.CUSTOMER_ID=#{customerId} + + \ No newline at end of file From 598828cad6ecc0755aadab06b678551c6dfc4a71 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 14 May 2021 17:39:19 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E5=8F=8A?= =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=80=BB=E6=95=B0=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/datastats/form/SubAgencyFormDTO.java | 12 + .../dto/datastats/form/SubGridFormDTO.java | 12 + .../result/SubAgencyGroupResultDTO.java | 33 ++ .../result/SubAgencyIssueResultDTO.java | 37 ++ .../result/SubAgencyProjectResultDTO.java | 33 ++ .../result/SubAgencyTopicResultDTO.java | 37 ++ .../result/SubGridGroupResultDTO.java | 33 ++ .../result/SubGridIssueResultDTO.java | 37 ++ .../result/SubGridProjectResultDTO.java | 33 ++ .../result/SubGridTopicResultDTO.java | 37 ++ .../controller/DataStatsController.java | 92 +++- .../dataaggre/dao/datastats/DataStatsDao.java | 69 ++- .../service/datastats/DataStatsService.java | 62 ++- .../datastats/impl/DataStatsServiceImpl.java | 438 +++++++++++++++++- .../mapper/datastats/DatsStatsDao.xml | 172 ++++++- .../impl/FactOriginExtractServiceImpl.java | 33 ++ 16 files changed, 1148 insertions(+), 22 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java index c70db44b6e..a02a39456c 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -25,4 +25,16 @@ public class SubAgencyFormDTO implements Serializable { private String dateId; public interface Agency extends CustomerClientShowGroup{} + @Data + public static class Topic implements Serializable { + //组织Id + private String agencyId; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java index e21141e22a..d7da58385e 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java @@ -25,4 +25,16 @@ public class SubGridFormDTO implements Serializable { private String dateId; public interface Agency extends CustomerClientShowGroup{} + @Data + public static class Topic implements Serializable { + //网格Id + private String gridId; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java new file mode 100644 index 0000000000..144368c26e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织群组数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyGroupResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java new file mode 100644 index 0000000000..5bece9dab4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织议题数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyIssueResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java new file mode 100644 index 0000000000..33aa889ad4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织项目数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyProjectResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java new file mode 100644 index 0000000000..bad0896389 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织话题数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyTopicResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java new file mode 100644 index 0000000000..eff29276d7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表群组数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridGroupResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java new file mode 100644 index 0000000000..e6131de173 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表议题数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridIssueResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java new file mode 100644 index 0000000000..d548cbe0a0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表项目数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridProjectResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java new file mode 100644 index 0000000000..88d4850f13 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表话题数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridTopicResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 81188aee40..951696b919 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -5,9 +5,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; -import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.service.datastats.DataStatsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -61,4 +59,92 @@ public class DataStatsController { return new Result>().ok(dataStatsService.subGridUser(formDTO)); } + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + @PostMapping("subagencygroup") + public Result> subAgencyGroup(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyGroup(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + @PostMapping("subgridgroup") + public Result> subGridGroup(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridGroup(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + */ + @PostMapping("subagencytopic") + public Result> subAgencyTopic(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyTopic(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + */ + @PostMapping("subgridtopic") + public Result> subGridTopic(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridTopic(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + @PostMapping("subagencyissue") + public Result> subAgencyIssue(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyIssue(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + @PostMapping("subgridissue") + public Result> subGridIssue(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridIssue(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + @PostMapping("subagencyproject") + public Result> subAgencyProject(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyProject(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + @PostMapping("subgridproject") + public Result> subGridProject(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridProject(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index c0ef0d6e14..c96b053cba 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -17,9 +17,9 @@ package com.epmet.dataaggre.dao.datastats; -import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; +import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; import com.epmet.dataaggre.entity.datastats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -77,7 +77,7 @@ public interface DataStatsDao { List getSubAgencyList(@Param("pid") String pid); /** - * @Description 查询当前组织的直属下级组织信息 + * @Description 查询直属下级组织注册用户日统计数据,默认按用户总数降序 * @author sun */ List getSubAgencyUser(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); @@ -93,4 +93,65 @@ public interface DataStatsDao { * @author sun */ List getSubGridUser(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织小组日统计数据,默认按群组总数降序 + * @author sun + */ + List getSubAgencyGroup(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级小组日统计数据,默认按群组总数降序 + * @author sun + */ + List getSubGridGroup(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织状态话题-日统计数据 + * @author sun + */ + List getSubAgencyTopic(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织转议题话题-日统计数据表 + * @author sun + */ + List getSubAgencyTopicShiftIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级状态话题-日统计数据 + * @author sun + */ + List getSubGridTopic(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级转议题话题-日统计数据表 + * @author sun + */ + List getSubGridTopicShiftIssue(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织议题日统计数据,默认按议题总数降序 + * @author sun + */ + List getSubAgencyIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级议题日统计数据,默认按议题总数降序 + * @author sun + */ + List getSubGridIssue(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织项目日统计数据,默认按项目总数降序 + * @author sun + */ + List getSubAgencyProject(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级项目日统计数据,默认按项目总数降序 + * @author sun + */ + List getSubGridProject(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index a69361e18a..6eb826dc8d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -3,9 +3,7 @@ package com.epmet.dataaggre.service.datastats; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; -import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.*; import java.util.List; @@ -35,4 +33,62 @@ public interface DataStatsService { * @author sun */ List subGridUser(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + List subAgencyGroup(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + List subGridGroup(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + * @return + */ + List subAgencyTopic(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + * @return + */ + List subGridTopic(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + List subAgencyIssue(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + List subGridIssue(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + List subAgencyProject(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + List subGridProject(SubGridFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 0c4465b7fe..f289a4abc9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.dataaggre.service.datastats.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; @@ -9,9 +8,7 @@ import com.epmet.dataaggre.dao.datastats.DataStatsDao; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; -import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; import com.epmet.dataaggre.entity.datastats.DimGridEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; @@ -23,9 +20,8 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.text.NumberFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -51,7 +47,7 @@ public class DataStatsServiceImpl implements DataStatsService { AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); resultDTO.setAgencyId(formDTO.getAgencyId()); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.SIX); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -72,7 +68,7 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询组织下最新群组日统计数据 AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId(), formDTO.getDateId()); - if (null != user) { + if (null != group) { resultDTO.setGroupTotal(group.getGroupTotal()); resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); resultDTO.setOrdinaryRatio(group.getOrdinaryTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getOrdinaryTotal() / (float) group.getGroupTotal()))); @@ -138,7 +134,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subAgencyUser(SubAgencyFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.SIX); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -180,7 +176,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subGridUser(SubGridFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.SIX); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -213,4 +209,424 @@ public class DataStatsServiceImpl implements DataStatsService { return resultList; } + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + @Override + public List subAgencyGroup(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织小组日统计数据,默认按群组总数降序 + resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); + re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); + subAgencyList.forEach(sub->{ + if(re.getAgencyId().equals(sub.getId())){ + re.setAgencyName(sub.getAgencyName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + @Override + public List subGridGroup(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级小组日统计数据,默认按群组总数降序 + resultList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); + re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); + gridList.forEach(sub->{ + if(re.getGridId().equals(sub.getId())){ + re.setGridName(sub.getGridName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + * @return + */ + @Override + public List subAgencyTopic(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织状态话题-日统计数据 + //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + List topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId()); + //查询直属下级组织转议题话题-日统计数据表 + List topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId()); + agencyIds.forEach(agencyId->{ + SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO(); + AtomicInteger topicTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger hiddenTotal = new AtomicInteger(0); + AtomicInteger shiftIssueTotal = new AtomicInteger(0); + AtomicReference agencyName = new AtomicReference<>(""); + topic.forEach(t->{ + if(t.getAgencyId().equals(agencyId)){ + topicTotal.addAndGet(t.getTopicCount()); + if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + } + }); + topicShiftIssue.forEach(t->{ + if(t.getAgencyId().equals(agencyId)){ + shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); + } + }); + subAgencyList.forEach(sub->{ + if(agencyId.equals(sub.getId())){ + agencyName.set(sub.getAgencyName()); + } + }); + + resultDTO.setAgencyId(agencyId); + resultDTO.setAgencyName(agencyName.get()); + resultDTO.setTopicTotal(topicTotal.get()); + resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setShiftIssueTotal(shiftIssueTotal.get()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + + resultList.add(resultDTO); + }); + + //3.默认按话题总数降序 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyTopicResultDTO o1, SubAgencyTopicResultDTO o2) { + //升序 + //return o1.getTopicTotal().compareTo(o2.getTopicTotal()); + //降序 + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + * @return + */ + @Override + public List subGridTopic(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级话题数据 + //查询网格层级状态话题-日统计数据 机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + List topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); + //查询网格层级转议题话题-日统计数据表 + List topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); + gridIds.forEach(gridId->{ + SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO(); + AtomicInteger topicTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger hiddenTotal = new AtomicInteger(0); + AtomicInteger shiftIssueTotal = new AtomicInteger(0); + AtomicReference gridName = new AtomicReference<>(""); + topic.forEach(t->{ + if(t.getGridId().equals(gridId)){ + topicTotal.addAndGet(t.getTopicCount()); + if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + } + }); + topicShiftIssue.forEach(t->{ + if(t.getGridId().equals(gridId)){ + shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); + } + }); + gridList.forEach(sub->{ + if(gridId.equals(sub.getId())){ + gridName.set(sub.getGridName()); + } + }); + + resultDTO.setGridId(gridId); + resultDTO.setGridName(gridName.get()); + resultDTO.setTopicTotal(topicTotal.get()); + resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setShiftIssueTotal(shiftIssueTotal.get()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + + resultList.add(resultDTO); + }); + + //3.默认按话题总数降序 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridTopicResultDTO o1, SubGridTopicResultDTO o2) { + //升序 + //return o1.getTopicTotal().compareTo(o2.getTopicTotal()); + //降序 + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + @Override + public List subAgencyIssue(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织议题日统计数据,默认按议题总数降序 + resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); + re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); + re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); + subAgencyList.forEach(sub->{ + if(re.getAgencyId().equals(sub.getId())){ + re.setAgencyName(sub.getAgencyName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + @Override + public List subGridIssue(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级议题日统计数据,默认按议题总数降序 + resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); + re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); + re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); + gridList.forEach(sub->{ + if(re.getGridId().equals(sub.getId())){ + re.setGridName(sub.getGridName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + @Override + public List subAgencyProject(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织项目日统计数据,默认按项目总数降序 + resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); + re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); + subAgencyList.forEach(sub->{ + if(re.getAgencyId().equals(sub.getId())){ + re.setAgencyName(sub.getAgencyName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + @Override + public List subGridProject(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级项目日统计数据,默认按项目总数降序 + resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); + re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); + gridList.forEach(sub->{ + if(re.getGridId().equals(sub.getId())){ + re.setGridName(sub.getGridName()); + } + }); + }); + + return resultList; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 43ea7b7e85..06967cceab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -65,7 +65,7 @@ closed_total AS closedIssueTotal, shift_project_total AS shiftProjectTotal FROM - fact_issue_agency_daily fiad + fact_issue_agency_daily WHERE del_flag = '0' AND agency_id = #{agencyId} @@ -144,4 +144,174 @@ reg_total DESC + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 9b8a74548e..62a4950f7b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -5,7 +5,9 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.service.StatsGroupService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerService; @@ -50,6 +52,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; @Autowired private FactGroupActDailyService factGroupActDailyService; + @Autowired + private StatsGroupService statsGroupService; @Override @@ -229,6 +233,35 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } }); + //网格、组织小组总数日统计 + threadPool.submit(() -> { + GroupTotalFormDTO formDTO = new GroupTotalFormDTO(); + formDTO.setCustomerId(param.getCustomerId()); + if (!isRange) { + formDTO.setDateId(param.getDateId()); + try { + statsGroupService.gridGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsGroupService.agencyGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } else { + try { + statsGroupService.gridGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsGroupService.agencyGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } + }); submitProjectRelationData(param, finalDaysBetween); }