|
|
@@ -23,13 +23,13 @@ import com.cyksj.mapper.corp.CorpUserTagMapper;
|
|
|
import com.cyksj.model.dto.AuthRedirect;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.manage.views.CorpQyMsgAuditChatView;
|
|
|
+import com.cyksj.model.manage.views.CorpWxOrderDonView;
|
|
|
import com.cyksj.model.request.corp.CorpCommonReq;
|
|
|
-import com.cyksj.model.views.CorpUserIntentionView;
|
|
|
-import com.cyksj.model.views.UserIntentionPieView;
|
|
|
-import com.cyksj.model.views.YHLXUserDetailView;
|
|
|
+import com.cyksj.model.views.*;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.corp.CorpService;
|
|
|
import com.cyksj.service.corp.CorpUserService;
|
|
|
+import com.cyksj.service.user.UserBindRelationService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
import com.ejlchina.searcher.param.Operator;
|
|
|
@@ -80,6 +80,8 @@ public class WxCorpController {
|
|
|
|
|
|
private final CorpUserAuthMapper corpUserAuthMapper;
|
|
|
|
|
|
+ private final UserBindRelationService userBindRelationService;
|
|
|
+
|
|
|
private final static String CORP_UUID = "corp-uuid";
|
|
|
|
|
|
/**
|
|
|
@@ -427,4 +429,55 @@ public class WxCorpController {
|
|
|
Page<CorpUserIntentionView> page = corpUserTagMapper.getCorpUserIntentionView(new Page<>(start, limit), userId, nickname, tagId, date, intention);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(page);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户车票详情列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/ticket")
|
|
|
+ public Result<SearchResult<TicketView>> getTicketView(Long userId) {
|
|
|
+ String corpUuid = getCorpUuid();
|
|
|
+ if (StrUtil.isEmpty(corpUuid)) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ if (userId == null) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ //关联关系
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ if (userIdList.isEmpty()) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ SearchResult<TicketView> ticketViews = beanSearcher.search(TicketView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
|
|
|
+ .field(TicketView::getUserId, userIdList).op(Operator.InList)
|
|
|
+ .put("condition", String.format("(gr.expiry_time is null or gr.expiry_time > '%s')", DateTime.now()))
|
|
|
+ .field(TicketView::getGrStatus, List.of("validity", "outside")).op(Operator.InList)
|
|
|
+ .orderBy(TicketView::getExpiryTime).asc()
|
|
|
+ .build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(ticketViews);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户订单详情列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/orders")
|
|
|
+ public Result<SearchResult<CorpWxOrderDonView>> getOrders(Long userId) {
|
|
|
+ String corpUuid = getCorpUuid();
|
|
|
+ if (StrUtil.isEmpty(corpUuid)) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ if (userId == null) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ if (userIdList.isEmpty()) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ SearchResult<CorpWxOrderDonView> orderDonViews = beanSearcher.search(CorpWxOrderDonView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .field(CorpWxOrderDonView::getUserId, userIdList).op(Operator.InList)
|
|
|
+ .orderBy(CorpWxOrderDonView::getId).desc()
|
|
|
+ .build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(orderDonViews);
|
|
|
+ }
|
|
|
}
|