From 178e4fd46593b28fcff54384e354c095a87924dc Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Wed, 31 Mar 2021 17:26:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/rocketmq/producer/PointsProducer.java | 2 +- .../dto/result/PointsStatisticsListResultDTO.java | 5 +++++ .../elink/esua/epdc/mq/PointsModifyConsumer.java | 2 +- .../src/main/resources/mapper/PointsLogsDao.xml | 13 ++++++------- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/rocketmq/producer/PointsProducer.java b/esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/rocketmq/producer/PointsProducer.java index 8798ee5d..2a598eeb 100644 --- a/esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/rocketmq/producer/PointsProducer.java +++ b/esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/rocketmq/producer/PointsProducer.java @@ -31,7 +31,7 @@ public class PointsProducer { public void sendMessage(String topic, String tag, String keys, String body) { Message message = new Message(topic, tag, keys, body.getBytes()); try { - SendResult sendResult = rocketMQTemplate.getProducer().send(message); + SendResult sendResult = rocketMQTemplate.getProducer().send(message,10000L); log.info("积分埋点发送消息结果:{sendStatus:{}, topic:{}, msgId:{}}", sendResult.getSendStatus(), topic, sendResult.getMsgId()); } catch (Exception e) { log.error("积分埋点发送消息异常:{topic:{}, tag:{}, keys:{}, body:{}}", topic, tag, keys, body); diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/result/PointsStatisticsListResultDTO.java b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/result/PointsStatisticsListResultDTO.java index eef1f887..332017ec 100644 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/result/PointsStatisticsListResultDTO.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/result/PointsStatisticsListResultDTO.java @@ -13,6 +13,11 @@ public class PointsStatisticsListResultDTO implements Serializable { */ private int allPoints; + /** + * 积分操作类型 + */ + private int pointsType; + /** * 消耗积分 */ diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java index 0296e9b0..e791adba 100644 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java @@ -130,7 +130,7 @@ public class PointsModifyConsumer implements RocketMQListener { } //2.赋值积分规则的上限期限(小时,年。。。。) pointsLogsFormDTO.setOperationFlag(pointsRuleResultDTO.getLimitType()); - //3.获取前一分钟的总分 + //3.获取时间段内的总分 Integer total = pointsLogsService.getPointsSumByBehaviorCodeAndUserId(pointsLogsFormDTO); //判断总分是否超过上限 if (total != null) { diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml index 7af40e9a..3e0693a2 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml @@ -52,7 +52,7 @@ case when OPERATION_TYPE =0 then sum(POINTS) else 0 end as f, case when OPERATION_TYPE =1 then sum(POINTS) else 0 end as z, BEHAVIOR_CODE - from epdc_points_logs where USER_ID = #{userId} and BEHAVIOR_CODE = #{behaviorCode} + from epdc_points_logs where USER_ID = #{userId} and RULE_CODE = #{ruleCode} and OPERATION_TIME between date_add(now() , interval -1 minute ) and now() @@ -183,9 +183,8 @@