Browse Source

BUG修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
d4e6545cfc
  1. 9
      esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/aop/UserBehaviorAop.java
  2. 4
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java

9
esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/aop/UserBehaviorAop.java

@ -8,11 +8,12 @@ import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.pointcommons.tools.annotation.RecordUserBehavior;
import com.elink.esua.epdc.pointcommons.tools.dto.BehaviorResultDto;
import com.elink.esua.epdc.pointcommons.tools.feign.PointsCommonFeignClient;
import com.elink.esua.epdc.pointcommons.tools.rocketmq.dto.BehaviorDto;
import com.elink.esua.epdc.pointcommons.tools.rocketmq.producer.PointsProducer;
import com.elink.esua.epdc.pointcommons.tools.annotation.RecordUserBehavior;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -36,6 +37,7 @@ import java.util.Date;
*/
@Aspect
@Component
@Slf4j
public class UserBehaviorAop {
@ -134,6 +136,7 @@ public class UserBehaviorAop {
Result<BehaviorResultDto> result = pointsFeignClient.getBehaviorCodeInfo(behaviorCode);
BehaviorResultDto behaviorResultDto = result.getData();
if (behaviorResultDto == null) {
log.info("根据行为编码获取编码动作失败!");
return;
}
behaviorRecodingTime = behaviorResultDto.getBehaviorRecordingTime();
@ -154,7 +157,8 @@ public class UserBehaviorAop {
String referenceId = this.covertData(recordUserBehavior.referenceId(), args, argNames);
String userId = this.covertData(recordUserBehavior.userId(), args, argNames);
String gridId = this.covertData(recordUserBehavior.gridId(), args, argNames);
if(StringUtils.isBlank(userId) || StringUtils.isBlank(referenceId)){
if(StringUtils.isBlank(userId) || StringUtils.isBlank(referenceId) || StringUtils.isBlank(gridId)){
log.info("用户ID,业务ID,网格ID转换失败!");
return;
}
BehaviorDto behaviorDto = new BehaviorDto();
@ -163,6 +167,7 @@ public class UserBehaviorAop {
behaviorDto.setUserId(userId);
behaviorDto.setGridId(Long.parseLong(gridId));
behaviorDto.setOperationTime(new Date());
log.info("动作发送信息:动作编码:"+behaviorCode+" 用户ID:"+userId+",业务ID:"+referenceId+",网格ID:"+gridId+",操作时间:"+behaviorDto.getOperationTime());
//发送mq
pointsProducer.sendMessage(RocketMqConstant.MQ_TOPIC_POINTS, RocketMqConstant.MQ_TAG_POINTS, referenceId, JSONObject.toJSONString(behaviorDto));
}

4
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java

@ -560,7 +560,7 @@ public interface UserFeignClient {
* @Param [userId]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcAppUserPointsResultDTO>
**/
@PostMapping(value = "app-user/epdc-app/user/getPointsByUserId/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE)
@GetMapping(value = "app-user/epdc-app/user/getPointsByUserId/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<EpdcAppUserPointsResultDTO> getPointsByUserId(@PathVariable String userId);
/**
* @Description 获取用户认证的网格接口
@ -569,7 +569,7 @@ public interface UserFeignClient {
* @Param [userId]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcAppUserPointsResultDTO>
**/
@PostMapping(value = "app-user/epdc-app/user/getUserGridIdByUserId/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE)
@GetMapping(value = "app-user/epdc-app/user/getUserGridIdByUserId/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<Long> getUserGridIdByUserId(@PathVariable String userId);
}
Loading…
Cancel
Save