|
@@ -28,6 +28,7 @@ import com.cyksj.service.user.WorkOrderFrontService;
|
|
|
import com.cyksj.web.util.StpUserUtil;
|
|
import com.cyksj.web.util.StpUserUtil;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
|
|
+import com.ejlchina.searcher.param.Operator;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.util.Assert;
|
|
import org.springframework.util.Assert;
|
|
@@ -93,14 +94,18 @@ public class UserController {
|
|
|
@GetMapping("/personal")
|
|
@GetMapping("/personal")
|
|
|
public Result<UserPersonalView> getPersonalView() {
|
|
public Result<UserPersonalView> getPersonalView() {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- List<RenewalView> ticket = groupRelationFrontService.getMyTicket(userId, false);
|
|
|
|
|
|
|
+ List<Long> userIds = userService.getRelationUserIdList(userId, null);
|
|
|
|
|
+ Number ticketNum = beanSearcher.searchCount(UserTicketView.class, MapUtils.builder()
|
|
|
|
|
+ .field(UserTicketView::getUserId, userIds).op(Operator.InList)
|
|
|
|
|
+ .field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
|
|
|
|
|
+ .build());
|
|
|
UserPersonalView personalView = new UserPersonalView();
|
|
UserPersonalView personalView = new UserPersonalView();
|
|
|
DateTime now = DateTime.now();
|
|
DateTime now = DateTime.now();
|
|
|
//车票
|
|
//车票
|
|
|
Integer register_count = registerOrderDonMapper.selectCount(Wrappers.lambdaQuery(RegisterOrderDon.class)
|
|
Integer register_count = registerOrderDonMapper.selectCount(Wrappers.lambdaQuery(RegisterOrderDon.class)
|
|
|
.eq(RegisterOrderDon::getUserId, userId)
|
|
.eq(RegisterOrderDon::getUserId, userId)
|
|
|
.eq(RegisterOrderDon::getStatus, RegisterOrderDon.Status.complete));
|
|
.eq(RegisterOrderDon::getStatus, RegisterOrderDon.Status.complete));
|
|
|
- personalView.setNumOfTickets(ticket.size() + register_count);
|
|
|
|
|
|
|
+ personalView.setNumOfTickets(ticketNum.intValue() + register_count);
|
|
|
//优惠券
|
|
//优惠券
|
|
|
Integer couponSize = couponUserMapper.selectCount(Wrappers.lambdaQuery(CouponUser.class)
|
|
Integer couponSize = couponUserMapper.selectCount(Wrappers.lambdaQuery(CouponUser.class)
|
|
|
.eq(CouponUser::getUserId, userId)
|
|
.eq(CouponUser::getUserId, userId)
|