subCustomerIds;
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerRelationDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerRelationDao.java
new file mode 100644
index 0000000000..a5c15ff8cc
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerRelationDao.java
@@ -0,0 +1,38 @@
+/**
+ * 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.stats;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.indexcal.CustomerSubInfoDTO;
+import com.epmet.entity.stats.CustomerRelationEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 客户关系表(01.14 add)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-01-14
+ */
+@Mapper
+public interface CustomerRelationDao extends BaseDao {
+
+ List selectCustomerSubInfo(@Param("list") List customerIds);
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerRelationEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerRelationEntity.java
new file mode 100644
index 0000000000..4c3d7098c9
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerRelationEntity.java
@@ -0,0 +1,63 @@
+/**
+ * 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.stats;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 客户关系表(01.14 add)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-01-14
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("customer_relation")
+public class CustomerRelationEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 父级客户id;如果是顶级客户,此列=0
+ */
+ private String parentCustomerId;
+
+ /**
+ * 当前客户类型取值: external:外部客户,internal:内部客户
+ */
+ private String customerType;
+
+ /**
+ * 父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0
+ */
+ private String parentCustomerType;
+
+ /**
+ * open,closed是否启用
+ */
+ private String status;
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
index 753dc70726..9a03124895 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
@@ -8,10 +8,12 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
+import com.epmet.dto.indexcal.CustomerSubInfoDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.redis.IndexCalRedis;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
+import com.epmet.service.stats.CustomerRelationService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -21,6 +23,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Map;
/**
* @author liujianjun
@@ -50,7 +53,8 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
private FactIndexCollectService factIndexCollectService;
@Autowired
private ScreenCustomerAgencyDao screenCustomerAgencyDao;
-
+ @Autowired
+ private CustomerRelationService customerRelationService;
@Override
public Boolean indexCalculate(CalculateCommonFormDTO formDTO) {
@@ -71,11 +75,20 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
} else {
customerIds.add(formDTO.getCustomerId());
}
+
+ //查询客户编码、子客户信息 add01.14
+ Map customerInfoMap=this.getCustomerInfoMap(customerIds);
+
Boolean flag = false;
for (String customerId : customerIds) {
CalculateCommonFormDTO param = new CalculateCommonFormDTO();
param.setCustomerId(customerId);
param.setMonthId(formDTO.getMonthId());
+ //01.14 add
+ if(null!=customerInfoMap.get(customerId)){
+ param.setCustomerAreaCode(customerInfoMap.get(customerId).getCustomerAreaCode());
+ param.setSubCustomerIds(customerInfoMap.get(customerId).getSubCustomerIds());
+ }
flag = calulateCustomerIndexScore(param);
}
return flag;
@@ -178,4 +191,8 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
}
return false;
}
+
+ private Map getCustomerInfoMap(List customerIds) {
+ return customerRelationService.getCustomerInfoMap(customerIds);
+ }
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerRelationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerRelationService.java
new file mode 100644
index 0000000000..cc94faa6c2
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerRelationService.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.stats;
+
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.dto.indexcal.CustomerSubInfoDTO;
+import com.epmet.entity.stats.CustomerRelationEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 客户关系表(01.14 add)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-01-14
+ */
+public interface CustomerRelationService extends BaseService {
+
+ /**
+ * @return java.util.Map
+ * @param customerIds
+ * @author yinzuomei
+ * @description 查询每个客户的area_code以及子客户列表
+ * @Date 2021/1/14 16:22
+ **/
+ Map getCustomerInfoMap(List customerIds);
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerRelationServiceImpl.java
new file mode 100644
index 0000000000..bbdbb9f386
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerRelationServiceImpl.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.stats.impl;
+
+import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.constant.DataSourceConstant;
+import com.epmet.dao.stats.CustomerRelationDao;
+import com.epmet.dto.indexcal.CustomerSubInfoDTO;
+import com.epmet.entity.stats.CustomerRelationEntity;
+import com.epmet.service.stats.CustomerRelationService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 客户关系表(01.14 add)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-01-14
+ */
+@DataSource(DataSourceConstant.STATS)
+@Service
+public class CustomerRelationServiceImpl extends BaseServiceImpl implements CustomerRelationService {
+
+
+ /**
+ * @param customerIds
+ * @return java.util.Map
+ * @author yinzuomei
+ * @description 查询每个客户的area_code以及子客户列表
+ * @Date 2021/1/14 16:22
+ **/
+ @Override
+ public Map getCustomerInfoMap(List customerIds) {
+ List list = baseDao.selectCustomerSubInfo(customerIds);
+ return list.stream().collect(Collectors.toMap(CustomerSubInfoDTO::getCustomerId, customer -> customer));
+ }
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerRelationDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerRelationDao.xml
new file mode 100644
index 0000000000..e959443001
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerRelationDao.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
\ No newline at end of file
From 4ff8195339df6e6d944397780a18f87557d13941 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Thu, 14 Jan 2021 17:32:45 +0800
Subject: [PATCH 009/101] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?=
=?UTF-8?q?=E5=85=A5=E5=8F=A3=EF=BC=8C=E5=85=A5=E5=8F=82CalculateCommonFor?=
=?UTF-8?q?mDTO=E7=BB=9F=E4=B8=80=E6=B7=BB=E5=8A=A0customerAreaCode?=
=?UTF-8?q?=E3=80=81subCustomerIds:=20processPenddingCalculate?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/epmet/controller/IndexCalculateController.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
index 11e082057a..1bf83298cc 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
@@ -84,6 +84,9 @@ public class IndexCalculateController {
CalculateCommonFormDTO form = new CalculateCommonFormDTO();
form.setCustomerId(flag.getForm().getCustomerId());
form.setMonthId(flag.getForm().getMonthId());
+ //01.14 add
+ form.setCustomerAreaCode(flag.getForm().getCustomerAreaCode());
+ form.setSubCustomerIds(flag.getForm().getSubCustomerIds());
indexCalculate(form);
}
});
From 0a84c7e0f7b36947d94d49f49dcdb67eb62f8725 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Fri, 15 Jan 2021 10:25:45 +0800
Subject: [PATCH 010/101] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3-?=
=?UTF-8?q?=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B=E5=88=86=E6=95=B0=E8=AE=A1?=
=?UTF-8?q?=E7=AE=97=E4=BF=AE=E6=94=B9end1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../FactIndexPartyAblityCpcMonthlyDao.java | 25 +++-
.../screen/ScreenCustomerAgencyEntity.java | 4 +
.../screen/ScreenCustomerDeptEntity.java | 5 +
.../screen/ScreenCustomerGridEntity.java | 5 +
.../impl/CpcIndexCalculateServiceImpl.java | 13 +-
.../FactIndexPartyAblityCpcMonthlyDao.xml | 118 +++++++++++-------
6 files changed, 120 insertions(+), 50 deletions(-)
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java
index 619b621d7a..1102a159b9 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java
@@ -18,6 +18,7 @@
package com.epmet.dao.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcollect.form.GridPartyMemberDataDetailFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -59,9 +60,29 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list,
@Param("customerId") String customerId);
- List