luodangjia
2024-08-28 7d797c3f197371bb66c8ed3e60327817e9f0364c
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) {