Browse Source

Merge remote-tracking branch 'origin/dev_1118' into dev_1118

feature/dangjian
李鹏飞 6 years ago
parent
commit
fc9dfb8ee2
  1. 67
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java
  2. 5
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java
  3. 43
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserRelationStatusConstant.java
  4. 15
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java
  5. 36
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java
  6. 18
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java
  7. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java
  8. 46
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java
  9. 10
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java
  10. 51
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  11. 4
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml
  12. 27
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

67
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java

@ -32,51 +32,56 @@ import java.util.Date;
@Data
public class ActUserLogDTO implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* 主键
*/
/**
* 主键
*/
private String id;
/**
* 活动ID
*/
private String actId;
/**
* 活动ID
*/
// private String actId;
/**
* 用户ID
*/
private String userId;
/**
* 用户ID
*/
// private String userId;
/**
* 操作类别0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
/**
* 用户活动关系表主键ACT_USER_RELATION_ID
*/
private String actUserRelationId;
/**
* 操作类别0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
private String operationType;
/**
* 审核不通过的原因
*/
/**
* 审核不通过的原因
*/
private String failureReason;
/**
* 操作时间
*/
/**
* 操作时间
*/
private Date operationTime;
/**
* 乐观锁
*/
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
/**
* 创建时间
*/
private Date createdTime;
/**
@ -89,4 +94,4 @@ public class ActUserLogDTO implements Serializable {
*/
private Date updatedTime;
}
}

5
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java

@ -17,6 +17,7 @@
package com.elink.esua.epdc.activity.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -57,21 +58,25 @@ public class ActInfoDetailAppResultDTO implements Serializable {
/**
* 报名开始时间yyyy-MM-dd HH:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signupStartTime;
/**
* 报名截止时间yyyy-MM-dd HH:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signupEndTime;
/**
* 活动开始时间yyyy-MM-dd HH:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actStartTime;
/**
* 活动结束时间yyyy-MM-dd HH:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actEndTime;
/**

43
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserRelationStatusConstant.java

@ -0,0 +1,43 @@
package com.elink.esua.epdc.constant;
/**
* @Description 用户活动关系表当前状态0-报名1-审核通过2-打卡3-取消报名4-审核不通过5-确认积分6-拒绝加积分
* @Author yinzuomei
* @Date 2020/2/5 21:35
*/
public interface ActUserRelationStatusConstant {
/**
* 报名
*/
String SIGN_UP="0";
/**
* 审核通过
*/
String APPROVED="1";
/**
* 打卡
*/
String CLOCK="2";
/**
* 取消报名
*/
String CANCEL_SIGN_UP = "3";
/**
* 审核不通过
*/
String NOT_APPROVED = "4";
/**
* 确认积分
*/
String CONFIRM_ADD_POINTS = "5";
/**
* 拒绝加积分
*/
String REFUSE_ADD_POINTS = "6";
}

15
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java

@ -86,10 +86,21 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
/**
* 自动审核
*
* @param actId
* @return
*/
List<ActUserRelationDTO> selectListActUserInfo(@Param("actId")String actId);
List<ActUserRelationDTO> selectListActUserInfo(@Param("actId") String actId);
List<ActUserClockResultDTO> getActUserClockPageFromPC(Map<String, Object> params);
}
/**
* @param userId 用户id
* @param actId 活动id
* @return com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity
* @Author yinzuomei
* @Description 根据用户id+活动id活动信息表
* @Date 2020/2/6 0:10
**/
ActUserRelationEntity selectOneByUserIdAndActId(@Param("userId") String userId, @Param("actId") String actId);
}

36
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java

@ -18,7 +18,6 @@
package com.elink.esua.epdc.modules.activity.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -38,24 +37,29 @@ public class ActUserLogEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 活动ID
*/
private String actId;
/**
* 活动ID
*/
// private String actId;
/**
* 用户ID
*/
private String userId;
/**
* 用户ID
*/
// private String userId;
/**
* 操作类别0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
/**
* 用户活动关系表主键ACT_USER_RELATION_ID
*/
private String actUserRelationId;
/**
* 操作类别0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
private String operationType;
/**
* 审核不通过的原因
*/
/**
* 审核不通过的原因
*/
private String failureReason;
/**
@ -63,4 +67,4 @@ public class ActUserLogEntity extends BaseEpdcEntity {
*/
private Date operationTime;
}
}

