gridList;
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java
index 63dbb58262..fd383a61dd 100644
--- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java
@@ -14,6 +14,7 @@ import java.math.BigDecimal;
@Data
public class ExtremeValueCommonDTO implements Serializable {
+ private static final long serialVersionUID = -6295067080250068024L;
/**
* 最小值
*/
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java
new file mode 100644
index 0000000000..ee7863d40b
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java
@@ -0,0 +1,116 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 网格(党支部)信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-08-26
+ */
+@Data
+public class ScreenCustomerGridDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键ID 主键ID
+ */
+ private String id;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 组织名称
+ */
+ private String gridName;
+
+ /**
+ * 网格所属组织id
+ */
+ private String parentAgencyId;
+
+ /**
+ * 坐标区域
+ */
+ private String areaMarks;
+
+ /**
+ * 中心点位
+ */
+ private String centerMark;
+
+ /**
+ * 党支部(=网格)的位置
+ */
+ private String partyMark;
+
+ /**
+ * 删除标识 0.未删除 1.已删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
+ */
+ private String dataEndTime;
+
+ /**
+ * 所有上级ID,用英文逗号分开
+ */
+ private String allParentIds;
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java
index c9fa856582..60f5a64ef4 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java
@@ -18,6 +18,7 @@
package com.epmet.dao.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.screencoll.form.CustomerGridFormDTO;
import com.epmet.entity.screen.ScreenCustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -55,4 +56,22 @@ public interface ScreenCustomerGridDao extends BaseDao
* @Date 10:52 2020-08-18
**/
void batchInsertCustomerGrid(@Param("list") List list, @Param("customerId")String customerId);
+
+ /**
+ * @return java.lang.Integer
+ * @param customerId
+ * @author yinzuomei
+ * @description 查询客户下网格总数
+ * @Date 2020/8/26 15:33
+ **/
+ Integer selectCountByCustomerId(@Param("customerId") String customerId);
+
+ /**
+ * @return java.util.List
+ * @param customerId
+ * @author yinzuomei
+ * @description 查询客户下网格信息
+ * @Date 2020/8/26 15:33
+ **/
+ List selectListByCustomerId(@Param("customerId")String customerId);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java
index 89001f5d4f..7b7905a535 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java
@@ -1,5 +1,6 @@
package com.epmet.service.indexcal;
+import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
/**
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java
index 70a6a9222b..a192fafc6a 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java
@@ -1,7 +1,18 @@
package com.epmet.service.indexcal.impl;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
+import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao;
+import com.epmet.dao.indexcoll.FactIndexServiceAblityGridMonthlyDao;
+import com.epmet.dao.screen.ScreenCustomerGridDao;
+import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
+import com.epmet.dto.indexcal.CustomerGridInfoDTO;
import com.epmet.service.indexcal.GridCorreLationService;
+import io.swagger.annotations.Authorization;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@@ -12,6 +23,16 @@ import org.springframework.stereotype.Service;
*/
@Service
public class GridCorreLationServiceImpl implements GridCorreLationService {
+ private Logger logger = LogManager.getLogger(GridCorreLationServiceImpl.class);
+ @Autowired
+ private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao;
+ @Autowired
+ private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao;
+ @Autowired
+ private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao;
+ @Autowired
+ private ScreenCustomerGridDao screenCustomerGridDao;
+
/**
* @param formDTO
@@ -22,6 +43,22 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
**/
@Override
public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) {
- return null;
+ return true;
+ }
+
+
+
+ /**
+ * @return com.epmet.dto.indexcal.CustomerGridInfoDTO
+ * @param customerId
+ * @author yinzuomei
+ * @description 查询客户下网格信息
+ * @Date 2020/8/26 15:37
+ **/
+ public CustomerGridInfoDTO queryCustomerGridInfo(String customerId){
+ CustomerGridInfoDTO customerGridInfoDTO=new CustomerGridInfoDTO();
+ customerGridInfoDTO.setTotal(screenCustomerGridDao.selectCountByCustomerId(customerId));
+ customerGridInfoDTO.setGridList(screenCustomerGridDao.selectListByCustomerId(customerId));
+ return customerGridInfoDTO;
}
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
index 5381e9ddd2..80450ccb6f 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
@@ -52,4 +52,27 @@
+
+
+ SELECT
+ count( GRID_ID ) AS total
+ FROM
+ screen_customer_grid m
+ WHERE
+ m.DEL_FLAG = '0'
+ AND m.CUSTOMER_ID =#{customerId}
+
+
+
+
+ SELECT
+ m.GRID_ID,
+ m.CUSTOMER_ID,
+ m.GRID_NAME
+ FROM
+ screen_customer_grid m
+ WHERE
+ m.DEL_FLAG = '0'
+ AND m.CUSTOMER_ID = #{customerId}
+
From 3538826d9d63ee27cd540d785588976d7bce8d42 Mon Sep 17 00:00:00 2001
From: jianjun
Date: Wed, 26 Aug 2020 16:13:01 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A6=81=E8=AE=A1?=
=?UTF-8?q?=E7=AE=97=E7=9A=84=E6=8C=87=E6=A0=87=E6=98=8E=E7=BB=86=E6=9D=83?=
=?UTF-8?q?=E9=87=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../epmet/dto/screen/IndexGroupDetailDTO.java | 60 +++++++++++++++++++
.../screen/result/IndexGroupDetailResult.java | 28 +++++++++
.../com/epmet/dao/screen/IndexGroupDao.java | 4 ++
.../epmet/dao/screen/IndexGroupDetailDao.java | 6 +-
.../entity/screen/IndexGroupDetailEntity.java | 10 ++++
.../IndexGroupDetailTemplateEntity.java | 5 ++
.../epmet/model/IndexExcelDataListener.java | 23 ++++---
.../screen/IndexGroupDetailService.java | 9 ++-
.../impl/IndexCalculateServiceImpl.java | 6 ++
.../impl/IndexGroupDetailServiceImpl.java | 16 +++++
.../mapper/screen/IndexGroupDetailDao.xml | 5 ++
.../screen/IndexGroupDetailTemplateDao.xml | 2 +-
12 files changed, 162 insertions(+), 12 deletions(-)
create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java
create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java
new file mode 100644
index 0000000000..efe372f027
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java
@@ -0,0 +1,60 @@
+/**
+ * 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 lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 客户指标详情
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-08-19
+ */
+@Data
+public class IndexGroupDetailDTO {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * index_group.id
+ */
+ private String indexGroupId;
+
+ /**
+ * 指标id
+ */
+ private String indexId;
+
+ /**
+ * 权重(同一组权重总和=1)
+ */
+ private BigDecimal weight;
+
+ /**
+ * 是否启用:启用:enable 禁用:disabled
+ */
+ private String status;
+
+ /**
+ * 阈值 如果是百分比 则为除以100以后的值
+ */
+ private BigDecimal threshold;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java
new file mode 100644
index 0000000000..0d6cea89c8
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java
@@ -0,0 +1,28 @@
+package com.epmet.dto.screen.result;
+
+import com.epmet.dto.screen.IndexGroupDetailDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * desc:计算指标时 获取要计算的组的指标
+ *
+ * @author liujianjun
+ */
+@Data
+public class IndexGroupDetailResult implements Serializable {
+ private static final long serialVersionUID = 3937041236261115759L;
+
+ /**
+ * 是否有下一组
+ */
+ private Boolean hasNextGroup;
+
+ /**
+ * desc:指标详情列表 如果hasNextGroup是true则返回的是明细,否则返回的是上级的分组的指标明细
+ * 例如:网格的三大能力上次已经返回完毕,下一次调用时返回的是网格相关的三大能力的 指标明细
+ */
+ private List indexGroupDetailList;
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java
index 5458720940..c873ffdb0b 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java
@@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.screen.IndexGroupEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 客户指标分组
*
@@ -31,4 +33,6 @@ import org.apache.ibatis.annotations.Mapper;
public interface IndexGroupDao extends BaseDao {
int inertGroupFromTable(String customerId);
+
+ List getDetailByCode(String indexCode, Integer offset);
}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java
index 1a7dd4a0a8..8c7a4e82fb 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java
@@ -20,6 +20,9 @@ package com.epmet.dao.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.screen.IndexGroupDetailEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
/**
* 客户指标详情
@@ -29,5 +32,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IndexGroupDetailDao extends BaseDao {
-
+
+ List getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode);
}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java
index c0088d5383..1336dd050f 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java
@@ -62,4 +62,14 @@ public class IndexGroupDetailEntity extends BaseEpmetEntity {
*/
private String status;
+ /**
+ * 阈值 如果是百分比 则为除以100以后的值
+ */
+ private BigDecimal threshold;
+
+ /**
+ * 所有指标code拼接的字符串 冒号隔开
+ */
+ private String allParentIndexCode;
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java
index 569cda48d9..20162b1198 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java
@@ -62,4 +62,9 @@ public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity {
*/
private BigDecimal threshold;
+ /**
+ * 所有指标code拼接的字符串 冒号隔开
+ */
+ private String allParentIndexCode;
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
index 931b9afd55..d19fb1d628 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
@@ -3,6 +3,7 @@ package com.epmet.model;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSON;
+import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.UniqueIdGenerator;
import com.epmet.entity.screen.IndexDictEntity;
import com.epmet.entity.screen.IndexGroupDetailTemplateEntity;
@@ -122,7 +123,7 @@ public class IndexExcelDataListener extends AnalysisEventListener {
group1.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true));
indexGroupMap.put(index.getLevel1Index(), group1);
}
-
+ StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode());
String level4Index = index.getLevel4Index();
indexDictEntity = indexDicMap.get(level4Index);
String level2GroupId = UniqueIdGenerator.generate();
@@ -139,14 +140,16 @@ public class IndexExcelDataListener extends AnalysisEventListener {
//构建 分组明细
templateEntity = indexGroupDetailMap.get(level4Index);
if (templateEntity == null) {
- buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2);
+ buildIndexGroupDetail(indexDictEntity, index, group1, allIndexCodeSb.toString(), 2);
}
}
indexDictEntity = indexDicMap.get(index.getLevel5Index());
+ allIndexCodeSb.append(StrConstant.COLON);
+ allIndexCodeSb.append(group2.getIndexCode());
templateEntity = indexGroupDetailMap.get(index.getLevel5Index());
if (templateEntity == null) {
- buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5);
+ buildIndexGroupDetail(indexDictEntity, index, group2, allIndexCodeSb.toString(), 5);
}
} else {
//todo 测试完去掉
@@ -162,7 +165,7 @@ public class IndexExcelDataListener extends AnalysisEventListener {
group1.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true));
indexGroupMap.put(index.getLevel1Index(), group1);
}
-
+ StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode());
String level2Index = index.getLevel2Index();
indexDictEntity = indexDicMap.get(level2Index);
String level2GroupId = UniqueIdGenerator.generate();
@@ -179,14 +182,15 @@ public class IndexExcelDataListener extends AnalysisEventListener {
//构建 分组明细
templateEntity = indexGroupDetailMap.get(level2Index);
if (templateEntity == null) {
- buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2);
+ buildIndexGroupDetail(indexDictEntity, index, group1, allIndexCodeSb.toString(), 2);
}
}
indexDictEntity = indexDicMap.get(index.getLevel5Index());
-
+ allIndexCodeSb.append(StrConstant.COLON);
+ allIndexCodeSb.append(group2.getIndexCode());
templateEntity = indexGroupDetailMap.get(index.getLevel5Index());
if (templateEntity == null) {
- buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5);
+ buildIndexGroupDetail(indexDictEntity, index, group2, allIndexCodeSb.toString(), 5);
}
}
//}
@@ -195,10 +199,11 @@ public class IndexExcelDataListener extends AnalysisEventListener {
LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values()));
}
- private void buildIndexGroupDetail(IndexDictEntity indexDictEntity, IndexModel index, String groupId, Integer level) {
+ private void buildIndexGroupDetail(IndexDictEntity indexDictEntity, IndexModel index, IndexGroupTemplateEntity parentGroup, String allIndexCode, Integer level) {
IndexGroupDetailTemplateEntity templateEntity;
templateEntity = new IndexGroupDetailTemplateEntity();
- templateEntity.setIndexGroupId(groupId);
+ templateEntity.setIndexGroupId(parentGroup.getId());
+ templateEntity.setAllParentIndexCode(allIndexCode);
templateEntity.setIndexId(indexDictEntity.getId());
if (level == 5) {
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java
index ea03e298a1..aa69cba8e7 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java
@@ -20,6 +20,8 @@ package com.epmet.service.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.screen.IndexGroupDetailEntity;
+import java.util.List;
+
/**
* 客户指标详情
*
@@ -27,5 +29,10 @@ import com.epmet.entity.screen.IndexGroupDetailEntity;
* @since v1.0.0 2020-08-19
*/
public interface IndexGroupDetailService extends BaseService {
-
+ /**
+ * desc:根据all_parent_index_code 获取指标明细
+ * @param customerId
+ * @param indexCode
+ */
+ List getDetailListByParentCode(String customerId,String... indexCode);
}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java
index 54a368044b..d51cf3ea88 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java
@@ -3,6 +3,8 @@ package com.epmet.service.screen.impl;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
+import com.epmet.dao.screen.IndexGroupDao;
+import com.epmet.dao.screen.IndexGroupDetailDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.IndexCalculateForm;
import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
@@ -31,6 +33,10 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao;
@Autowired
private GridCorreLationService gridCorreLationService;
+ @Autowired
+ private IndexGroupDao indexGroupDao;
+ @Autowired
+ private IndexGroupDetailDao indexGroupDetailDao;
@Override
public Boolean indexCalculate(IndexCalculateForm formDTO) {
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java
index db9fe1f411..6c22b360d6 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java
@@ -18,11 +18,15 @@
package com.epmet.service.screen.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.StrConstant;
+import com.epmet.commons.tools.exception.RenException;
import com.epmet.dao.screen.IndexGroupDetailDao;
import com.epmet.entity.screen.IndexGroupDetailEntity;
import com.epmet.service.screen.IndexGroupDetailService;
import org.springframework.stereotype.Service;
+import java.util.List;
+
/**
* 客户指标详情
*
@@ -33,4 +37,16 @@ import org.springframework.stereotype.Service;
public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService {
+ @Override
+ public List getDetailListByParentCode(String customerId,String... indexCode) {
+ if (indexCode == null || indexCode.length == 0){
+ throw new RenException("参数错误");
+ }
+ StringBuilder sb = new StringBuilder();
+ for (String code:indexCode){
+ sb.append(code).append(StrConstant.COLON);
+ }
+ sb = sb.deleteCharAt(sb.length());
+ return baseDao.getDetailListByParentCode(customerId,sb.toString());
+ }
}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml
index b7854f3338..ac4ad73bd5 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml
@@ -3,4 +3,9 @@
+
+
+ select ID, INDEX_GROUP_ID, INDEX_ID, WEIGHT, THRESHOLD FROM index_group_detail_template
+ where STATUS = 'enable' and DEL_FLAG = '0'
+
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml
index c044654dd8..8ec562b386 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml
@@ -7,7 +7,7 @@
delete from index_group_detail_template
- select ID, INDEX_GROUP_ID, INDEX_ID, WEIGHT, THRESHOLD
+ select ID, INDEX_GROUP_ID, INDEX_ID, WEIGHT, THRESHOLD, ALL_PARENT_INDEX_CODE
from index_group_detail_template
where STATUS = 'enable' and DEL_FLAG = '0'