Pu Zhibing
2025-03-06 1b81b84edaeea9b200c622e4a34c49b4b1aaac92
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
@@ -344,17 +344,29 @@
    @ApiOperation(value = "购买会员", tags = {"小程序-个人中心"})
    @GetMapping("/vipInfo/pay")
    public Object vipInfoPay(@RequestParam("vipId")Integer vipId,@RequestParam("buyType") Integer buyType,
        @RequestParam("payType") Integer payType
    ) {
        @RequestParam("payType") Integer payType) {
        LocalDateTime now = LocalDateTime.now();
        TVip byId = vipService.getById(vipId);
        if (byId==null){
            return R.ok("当前会员不存在,请刷新后重试。");
        }
        if(byId.getReveal() == 0){
            return R.ok("无效的会员");
        }
        if(1 == buyType && byId.getMonthlyCardDiscountReveal() == 0){
            return R.ok("无效的会员");
        }
        if(2 == buyType && byId.getSeasonCardDiscountReveal() == 0){
            return R.ok("无效的会员");
        }
        if(3 == buyType && byId.getAnnualCardReveal() == 0){
            return R.ok("无效的会员");
        }
        BigDecimal payMoney = BigDecimal.ZERO;
        BigDecimal discountMoney = BigDecimal.ZERO;
        BigDecimal discount = BigDecimal.ZERO;
        LocalDateTime now = LocalDateTime.now();
        switch (buyType){
            case 1:
                if (byId.getMonthlyCardDiscountStart()!=null&&(now.isAfter(byId.getMonthlyCardDiscountStart())&&now.isBefore(byId.getMonthlyCardDiscountEnd()))){