18
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java

@ -34,11 +34,17 @@ public class ActUserLogExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "活动ID")
private String actId;
@Excel(name = "用户ID")
private String userId;
// @Excel(name = "活动ID")
// private String actId;
//
// @Excel(name = "用户ID")
// private String userId;
/**
* 用户活动关系表主键ACT_USER_RELATION_ID
*/
@Excel(name = "用户活动关系表主键")
private String actUserRelationId;
@Excel(name = "操作类别(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过)")
private String operationType;
@ -65,4 +71,4 @@ public class ActUserLogExcel {
private Date updatedTime;
}
}

2
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java

@ -165,4 +165,4 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
*/
Result updateAuditDefaultStatus(String actId);
}
}

46
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java

@ -38,6 +38,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.constant.ActStateConstant;
import com.elink.esua.epdc.constant.ActUserRelationStatusConstant;
import com.elink.esua.epdc.constant.ActUserStatusConstant;
import com.elink.esua.epdc.dto.ScheduleJobDTO;
import com.elink.esua.epdc.modules.activity.dao.ActInfoDao;
@ -245,6 +246,14 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
return new Result<ActInfoDetailAppResultDTO>().ok(resultDTO);
}
/**
* @param actId 活动id
* @param userId 用户id
* @return java.lang.String
* @Author yinzuomei
* @Description 返回当前活动下用户状态0-我要报名1-取消报名2-已报满3-未开始4-我要打卡5-更新打卡6-已结束7-已取消
* @Date 2020/2/5 21:54
**/
public String getCurrentUserStatus(String actId, String userId) {
ActInfoEntity actInfoEntity = baseDao.selectById(actId);
String currentUserStatus = "";
@ -252,7 +261,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
//1、查询用户活动关系
QueryWrapper<ActUserRelationEntity> actUserRelationWrapper = new QueryWrapper<>();
actUserRelationWrapper.eq("ACT_ID", actId)
.eq("USER_ID", userId);
.eq("USER_ID", userId)
.orderByDesc("CREATED_TIME").last("limit 1");
ActUserRelationEntity actUserRelationEntity = actUserRelationDao.selectOne(actUserRelationWrapper);
//2、查询用户打卡记录
List<ActUserClockLogEntity> actUserClockLogList = new ArrayList<ActUserClockLogEntity>();
@ -276,11 +286,11 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
if (null == actUserRelationEntity) {
currentUserStatus = ActUserStatusConstant.FINISHED;
} else if (null != actUserRelationEntity
&& actUserRelationEntity.getStatus().equals("1")
&& ActUserRelationStatusConstant.APPROVED.equals(actUserRelationEntity.getStatus())
&& CollUtil.isEmpty(actUserClockLogList)) {
currentUserStatus = ActUserStatusConstant.CLOCK;
} else if (null != actUserRelationEntity
&& actUserRelationEntity.getStatus().equals("2")
&& ActUserRelationStatusConstant.CLOCK.equals(actUserRelationEntity.getStatus())
&& CollUtil.isNotEmpty(actUserClockLogList)) {
currentUserStatus = ActUserStatusConstant.UPDATE_CLOCK;
}
@ -292,38 +302,46 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
if (null == actUserRelationEntity) {
currentUserStatus = ActUserStatusConstant.ON_GOING;
} else if (null != actUserRelationEntity
&& actUserRelationEntity.getStatus().equals("1")
&& ActUserRelationStatusConstant.APPROVED.equals(actUserRelationEntity.getStatus())
&& CollUtil.isEmpty(actUserClockLogList)) {
currentUserStatus = ActUserStatusConstant.CLOCK;
} else if (null != actUserRelationEntity
&& actUserRelationEntity.getStatus().equals("2")
&& ActUserRelationStatusConstant.CLOCK.equals(actUserRelationEntity.getStatus())
&& CollUtil.isNotEmpty(actUserClockLogList)) {
currentUserStatus = ActUserStatusConstant.UPDATE_CLOCK;
}
} else if (currentTime.before(actInfoEntity.getSignupEndTime())) {
/*报名截至时间前
1当前用户未报名底部显示按钮 我要报名
2当前用户已报名底部显示按钮 取消报名
3当前用户未报名且活动名额已满底部显示按钮 已报满*/
2当前用户未报名且活动名额已满底部显示按钮 已报满
3当前用户已报名底部显示按钮 取消报名
4当前用户已经取消报名的可再次报名-我要报名*/
if (null == actUserRelationEntity && (actInfoEntity.getActQuota() > actInfoEntity.getSignupNum())) {
currentUserStatus = ActUserStatusConstant.SIGN_UP;
} else if (null == actUserRelationEntity && (actInfoEntity.getActQuota().equals(actInfoEntity.getSignupNum()))) {
currentUserStatus = ActUserStatusConstant.FULL_SIGN_UP;
} else if (null != actUserRelationEntity
&& (actUserRelationEntity.getStatus().equals("0")
|| actUserRelationEntity.getStatus().equals("1"))) {
&& (ActUserRelationStatusConstant.SIGN_UP.equals(actUserRelationEntity.getStatus())
|| ActUserRelationStatusConstant.APPROVED.equals(actUserRelationEntity.getStatus()))) {
currentUserStatus = ActUserStatusConstant.CANCEL_SIGN_UP;
} else if (null != actUserRelationEntity && ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserRelationEntity.getStatus())) {
currentUserStatus = ActUserStatusConstant.SIGN_UP;
}
} else if (currentTime.after(actInfoEntity.getSignupEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) {
/*报名截至时间到活动未开始时间段内
1当前用户未报名底部显示按钮 未开始
2当前用户已报名且审核通过 取消报名
3当前用户已报名审核不通过 未开始*/
1当前用户未报名底部显示按钮 -未开始
2当前用户已经取消报名的-未开始
3当前用户已报名且审核通过未审核 -取消报名
4当前用户已报名审核不通过 -未开始*/
if (null == actUserRelationEntity) {
currentUserStatus = ActUserStatusConstant.NOT_STARTED;
} else if (null != actUserRelationEntity && actUserRelationEntity.getStatus().equals("1")) {
} else if (null != actUserRelationEntity && ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserRelationEntity.getStatus())) {
currentUserStatus = ActUserStatusConstant.NOT_STARTED;
} else if (null != actUserRelationEntity
&& (ActUserRelationStatusConstant.APPROVED.equals(actUserRelationEntity.getStatus())
|| ActUserRelationStatusConstant.SIGN_UP.equals(actUserRelationEntity.getStatus()))) {
currentUserStatus = ActUserStatusConstant.CANCEL_SIGN_UP;
} else if (null != actUserRelationEntity && actUserRelationEntity.getStatus().equals("4")) {
} else if (null != actUserRelationEntity && ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserRelationEntity.getStatus())) {
currentUserStatus = ActUserStatusConstant.NOT_STARTED;
}
}

