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/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/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/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java index 0d89e8add8..594042091f 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 @@ -33,6 +33,11 @@ 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; @@ -106,7 +111,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); // 建群党员数 @@ -252,7 +257,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); @@ -646,4 +652,24 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { 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/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/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index 85fe22a61a..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 @@ -152,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/indexcal/FactIndexAgencySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml new file mode 100644 index 0000000000..fa016f4fbc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml new file mode 100644 index 0000000000..6987c01df5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml new file mode 100644 index 0000000000..0585208907 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file