release- 修复用户积分日志查询bug

release-2024-04-25
huangyawei 1 month ago
parent c74477f13a
commit 70fe7a1d54

@ -199,7 +199,7 @@ public class PointController {
@ApiParam(value = "页码", required = true) @PathVariable Integer page,
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size) {
return Result.success(
userPointLogService.getUserPointLogList(token, userPointLogSearchDto, page, size));
userPointLogService.getUserPointLogList(null, userPointLogSearchDto, page, size));
}
@ApiOperation(value = "2.3.用户积分日志列表APP", notes = "用户积分日志列表")

@ -343,8 +343,10 @@ public class UserPointLogService {
UserPointLogSearchDto userPointLogSearchDto, Integer page,
Integer size) {
UserLoginDto userLoginDto = jwtUtil.getUser();
if (token != null) {
UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token);
userPointLogSearchDto.setUserId(userLoginDto.getUserId());
}
BooleanBuilder booleanBuilder = new BooleanBuilder();
QUserPointLog qUserPointLog = QUserPointLog.userPointLog;
checkCondition(booleanBuilder, qUserPointLog, userPointLogSearchDto);
@ -382,13 +384,13 @@ public class UserPointLogService {
}
public void checkCondition(BooleanBuilder booleanBuilder, QUserPointLog qUserPointLog, UserPointLogSearchDto userPointLogSearchDto) {
if (!StringUtils.isEmpty(userPointLogSearchDto.getUserId())) {
if (StringUtils.isNotBlank(userPointLogSearchDto.getUserId())) {
booleanBuilder.and(qUserPointLog.createUser.eq(userPointLogSearchDto.getUserId()));
}
if (userPointLogSearchDto.getType() != null) {
booleanBuilder.and(qUserPointLog.type.eq(userPointLogSearchDto.getType()));
}
if (!StringUtils.isEmpty(userPointLogSearchDto.getCreateMonth())) {
if (StringUtils.isNotBlank(userPointLogSearchDto.getCreateMonth())) {
// 判断userPointLogSearchDto.getCreateMonth() 是否是当月时间
LocalDate now = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");

Loading…
Cancel
Save