10
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java

@ -33,6 +33,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.ActStateConstant;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.logs.PointsLogsDTO;
import com.elink.esua.epdc.modules.activity.dao.ActUserClockLogDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity;
import com.elink.esua.epdc.modules.activity.redis.ActUserClockLogRedis;
import com.elink.esua.epdc.modules.activity.service.*;
@ -42,7 +43,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.elink.esua.epdc.modules.activity.dao.ActUserClockLogDao;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.Arrays;
@ -178,8 +178,7 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
actUserRelationService.update(actUserRelationEntity);
//存储活动日志表 epdc_act_user_log
ActUserLogDTO actUserLogDTO = new ActUserLogDTO();
actUserLogDTO.setUserId(checkDTO.getUserId());
actUserLogDTO.setActId(dto.getActId());
actUserLogDTO.setActUserRelationId(checkDTO.getId());
actUserLogDTO.setOperationType(dto.getStatus());
actUserLogDTO.setOperationTime(new Date());
actUserLogService.save(actUserLogDTO);
@ -249,8 +248,7 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
String clockId = entity.getId();
//存储活动日志表 epdc_act_user_log
ActUserLogDTO actUserLogDTO = new ActUserLogDTO();
actUserLogDTO.setUserId(actUserRelationDTO.getUserId());
actUserLogDTO.setActId(actUserRelationDTO.getActId());
actUserLogDTO.setActUserRelationId(actUserRelationDTO.getId());
actUserLogDTO.setOperationType("2");//打卡
actUserLogDTO.setOperationTime(new Date());
actUserLogService.save(actUserLogDTO);
@ -269,4 +267,4 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
return new Result().ok("打卡成功");
}
}
}

