From 7473e0157c4f687c354ec351c3a22a40d1788ed5 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 28 八月 2024 10:41:31 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java index 951755c..a106416 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java @@ -513,7 +513,7 @@ appUserInfoDto.setVipExpireTime(byId.getVipEndTime()); } //判断当天是否签到 - Long count = signService.lambdaQuery().eq(TAppUserSign::getSignDay, LocalDate.now()).count(); + Long count = signService.lambdaQuery().eq(TAppUserSign::getAppUserId,userId).eq(TAppUserSign::getSignDay, LocalDate.now()).count(); appUserInfoDto.setIsSign(count>0?1:0); //获取当前拥有的优惠卷数量 Long coupons = appCouponService.lambdaQuery().eq(TAppCoupon::getAppUserId, userId).eq(TAppCoupon::getStatus, 1).count(); @@ -525,6 +525,7 @@ } appUserInfoDto.setUserCars(list); appUserInfoDto.setFirstAdd(byId.getFirstAdd()!=null?byId.getFirstAdd():0); + appUserInfoDto.setPoints(byId.getPoints()==null?0:byId.getPoints()); return R.ok(appUserInfoDto); @@ -544,6 +545,7 @@ InfoCouponDto infoCouponDto = new InfoCouponDto(); BeanUtils.copyProperties(coupon, infoCouponDto); infoCouponDto.setId(tAppCoupon.getId()); + infoCouponDto.setEndTime(tAppCoupon.getEndTime()); couponDtos1.add(infoCouponDto); } @@ -557,6 +559,7 @@ InfoCouponDto infoCouponDto = new InfoCouponDto(); BeanUtils.copyProperties(coupon, infoCouponDto); infoCouponDto.setId(tAppCoupon.getId()); + infoCouponDto.setEndTime(tAppCoupon.getEndTime()); couponDtos2.add(infoCouponDto); } for (TAppCoupon tAppCoupon : list2) { @@ -564,13 +567,19 @@ InfoCouponDto infoCouponDto = new InfoCouponDto(); BeanUtils.copyProperties(coupon, infoCouponDto); infoCouponDto.setId(tAppCoupon.getId()); + infoCouponDto.setEndTime(tAppCoupon.getEndTime()); couponDtos2.add(infoCouponDto); } ListInfoCouponDto listInfoCouponDto = new ListInfoCouponDto(); - listInfoCouponDto.setInfoCouponDtoList1(couponDtos1); - listInfoCouponDto.setInfoCouponDtoList2(couponDtos2); + if (type==1){ + listInfoCouponDto.setInfoCouponDtoList(couponDtos1); + }else { + listInfoCouponDto.setInfoCouponDtoList(couponDtos2); + } + listInfoCouponDto.setNum1(couponDtos1.size()); + listInfoCouponDto.setNum2(couponDtos2.size()); return R.ok(listInfoCouponDto); } @@ -808,6 +817,15 @@ return R.ok(); } + @PostMapping(value = "/user/points/change/down") + public R changeDown(@RequestBody PointChangeDto points) { + TAppUser byId = appUserService.getById(points.getUserId()); + pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()-points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF"); + byId.setPoints(byId.getPoints()-points.getPoints()); + appUserService.updateById(byId); + return R.ok(); + } + @ApiOperation(value = "添加编辑车辆", tags = {"小程序-个人中心-车辆"}) @PostMapping(value = "/user/car/addOrUpdate") public R carAdd(@RequestBody TAppUserCar appUserCar) { -- Gitblit v1.7.1