Browse Source

heart:新增act_grant_point_log

master
yinzuomei 5 years ago
parent
commit
24b460ee92
  1. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActGrantPointLogDao.java
  2. 73
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActGrantPointLogEntity.java
  3. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  4. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql
  5. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActGrantPointLogDao.xml
  6. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<ActGrantPointLogEntity> {
}

73
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

21
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;

24
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
-- ----------------------------

24
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActGrantPointLogDao.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ActGrantPointLogDao">
<resultMap type="com.epmet.entity.ActGrantPointLogEntity" id="actGrantPointLogMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="actId" column="ACT_ID"/>
<result property="reward" column="REWARD"/>
<result property="remark" column="REMARK"/>
<result property="operatorId" column="OPERATOR_ID"/>
<result property="sendMsg" column="SEND_MSG"/>
<result property="responseMsg" column="RESPONSE_MSG"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

1
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}
</select>

Loading…
Cancel
Save