活动-用户相关功能
This commit is contained in:
parent
16e6520546
commit
8cf8e5be32
@ -115,12 +115,11 @@ public class UserController {
|
|||||||
* 用户查询活动详细信息。
|
* 用户查询活动详细信息。
|
||||||
*
|
*
|
||||||
* @param activityId 活动ID
|
* @param activityId 活动ID
|
||||||
* @param wxOpenId OpenID
|
|
||||||
* @return 登陆结果
|
* @return 登陆结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("activity/info")
|
@GetMapping("activity/info")
|
||||||
public JsonResult<?> activityInfo(@NotNull(message = "活动ID不能为空") Long activityId,@NotNull(message = "OpenID不能为空") String wxOpenId) {
|
public JsonResult<?> activityInfo(@NotNull(message = "活动ID不能为空") Long activityId) {
|
||||||
ActivityInfo activityInfo = userService.activityInfo(activityId,wxOpenId);
|
ActivityInfo activityInfo = userService.activityInfo(activityId);
|
||||||
return JsonResult.success(activityInfo);
|
return JsonResult.success(activityInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,5 +18,5 @@ public interface UserService extends IService<User> {
|
|||||||
|
|
||||||
void registration(RegistrationVo registrationVo);
|
void registration(RegistrationVo registrationVo);
|
||||||
|
|
||||||
ActivityInfo activityInfo(Long activityId, String wxOpenId);
|
ActivityInfo activityInfo(Long activityId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActivityInfo activityInfo(Long activityId, String wxOpenId) {
|
public ActivityInfo activityInfo(Long activityId) {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
.where(ACTIVITY.ACTIVITY_ID.eq(activityId));
|
.where(ACTIVITY.ACTIVITY_ID.eq(activityId));
|
||||||
ActivityInfo activityInfo = activityMapper.selectObjectByQueryAs(queryWrapper, ActivityInfo.class);
|
ActivityInfo activityInfo = activityMapper.selectObjectByQueryAs(queryWrapper, ActivityInfo.class);
|
||||||
@ -128,17 +128,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|||||||
if (activityInfo.getRegistrationEndTime().isBefore(LocalDateTime.now())) {
|
if (activityInfo.getRegistrationEndTime().isBefore(LocalDateTime.now())) {
|
||||||
activityInfo.setPossibleRegister(Boolean.FALSE);
|
activityInfo.setPossibleRegister(Boolean.FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activityInfo.getLimitRegister() == 1) {
|
|
||||||
queryWrapper.clear();
|
|
||||||
queryWrapper.where(ACTIVITY_USER.ACTIVITY_ID.eq(activityId))
|
|
||||||
.where(USER.WX_OPEN_ID.eq(wxOpenId))
|
|
||||||
.leftJoin(USER).on(USER.USER_ID.eq(ACTIVITY_USER.USER_ID));
|
|
||||||
ActivityUser selected = activityUserMapper.selectOneByQuery(queryWrapper);
|
|
||||||
if (selected == null) {
|
|
||||||
activityInfo.setPossibleRegister(Boolean.FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return activityInfo;
|
return activityInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user