From 70fe7a1d54910f420de5c57f13490e22de32fd71 Mon Sep 17 00:00:00 2001 From: huangyawei Date: Fri, 18 Oct 2024 19:16:29 +0800 Subject: [PATCH] =?UTF-8?q?release-=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E6=97=A5=E5=BF=97=E6=9F=A5=E8=AF=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/luoo/user/controller/PointController.java | 2 +- .../com/luoo/user/service/UserPointLogService.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/luoo_user/src/main/java/com/luoo/user/controller/PointController.java b/luoo_user/src/main/java/com/luoo/user/controller/PointController.java index 411a8d3..84494d8 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/PointController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/PointController.java @@ -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 = "用户积分日志列表") diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java b/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java index 5ba6ab9..fee4a7d 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java @@ -343,8 +343,10 @@ public class UserPointLogService { UserPointLogSearchDto userPointLogSearchDto, Integer page, Integer size) { - UserLoginDto userLoginDto = jwtUtil.getUser(); - userPointLogSearchDto.setUserId(userLoginDto.getUserId()); + 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");