luodangjia
2024-10-31 21dbee73f1310f6c57efdc70982d58e354154183
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -5,6 +5,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -585,6 +586,8 @@
        return R.ok();
    }
    @Resource
    private TAppUserVipDetailService appUserVipDetailService;
    @ApiOperation(value = "个人中心信息", tags = {"小程序-个人中心"})
    @GetMapping(value = "/user/info")
@@ -601,12 +604,14 @@
        if (byId.getVipEndTime()==null||byId.getVipEndTime().isBefore(LocalDateTime.now())){
            appUserInfoDto.setIsVip(0);
        }else {
            TAppUserVipDetail one = appUserVipDetailService.getOne(new LambdaQueryWrapper<TAppUserVipDetail>()
                    .eq(TAppUserVipDetail::getAppUserId, userId)
                    .eq(TAppUserVipDetail::getVipId, byId.getVipId())
                    .last(" and now() between start_time and end_time"));
            Long count = appCouponService.lambdaQuery().eq(TAppCoupon::getDetailId, one.getId()).count();
            appUserInfoDto.setVipCouponNum(count);
            appUserInfoDto.setIsVip(1);
            appUserInfoDto.setVipExpireTime(byId.getVipEndTime());
@@ -765,8 +770,11 @@
    @PostMapping(value = "/user/invite/page")
    public R<Page<TInviteUser>> invitePage(@RequestBody BasePage basePage) {
        Long userId = tokenService.getLoginUserApplet().getUserId();
        Page<TInviteUser> page = inviteUserService.lambdaQuery().eq(TInviteUser::getAppUserId, userId).isNotNull(TInviteUser::getAward).orderByDesc(TInviteUser::getCreateTime).page(Page.of(basePage.getPageCurr(), basePage.getPageSize()));
        for (TInviteUser record : page.getRecords()) {
            TAppUser byId = appUserService.getById(record.getBeInvitedAppUserId());
            record.setAvatar(byId.getAvatar());
        }
        return R.ok(page);
    }
@@ -1115,6 +1123,10 @@
    public R getModel(String id) throws Exception {
        String modelById = CarBrandUtil.getModelById(id);
        JSONObject jsonObject = JSON.parseObject(modelById);
        Integer code = jsonObject.getInteger("code");
        if (code==701){
            return R.fail("当前品牌暂无分类");
        }
        JSONArray data = jsonObject.getJSONArray("data");
        JSONArray backList = new JSONArray();
        for (Object datum : data) {