Browse Source

新增user_kindness_time_log

dev_shibei_match
yinzuomei 5 years ago
parent
commit
427978366d
  1. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/UserKindnessTimeLogDao.java
  2. 56
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/UserKindnessTimeLogEntity.java
  3. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  4. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql
  5. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/UserKindnessTimeLogDao.xml

33
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/UserKindnessTimeLogDao.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.UserKindnessTimeLogEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户爱心时长记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-31
*/
@Mapper
public interface UserKindnessTimeLogDao extends BaseDao<UserKindnessTimeLogEntity> {
}

56
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/UserKindnessTimeLogEntity.java

@ -0,0 +1,56 @@
/**
* 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;
import java.util.Date;
/**
* 用户爱心时长记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("user_kindness_time_log")
public class UserKindnessTimeLogEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 活动id
*/
private String actId;
/**
* 居民端用户id
*/
private String resiUserId;
/**
* 服务时长
*/
private Integer kindnessTime;
}

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -91,6 +91,8 @@ public class WorkActServiceImpl implements WorkActService {
private ActSummaryDao actSummaryDao;
@Autowired
private ActGrantPointLogDao actGrantPointLogDao;
@Autowired
private UserKindnessTimeLogDao userKindnessTimeLogDao;
/**
* @return void
* @author yinzuomei
@ -958,10 +960,20 @@ public class WorkActServiceImpl implements WorkActService {
if(ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())){
//已签到的
heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin());
UserKindnessTimeLogEntity userKindnessTimeLogEntity=new UserKindnessTimeLogEntity();
userKindnessTimeLogEntity.setActId(actInfoDTO.getId());
userKindnessTimeLogEntity.setKindnessTime(actInfoDTO.getServiceMin());
userKindnessTimeLogEntity.setResiUserId(actUserRelation.getUserId());
userKindnessTimeLogDao.insert(userKindnessTimeLogEntity);
}else{
//未签到,但是有积分的
if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){
heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin());
UserKindnessTimeLogEntity userKindnessTimeLogEntity=new UserKindnessTimeLogEntity();
userKindnessTimeLogEntity.setActId(actInfoDTO.getId());
userKindnessTimeLogEntity.setKindnessTime(actInfoDTO.getServiceMin());
userKindnessTimeLogEntity.setResiUserId(actUserRelation.getUserId());
userKindnessTimeLogDao.insert(userKindnessTimeLogEntity);
}
}
}

14
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql

@ -443,3 +443,17 @@ CREATE TABLE `volunteer_info` (
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '志愿者信息' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE `user_kindness_time_log` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`ACT_ID` varchar(64) NOT NULL COMMENT '活动id',
`RESI_USER_ID` varchar(64) NOT NULL COMMENT '居民端用户id',
`KINDNESS_TIME` int(11) NOT NULL COMMENT '服务时长',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人(工作人员id)',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间(操作的时间)',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户爱心时长记录表';

20
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/UserKindnessTimeLogDao.xml

@ -0,0 +1,20 @@
<?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.UserKindnessTimeLogDao">
<resultMap type="com.epmet.entity.UserKindnessTimeLogEntity" id="userKindnessTimeLogMap">
<result property="id" column="ID"/>
<result property="actId" column="ACT_ID"/>
<result property="resiUserId" column="RESI_USER_ID"/>
<result property="kindnessTime" column="KINDNESS_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<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>
Loading…
Cancel
Save