| | |
| | | if (vo.getCouponType()==4){ |
| | | List<String> goodNames = new ArrayList<>(); |
| | | if (vo.getForGoodIds().equals("-1")){ |
| | | goodNames.add("全部商品"); |
| | | List<Goods> data1 = goodsClient.getAllGoods().getData(); |
| | | List<String> collect = data1.stream().map(Goods::getName).collect(Collectors.toList()); |
| | | goodNames.addAll(collect); |
| | | }else{ |
| | | String[] split = vo.getForGoodIds().split(","); |
| | | R<List<Goods>> goodsById = goodsClient.getGoodsById(split); |
| | |
| | | userCouponService.updateById(userCoupon); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户优惠券详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/getUserCoupon") |
| | | public R<UserCoupon> getUserCoupon(@RequestParam("id") Long id){ |
| | | UserCoupon userCoupon = userCouponService.getById(id); |
| | | return R.ok(userCoupon); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑用户优惠券 |
| | | * @return |
| | | */ |
| | | @PostMapping("/editUserCoupon") |
| | | public R editUserCoupon(@RequestBody UserCoupon userCoupon){ |
| | | userCouponService.updateById(userCoupon); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |