luofl
2025-02-11 d20ede4470f761d0c76a0c993170ebbd96a1bcc1
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -98,7 +98,9 @@
                    List<Goods> data1 = goodsClient.getAllGoods().getData();
                    List<String> collect = data1.stream().map(Goods::getName).collect(Collectors.toList());
                    goodNames.addAll(collect);
                }else{
                }else if(StringUtils.isEmpty(data.getForGoodIds())){
                    goodNames.addAll(JSON.parseArray(data.getGoodsNameJson(), String.class));
                }else {
                    String[] split = vo.getForGoodIds().split(",");
                    R<List<Goods>> goodsById = goodsClient.getGoodsById(split);
                    if (goodsById.getData()!=null){
@@ -241,15 +243,17 @@
            byId.setLavePoint(byId.getLavePoint() - point);
            appUserService.updateById(byId);
            
            UserPoint userPoint = new UserPoint();
            userPoint.setType(11);
            userPoint.setHistoricalPoint(lavePoint);
            userPoint.setVariablePoint(point);
            userPoint.setBalance(byId.getLavePoint());
            userPoint.setAppUserId(userid);
            userPoint.setObjectId(Long.valueOf(data.getId()));
            userPoint.setCreateTime(LocalDateTime.now());
            userPointService.save(userPoint);
            if(point > 0){
                UserPoint userPoint = new UserPoint();
                userPoint.setType(15);
                userPoint.setHistoricalPoint(lavePoint);
                userPoint.setVariablePoint(point);
                userPoint.setBalance(byId.getLavePoint());
                userPoint.setAppUserId(userid);
                userPoint.setObjectId(Long.valueOf(data.getId()));
                userPoint.setCreateTime(LocalDateTime.now());
                userPointService.save(userPoint);
            }
        }
        //增加优惠券记录,根据时间类型设置开始结束时间
        UserCoupon userCoupon = new UserCoupon();