From 24b460ee92ae6c89a1bda0ff7da47a5a6499e930 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Thu, 30 Jul 2020 14:13:08 +0800
Subject: [PATCH] =?UTF-8?q?heart:=E6=96=B0=E5=A2=9Eact=5Fgrant=5Fpoint=5Fl?=
=?UTF-8?q?og?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/epmet/dao/ActGrantPointLogDao.java | 33 +++++++++
.../epmet/entity/ActGrantPointLogEntity.java | 73 +++++++++++++++++++
.../service/impl/WorkActServiceImpl.java | 21 +++++-
.../resources/db/migration/epmet_heart.sql | 24 +++++-
.../resources/mapper/ActGrantPointLogDao.xml | 24 ++++++
.../resources/mapper/ActUserRelationDao.xml | 1 +
6 files changed, 174 insertions(+), 2 deletions(-)
create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActGrantPointLogDao.java
create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActGrantPointLogEntity.java
create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActGrantPointLogDao.xml
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActGrantPointLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActGrantPointLogDao.java
new file mode 100644
index 0000000000..adf8eacc5d
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActGrantPointLogDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.ActGrantPointLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 活动发放积分日志表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-30
+ */
+@Mapper
+public interface ActGrantPointLogDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActGrantPointLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActGrantPointLogEntity.java
new file mode 100644
index 0000000000..6bd2ae0a7d
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActGrantPointLogEntity.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 活动发放积分日志表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-30
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("act_grant_point_log")
+public class ActGrantPointLogEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ private String customerId;
+
+ /**
+ *
+ */
+ private String actId;
+
+ /**
+ *
+ */
+ private Integer reward;
+
+ /**
+ *
+ */
+ private String remark;
+
+ /**
+ *
+ */
+ private String operatorId;
+
+ /**
+ *
+ */
+ private String sendMsg;
+
+ /**
+ *
+ */
+ private String responseMsg;
+
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
index 3d4b26a331..bbc8c3a9c4 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
@@ -89,7 +89,8 @@ public class WorkActServiceImpl implements WorkActService {
private HeartUserInfoService heartUserInfoService;
@Autowired
private ActSummaryDao actSummaryDao;
-
+ @Autowired
+ private ActGrantPointLogDao actGrantPointLogDao;
/**
* @return void
* @author yinzuomei
@@ -868,6 +869,15 @@ public class WorkActServiceImpl implements WorkActService {
}
mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
+ ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity();
+ actGrantPointLogEntity.setActId(actInfoDTO.getId());
+ actGrantPointLogEntity.setCustomerId(actInfoDTO.getCustomerId());
+ actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId());
+ actGrantPointLogEntity.setRemark(remark);
+ actGrantPointLogEntity.setReward(actInfoDTO.getReward());
+ actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO));
+ actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
+ actGrantPointLogDao.insert(actGrantPointLogEntity);
if(!result.success()){
logger.error("活动积分发放失败");
}
@@ -899,6 +909,15 @@ public class WorkActServiceImpl implements WorkActService {
logger.info("发送消息入参:"+JSON.toJSON(mqBaseMsgDTO));
Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
logger.info("发送消息返参:"+JSON.toJSON(result));
+ ActGrantPointLogEntity actGrantPointLogEntity=new ActGrantPointLogEntity();
+ actGrantPointLogEntity.setActId(formDTO.getSourceId());
+ actGrantPointLogEntity.setCustomerId(formDTO.getCustomerId());
+ actGrantPointLogEntity.setOperatorId(loginUserUtil.getLoginUserId());
+ actGrantPointLogEntity.setRemark(formDTO.getRemark());
+ actGrantPointLogEntity.setReward(formDTO.getReward());
+ actGrantPointLogEntity.setSendMsg(JSON.toJSONString(mqBaseMsgDTO));
+ actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
+ actGrantPointLogDao.insert(actGrantPointLogEntity);
if (!result.success()) {
logger.error("积分发放失败");
return;
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql
index 67ee2b23de..3cb7da4267 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql
@@ -11,7 +11,7 @@
Target Server Version : 50728
File Encoding : 65001
- Date: 28/07/2020 15:17:47
+ Date: 30/07/2020 14:11:45
*/
SET NAMES utf8mb4;
@@ -58,6 +58,28 @@ CREATE TABLE `act_customized` (
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '爱心互助首页自定义配置' ROW_FORMAT = Dynamic;
+-- ----------------------------
+-- Table structure for act_grant_point_log
+-- ----------------------------
+DROP TABLE IF EXISTS `act_grant_point_log`;
+CREATE TABLE `act_grant_point_log` (
+ `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `REWARD` int(11) NOT NULL,
+ `REMARK` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `OPERATOR_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `SEND_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
+ `RESPONSE_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
+ `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁',
+ `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标记',
+ `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
+ `CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间(报名时间)',
+ `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
+ `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '活动发放积分日志表' ROW_FORMAT = Dynamic;
+
-- ----------------------------
-- Table structure for act_info
-- ----------------------------
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActGrantPointLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActGrantPointLogDao.xml
new file mode 100644
index 0000000000..e1aaf3b732
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActGrantPointLogDao.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml
index b845694873..e6ddb723fc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml
@@ -175,6 +175,7 @@
WHERE
aur.DEL_FLAG = '0'
AND aur.PROCESS_FLAG != 'handled'
+ and aur.`status`='passed'
AND aur.ACT_ID = #{actId}