|
@@ -89,9 +89,9 @@ public class CouponFrontController {
|
|
|
* 个人优惠券列表
|
|
* 个人优惠券列表
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/personal/list")
|
|
@GetMapping("/personal/list")
|
|
|
- public Result<Page<CouponUserView>> couponPersonalList(@RequestParam(defaultValue = "1") Long start, @RequestParam(defaultValue = "5") Long limit) {
|
|
|
|
|
|
|
+ public Result<Page<CouponUserView>> couponPersonalList(@RequestParam(defaultValue = "1") Long start, @RequestParam(defaultValue = "5") Long limit, Long couponId) {
|
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- Page<CouponUserView> page = couponUserMapper.couponPersonalList(userId, new Page<>(start, limit));
|
|
|
|
|
|
|
+ Page<CouponUserView> page = couponUserMapper.couponPersonalList(userId, new Page<>(start, limit), couponId);
|
|
|
page.getRecords().forEach(data -> {
|
|
page.getRecords().forEach(data -> {
|
|
|
String str = couponSkuMapper.selectGoodsSkuStr(data.getCouponId());
|
|
String str = couponSkuMapper.selectGoodsSkuStr(data.getCouponId());
|
|
|
data.setGoodsSkuStr(str.replaceAll(",", "/").replaceAll(";", ""));
|
|
data.setGoodsSkuStr(str.replaceAll(",", "/").replaceAll(";", ""));
|
|
@@ -146,14 +146,14 @@ public class CouponFrontController {
|
|
|
* 推荐优惠券列表
|
|
* 推荐优惠券列表
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/recommend/list")
|
|
@GetMapping("/recommend/list")
|
|
|
- public Result<Page<CouponRecommendView>> getRecommendList(@RequestParam(defaultValue = "1") Long start, @RequestParam(defaultValue = "5") Long limit) {
|
|
|
|
|
|
|
+ public Result<Page<CouponRecommendView>> getRecommendList(@RequestParam(defaultValue = "1") Long start, @RequestParam(defaultValue = "5") Long limit, Long couponId) {
|
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
CouponNewUserView couponNewUserView = beanSearcher.searchFirst(CouponNewUserView.class, MapUtils.builder().field(CouponNewUserView::getUserId, userId).op(Operator.Equal).build());
|
|
CouponNewUserView couponNewUserView = beanSearcher.searchFirst(CouponNewUserView.class, MapUtils.builder().field(CouponNewUserView::getUserId, userId).op(Operator.Equal).build());
|
|
|
Boolean isNewUser = true;
|
|
Boolean isNewUser = true;
|
|
|
if (couponNewUserView != null) {
|
|
if (couponNewUserView != null) {
|
|
|
isNewUser = false;
|
|
isNewUser = false;
|
|
|
}
|
|
}
|
|
|
- Page<CouponRecommendView> page = couponRecommendMapper.getRecommendCouponViewList(userId, isNewUser, new Page<>(start, limit));
|
|
|
|
|
|
|
+ Page<CouponRecommendView> page = couponRecommendMapper.getRecommendCouponViewList(userId, isNewUser, new Page<>(start, limit), couponId);
|
|
|
page.getRecords().forEach(data -> {
|
|
page.getRecords().forEach(data -> {
|
|
|
if (data.getCouponStatus() == CouponActiveView.CouponStatus.received) {
|
|
if (data.getCouponStatus() == CouponActiveView.CouponStatus.received) {
|
|
|
data.setValidStartTime(data.getUserValidStartTime());
|
|
data.setValidStartTime(data.getUserValidStartTime());
|