无关风月
20 小时以前 71656127d2d3fa023eb767343a9ac01172f2802d
cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
@@ -130,7 +130,7 @@
        // 使用 Stream + 手动拷贝提升性能和可读性(或使用 MapStruct)
        vipDetailVOS = list.stream().map(vipDetail -> {
            VipDetailVO vo = new VipDetailVO();
            BeanUtils.copyProperties(vo, vipDetail); // 注意参数顺序是否正确
            BeanUtils.copyProperties(vipDetail, vo); // 注意参数顺序是否正确
            return vo;
        }).collect(Collectors.toList());
        List<Coupon> coupons = couponService.list();
@@ -947,5 +947,12 @@
    @PostMapping("/base/coupon/updateType")
    public void updateType(@RequestBody Long id) {
        couponService.updateType(id);
        UserCoupon userCoupon = userCouponService.getById(id);
        if (userCoupon.getIsVipGrant()!=null&& userCoupon.getIsVipGrant()==1){
            VipDetail vipDetailServiceById = vipDetailService.getById(userCoupon.getVipDetailId());
            vipDetailServiceById.setUseTime(new Date());
            vipDetailServiceById.setStatus(2);
        }
    }
}