From 116ae9c353b2f9122db5805cd9b173fc1ca92963 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 25 Jan 2021 15:43:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=96=B0=E5=A2=9E=E7=A7=AF=E5=88=86=E8=A7=84=E5=88=99?= =?UTF-8?q?=E5=92=8C=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/DataStatisticalOpenFeignClient.java | 9 ++++++++ ...ataStatisticalOpenFeignClientFallBack.java | 6 ++++++ .../feign/EpmetPointOpenFeignClient.java | 8 +++++++ .../EpmetPointOpenFeignClientFallback.java | 6 ++++++ epmet-module/oper-crm/oper-crm-server/pom.xml | 12 +++++++++++ .../service/impl/CustomerServiceImpl.java | 21 +++++++++++++++++++ 6 files changed, 62 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 4be6144bc2..27a471f2d4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -7,6 +7,7 @@ import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; @@ -227,4 +228,12 @@ public interface DataStatisticalOpenFeignClient { **/ @PostMapping("/data/stats/screenextract/extractmonthlyall") Result extractMonthlyAll(ExtractScreenFormDTO extractScreenFormDTO); + + /** + * @Description 新客户初始化评价指标 权重 + * @author sun + */ + @PostMapping(value = "/data/stats/indexdict/initCustomerIndex") + Result initCustomerIndex(@RequestBody InitCustomerIndexForm formDTO); + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 0f09dc88b9..88574dbd8d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -8,6 +8,7 @@ import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import org.springframework.stereotype.Component; @@ -224,4 +225,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result extractMonthlyAll(ExtractScreenFormDTO extractScreenFormDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "screenExtractMonthly", extractScreenFormDTO); } + + @Override + public Result initCustomerIndex(InitCustomerIndexForm formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initCustomerIndex", formDTO); + } } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java index d5b9edd6c6..63ffc6a3c0 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.InitPointRuleResultDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback; @@ -26,4 +27,11 @@ public interface EpmetPointOpenFeignClient { **/ @PostMapping("/point/resi/point/mypoint") Result myPoint(CommonUserFormDTO param); + + /** + * @Description 新客户初始化积分规则 + * @author sun + **/ + @PostMapping("/point/opback/initpointrule") + Result initPointRule(); } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java index 7d5cda718f..ab0688e134 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.InitPointRuleResultDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.EpmetPointOpenFeignClient; @@ -20,4 +21,9 @@ public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignCli public Result myPoint(CommonUserFormDTO param) { return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint",param); } + + @Override + public Result initPointRule() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule"); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 610cdd9734..cc8a8b2112 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -99,6 +99,18 @@ epmet-commons-rocketmq 2.0.0 + + com.epmet + epmet-point-client + 2.0.0 + compile + + + com.epmet + data-statistical-client + 2.0.0 + compile + diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 9080d1573f..af4ae6ad59 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -39,6 +39,7 @@ import com.epmet.dao.CustomerDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.entity.CustomerEntity; import com.epmet.feign.*; import com.epmet.redis.CustomerRedis; @@ -84,6 +85,10 @@ public class CustomerServiceImpl extends BaseServiceImpl page(Map params) { @@ -547,6 +552,22 @@ public class CustomerServiceImpl extends BaseServiceImpl resultPoint = epmetPointOpenFeignClient.initPointRule(); + if (!resultPoint.success()) { + throw new RenException(resultPoint.getCode(), resultPoint.getInternalMsg()); + } + + //9.新客户初始化评价指标 权重 + InitCustomerIndexForm indexForm = new InitCustomerIndexForm(); + indexForm.setCustomerId(formDTO.getCustomerId()); + Result resultData = dataStatisticalOpenFeignClient.initCustomerIndex(indexForm); + if (!resultData.success()) { + throw new RenException(resultData.getCode(), resultData.getInternalMsg()); + } + //2021.1.25 end + } private InitCustomerMQMsg.InitCustomerStaff constructStaffInfo4CustomerInit(String agencyId, PaUserDTO paUser) { From 5fee231303635df5cd0e862793d9f5cffcdab7b5 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 28 Jan 2021 15:29:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=BD=91=E5=85=B3=E6=B6=88=E6=81=AF=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/utils/SendMqMsgUtils.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java index c9003a3655..abb6684cd5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java @@ -7,7 +7,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.mq.EventClassDto; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqReturnBaseResult; -import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.enums.MqMethodPathEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ValidateException; @@ -40,7 +39,7 @@ public class SendMqMsgUtils { if (mqConfig == null) { mqConfig = SpringContextUtils.getBean(MqConfig.class); } - log.debug("sendMsg param:{}", JSON.toJSONString(msg)); + log.info("sendMsg param:{}", JSON.toJSONString(msg)); try { // TODO ValidatorUtils.validateEntity(msg, DefaultGroup.class); @@ -52,7 +51,7 @@ public class SendMqMsgUtils { msg.setToken(mqConfig.getToken()); try { Result result = HttpClientManager.getInstance().sendPostByHttps(msg.getRequestUrl(), JSON.toJSONString(msg)); - log.debug("sendMsg result:{}", JSON.toJSONString(result)); + log.info("sendMsg result:{}", JSON.toJSONString(result)); if (result.success()) { MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); if (resultResult.getErrCode().equals(NumConstant.ZERO)) { @@ -68,7 +67,7 @@ public class SendMqMsgUtils { resultResult.setInternalMsg(result.getInternalMsg()); return resultResult; } catch (Exception e) { - log.debug("sendMsg exception", e); + log.error("sendMsg exception", e); return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } } @@ -90,7 +89,7 @@ public class SendMqMsgUtils { try { Result result = HttpClientManager.getInstance().sendPostByHttps(requestUrl, JSON.toJSONString(param)); - log.debug("getEventClassList result:{}", JSON.toJSONString(result)); + log.info("getEventClassList result:{}", JSON.toJSONString(result)); if (result.success()) { MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); if (resultResult.getErrCode().equals(NumConstant.ZERO)) { @@ -106,7 +105,7 @@ public class SendMqMsgUtils { resultResult.setInternalMsg(result.getInternalMsg()); return resultResult; } catch (Exception e) { - log.debug("sendMsg exception", e); + log.error("sendMsg exception", e); return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } }