From 630048f22115d450ea3f41fdd49f82d17ca74cdb Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 24 Dec 2021 20:24:15 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mq/listener/OpenDataPatrolChangeEventListener.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java index 8c4db7b3e4..e13b8d01b7 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java @@ -3,6 +3,7 @@ package com.epmet.opendata.mq.listener; import com.alibaba.fastjson.JSON; import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -70,10 +71,10 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr logger.info("【开放数据事件监听器】-巡查记录信息变更-收到消息内容:{}, 操作:{}", msg, tags); StaffPatrolMQMsg msgObj = JSON.parseObject(msg, StaffPatrolMQMsg.class); - //只推送平阴数据 todo 先干掉测试 - /*if (!StrConstant.PY_CUSTOMER.equals(msgObj.getCustomerId())) { + //只推送平阴数据 + if (!StrConstant.PY_CUSTOMER.equals(msgObj.getCustomerId())) { return; - }*/ + } if (msgObj == null) { log.warn("consumeMessage msg body is blank"); return; From 064158e58413dbe5d59ff32265b9ef5bf15e0e15 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 24 Dec 2021 20:48:37 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=B8=8D=E9=BB=98=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BaseGridDailyworkServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java index 3a65046992..c365863aed 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java @@ -151,7 +151,13 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl Date: Fri, 24 Dec 2021 21:01:22 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=84=8F=E6=83=B3=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BaseGridDailyworkServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java index c365863aed..2f29c8d240 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java @@ -155,7 +155,13 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl Date: Sun, 26 Dec 2021 18:43:42 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=B9=B2=E6=8E=89=E9=82=A3=E4=B8=AA?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ShiBeiScreenCollServiceImpl.java | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 02e4df412b..0f738cb679 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -110,7 +110,21 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO.getDataList(), customerId); + List list = new ArrayList<>(); + formDTO.getDataList().forEach(item -> { + if (StringUtils.isEmpty(item.getGridId())) { + log.warn("gridId is null,userId:{}", item.getUserId()); + return; + } + list.add(item); + if (list.size() == NumConstant.ONE_HUNDRED) { + screenPartyUserRankDataDao.batchInsertPartyUserRankData(list, customerId); + list.clear(); + } + }); + if (list.size() > NumConstant.ZERO) { + screenPartyUserRankDataDao.batchInsertPartyUserRankData(list, customerId); + } } } @@ -134,7 +148,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Transactional(rollbackFor = Exception.class) public void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId) { if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { - throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); + throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); } if (formDTO.getIsFirst()) { int deleteNum; @@ -152,7 +166,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Transactional(rollbackFor = Exception.class) public void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId) { if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { - throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); + throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); } if (formDTO.getIsFirst()) { int deleteNum; @@ -170,7 +184,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Transactional(rollbackFor = Exception.class) public void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId) { if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { - throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); + throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); } if (formDTO.getIsFirst()) { int deleteNum; @@ -261,7 +275,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Transactional(rollbackFor = Exception.class) public void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId) { if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { - throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); + throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); } if (formDTO.getIsFirst()) { int deleteNum; @@ -359,7 +373,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Transactional(rollbackFor = Exception.class) public void insertUserJoin(UserJoinListFormDTO formDTO, String customerId) { if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { - throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); + throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); } if (formDTO.getIsFirst()) { int deleteNum; @@ -377,7 +391,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { /*String[] lastMonth = this.lastMonthDate(); // 获取上个月的基本数据 String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE];*/ - String monthId= DateUtils.getBeforeNMonthByMonth(1,formDTO.getMonthId()); + String monthId = DateUtils.getBeforeNMonthByMonth(1, formDTO.getMonthId()); List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, monthId, orgIds); @@ -386,7 +400,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { List curMonthJoinEntityList = new ArrayList<>(); // 增加率计算 if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) { - log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId的上月已有数据集合长度="+lastMonthJoinList.size()); + log.info("当前传入的monthId=" + formDTO.getMonthId() + ";数据集合长度=" + formDTO.getDataList() + ";当前monthId的上月已有数据集合长度=" + lastMonthJoinList.size()); // 存在上个月的数据 (本月-上月)/上月 *100 for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) { @@ -403,7 +417,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { } } } else { - log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId上月不存在数据。"); + log.info("当前传入的monthId=" + formDTO.getMonthId() + ";数据集合长度=" + formDTO.getDataList() + ";当前monthId上月不存在数据。"); // 计算增长率后的 待新增数据 BigDecimal zero = new BigDecimal(NumConstant.ZERO); // 不存在上个月的数据 @@ -428,7 +442,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Transactional(rollbackFor = Exception.class) public Integer initBizOrg(CustomerBizOrgFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - List entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId(),null,null); + List entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId(), null, null); List list = new ArrayList<>(); if (CollectionUtils.isEmpty(entityList)) { return 0; From d2171ce68cba87b4d35c6d8789ba72137715b960 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Dec 2021 10:44:00 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=20?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89=20=E5=B8=82=E5=8C=97?= =?UTF-8?q?=E5=AE=A2=E6=88=B7id=20=E7=9A=84=E6=8C=87=E6=A0=87=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E6=95=B0=E6=8D=AE=E6=8A=BD=E5=8F=96=E5=8F=8A=20?= =?UTF-8?q?=E5=B8=82=E5=8C=97=E7=9A=84=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=EF=BC=88=E5=B8=82=E5=8C=97=E5=8F=AA=E6=94=AF=E6=8C=81=20?= =?UTF-8?q?=E4=BB=96=E4=BB=AC=E8=87=AA=E5=B7=B1=E8=B0=83=E7=94=A8=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/CustomerIdConstant.java | 15 +++++++++++++++ .../impl/IndexOriginExtractServiceImpl.java | 3 +++ .../toscreen/impl/ScreenExtractServiceImpl.java | 6 ++++++ .../indexcal/impl/IndexCalculateServiceImpl.java | 3 --- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/CustomerIdConstant.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/CustomerIdConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/CustomerIdConstant.java new file mode 100644 index 0000000000..9860f9d1ad --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/CustomerIdConstant.java @@ -0,0 +1,15 @@ +package com.epmet.commons.tools.constant; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2021/12/27 10:22 上午 + * @version: 1.0 + */ +public interface CustomerIdConstant { + /** + * 市北生产-客户ID + */ + String SHI_BEI_CUSTOMER_ID = "b09527201c4409e19d1dbc5e3c3429a1"; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index 6bc96d1006..a30c0e3169 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.CustomerIdConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.extract.form.ExtractIndexFormDTO; @@ -67,6 +68,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService log.error("indexOriginExtractAll 获取客户Id为空"); return; } + //去除 市北客户id的抽取 + customerIds.remove(CustomerIdConstant.SHI_BEI_CUSTOMER_ID); } String finalMonthId = monthId; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index d84301a75b..83d52891dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.CustomerIdConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; @@ -460,6 +461,11 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { } catch (Exception e) { log.error("项目(事件)数量分析按组织_按月统计失败,参数为{}" + JSON.toJSONString(formDTO), e); } + //去除 市北客户id的抽取 + if (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(customerId)){ + log.info("===== extractMonthly method end not contains shi bei:{}======", customerId); + return; + } //此方法保持在最后即可 计算指标分数 todo 优化 手动创建线程池 控制任务数量 ExecutorService pool = Executors.newSingleThreadExecutor(); pool.submit(() -> { 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 5694fbaef0..3fd804ec7a 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 @@ -15,7 +15,6 @@ import com.epmet.dto.indexcal.IndexStatisticsFormDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.redis.IndexCalRedis; import com.epmet.service.crm.CustomerRelationService; -import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.util.DimIdGenerator; @@ -59,8 +58,6 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private ScreenCustomerAgencyDao screenCustomerAgencyDao; @Autowired private CustomerRelationService customerRelationService; - @Autowired - private IndexOriginExtractService indexOriginExtractService; @Override public Boolean indexCalculate(CalculateCommonFormDTO formDTO) {