51
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java

@ -30,6 +30,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.ActStateConstant;
import com.elink.esua.epdc.constant.ActUserRelationStatusConstant;
import com.elink.esua.epdc.modules.activity.dao.ActInfoDao;
import com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
@ -140,8 +141,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
updateById(updateEntity);
//存储活动日志表 epdc_act_user_log
ActUserLogDTO actUserLogDTO = new ActUserLogDTO();
actUserLogDTO.setUserId(entity.getUserId());
actUserLogDTO.setActId(entity.getActId());
actUserLogDTO.setActUserRelationId(dto.getId());
actUserLogDTO.setOperationType(dto.getStatus());
actUserLogDTO.setFailureReason(dto.getFailureReason());
actUserLogDTO.setOperationTime(new Date());
@ -162,42 +162,44 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
public Result activitySignUp(ActUserRelationDTO actUserRelationDTO) {
ActInfoDTO actInfoDTO = actInfoDao.queryActSignupNum(actUserRelationDTO.getActId());
//判断报名是否已满
if (actInfoDTO.getActQuotaCategory() != 0 && actInfoDTO.getActQuota() == actInfoDTO.getSignupNum()){
return new Result().error("已报满");
if (actInfoDTO.getActQuotaCategory() != 0 && actInfoDTO.getActQuota().equals(actInfoDTO.getSignupNum())) {
return new Result().error("活动已报满");
}
//查询是否已报名
int data = baseDao.isSignUp(actUserRelationDTO.getUserId(),actUserRelationDTO.getActId());
if(data == 0){
ActUserRelationEntity actUserRelationEntity = baseDao.selectOneByUserIdAndActId(actUserRelationDTO.getUserId(), actUserRelationDTO.getActId());
if (null == actUserRelationEntity || (ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserRelationEntity.getStatus())
|| ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserRelationEntity.getStatus()))) {
//未报名该活动,进行报名
//存储活动人员关系表
ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class);
insert(entity);
if (null != actUserRelationEntity) {
entity.setId(actUserRelationEntity.getId());
baseDao.updateById(entity);
} else {
insert(entity);
}
//存储活动日志表
ActUserLogDTO actUserLogDTO = new ActUserLogDTO();
actUserLogDTO.setActId(actUserRelationDTO.getActId());
actUserLogDTO.setUserId(actUserRelationDTO.getUserId());
actUserLogDTO.setOperationType("0");//报名
actUserLogDTO.setActUserRelationId(entity.getId());
actUserLogDTO.setOperationType(ActUserRelationStatusConstant.SIGN_UP);
actUserLogDTO.setOperationTime(new Date());
actUserLogService.save(actUserLogDTO);
//更新epdc_act_info的已报名名额
actInfoDTO.setSignupNum(actInfoDTO.getSignupNum() + 1);
actInfoService.update(actInfoDTO);
}else{
return new Result().error("已报名");
} else {
return new Result().error("已报名");
}
return new Result().ok("报名成功");
}
@Override
public Result activityCancelSignUp(AppActUserCancelsignupDTO appActUserCancelsignupDTO) {
//查询是否已报名
List<ActUserRelationDTO> data = baseDao.selectOneActUserRelationInfo(appActUserCancelsignupDTO.getUserId(),appActUserCancelsignupDTO.getActId());
if(data != null && data.size() > 0){
List<ActUserRelationDTO> data = baseDao.selectOneActUserRelationInfo(appActUserCancelsignupDTO.getUserId(), appActUserCancelsignupDTO.getActId());
if (data != null && data.size() > 0) {
ActUserRelationDTO actUserRelationDTO = data.get(0);
actUserRelationDTO.setStatus("3");//取消报名
actUserRelationDTO.setStatus(ActUserRelationStatusConstant.CANCEL_SIGN_UP);//取消报名
actUserRelationDTO.setFailureReason(appActUserCancelsignupDTO.getFailureReason());//取消报名原因
//已报名该活动,进行取消报名
//更新活动人员关系表
@ -205,12 +207,11 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
updateById(entity);
//存储活动日志表
ActUserLogDTO actUserLogDTO = new ActUserLogDTO();
actUserLogDTO.setActId(actUserRelationDTO.getActId());
actUserLogDTO.setUserId(actUserRelationDTO.getUserId());
actUserLogDTO.setOperationType("3");//取消报名
actUserLogDTO.setActUserRelationId(actUserRelationDTO.getId());
actUserLogDTO.setOperationType(ActUserRelationStatusConstant.CANCEL_SIGN_UP);//取消报名
actUserLogDTO.setOperationTime(new Date());
actUserLogDTO.setFailureReason(appActUserCancelsignupDTO.getFailureReason());
actUserLogService.save(actUserLogDTO);
//更新epdc_act_info的已报名名额
ActInfoDTO actInfoDTO = actInfoDao.queryActSignupNum(actUserRelationDTO.getActId());
actInfoDTO.setSignupNum(actInfoDTO.getSignupNum() - 1);
@ -218,7 +219,6 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
}else{
return new Result().error("未报名");
}
return new Result().ok("取消报名成功");
}
@ -299,8 +299,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
updateById(entity);
// 存储活动日志表
ActUserLogDTO actUserLogDTO = new ActUserLogDTO();
actUserLogDTO.setActId(actUserRelationDTO.getActId());
actUserLogDTO.setUserId(actUserRelationDTO.getUserId());
actUserLogDTO.setActUserRelationId(entity.getId());
actUserLogDTO.setOperationType(actUserDefaultState);// 默认状态
actUserLogDTO.setOperationTime(new Date());
actUserLogService.save(actUserLogDTO);
@ -312,4 +311,4 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
return new Result().ok("该活动对已报名的志愿者自动审核成功");
}
}
}

