diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index 13b27760a5..12b5c2a136 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -20,4 +20,18 @@ public interface IndexCalConstant { String USER_ID="USER_ID"; String YEAR_ID = "YEAR_ID"; + + String COMMUNITY_GOVERN = "zhilinengli"; + + String COMMUNITY_PARTY = "dangjiannengli"; + + String COMMUNITY_SERVICE = "fuwunengli"; + + String COMMUNITY_SERVICE_AVG = "shequxiajisywgfwnldfpjz"; + + String COMMUNITY_GOVERN_AVG = "shequxiashusywgzlnlhzpyz"; + + String COMMUNITY_PARTY_AVG = "xiazhusuoyouwgddjnlpjz"; + + String COMMUNITY_RELATE = "shequxiangguan"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java deleted file mode 100644 index 5f2fbf85b7..0000000000 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

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

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

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.dto.screen; - -import java.io.Serializable; -import java.math.BigDecimal; - -import lombok.Data; - -/** - * 社区相关-治理能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -public class FactIndexCommunityGovrnFiveScoreDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * - */ - private String id; - - /** - * 机关iD - */ - private String agencyId; - - /** - * 月份ID - */ - private String monthId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 总指数分值 - */ - private BigDecimal totalScore; - - /** - * 党建能力分值 - */ - private BigDecimal partyAbilityScore; - - /** - * 治理能力分值 - */ - private BigDecimal govrnAbilityScore; - - /** - * 服务能力分值 - */ - private BigDecimal serviceAbilityScore; - - /** - * 删除状态,0正常,1删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 更新人 - */ - private String updatedBy ; - - public FactIndexCommunityGovrnFiveScoreDTO() { - this.agencyId = ""; - this.monthId = ""; - this.indexId = ""; - this.totalScore = new BigDecimal(0); - this.partyAbilityScore = new BigDecimal(0); - this.govrnAbilityScore = new BigDecimal(0); - this.serviceAbilityScore = new BigDecimal(0); - this.delFlag = 0; - this.revision = 0; - this.createdBy = "APP_USER"; - this.updatedBy = "APP_USER"; - } -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java deleted file mode 100644 index 79024c60ca..0000000000 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

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

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

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.dto.screen; - -import java.io.Serializable; -import java.math.BigDecimal; - -import lombok.Data; - -/** - * 社区相关-党建能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -public class FactIndexCommunityPartyFiveScoreDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * id - */ - private String id; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 月度ID - */ - private String monthId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 总指数分值 - */ - private BigDecimal totalScore; - - /** - * 党建能力分值 - */ - private BigDecimal partyAbilityScore; - - /** - * 治理能力分值 - */ - private BigDecimal govrnAbilityScore; - - /** - * 服务能力分值 - */ - private BigDecimal serviceAbilityScore; - - /** - * 删除状态,0正常,1删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 更新人 - */ - private String updatedBy; - - public FactIndexCommunityPartyFiveScoreDTO() { - this.agencyId = ""; - this.monthId = ""; - this.indexId = ""; - this.totalScore = new BigDecimal(0); - this.partyAbilityScore = new BigDecimal(0); - this.govrnAbilityScore = new BigDecimal(0); - this.serviceAbilityScore = new BigDecimal(0); - this.delFlag = 0; - this.revision = 0; - this.createdBy = "APP_USER"; - this.updatedBy = "APP_USER"; - } - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java index 805e28ef7f..8ad2ec6658 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -27,7 +27,7 @@ import java.math.BigDecimal; * 社区相关分数表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 + * @since v1.0.0 2020-08-31 */ @Data public class FactIndexCommunityScoreDTO implements Serializable { @@ -35,49 +35,59 @@ public class FactIndexCommunityScoreDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * + * ID 主键 */ private String id; /** - * 机关ID + * 客户Id + */ + private String customerId; + + /** + * 组织id */ private String agencyId; /** - * 月份ID + * 社区上一级组织id */ - private String monthId; + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; /** - * 季度ID + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 */ private String quarterId; /** - * 年度ID + * 月维度Id: yyyyMM */ - private String yearId; + private String monthId; /** - * 指标ID + * 1:总分;0不是;默认0 */ - private String indexId; + private String isTotal; /** - * 分数 + * 分值 */ private BigDecimal score; /** - * 党建能力:party,治理能力:govrn,服务能力:service + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan */ - private String type; + private String indexCode; /** - * 删除状态,0正常,1删除 + * 删除状态 */ - private Integer delFlag; + private Integer delFlag; /** * 乐观锁 @@ -104,4 +114,19 @@ public class FactIndexCommunityScoreDTO implements Serializable { */ private Date updatedTime; + public FactIndexCommunityScoreDTO() { + this.customerId = ""; + this.agencyId = ""; + this.parentAgencyId = ""; + this.yearId = ""; + this.quarterId = ""; + this.monthId = ""; + this.isTotal = "0"; + this.score = new BigDecimal(0); + this.indexCode = ""; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java deleted file mode 100644 index 1eb6386bcc..0000000000 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

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

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

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.dto.screen; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 社区相关-服务能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -public class FactIndexCommunityServiceFiveScoreDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * - */ - private String id; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 月度ID - */ - private String monthId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 总指数分值 - */ - private BigDecimal totalScore; - - /** - * 党建能力分值 - */ - private BigDecimal partyAbilityScore; - - /** - * 治理能力分值 - */ - private BigDecimal govrnAbilityScore; - - /** - * 服务能力分值 - */ - private BigDecimal serviceAbilityScore; - - /** - * 删除状态,0正常,1删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java new file mode 100644 index 0000000000..ec3b17f615 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/31 2:12 下午 + */ +@Data +public class CommunityActivityCountResultDTO implements Serializable { + + private static final long serialVersionUID = -6623426101220283941L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 发文数 + */ + public Integer activityCount; + + public CommunityActivityCountResultDTO() { + this.agencyId = ""; + this.parentId = ""; + this.monthId = ""; + this.quarterId = ""; + this.yearId = ""; + this.activityCount = 0; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java index fe50bbf597..cf29133001 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java @@ -13,6 +13,11 @@ public class CommunityPublishArticleCountResultDTO implements Serializable { private static final long serialVersionUID = -8260746179353253237L; + /** + * 客户ID + */ + private String customerId; + /** * 机关ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java new file mode 100644 index 0000000000..aa9f471405 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/30 8:11 下午 + */ +@Data +public class MaxAndMinBigDecimalResultDTO implements Serializable { + + private static final long serialVersionUID = 76227645470470839L; + + private BigDecimal min; + + private BigDecimal max; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java new file mode 100644 index 0000000000..64f3cc7319 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/31 9:11 上午 + */ +@Data +public class SubGridGovernAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -1354963771895272899L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java index 38263c4dc1..48b4501606 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java @@ -19,6 +19,11 @@ public class SubGridPartyAvgResultDTO implements Serializable { */ private String agencyId; + /** + * 客户ID + */ + private String customerId; + /** * 上级组织ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java new file mode 100644 index 0000000000..ba6329aef1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/31 1:53 下午 + */ +@Data +public class SubGridServiceAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -405197363477213644L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} 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 5f18b920f9..2b88f53f42 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 @@ -120,7 +120,25 @@ public class DemoController { @PostMapping("zxc") public Result getZxc(){ // indexCalculateCommunityService.communityPublishArticleCountCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); - indexCalculateCommunityService.communityPublishArticleCountCalculate("","202008"); + indexCalculateCommunityService.communityGovernAbilityCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); + return new Result(); + } + + @PostMapping("zxc1") + public Result getZxc1(){ + indexCalculateCommunityService.communityPartyCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); + return new Result(); + } + + @PostMapping("zxc2") + public Result getZxc2(){ + indexCalculateCommunityService.communityServiceAbilityCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); + return new Result(); + } + + @PostMapping("zxcAll") + public Result getZxcAll(){ + indexCalculateCommunityService.communityRelate("b09527201c4409e19d1dbc5e3c3429a1","202008"); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index fa9b8569b9..f28e6a2fd3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -25,6 +25,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 治理能力-街道及社区相关数据 @@ -70,5 +71,5 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId); + List> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index 31c268cd75..261fb8b945 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -19,6 +19,8 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.OrgServiceAbilityFormDTO; +import com.epmet.dto.screen.result.CommunityActivityCountResultDTO; +import com.epmet.dto.screen.result.CommunityPublishArticleCountResultDTO; import com.epmet.entity.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -62,4 +64,13 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 社区活动组织次数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 2:15 下午 + */ + List selectActivityCount(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java deleted file mode 100644 index 52cd149927..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.FactIndexCommunityGovrnFiveScoreEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 社区相关-治理能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Mapper -public interface FactIndexCommunityGovrnFiveScoreDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java deleted file mode 100644 index 4c628a1ec0..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.screen.FactIndexCommunityPartyFiveScoreDTO; -import com.epmet.entity.screen.FactIndexCommunityPartyFiveScoreEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 社区相关-党建能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Mapper -public interface FactIndexCommunityPartyFiveScoreDao extends BaseDao { - - /** - * @Description 党建能力【社区】中间表插入 - * @param lists - * @author zxc - * @date 2020/8/27 5:05 下午 - */ - void insertCommunityPartyRecord(@Param("lists")List lists); - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java index 9ea796d24a..607132ea18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java @@ -18,16 +18,47 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.entity.screen.FactIndexCommunityScoreEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 社区相关分数表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 + * @since v1.0.0 2020-08-31 */ @Mapper public interface FactIndexCommunityScoreDao extends BaseDao { - + + /** + * @Description 党建能力【社区】中间表插入 + * @param lists + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertCommunityPartyRecord(@Param("lists") List lists); + + /** + * @Description 删除旧记录 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/1 9:03 上午 + */ + void deleteOldRecord(@Param("customerId") String customerId,@Param("monthId")String monthId,@Param("indexCode")String indexCode); + + /** + * @Description 查询社区相关信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectCommunityInfo(@Param("customerId") String customerId,@Param("monthId")String monthId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java deleted file mode 100644 index 97a03ad2c9..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.FactIndexCommunityServiceFiveScoreEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 社区相关-服务能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Mapper -public interface FactIndexCommunityServiceFiveScoreDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java index b95b41ff55..223a297db4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java @@ -18,7 +18,9 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.result.SubGridGovernAvgResultDTO; import com.epmet.dto.screen.result.SubGridPartyAvgResultDTO; +import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO; import com.epmet.entity.screen.FactIndexGridScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,4 +45,22 @@ public interface FactIndexGridScoreDao extends BaseDao */ List selectSubGridPartyAvgScore(@Param("customerId")String customerId,@Param("monthId")String monthId); + /** + * @Description 社区下属所有网格治理能力汇总平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 9:19 上午 + */ + List selectSubGridGovernAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 社区下级所有网格服务能力得分平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectSubGridServiceAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityFiveScoreEntity.java similarity index 92% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityFiveScoreEntity.java index c42849dd0b..b43e51ad7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityFiveScoreEntity.java @@ -34,8 +34,8 @@ import java.util.Date; */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("fact_index_community_party_five_score") -public class FactIndexCommunityPartyFiveScoreEntity extends BaseEpmetEntity { +@TableName("fact_index_community_five_score") +public class FactIndexCommunityFiveScoreEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java deleted file mode 100644 index bf0bcbeac0..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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.screen; - -import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 社区相关-治理能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_index_community_govrn_five_score") -public class FactIndexCommunityGovrnFiveScoreEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 机关iD - */ - private String agencyId; - - /** - * 月份ID - */ - private String monthId; - - /** - * 季度ID - */ - private String quarterId; - - /** - * 年度ID - */ - private String yearId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 分数 - */ - private BigDecimal score; - - /** - * 社区被吹哨次数:transfered,社区办结项目数:closed_project,社区项目响应度:resp_project_ratio,社区超期项目率:overdue_project_ratio,社区办结项目率:closed_project_ratio,社区办结项目满意度:satisfaction_ratio - */ - private String type; - -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java index 1c3899ef2d..01b0ff363f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java @@ -30,7 +30,7 @@ import java.util.Date; * 社区相关分数表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 + * @since v1.0.0 2020-08-31 */ @Data @EqualsAndHashCode(callSuper=false) @@ -40,38 +40,48 @@ public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; /** - * 机关ID + * 客户Id + */ + private String customerId; + + /** + * 组织id */ private String agencyId; /** - * 月份ID + * 社区上一级组织id */ - private String monthId; + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; /** - * 季度ID + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 */ private String quarterId; /** - * 年度ID + * 月维度Id: yyyyMM */ - private String yearId; + private String monthId; /** - * 指标ID + * 1:总分;0不是;默认0 */ - private String indexId; + private String isTotal; /** - * 分数 + * 分值 */ private BigDecimal score; /** - * 党建能力:party,治理能力:govrn,服务能力:service + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan */ - private String type; + private String indexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java deleted file mode 100644 index 8d0fb8857f..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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.screen; - -import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 社区相关-服务能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_index_community_service_five_score") -public class FactIndexCommunityServiceFiveScoreEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 月度ID - */ - private String monthId; - - /** - * 季度ID - */ - private String quarterId; - - /** - * 年度ID - */ - private String yearId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 分数 - */ - private BigDecimal score; - - /** - * 社区活动组织次数:activity - */ - private String type; - -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java index daf11c1519..f597e3748f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java @@ -12,13 +12,13 @@ import java.util.List; public interface IndexCalculateCommunityService { /** - * @Description 社区名义发文数量计算 + * @Description 社区党建能力 * @param customerId * @param monthId * @author zxc * @date 2020/8/26 10:46 上午 */ - void communityPublishArticleCountCalculate(String customerId, String monthId); + void communityPartyCalculate(String customerId, String monthId); /** * @Description 社区治理能力 @@ -27,6 +27,23 @@ public interface IndexCalculateCommunityService { * @author zxc * @date 2020/8/26 1:40 下午 */ - void CommunityGovernAbilityCalculate(String customerId, String monthId); + void communityGovernAbilityCalculate(String customerId, String monthId); + /** + * @Description 社区服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + void communityServiceAbilityCalculate(String customerId, String monthId); + + /** + * @Description 社区相关计算 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + void communityRelate(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index 15e0b36ff7..89554a0cf2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -1,30 +1,25 @@ package com.epmet.service.screen.impl; +import com.alibaba.druid.util.StringUtils; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; -import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dao.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dao.indexcoll.FactIndexServiceAblityOrgMonthlyDao; import com.epmet.dao.screen.*; -import com.epmet.dto.indexcal.ExtremeValueCommonDTO; -import com.epmet.dto.screen.FactIndexCommunityPartyFiveScoreDTO; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.result.*; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.IndexCodeFieldReService; import com.epmet.service.screen.IndexCalculateCommunityService; import com.epmet.service.screen.IndexGroupDetailService; -import com.epmet.support.normalizing.Correlation; -import com.epmet.support.normalizing.IntegerScoreCalculator; -import com.epmet.support.normalizing.ScoreCalculator; -import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.*; import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.IndexOutputVO; import com.epmet.support.normalizing.batch.SampleValue; -import com.github.pagehelper.Page; -import com.github.pagehelper.PageHelper; -import io.swagger.models.auth.In; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -48,19 +43,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Autowired private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired private IndexGroupDetailService indexGroupDetailService; @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityPartyFiveScoreDao factIndexCommunityPartyFiveScoreDao; + private FactIndexCommunityScoreDao factIndexCommunityScoreDao; @Autowired private FactIndexGridScoreDao factIndexGridScoreDao; - @Autowired - private FactIndexCommunityServiceFiveScoreDao factIndexCommunityServiceFiveScoreDao; - @Autowired - private FactIndexCommunityGovrnFiveScoreDao factIndexCommunityGovrnFiveScoreDao; - @Autowired - private FactIndexCommunityScoreDao factIndexCommunityScoreDao; /** * @Description 社区名义发文数量计算【党建能力】 @@ -70,32 +61,48 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni */ @Transactional(rollbackFor = Exception.class) @Override - public void communityPublishArticleCountCalculate(String customerId, String monthId) { + public void communityPartyCalculate(String customerId, String monthId) { customerId = "b09527201c4409e19d1dbc5e3c3429a1"; // 党建能力 // 根据all_parent_index_code 获取指标明细 List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - - List subAllGridList = new ArrayList<>(); - List communityPublishArticle = new ArrayList<>(); - + List subAllGridList = new ArrayList<>(); + List communityPublishArticle = new ArrayList<>(); //下属所有网格的党建能力平均值 String finalCustomerId = customerId; detailListByParentCode.forEach(indexGroup -> { - if (indexGroup.getIndexCode().equals("xiazhusuoyouwgddjnlpjz")){ + if (indexGroup.getIndexCode().equals(IndexCalConstant.COMMUNITY_PARTY_AVG)){ List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(finalCustomerId, monthId); if (subGridPartyAvgScore.size() != NumConstant.ZERO){ - subGridPartyAvgScore.forEach(subGridParty -> { - BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight()); - subGridParty.setScore(multiply); - FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); - BeanUtils.copyProperties(subGridParty,dto); - dto.setIndexId(indexGroup.getIndexId()); - dto.setTotalScore(dto.getPartyAbilityScore()); - subAllGridList.add(dto); - }); - factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + do { + collect = subGridPartyAvgScore.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,dto); + subAllGridList.add(dto); + }); + IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), index1SampleValues,indexGroup.getThreshold(), indexGroup.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + subAllGridList.forEach(grid -> { + if (grid.getAgencyId().equals(agency.getSampleId())){ + grid.setScore(agency.getSampleScore()); + } + }); + }); + indexStart++; + }while (collect.size() == NumConstant.TEN); } } }); @@ -105,13 +112,13 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (indexGroup.getIndexCode().equals("shequmingyifwsl")) { if (publishArticleCounts.size() == NumConstant.ONE) { //TODO 计算之后的分数 - FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); BeanUtils.copyProperties(detailListByParentCode.get(NumConstant.ZERO), dto); - dto.setPartyAbilityScore(BigDecimal.valueOf(50.00)); - dto.setIndexId(detailListByParentCode.get(NumConstant.ZERO).getIndexId()); + dto.setScore(BigDecimal.valueOf(50.00)); + dto.setIndexCode(detailListByParentCode.get(NumConstant.ZERO).getIndexCode()); communityPublishArticle.add(dto); - factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); - } else if (publishArticleCounts.size() != NumConstant.ZERO) { + factIndexCommunityScoreDao.insertCommunityPartyRecord(communityPublishArticle); + } else if (publishArticleCounts.size() > NumConstant.ONE) { Integer indexStart = NumConstant.ZERO; Integer indexEnd = NumConstant.TEN; List collect; @@ -123,32 +130,37 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni collect.forEach(c -> { SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount()); ll.add(s); - FactIndexCommunityPartyFiveScoreDTO publishArticle = new FactIndexCommunityPartyFiveScoreDTO(); + FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); BeanUtils.copyProperties(c,publishArticle); communityPublishArticle.add(publishArticle); }); - IndexInputVO index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll, indexGroup.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll,indexGroup.getThreshold(), indexGroup.getWeight(), sc1); List indexInputVOS = Arrays.asList(index1VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { communityPublishArticle.forEach(publish -> { if (publish.getAgencyId().equals(agency.getSampleId())){ - publish.setIndexId(indexGroup.getIndexId()); - publish.setPartyAbilityScore(agency.getSampleScore()); - publish.setTotalScore(agency.getSampleScore()); + publish.setIndexCode(indexGroup.getIndexCode()); + publish.setScore(agency.getSampleScore()); } }); }); indexStart++; - } while (collect.size() == 10); - factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); + } while (collect.size() == NumConstant.TEN); } } }); - - - + subAllGridList.forEach(grid -> { + communityPublishArticle.forEach(publish -> { + if (grid.getAgencyId().equals(publish.getAgencyId())){ + grid.setScore(grid.getScore().add(publish.getScore())); + grid.setIndexCode(IndexCalConstant.COMMUNITY_PARTY); + } + }); + }); + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_PARTY); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } /** @@ -160,21 +172,260 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni */ @Transactional(rollbackFor = Exception.class) @Override - public void CommunityGovernAbilityCalculate(String customerId, String monthId) { - List communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId); + public void communityGovernAbilityCalculate(String customerId, String monthId) { + customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + + List subAllGridList = new ArrayList<>(); + + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + + String finalCustomerId = customerId; + detailListByParentCode.forEach(detail -> { + if (detail.getIndexCode().equals(IndexCalConstant.COMMUNITY_GOVERN_AVG)){ + List subGridGovernAvg = factIndexGridScoreDao.selectSubGridGovernAvgScore(finalCustomerId, monthId); + if (subGridGovernAvg.size() == NumConstant.ONE){ + + // TODO + + }else if (subGridGovernAvg.size() > NumConstant.ONE){ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + do { + collect = subGridGovernAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,dto); + subAllGridList.add(dto); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold() ,detail.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + scoreCountOfSampleId.forEach((key,value) -> { + subAllGridList.forEach(grid -> { + if (grid.getAgencyId().equals(key)){ + grid.setScore(value); + } + }); + }); + indexStart++; + }while (collect.size() == NumConstant.TEN); + } + } + else { + + } + }); + + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(finalCustomerId, monthId); if (communityGovernAbility.size() == NumConstant.ONE){ - List result = new ArrayList<>(); - CommunityGovernAbilityCalculateResultDTO governAbility = new CommunityGovernAbilityCalculateResultDTO(); - BeanUtils.copyProperties(communityGovernAbility.get(NumConstant.ZERO),governAbility); - // TODO 计算之后的分数 + // TODO - result.add(governAbility); + }else if (communityGovernAbility.size() > NumConstant.ONE){ + List indexInputVOS = new ArrayList<>(); + detailListByParentCode.forEach(detail -> { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (!StringUtils.isEmpty(fieldNameByIndexCode)){ + if (communityGovernAbility.get(NumConstant.ZERO).containsKey(fieldNameByIndexCode)) { + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List> collect; + do { + collect = communityGovernAbility.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + } while (collect.size() == NumConstant.TEN); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + scoreCountOfSampleId.forEach((key,value) -> { + subAllGridList.forEach(grid -> { + if (key.equals(grid.getAgencyId())) { + grid.setCustomerId(finalCustomerId); + grid.setIndexCode(IndexCalConstant.COMMUNITY_GOVERN); + grid.setScore(grid.getScore().add(value)); + } + }); + }); + } + } + }); } + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_GOVERN); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } + /** + * @Description 社区服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void communityServiceAbilityCalculate(String customerId, String monthId) { + + + List subAllGridList = new ArrayList<>(); + List communityPublishArticle = new ArrayList<>(); + + + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + detailListByParentCode.forEach(detail -> { + switch (detail.getIndexCode()){ + case IndexCalConstant.COMMUNITY_SERVICE_AVG: + List subGridServiceAvg = factIndexGridScoreDao.selectSubGridServiceAvgScore(customerId, monthId); + if (subGridServiceAvg.size() == NumConstant.ONE){ + + // TODO 只有一条记录时 + + }else if (subGridServiceAvg.size() > NumConstant.ONE ){ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + do { + collect = subGridServiceAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,dto); + subAllGridList.add(dto); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues,detail.getThreshold(), detail.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + subAllGridList.forEach(grid -> { + if (grid.getAgencyId().equals(agency.getSampleId())){ + grid.setScore(agency.getSampleScore()); + } + }); + }); + indexStart++; + }while (collect.size() == NumConstant.TEN); + } + break; + case "shequhuodongzzcs": + List communityActivityCount = factIndexServiceAblityOrgMonthlyDao.selectActivityCount(customerId, monthId); + if (communityActivityCount.size() == NumConstant.ONE){ + + // TODO + + }else if (communityActivityCount.size() > NumConstant.ONE){ + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(communityActivityCount.stream().map(o -> new BigDecimal(o.getActivityCount())).collect(Collectors.toList())); + do { + collect = communityActivityCount.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List> ll = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getActivityCount()); + ll.add(s); + FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,publishArticle); + communityPublishArticle.add(publishArticle); + }); + IndexInputVO index1VO = new IndexInputVO<>(detail.getIndexId(), ll, detail.getThreshold(),detail.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + communityPublishArticle.forEach(publish -> { + if (publish.getAgencyId().equals(agency.getSampleId())){ + publish.setScore(agency.getSampleScore()); + } + }); + }); + indexStart++; + } while (collect.size() == NumConstant.TEN); + } + break; + default: + } + }); + subAllGridList.forEach(grid -> { + grid.setIndexCode(IndexCalConstant.COMMUNITY_SERVICE); + communityPublishArticle.forEach(publish -> { + if (grid.getAgencyId().equals(publish.getAgencyId())){ + grid.setScore(grid.getScore().add(publish.getScore())); + grid.setCustomerId(customerId); + } + }); + }); + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_SERVICE); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); + + } + + /** + * @Description 社区相关计算 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + @Override + public void communityRelate(String customerId, String monthId) { + + this.communityPartyCalculate(customerId, monthId); //党建能力 + this.communityGovernAbilityCalculate(customerId, monthId); // 治理能力 + this.communityServiceAbilityCalculate(customerId, monthId); // 服务能力 + + List communityPublishArticle = new ArrayList<>(); + + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfo(customerId, monthId); + detailListByParentCode.forEach(detail -> { + factIndexCommunityScoreEntities.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())){ + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + + Map> collect = factIndexCommunityScoreEntities.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key,value) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + factIndexCommunityScoreEntities.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + }); + result.add(score); + }); + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_RELATE); + factIndexCommunityScoreDao.insertCommunityPartyRecord(result); + } + /** * @Description Integer类型获取最大数和最小数 * @param list @@ -190,6 +441,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return result; } + + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list){ + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + /** * @Description Double类型获取最大数和最小数 * @param list diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 11b87f6eb8..76d61d7b83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -87,19 +87,19 @@ - SELECT - agency_id AS agencyId, - parent_id AS parentId, - month_id AS monthId, - quarter_id AS quarterId, - year_id AS yearId, - transfered_count AS transferedCount, - closed_project_count AS closedProjectCount, - resp_project_ratio AS respProjectRatio, - overdue_project_ratio AS overDueProjectRatio, - closed_project_ratio AS closedProjectRatio, - satisfaction_ratio AS satisfactionRatio + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + OVERDUE_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO FROM fact_index_govrn_ablity_org_monthly WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index ff41b99bd4..4e6bd0cd6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -79,7 +79,8 @@ month_id, quarter_id, year_id, - publish_article_count + publish_article_count, + customer_id FROM fact_index_party_ablity_org_monthly WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index c475e2aca1..d223423e17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -70,4 +70,23 @@ ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml deleted file mode 100644 index 721b8181ef..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml deleted file mode 100644 index 7110ba2c04..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - INSERT INTO fact_index_community_party_five_score ( ID, AGENCY_ID, MONTH_ID, INDEX_ID, TOTAL_SCORE, PARTY_ABILITY_SCORE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) - VALUES - - ( - REPLACE ( UUID(), '-', '' ), - #{item.agencyId}, - #{item.monthId}, - #{item.indexId}, - #{item.totalScore}, - #{item.partyAbilityScore}, - #{item.delFlag}, - #{item.revision}, - #{item.createdBy}, - NOW(), - #{item.updatedBy}, - NOW() - ) - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml index 54611e0f02..91bebf545b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml @@ -3,4 +3,60 @@ + + + INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE(UUID(),'-',''), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_community_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + AND index_code = #{indexCode} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml deleted file mode 100644 index 509f723548..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml index 7e4ad04732..b38cf57c0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml @@ -8,13 +8,55 @@ SELECT agency_id, month_id, - AVG( party_ablity_score ) AS score + quarter_id, + year_id, + AVG( score ) AS score, + customer_id FROM fact_index_grid_score WHERE del_flag = '0' AND customer_id = #{customerId} AND month_id = #{monthId} + AND index_code = 'dangjiannengli' GROUP BY agency_id + + + + + + \ No newline at end of file