From 2bc35df79fca920ad584a82b5ea7b35b6ca7b8a0 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期三, 15 一月 2025 10:12:57 +0800 Subject: [PATCH] 12.18 --- ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java | 30 +++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 1 deletions(-) diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java index b1642bc..33f4f12 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java @@ -134,7 +134,21 @@ @GetMapping("/user/list") @ApiOperation(value = "积分管理-用户积分明细(必传用户id)", tags = "后台") public R<Page<UserPoint>> userlist(UserPoint userPoint) { - Page<UserPoint> page = userPointService.lambdaQuery().eq(UserPoint::getAppUserId, userPoint.getAppUserId()).orderByDesc(UserPoint::getCreateTime).page(Page.of(userPoint.getPageNum(), userPoint.getPageSize())); + Page<UserPoint> page = userPointService.lambdaQuery() + .eq(userPoint.getType()!=null,UserPoint::getType, userPoint.getType()) + .eq(UserPoint::getAppUserId, userPoint.getAppUserId()) + .orderByDesc(UserPoint::getCreateTime) + .page(Page.of(userPoint.getPageNum(), userPoint.getPageSize())); + for (UserPoint record : page.getRecords()) { + int i = record.getHistoricalPoint() - record.getBalance(); + if (i>0){ + record.setVariableType(2); + }else if (i<0){ + record.setVariableType(1); + }else{ + record.setVariableType(0); + } + } return R.ok(page); } @@ -173,5 +187,19 @@ List<UserPoint> list = userPointService.list(queryWrapper); return R.ok(list); } + + + + /** + * 判断当天是否分享获得过积分 + * @param appUserId + * @return + */ + @PostMapping("/judgmentDailyShare") + public R<Boolean> judgmentDailyShare(@RequestParam("appUserId") Long appUserId){ + long count = userPointService.count(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUserId) + .eq(UserPoint::getType, 4).last(" and DATE_FORMAT(NOW(), '%Y-%m-%d') = DATE_FORMAT(create_time, '%Y-%m-%d')")); + return R.ok(count != 0); + } } -- Gitblit v1.7.1