4
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml

@ -5,8 +5,6 @@
<resultMap type="com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity" id="actUserLogMap">
<result property="id" column="ID"/>
<result property="actId" column="ACT_ID"/>
<result property="userId" column="USER_ID"/>
<result property="operationType" column="OPERATION_TYPE"/>
<result property="failureReason" column="FAILURE_REASON"/>
<result property="operationTime" column="OPERATION_TIME"/>
@ -18,4 +16,4 @@
</resultMap>
</mapper>
</mapper>

27
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

@ -41,17 +41,12 @@
<result property="failureReason" column="FAILURE_REASON"/>
<result property="auditTime" column="AUDIT_TIME"/>
<result property="signupTime" column="SIGNUP_TIME"/>
<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>
<select id="isSignUp" resultType="int" parameterType="String">
select count(*) countNum from epdc_act_user_relation where USER_ID = #{userId}
and ACT_ID = #{actId}
and status not in ('3' ,'4')
and status in ('0' ,'1')
and DEL_FLAG = 0
</select>
@ -60,7 +55,7 @@
from epdc_act_user_relation
where USER_ID = #{userId}
and ACT_ID = #{actId}
and status not in ('3' ,'4')
and status in ('0' ,'1')
</select>
<select id="getActUserRelationPageFromPC" resultMap="actUserRelationResultMap">
SELECT
@ -117,11 +112,6 @@
<result property="failureReason" column="FAILURE_REASON"/>
<result property="auditTime" column="AUDIT_TIME"/>
<result property="signupTime" column="SIGNUP_TIME"/>
<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>
<select id="getActUserClockPageFromPC" resultMap="actUserClockResultMap">
SELECT
@ -239,11 +229,20 @@
</foreach>
</select>
<select id="selectListActUserInfo" resultType="com.elink.esua.epdc.activity.ActUserRelationDTO" parameterType="String">
<select id="selectListActUserInfo" resultType="com.elink.esua.epdc.activity.ActUserRelationDTO"
parameterType="String">
select ID,ACT_ID,USER_ID,FACE_IMG,NICKNAME,REAL_NAME,PARTY_FLAG
from epdc_act_user_relation
where ACT_ID = #{actId}
and status = '0'
</select>
</mapper>
<!-- 根据用户id+活动id活动信息表 -->
<select id="selectOneByUserIdAndActId" parameterType="map"
resultType="com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity">
select * from epdc_act_user_relation eaur
where eaur.DEL_FLAG='0'
and eaur.ACT_ID=#{actId}
and eaur.USER_ID=#{userId}
</select>
</mapper>

Loading…
Cancel
Save