jianjun 5 years ago
parent
commit
88900a3235
  1. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java
  2. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  3. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  4. 8
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
  5. 6
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
  6. 12
      epmet-module/oper-crm/oper-crm-server/pom.xml
  7. 21
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

11
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<String> 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<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
}
@ -90,7 +89,7 @@ public class SendMqMsgUtils {
try {
Result<String> 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<List<EventClassDto>>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
}

9
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<Boolean> initCustomerIndex(@RequestBody InitCustomerIndexForm formDTO);
}

6
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<Boolean> initCustomerIndex(InitCustomerIndexForm formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initCustomerIndex", formDTO);
}
}

8
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<ResiPointDetailResultDTO> myPoint(CommonUserFormDTO param);
/**
* @Description 新客户初始化积分规则
* @author sun
**/
@PostMapping("/point/opback/initpointrule")
Result<InitPointRuleResultDTO> initPointRule();
}

6
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<ResiPointDetailResultDTO> myPoint(CommonUserFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint",param);
}
@Override
public Result<InitPointRuleResultDTO> initPointRule() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule");
}
}

12
epmet-module/oper-crm/oper-crm-server/pom.xml

@ -99,6 +99,18 @@
<artifactId>epmet-commons-rocketmq</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-point-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>data-statistical-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

21
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -40,6 +40,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;
@ -85,6 +86,10 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private EpmetPointOpenFeignClient epmetPointOpenFeignClient;
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Override
public PageData<CustomerDTO> page(Map<String, Object> params) {
@ -550,6 +555,22 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
}
}
//2021.1.25 sun 新增初始化客户积分规则和评价指标权重 start
//8.客户初始化已有的积分规则
Result<InitPointRuleResultDTO> resultPoint = epmetPointOpenFeignClient.initPointRule();
if (!resultPoint.success()) {
throw new RenException(resultPoint.getCode(), resultPoint.getInternalMsg());
}
//9.新客户初始化评价指标 权重
InitCustomerIndexForm indexForm = new InitCustomerIndexForm();
indexForm.setCustomerId(formDTO.getCustomerId());
Result<Boolean> 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) {

Loading…
Cancel
Save