diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 6d6632dbdf..c5bf2bab81 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; @@ -13,6 +14,7 @@ import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.exceptions.TooManyResultsException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -48,19 +50,24 @@ public class AgencyServiceImpl implements AgencyService { // 验签关闭,customerId无法获取,暂时写死 - if(StringUtils.isBlank(customerId)){ + if (StringUtils.isBlank(customerId)) { customerId = "b09527201c4409e19d1dbc5e3c3429a1"; } - TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); - if (null == rootAgency){ - return new TreeResultDTO(); + TreeResultDTO rootAgency = null; + try { + rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); + if (null == rootAgency) { + return new TreeResultDTO(); + } + } catch (TooManyResultsException e) { + throw new RenException("根组织结构数据有误"); } List centerMark = this.getCenterMark(rootAgency.getCenterMarkA()); rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); - if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)){ + if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)) { List treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue()); rootAgency.setChildren(treeResultDTOS); - }else { + } else { List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue())); rootAgency.setChildren(departmentList); } 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 index 4be7ed8605..2c4dec2bf4 100644 --- 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 @@ -18,7 +18,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySelfSubScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.CommunitySelfSubScoreEntity; import org.apache.ibatis.annotations.Mapper; /** @@ -28,6 +28,6 @@ import org.apache.ibatis.annotations.Mapper; * @since v1.0.0 2020-09-21 */ @Mapper -public interface FactIndexCommunitySelfSubScoreDao extends BaseDao { +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 index af45b61b0e..d6ee6208ab 100644 --- 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 @@ -18,7 +18,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.evaluationindex.indexcal.FactIndexGridSelfSubScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity; import org.apache.ibatis.annotations.Mapper; /** @@ -28,6 +28,6 @@ import org.apache.ibatis.annotations.Mapper; * @since v1.0.0 2020-09-21 */ @Mapper -public interface FactIndexGridSelfSubScoreDao extends BaseDao { +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/AgencySelfSubScoreEntity.java similarity index 83% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySelfSubScoreEntity.java index 19c829e4e3..7a4b3d7d93 100644 --- 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/AgencySelfSubScoreEntity.java @@ -28,12 +28,12 @@ import java.math.BigDecimal; * 区/街道相关 自身和下级分数表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-09-21 + * @since v1.0.0 2020-09-23 */ @Data @EqualsAndHashCode(callSuper = false) @TableName("fact_index_agency_self_sub_score") -public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity { +public class AgencySelfSubScoreEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -73,19 +73,19 @@ public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity { private String dataType; /** - * 分数类型,self:自身得分;sub:下级得分 + * 自身指标得分 */ - private String scoreType; + private BigDecimal selfScore; /** - * 分值 + * 下级指标得分 */ - private BigDecimal score; + private BigDecimal subScore; /** - * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; */ - private String indexCode; + private String parentIndexCode; /** * 所有指标code拼接的字符串 冒号隔开 @@ -93,8 +93,13 @@ public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity { private String allParentIndexCode; /** - * 权重 + * 自身指标权重 */ - private BigDecimal weight; + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; } 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/CommunitySelfSubScoreEntity.java similarity index 50% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CommunitySelfSubScoreEntity.java index 4bc4d33dc6..ac892b03f2 100644 --- 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/CommunitySelfSubScoreEntity.java @@ -28,68 +28,73 @@ import java.math.BigDecimal; * 社区相关 自身/下级分数表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-09-21 + * @since v1.0.0 2020-09-23 */ @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; +public class CommunitySelfSubScoreEntity 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; + + /** + * 自身指标得分 + */ + private BigDecimal selfScore; + + /** + * 下级指标得分 + */ + private BigDecimal subScore; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + private String parentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 自身指标权重 + */ + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; } 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 deleted file mode 100644 index b7b73ee9ca..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java +++ /dev/null @@ -1,100 +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.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/entity/evaluationindex/indexcal/GridSelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSelfSubScoreEntity.java new file mode 100644 index 0000000000..472d12074e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSelfSubScoreEntity.java @@ -0,0 +1,105 @@ +/** + * 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-23 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_grid_self_sub_score") +public class GridSelfSubScoreEntity 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; + + /** + * 自身指标得分 + */ + private BigDecimal selfScore; + + /** + * 下级指标得分 + */ + private BigDecimal subScore; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + private String parentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 自身指标权重 + */ + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index bf04a2b990..d4fc251cdb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -110,13 +110,20 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { indexList.forEach(index -> { String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); //获取出指标之间的关系 - List slefsubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); - if (CollectionUtils.isEmpty(slefsubIndexList)) { - log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + List selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(selfSubIndexList)) { + log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId()); return; } //获取该能力下的分数 List subScore = gridSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + if (CollectionUtils.isEmpty(subScore)) { + log.error("calculateSelfSubScore gridSubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); + return; + } + selfSubIndexList.forEach(score -> { + + }); }); } 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 index 6987c01df5..f97b98ce61 100644 --- 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 @@ -3,7 +3,7 @@ - + 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 index 0585208907..ea015c53c0 100644 --- 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 @@ -3,7 +3,7 @@ - + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml index 563457b520..d04a0356d5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml @@ -68,20 +68,24 @@ \ No newline at end of file