| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.service.CouponInfoService; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private UserCouponClient userCouponClient; |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "优惠劵管理-列表", tags = {"管理后台-活动管理"}) |
| | |
| | | @ApiOperation(value = "优惠劵管理-详情", tags = {"管理后台-活动管理"}) |
| | | public R<CouponInfo> detail(@RequestParam("id") Integer id) { |
| | | CouponInfo byId = couponInfoService.getById(id); |
| | | byId.setGoodsNameList(JSON.parseArray(byId.getGoodsNameJson(), String.class)); |
| | | String forGoodIds = byId.getForGoodIds(); |
| | | if (StringUtils.isNotEmpty(forGoodIds)){ |
| | | List<Goods> goods = goodsService.listByIds(Arrays.asList(forGoodIds.split(","))); |
| | | byId.setGoods(goods); |
| | | } |
| | | |
| | | return R.ok(byId); |
| | | } |
| | | |