|
|
@ -9,6 +9,7 @@ import com.luoo.user.dao.UserPointLogDao;
|
|
|
|
import com.luoo.user.dto.point.DrawDTO;
|
|
|
|
import com.luoo.user.dto.point.DrawDTO;
|
|
|
|
import com.luoo.user.dto.point.UserPointLogSearchDto;
|
|
|
|
import com.luoo.user.dto.point.UserPointLogSearchDto;
|
|
|
|
import com.luoo.user.pojo.*;
|
|
|
|
import com.luoo.user.pojo.*;
|
|
|
|
|
|
|
|
import com.luoo.user.vo.point.UserInvitationLogVO;
|
|
|
|
import com.luoo.user.vo.point.UserPointLogVO;
|
|
|
|
import com.luoo.user.vo.point.UserPointLogVO;
|
|
|
|
import com.querydsl.core.BooleanBuilder;
|
|
|
|
import com.querydsl.core.BooleanBuilder;
|
|
|
|
import com.querydsl.core.types.Projections;
|
|
|
|
import com.querydsl.core.types.Projections;
|
|
|
@ -23,6 +24,7 @@ import enums.PointEnums;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
|
@ -124,7 +126,6 @@ public class UserPointLogService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 通过任务添加积分明细,直接使用userId
|
|
|
|
* 通过任务添加积分明细,直接使用userId
|
|
|
|
*
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void addByTaskDailyAndUserId(String taskPointId, String userId) {
|
|
|
|
public void addByTaskDailyAndUserId(String taskPointId, String userId) {
|
|
|
|
UserPointLog userPointLog = UserPointLog.builder()
|
|
|
|
UserPointLog userPointLog = UserPointLog.builder()
|
|
|
@ -301,6 +302,27 @@ public class UserPointLogService {
|
|
|
|
addByTaskDaily(TaskPointIdConstants.SHARE_JOURNAL, token);
|
|
|
|
addByTaskDaily(TaskPointIdConstants.SHARE_JOURNAL, token);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UserInvitationLogVO getUserInvitationLog(String token) {
|
|
|
|
|
|
|
|
UserLoginDto userLoginDto = jwtUtil.getUser();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String userId = userLoginDto.getUserId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> taskPointIds = new ArrayList<>();
|
|
|
|
|
|
|
|
taskPointIds.add(TaskPointIdConstants.NEW_USER_INVITE);
|
|
|
|
|
|
|
|
taskPointIds.add(TaskPointIdConstants.INVITE_USER_3);
|
|
|
|
|
|
|
|
taskPointIds.add(TaskPointIdConstants.INVITE_USER_6);
|
|
|
|
|
|
|
|
taskPointIds.add(TaskPointIdConstants.INVITE_USER_10);
|
|
|
|
|
|
|
|
taskPointIds.add(TaskPointIdConstants.INVITE_USER_20);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<UserPointLog> userPointLogByTaskPointIdInAndUserId = userPointLogDao.findUserPointLogByTaskPointIdInAndUserId(taskPointIds, userId);
|
|
|
|
|
|
|
|
UserInvitationLogVO userInvitationLogVO = new UserInvitationLogVO();
|
|
|
|
|
|
|
|
userInvitationLogVO.setNum(userPointLogByTaskPointIdInAndUserId.isEmpty() ? 0 : userPointLogByTaskPointIdInAndUserId.size());
|
|
|
|
|
|
|
|
userInvitationLogVO.setPoint(userPointLogByTaskPointIdInAndUserId.isEmpty() ? 0 :
|
|
|
|
|
|
|
|
userPointLogByTaskPointIdInAndUserId.stream().map(UserPointLog::getScore).reduce(0, Integer::sum)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
return userInvitationLogVO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 分页查询用户积分列表
|
|
|
|
* 分页查询用户积分列表
|
|
|
|
*
|
|
|
|
*
|
|
|
|