diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index b672d53351..980367b007 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -193,7 +193,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result factOriginExtractAll(ExtractFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractAll", formDTO); } /** @@ -205,6 +205,6 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result indexOriginExtractAll(ExtractIndexFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "indexOriginExtractAll", formDTO); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractAll", formDTO); } } 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 c983812f2a..803b93525e 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 @@ -14,6 +14,7 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthly import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; +import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; @@ -25,7 +26,9 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.entity.stats.DimDateEntity; +import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.evaluationindex.extract.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.CalGridIndexService; import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; @@ -82,6 +85,8 @@ public class DemoController { @Autowired private DimDateDao dimDateDao; @Autowired + private DimMonthDao dimMonthDao; + @Autowired private DimCustomerDao dimCustomerDao; @Autowired private FactOriginTopicMainDailyService factOriginTopicMainDailyService; @@ -571,5 +576,43 @@ public class DemoController { ); } + @Autowired + private CalCpcIndexService calCpcIndexService; + + @PostMapping("calCpcPartyAbility") + public Result calCpcPartyAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) { + calCpcIndexService.calCpcPartyAbility(customerId,monthId); + }else{ + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + List dimMonthEntityList= dimMonthDao.selectList(wrapper); + for(DimCustomerEntity customerEntity:customerEntityList){ + for(DimMonthEntity monthEntity:dimMonthEntityList) { + calCpcIndexService.calCpcPartyAbility(customerEntity.getId(),monthEntity.getId()); + } + } + } + return new Result(); + } + + @PostMapping("calGridIndexServiceAbility") + public Result calGridIndexServiceAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) { + calGridIndexService.calGridIndexServiceAbility(customerId,monthId); + }else{ + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + List dimMonthEntityList= dimMonthDao.selectList(wrapper); +// for(DimCustomerEntity customerEntity:customerEntityList){ + for(DimMonthEntity monthEntity:dimMonthEntityList) { + calGridIndexService.calGridIndexServiceAbility("3ef7e4bb195eb9e622d68b52509aa940",monthEntity.getId()); + } +// } + } + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index c115125ba8..5ef3c02f02 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -64,6 +64,15 @@ public interface FactOriginIssueMainDailyDao extends BaseDao selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId); + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotalTwoMonthPlus(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("minusMonthId") String minusMonthId); + /** * @Description 网格总项目数 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java new file mode 100644 index 0000000000..af290b9ca6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.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.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.FactIndexAgencySelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 区/街道相关 自身和下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface FactIndexAgencySelfSubScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java new file mode 100644 index 0000000000..4be7ed8605 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.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.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 社区相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface FactIndexCommunitySelfSubScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java new file mode 100644 index 0000000000..af45b61b0e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.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.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.FactIndexGridSelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格相关自身/下级分值记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface FactIndexGridSelfSubScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 1d8b7eb7ba..927e157db0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -134,5 +134,5 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.List + * @param regUserIds + * @author yinzuomei + * @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 + * @Date 2020/9/21 13:55 + **/ + List selectGridRegUserVolunteer(@Param("list") List regUserIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java index 7927e8bee1..18b44ea8e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java @@ -36,4 +36,12 @@ public interface PartyMemberDao{ */ List selectPartyMemberByCustomer(@Param("customerId") String customerId); + /** + * @return java.util.List + * @param volunteerUserIds + * @author yinzuomei + * @description 志愿者中,同时是党员的人数 + * @Date 2020/9/21 14:13 + **/ + List selectVolunteerPartyUserIds(@Param("list") List volunteerUserIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 22372cbed4..28c0a2c389 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -111,4 +111,14 @@ public interface UserDao { List selectPartymembersByCustomerId(@Param("customerId")String customerId); List selectWarmHeartedByCustomerId(@Param("customerId")String customerId); + + /** + * @param customerId + * @param gridId + * @return java.util.List + * @author yinzuomei + * @description 查询当前网格下,首次注册的用户ids + * @Date 2020/9/21 13:46 + **/ + List selectGridRegUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java new file mode 100644 index 0000000000..19c829e4e3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.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.indexcal; + +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 2020-09-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_agency_self_sub_score") +public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id(eg:社区或者街道id) + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + + /** + * 分数类型,self:自身得分;sub:下级得分 + */ + private String scoreType; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重 + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java new file mode 100644 index 0000000000..4bc4d33dc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.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.entity.evaluationindex.indexcal; + +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 2020-09-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_community_self_sub_score") +public class FactIndexCommunitySelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 社区上一级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 分数类型,self:自身得分;sub:下级得分 + */ + private String scoreType; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重 + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java new file mode 100644 index 0000000000..b7b73ee9ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.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.indexcal; + +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 2020-09-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_grid_self_sub_score") +public class FactIndexGridSelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 分数类型,self:自身得分;sub:下级得分 + */ + private String scoreType; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重 + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginGroupMainDailyService.java new file mode 100644 index 0000000000..d534871aeb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginGroupMainDailyService.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.service.evaluationindex.extract; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; + +import java.util.List; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +public interface FactOriginGroupMainDailyService extends BaseService { + + /** + * @return java.util.List + * @param customerId + * @param userId + * @author yinzuomei + * @description 查询当前用户建了多少个组 + * @Date 2020/9/21 16:12 + **/ + List selectGroupIds(String customerId, String userId); + + /** + * @return java.util.List + * @param groupIdList + * @author yinzuomei + * @description 根据组,查询组里面的成员(去重) + * @Date 2020/9/21 16:13 + **/ + List selectGroupMemberList(List groupIdList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java index 45f9c1ff0a..c0b0201750 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java @@ -42,6 +42,15 @@ public interface IssueExtractService { */ List selectIssueTotal(String customerId, String monthId); + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId); + /** * @Description 网格总项目数 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java index 0b64d285fa..595580f363 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java @@ -1,14 +1,11 @@ package com.epmet.service.evaluationindex.extract.impl; -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.constant.IndexCalConstant; -import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; -import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.service.evaluationindex.extract.*; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -35,8 +32,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { @Autowired private DimCustomerPartymemberService dimCustomerPartymemberService; @Autowired - private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; - @Autowired private FactOriginTopicMainDailyService factOriginTopicMainDailyService; @Autowired private FactOriginTopicLogDailyService factOriginTopicLogDailyService; @@ -45,7 +40,9 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { @Autowired private FactOriginProjectMainDailyService factOriginProjectMainDailyService; @Autowired - private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao; + private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; /** * @param customerId 客户id @@ -66,7 +63,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { String quarterId= DateUtils.getQuarterId(monthId); String yearId=DateUtils.getYearId(monthId); //2、删除之前统计过的 - deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); + factIndexPartyAblityCpcMonthlyService.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); //1、党员提出话题数 @@ -132,7 +129,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //4、分批插入批量插入 List> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); partition.forEach(list -> { - this.saveFactIndexPartyAblityCpcMonthlyEntity(list); + factIndexPartyAblityCpcMonthlyService.saveFactIndexPartyAblityCpcMonthlyEntity(list); }); } @@ -150,7 +147,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map> map = new HashMap<>(); for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { //查询当前党员建了多少个组 - List groupIdList = factOriginGroupMainDailyDao.selectGroupIds(customerId, partyMember.getUserId()); + List groupIdList=factOriginGroupMainDailyService.selectGroupIds(customerId,partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { map.put(partyMember.getUserId(), new ArrayList<>()); continue; @@ -259,12 +256,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //查询当前党员建了多少个组 List groupIdList = userCreatedGroups.get(partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { + log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0"); map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } //去重组里面的成员 - List memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); + List memberIdList=factOriginGroupMainDailyService.selectGroupMemberList(groupIdList); if (CollectionUtils.isEmpty(memberIdList)) { + //memberIdList肯定不会为空,因为起码会有群主一个人 map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } else { @@ -303,11 +302,12 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //1、查询当前党员建了多少个组 List groupIdList = userCreatedGroups.get(partyMember.getUserId()); if (CollectionUtils.isEmpty(groupIdList)) { + log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0"); map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } //2、去重组里面的成员 - List memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); + List memberIdList = factOriginGroupMainDailyService.selectGroupMemberList(groupIdList); if (CollectionUtils.isEmpty(memberIdList)) { map.put(partyMember.getUserId(), NumConstant.ZERO); continue; @@ -396,7 +396,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { continue; } NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(6); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal); BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr); map.put(partyMember.getUserId(), topicToIssueRatio); @@ -404,32 +404,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { return map; } - /** - * @param customerId - * @param monthId - * @return void - * @author yinzuomei - * @description 删除这个客户这个月 党员相关-党建能力的数据 - * @Date 2020/9/18 10:20 - **/ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX) - public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) { - int deleteNum; - do { - deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); - } while (deleteNum > NumConstant.ZERO); - } - /** - * @param list - * @return void - * @author yinzuomei - * @description 批量插入党员相关党建能力表 - * @Date 2020/9/18 10:27 - **/ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX) - private void saveFactIndexPartyAblityCpcMonthlyEntity(List list) { - factIndexPartyAblityCpcMonthlyDao.insertBatchEntity(list); - } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java index ee562f54d7..46fa256caf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java @@ -9,8 +9,7 @@ import com.epmet.constant.ExtractConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.constant.ProjectEvaluateConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; -import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; -import com.epmet.dao.heart.ActInfoDao; +import com.epmet.dao.partymember.PartyMemberDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; @@ -19,8 +18,12 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMont import com.epmet.service.evaluationindex.extract.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; +import com.epmet.service.heart.ActInfoService; +import com.epmet.service.partymember.PartyMemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -29,6 +32,13 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -68,9 +78,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { @Autowired private FactIndexServiceAbilityGridMonthlyService factIndexServiceAbilityGridMonthlyService; @Autowired - private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + private FactIndexServiceAblityGridMonthlyService factIndexServiceAblityGridMonthlyService; @Autowired - private ActInfoDao actInfoDao; + private ActInfoService actInfoService; + @Autowired + private UserService userService; + @Autowired + private PartyMemberService partyMemberService; + /** * @Description 计算网格指标党建能力 * @param customerId @@ -97,7 +112,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { // 网格的发文数量 List publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId); // 网格议题转项目率 - List gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); + List gridIssueTotalList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, minusMonthId(monthId)); List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); // 建群党员数 @@ -216,7 +231,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { }); } }); - delAndInsertPartyAbility(result,customerId,monthId); + delPartyAbility(customerId, monthId); + List> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + partition.forEach(r -> { + insertPartyAbility(r); + }); return true; } @@ -239,7 +258,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { //网格总项目数 List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); //网格议题转项目率 - List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); + List gridIssueCountList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, minusMonthId(monthId)); + List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridProjectTotalList); //网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格 List projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId); Map autoMap = new HashMap<>(16); @@ -364,7 +384,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } }); }); - delAndInsertGovernAbility(result,customerId,monthId); + delGovernAbility(customerId, monthId); + List> resultList = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + resultList.forEach(r -> { + insertGovernAbility(r); + }); return true; } @@ -380,29 +404,67 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { //1、构造好初始数据,各指标赋值0 List entityList=factIndexServiceAbilityGridMonthlyService.initAllGridList(customerId); if(CollectionUtils.isEmpty(entityList)){ - log.info("screen_customer_grid do not any records"); + log.info("customerId:"+customerId+",screen_customer_grid do not any records"); return true; } String quarterId= DateUtils.getQuarterId(monthId); String yearId=DateUtils.getYearId(monthId); - //各个网格这个月举办的活动 - Map activityCountMap=calActivityCountMap(customerId,monthId); + //各个网格这个月举办的活动 :活动状态已结束并且实际结束时间在评价周期内的 + Map activityCountMap=actInfoService.calActivityCountMap(customerId,monthId); //2、遍历网格,赋值每个网格指标 for(FactIndexServiceAblityGridMonthlyEntity entity:entityList){ entity.setMonthId(monthId); entity.setQuarterId(quarterId); entity.setYearId(yearId); - //网格活动组织次数 爱心活动 + //网格活动组织次数 爱心活动 : 活动状态已结束并且实际结束时间在评价周期内的 if(activityCountMap.containsKey(entity.getGridId())){ entity.setActivityCount(activityCountMap.get(entity.getGridId())); } - //网格志愿者占比 todo -// entity.setVolunteerRatio(); - //网格党员志愿者率 todo -// entity.setPartyVolunteerRatio(); + + List volunteerUserIds=new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + //网格志愿者占比 : 所有注册用户中,注册了志愿者的用户占比 + //(1)网格内的注册用户有哪些? + List regUserIds=userService.getGridRegUserIds(customerId,entity.getGridId()); + if(CollectionUtils.isEmpty(regUserIds)){ + log.info(String.format("当前网格%s下没有注册用户,所以【网格志愿者占比】volunteerRatio赋值0",entity.getGridId())); + entity.setVolunteerRatio(BigDecimal.ZERO); + }else{ + //(2)网格内注册用户中,那些人注册了志愿者? + volunteerUserIds=actInfoService.getGridRegUserVolunteer(regUserIds); + if(CollectionUtils.isEmpty(volunteerUserIds)){ + log.info(String.format("当前网格%s下注册用户%s个,其中志愿者为0个,所以【网格志愿者占比】volunteerRatio赋值0",entity.getGridId(),regUserIds.size())); + entity.setVolunteerRatio(BigDecimal.ZERO); + }else{ + int volunteerTotal=volunteerUserIds.size(); + int regUserTotal=regUserIds.size(); + String volunteerRatioStr = numberFormat.format((float) volunteerTotal / regUserTotal); + BigDecimal volunteerRatio = new BigDecimal(volunteerRatioStr); + entity.setVolunteerRatio(volunteerRatio); + } + } + //网格党员志愿者率 : 所有志愿者中,同时是党员的占比 + if(CollectionUtils.isEmpty(volunteerUserIds)){ + log.info(String.format("当前网格%s下志愿者人数0个,所以【网格党员志愿者率】partyVolunteerRatio赋值为0",entity.getGridId())); + entity.setPartyVolunteerRatio(BigDecimal.ZERO); + }else{ + List paryUserIds=partyMemberService.getVolunteerPartyUserIds(volunteerUserIds); + if(CollectionUtils.isEmpty(paryUserIds)){ + log.info(String.format("当前网格%s下志愿者%s个,同时是党员的0个,所以【网格党员志愿者率】partyVolunteerRatio赋值为0",entity.getGridId(),volunteerUserIds.size())); + entity.setPartyVolunteerRatio(BigDecimal.ZERO); + }else{ + int volunteerCount=volunteerUserIds.size(); + int partyUserCount=paryUserIds.size(); + String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount); + BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr); + entity.setPartyVolunteerRatio(partyVolunteerRatio); + } + } + } //3、批量删 - deleteBatchIndexServiceAblityGridMonthly(customerId,monthId); + factIndexServiceAblityGridMonthlyService.deleteBatchIndexServiceAblityGridMonthly(customerId,monthId); //4、批量增 List> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); partition.forEach(list -> { @@ -411,41 +473,16 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return true; } - /** - * @return java.util.Map - * @param customerId - * @param monthId - * @author yinzuomei - * @description 网格活动组织次数 爱心活动 值得是: 活动状态已结束并且实际结束时间在评价周期内的 - * @Date 2020/9/21 10:23 - **/ - @DataSource(DataSourceConstant.EPMET_HEART) - private Map calActivityCountMap(String customerId, String monthId) { - List> mapList = actInfoDao.selectActGroupByGridId(customerId, monthId); - Map resultMap = new HashMap<>(); - for (Map map : mapList) { - for (Map.Entry m : map.entrySet()) { - resultMap.put(m.getKey(), m.getValue()); - } - } - return resultMap; - } + /*public static void main(String[] args) { + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + int volunteerCount=7; + int partyUserCount=6; + String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount); + BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr); + System.out.println(partyVolunteerRatio); + }*/ - /** - * @return void - * @param customerId - * @param monthId - * @author yinzuomei - * @description 批量删除网格相关-服务能力指标表 - * @Date 2020/9/21 10:16 - **/ - @DataSource(DataSourceConstant.EVALUATION_INDEX) - private void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId) { - int deleteNum; - do { - deleteNum = factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, monthId); - } while (deleteNum > NumConstant.ZERO); - } /** * @param list @@ -490,30 +527,78 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } /** - * @Description 删除并插入党建能力的记录 + * @Description 插入党建能力的记录 * @param result * @author zxc * @date 2020/9/19 4:06 下午 */ @Transactional(rollbackFor = Exception.class) - public void delAndInsertPartyAbility(List result,String customerId,String monthId){ + public void insertPartyAbility(List result){ if (!CollectionUtils.isEmpty(result)){ - partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId); partyAbilityOrgMonthlyService.insertPartyAbility(result); } } /** - * @Description 删除并插入治理能力的记录 + * @Description 删除党建能力的记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delPartyAbility(String customerId,String monthId){ + Integer delNum; + do { + delNum = partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId); + }while (delNum > NumConstant.ZERO); + } + + /** + * @Description 插入治理能力的记录 * @param result * @author zxc * @date 2020/9/19 4:06 下午 */ @Transactional(rollbackFor = Exception.class) - public void delAndInsertGovernAbility(List result,String customerId,String monthId){ + public void insertGovernAbility(List result){ if (!CollectionUtils.isEmpty(result)){ - governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); governAbilityOrgMonthlyService.insertGovernAbilityRecord(result); } } + + /** + * @Description 删除治理能力的记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delGovernAbility(String customerId,String monthId){ + Integer delNum; + do { + delNum = governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); + }while (delNum > NumConstant.ZERO); + } + + /** + * @Description 根据monthId【yyyyMM】获取上一个月份ID + * @param monthId + * @author zxc + * @date 2020/9/21 2:43 下午 + */ + public String minusMonthId(String monthId){ + String minusMonthId = null; + SimpleDateFormat sft = new SimpleDateFormat("yyyyMM"); + try { + Date parse = sft.parse(monthId); + LocalDate birth = parse.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate localDate = birth.minusMonths(NumConstant.ONE); + minusMonthId = localDate.toString().substring(NumConstant.ZERO, NumConstant.FOUR).concat(localDate.toString().substring(NumConstant.FIVE, NumConstant.SEVEN)); + } catch (ParseException e) { + e.printStackTrace(); + } + return minusMonthId; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java index 7bbf688492..fc18939393 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java @@ -32,6 +32,7 @@ public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexS * @Date 2020/9/21 9:38 **/ @Override + @DataSource(DataSourceConstant.EVALUATION_INDEX) public List initAllGridList(String customerId) { return baseDao.initAllGridList(customerId); } @@ -44,6 +45,7 @@ public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexS * @Date 2020/9/21 10:05 **/ @Override + @DataSource(DataSourceConstant.EVALUATION_INDEX) public void insertBatchEntity(List list) { baseDao.insertBatchEntity(list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginGroupMainDailyServiceImpl.java new file mode 100644 index 0000000000..de9d2d2a40 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginGroupMainDailyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * 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.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import com.epmet.service.evaluationindex.extract.FactOriginGroupMainDailyService; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Service +public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMainDailyService { + + + /** + * @return java.util.List + * @param customerId + * @param userId + * @author yinzuomei + * @description 查询当前用户建了多少个组 + * @Date 2020/9/21 16:13 + **/ + @Override + public List selectGroupIds(String customerId, String userId) { + List groupIdList = baseDao.selectGroupIds(customerId,userId); + return groupIdList; + } + + /** + * @param groupIdList + * @return java.util.List + * @author yinzuomei + * @description 根据组,查询组里面的成员(去重) + * @Date 2020/9/21 16:13 + **/ + @Override + public List selectGroupMemberList(List groupIdList) { + List memberIdList = baseDao.selectGroupMemberList(groupIdList); + return memberIdList; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java index 089fa9fdbd..9c664f4007 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java @@ -137,9 +137,12 @@ public class GroupExtractServiceImpl implements GroupExtractService { List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); List heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId()); - - factOriginGroupMainDailyDao.updatePartyFlag(partyIds,param.getCustomerId()); - factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds,param.getCustomerId()); + if(!partyIds.isEmpty()) { + factOriginGroupMainDailyDao.updatePartyFlag(partyIds, param.getCustomerId()); + } + if(!heartedIds.isEmpty()) { + factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds, param.getCustomerId()); + } } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index 2c6414b910..7388910ddc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -238,6 +238,18 @@ public class IssueExtractServiceImpl implements IssueExtractService { return issueMainDailyDao.selectIssueTotal(customerId, monthId); } + /** + * @Description 查询俩月的网格议题总数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + @Override + public List selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId) { + return issueMainDailyDao.selectIssueTotalTwoMonthPlus(customerId, monthId, minusMonthId); + } + /** * @Description 网格总项目数 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java index ade3c57f5b..272da9faef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java @@ -39,5 +39,5 @@ public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService + * 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.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; + +import java.util.List; + + +/** + * 党建能力-党员相关的事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +public interface FactIndexPartyAblityCpcMonthlyService extends BaseService { + /** + * @return void + * @param customerId + * @param monthId + * @author yinzuomei + * @description 删除这个客户这个月 党员相关-党建能力的数据 + * @Date 2020/9/21 16:01 + **/ + void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId); + + /** + * @return void + * @param list + * @author yinzuomei + * @description 批量插入党员相关党建能力表 + * @Date 2020/9/21 16:04 + **/ + void saveFactIndexPartyAblityCpcMonthlyEntity(List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java index 4dbf8a26a2..cc541f597f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java @@ -38,5 +38,5 @@ public interface FactIndexPartyAblityOrgMonthlyService extends BaseService + * 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.indexcoll; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; + + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +public interface FactIndexServiceAblityGridMonthlyService extends BaseService { + /** + * @return void + * @param customerId + * @param monthId + * @author yinzuomei + * @description 批量删除网格相关-服务能力指标表 + * @Date 2020/9/21 16:38 + **/ + void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java index 954af7e1f8..e2f2170f67 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java @@ -36,7 +36,7 @@ public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl + * 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.indexcoll.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.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 党建能力-党员相关的事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Service +public class FactIndexPartyAblityCpcMonthlyServiceImpl extends BaseServiceImpl implements FactIndexPartyAblityCpcMonthlyService { + /** + * @param customerId + * @param monthId + * @return void + * @author yinzuomei + * @description 删除这个客户这个月 党员相关-党建能力的数据 + * @Date 2020/9/18 10:20 + **/ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) { + int deleteNum; + do { + deleteNum = baseDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); + } while (deleteNum > NumConstant.ZERO); + } + + + /** + * @param list + * @return void + * @author yinzuomei + * @description 批量插入党员相关党建能力表 + * @Date 2020/9/18 10:27 + **/ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public void saveFactIndexPartyAblityCpcMonthlyEntity(List list) { + baseDao.insertBatchEntity(list); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java index f2caafd528..5c66bd92f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java @@ -36,7 +36,7 @@ public class FactIndexPartyAblityOrgMonthlyServiceImpl extends BaseServiceImpl + * 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.indexcoll.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.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; +import org.springframework.stereotype.Service; + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Service +public class FactIndexServiceAblityGridMonthlyServiceImpl extends BaseServiceImpl implements FactIndexServiceAblityGridMonthlyService { + + /** + * @return void + * @param customerId + * @param monthId + * @author yinzuomei + * @description 批量删除网格相关-服务能力指标表 + * @Date 2020/9/21 10:16 + **/ + @Override + @DataSource(DataSourceConstant.EVALUATION_INDEX) + public void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId) { + int deleteNum; + do { + deleteNum = baseDao.deleteFactIndexServiceAblityGridMonthly(customerId, monthId); + } while (deleteNum > NumConstant.ZERO); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java index ad5ce2728f..71e16ac3a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java @@ -27,6 +27,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.util.Date; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -127,6 +128,21 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService })); } + //办结数 + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); + Map responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month"); + list.forEach(entity ->{ + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId())); + BigDecimal element = entity.getClosedProjectRatio(); + //办结率 + entity.setClosedProjectRatio( + element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP) + ); + //响应度 + entity.setRespProjectRatio(responseMap.get(entity.getAgencyId())); + }); + + factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); factIndexGovrnAblityOrgMonthlyService.insertBatch(list); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java new file mode 100644 index 0000000000..4caa64828f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java @@ -0,0 +1,31 @@ +package com.epmet.service.heart; + +import java.util.List; +import java.util.Map; + +/** + * 活动信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/21 16:39 + */ +public interface ActInfoService { + /** + * @return java.util.List + * @param regUserIds + * @author yinzuomei + * @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 + * @Date 2020/9/21 16:41 + **/ + List getGridRegUserVolunteer(List regUserIds); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 网格活动组织次数 爱心活动 值得是: 活动状态已结束并且实际结束时间在评价周期内的 + * @Date 2020/9/21 16:43 + **/ + Map calActivityCountMap(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java new file mode 100644 index 0000000000..f56ecc918c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java @@ -0,0 +1,61 @@ +package com.epmet.service.heart.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.heart.ActInfoDao; +import com.epmet.service.heart.ActInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 活动信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/21 16:40 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EPMET_HEART) +public class ActInfoServiceImpl implements ActInfoService { + @Autowired + private ActInfoDao baseDao; + + /** + * @return java.util.List + * @param regUserIds + * @author yinzuomei + * @description 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 + * @Date 2020/9/21 13:50 + **/ + @Override + @DataSource(DataSourceConstant.EPMET_HEART) + public List getGridRegUserVolunteer(List regUserIds) { + return baseDao.selectGridRegUserVolunteer(regUserIds); + } + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 网格活动组织次数 爱心活动 值得是: 活动状态已结束并且实际结束时间在评价周期内的 + * @Date 2020/9/21 10:23 + **/ + @Override + @DataSource(DataSourceConstant.EPMET_HEART) + public Map calActivityCountMap(String customerId, String monthId) { + List> mapList = baseDao.selectActGroupByGridId(customerId, monthId); + Map resultMap = new HashMap<>(); + for (Map map : mapList) { + for (Map.Entry m : map.entrySet()) { + resultMap.put(m.getKey(), m.getValue()); + } + } + return resultMap; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java index aefae23621..df2dd2741e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java @@ -29,4 +29,12 @@ public interface PartyMemberService { */ List getPartyMemberByCustomer(String customerId); + /** + * @return java.util.List + * @param volunteerUserIds + * @author yinzuomei + * @description 志愿者中,同时是党员的人数 + * @Date 2020/9/21 16:46 + **/ + List getVolunteerPartyUserIds(List volunteerUserIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java index 90f3cff949..88fd54bcc4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java @@ -41,4 +41,16 @@ public class PartyMemberServiceImpl implements PartyMemberService { return partyMemberDao.selectPartyMemberByCustomer(customerId); } + /** + * @return java.util.List + * @param volunteerUserIds + * @author yinzuomei + * @description 志愿者中,同时是党员的人数 + * @Date 2020/9/21 14:10 + **/ + @Override + @DataSource(DataSourceConstant.PARTY_MEMBER) + public List getVolunteerPartyUserIds(List volunteerUserIds) { + return partyMemberDao.selectVolunteerPartyUserIds(volunteerUserIds); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 0203780cc8..29521f2f2c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -55,4 +55,14 @@ public interface UserService { * @date 2020.09.20 15:01 **/ List getWarmHeartedByCustomerId(String customerId); + + /** + * @return java.util.List + * @param customerId + * @param gridId + * @author yinzuomei + * @description 查询当前网格下,首次注册的用户ids + * @Date 2020/9/21 16:44 + **/ + List getGridRegUserIds(String customerId, String gridId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 5a8aa7b3f2..12616b584c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -719,4 +719,20 @@ public class UserServiceImpl implements UserService { System.out.println(format.format(calendar.getTime())); System.out.println(format2.format(calendar.getTime())); } + + + /** + * @return java.util.List + * @param customerId + * @param gridId + * @author yinzuomei + * @description 查询当前网格下,首次注册的用户ids + * @Date 2020/9/21 13:44 + **/ + @Override + @DataSource(DataSourceConstant.EPMET_USER) + public List getGridRegUserIds(String customerId, String gridId) { + return userDao.selectGridRegUserIds(customerId,gridId); + } + } 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 d07e74fae7..da7cb183e7 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 @@ -71,8 +71,7 @@ DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND - + GROUP_OWNER_ID = #{ownerId} @@ -84,8 +83,7 @@ DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND - + (GROUP_OWNER_ID = #{item.userId} AND GRID_ID = #{item.gridId}) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index de03f24dc5..a15bd53984 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -108,7 +108,6 @@ fact_origin_issue_main_daily t1 WHERE t1.DEL_FLAG = '0' --- AND t1.TOPIC_USER_IS_PARTY = '1' AND t1.CUSTOMER_ID = #{customerId} AND t1.MONTH_ID = #{monthId} AND ISNULL(T1.CREATE_TOPIC_USER_ID)=0 @@ -153,4 +152,18 @@ LIMIT 2 )t + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml index bbb25ff3ae..5ef409a772 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml @@ -77,7 +77,6 @@ t1.DEL_FLAG = '0' AND t1.CUSTOMER_ID = #{customerId} AND t1.MONTH_ID = #{monthId} --- AND t1.OPERATE_USER_IS_PARTY = '1' AND t1.ACTION_CODE = 'comment' GROUP BY t1.OPERATE_USER_ID @@ -107,20 +106,21 @@ SELECT COUNT( 1 ) AS TOTAL FROM - fact_origin_topic_main_daily T1 + fact_origin_topic_log_daily T1 WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} AND T1.MONTH_ID = #{monthId} AND T1.OPERATE_USER_ID = #{userId} + AND t1.ACTION_CODE = 'comment' + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml index b5e77a8699..1a6a74ddd4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml @@ -29,4 +29,19 @@ CUSTOMER_ID = #{customerId} AND (FIRST_REGISTER = 1 OR REGISTER = 1) + + + \ 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 b8465ad316..3075cedca7 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 @@ -76,7 +76,7 @@ 0 as JOIN_TOPIC_COUNT, 0 as SHIFT_ISSUE_COUNT, 0 as SHIFT_PROJECT_COUNT, - 0 as OIN_THREE_MEETS_COUNT, + 0 as JOIN_THREE_MEETS_COUNT, 0 as GROUP_USER_COUNT, 0 as GROUP_ACTIVE_USER_COUNT, 0 as GROUP_TOPIC_COUNT, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 22061e3e70..03f525d12d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -457,4 +457,17 @@ AND rolename.ROLE_KEY = 'warmhearted' + + +