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