|
|
@@ -123,11 +123,12 @@ public class UserController {
|
|
|
@GetMapping("/personal")
|
|
|
public Result<UserPersonalView> getPersonalView(String customId) {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ String userIds = userIdList.toString().replace("[", "(").replace("]", ")");
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
List<RenewalView> renewalViews = beanSearcher.searchAll(RenewalView.class, builder
|
|
|
.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
|
|
|
- .field(RenewalView::getUserId, userIds).op(Operator.InList)
|
|
|
+ .field(RenewalView::getUserId, userIdList).op(Operator.InList)
|
|
|
.field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
|
|
|
.orderBy(RenewalView::getExpiryTime).asc()
|
|
|
.onlySelect(RenewalView::getExpiryTime)
|
|
|
@@ -161,7 +162,7 @@ public class UserController {
|
|
|
personalView.setIsNoPayment(orderDon != null ? true : false);
|
|
|
//礼品卡可用数量
|
|
|
Number numOfGiftCard = beanSearcher.searchCount(GiftCardUserRecordView.class, MapUtils.builder()
|
|
|
- .put("uid", String.format("((user_id = %s and is_send = 0) or (to_user_id = %s and is_used = 0))", userId, userId))
|
|
|
+ .put("uid", String.format("((user_id in %s and is_send = 0) or (to_user_id in %s and is_used = 0))", userIds, userIds))
|
|
|
.field(GiftCardUserRecordView::getIsPay, true)
|
|
|
.build());
|
|
|
personalView.setNumOfGiftCard(numOfGiftCard.intValue());
|
|
|
@@ -396,10 +397,12 @@ public class UserController {
|
|
|
@GetMapping("/get/giftCard")
|
|
|
public Result<SearchResult<GiftCardUserPayFrontView>> getGiftCard() {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- String condition = String.format("and (user_id = %s or to_user_id = %s)", userId, userId);
|
|
|
- SearchResult<GiftCardUserPayFrontView> view = beanSearcher.search(GiftCardUserPayFrontView.class, MapUtils.builder()
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ String userIds = userIdList.toString().replace("[", "(").replace("]", ")");
|
|
|
+ String condition = String.format("and (user_id in %s or to_user_id in %s)", userIds, userIds);
|
|
|
+ SearchResult<GiftCardUserPayFrontView> view = beanSearcher.search(GiftCardUserPayFrontView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.put("condition", condition)
|
|
|
- .put("uid", userId)
|
|
|
+ .put("uid", userIds)
|
|
|
.orderBy(GiftCardUserRecordView::getIsUsed).asc()
|
|
|
.orderBy(GiftCardUserPayFrontView::getId).desc().build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(view);
|
|
|
@@ -411,10 +414,12 @@ public class UserController {
|
|
|
@GetMapping("/get/available/giftCard")
|
|
|
public Result<List<GiftCardUserPayFrontView>> getAvailGiftCard() {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- String condition = String.format("and to_user_id = %s", userId);
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ String userIds = userIdList.toString().replace("[", "(").replace("]", ")");
|
|
|
+ String condition = String.format("and to_user_id in %s", userIds);
|
|
|
List<GiftCardUserPayFrontView> view = beanSearcher.searchAll(GiftCardUserPayFrontView.class, MapUtils.builder()
|
|
|
.put("condition", condition)
|
|
|
- .put("uid", userId)
|
|
|
+ .put("uid", userIds)
|
|
|
//现金卡
|
|
|
.field(GiftCardUserPayFrontView::getGcType, 1)
|
|
|
.orderBy(GiftCardUserRecordView::getIsUsed).asc()
|