无关风月
2025-03-20 053492c159a2cb8f12e8a7f59675ef6516d31440
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -973,31 +973,9 @@
            } else if (giveVipDto.getType() == 3) {
                plusDay = 12;
            }
            BigDecimal bigDecimal = new BigDecimal("0");
            TVip info = vipClient.getInfo1(giveVipDto.getVipId()).getData();
            switch (giveVipDto.getType()){
                case 1:
                    bigDecimal = bigDecimal.add(info.getMonthlyCard()==null?new BigDecimal(0):info.getMonthlyCard());
                    break;
                case 2:
                    bigDecimal = bigDecimal.add(info.getSeasonCard()==null?new BigDecimal(0):info.getSeasonCard());
                    break;
                case 3:
                    bigDecimal = bigDecimal.add(info.getAnnualCard()==null?new BigDecimal(0):info.getAnnualCard());
                    break;
            }
            //增加vipDetail
            giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay,giveVipDto.getType());
            appUserService.updateById(nowUser);
            // 新增后台赠送记录
            TGrantVip tGrantVip = new TGrantVip();
            tGrantVip.setCode(OrderCodeUtil.getOrderCode("ZS"));
            tGrantVip.setAppUserId(nowUser.getId());
            tGrantVip.setVipId(giveVipDto.getVipId());
            tGrantVip.setOrderAmount(bigDecimal);
            tGrantVip.setCreateTime(LocalDateTime.now());
            tGrantVip.setAppUserId(nowUser.getId());
            orderClient.managementGiveVip(tGrantVip);
        }
        return R.ok();
    }