|
|
@@ -31,6 +31,7 @@ import com.cyksj.service.shop.YhShopFrontService;
|
|
|
import com.cyksj.service.user.UserBindRelationService;
|
|
|
import com.cyksj.service.user.UserLoginRecordService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
+import com.ejlchina.searcher.SearchResult;
|
|
|
import com.ejlchina.searcher.param.Operator;
|
|
|
import com.ejlchina.searcher.util.MapBuilder;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
@@ -43,7 +44,6 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.*;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.cyksj.enums.GatewayApiCode.GROUP_INDEX_ALREADY_BE_USER;
|
|
|
import static com.cyksj.enums.GatewayApiCode.GROUP_INDEX_NOT_FIND;
|
|
|
@@ -101,33 +101,31 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
private final static String VERIFY_CODE_SECRET = "q1w2e3";
|
|
|
|
|
|
@Override
|
|
|
- public List<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId) {
|
|
|
+ public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account) {
|
|
|
User u = userMapper.selectById(userId);
|
|
|
if (u == null) throw BusinessRuntimeException.getGatewayApiCode(GatewayApiCode.CMS_TOKEN_VALID);
|
|
|
if (u.getIsBlack()) {
|
|
|
- return new ArrayList<>();
|
|
|
+ return new SearchResult<>();
|
|
|
}
|
|
|
List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, u);
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
//Long yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
|
|
|
- List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, builder
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ if (StrUtil.isNotBlank(account)) {
|
|
|
+ builder.field(RenewalView::getAccount, account).op(Operator.Contain);
|
|
|
+ }
|
|
|
+ SearchResult<RenewalView> list = beanSearcher.search(RenewalView.class, builder
|
|
|
.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
|
|
|
.field(RenewalView::getUserId, userIds).op(Operator.InList)
|
|
|
//.field(RenewalView::getYhsId, yhsId)
|
|
|
+ .field("condition", String.format("(gr.expiry_time is null or gr.expiry_time > '%s')", now))
|
|
|
.field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
|
|
|
.orderBy(RenewalView::getExpiryTime).asc()
|
|
|
.build());
|
|
|
//过滤邀请制、已失效的车位
|
|
|
- DateTime now = DateTime.now();
|
|
|
- list = list.stream().filter(e -> {
|
|
|
- if (e.getExpiryTime() != null && e.getExpiryTime().before(now)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- Integer size = list.size();
|
|
|
+ Integer size = list.getTotalCount().intValue();
|
|
|
|
|
|
- list.forEach(ticket -> {
|
|
|
+ list.getDataList().forEach(ticket -> {
|
|
|
if (ticket.getSkuId() == null || ticket.getGoodsId() == null) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -604,6 +602,15 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
return num;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<RenewalView> getHasPayGoods(long userId) {
|
|
|
+ User user = userMapper.selectById(userId);
|
|
|
+ List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, user);
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ List<RenewalView> list = groupsRelationMapper.getUserHasPayGoods(userIds, now);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
public String getDifferentGoodsCode(Long goodsId, String body, Integer type) {
|
|
|
String code = null;
|
|
|
//奈飞
|