diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java index fcfad239b..bc26710e3 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java +++ b/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; -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java index ec7fb1e33..d03cd1f68 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java +++ b/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; /** diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserRelationStatusConstant.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserRelationStatusConstant.java new file mode 100644 index 000000000..e087f504f --- /dev/null +++ b/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"; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java index c564e594a..b6805e9c9 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java +++ b/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 { /** * 自动审核 + * * @param actId * @return */ - List selectListActUserInfo(@Param("actId")String actId); + List selectListActUserInfo(@Param("actId") String actId); List getActUserClockPageFromPC(Map params); -} \ No newline at end of file + + /** + * @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); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java index 1d0f91068..46b6e18d0 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java +++ b/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; -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java index c8416289e..db0a0e475 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java +++ b/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; -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java index 08eb3c127..d7441d34f 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java +++ b/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().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 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 actUserClockLogList = new ArrayList(); @@ -276,11 +286,11 @@ public class ActInfoServiceImpl extends BaseServiceImpl 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; } } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java index 7dfc8504c..849d1c01a 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java +++ b/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 data = baseDao.selectOneActUserRelationInfo(appActUserCancelsignupDTO.getUserId(),appActUserCancelsignupDTO.getActId()); - if(data != null && data.size() > 0){ + List 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 - - @@ -18,4 +16,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml index 4f64a85ab..8896136d4 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml @@ -41,17 +41,12 @@ - - - - - @@ -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 @@ -239,11 +229,20 @@ - 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' - \ No newline at end of file + + +