记得上下班打卡 | git大法好,push需谨慎

Commit ff918435 authored by wangyifan's avatar wangyifan

我的拼团列表返回 演出相关信息

parent ef3fb395
......@@ -37,6 +37,18 @@ public class KylinGroupBuyMyGroupVo implements Serializable {
@ApiModelProperty(value = "是否团长 1是 0否")
private Integer isLeader;
@ApiModelProperty(value = "演出标题")
private String performanceTitle;
@ApiModelProperty(value = "演出图片")
private String performanceImg;
@ApiModelProperty(value = "票种名称")
private String ticketTitle;
@ApiModelProperty(value = "场次名称")
private String timeTitle;
@ApiModelProperty(value = "成员头像列表")
private List<GroupBuyMemberUserInfoVo> memberBriefs;
}
......@@ -93,6 +93,8 @@ public class KylinGroupBuyOrderServiceImpl implements IKylinGroupBuyOrderService
KylinGroupBuyOrderVo.class, KylinGroupBuyOrderVo.class.getSimpleName());
List<KylinGroupBuyMyGroupVo> result = new ArrayList<>();
Map<String, String> avatarCache = new HashMap<>();
Map<String, KylinGroupBuyActivityVo> activityCache = new HashMap<>();
Map<String, KylinPerformanceVo> performanceCache = new HashMap<>();
for (KylinGroupBuyOrderVo o : orders) {
KylinGroupBuyMyGroupVo vo = new KylinGroupBuyMyGroupVo();
vo.setGroupOrderId(o.getGroupOrderId());
......@@ -103,6 +105,7 @@ public class KylinGroupBuyOrderServiceImpl implements IKylinGroupBuyOrderService
vo.setStatus(o.getStatus());
vo.setExpiresAt(o.getExpiresAt());
vo.setIsLeader(uid.equals(o.getLeaderUserId()) ? 1 : 0);
fillMyGroupPerformanceInfo(o, vo, activityCache, performanceCache);
if (o.getMembers() != null) {
List<GroupBuyMemberUserInfoVo> memberUserList = new ArrayList<>();
for (KylinGroupBuyMemberVo m : o.getMembers()) {
......@@ -427,4 +430,56 @@ public class KylinGroupBuyOrderServiceImpl implements IKylinGroupBuyOrderService
}
}
/**
* 我的拼团列表:活动 → 演出 → 场次/票种名称、封面。
*/
private void fillMyGroupPerformanceInfo(KylinGroupBuyOrderVo order, KylinGroupBuyMyGroupVo vo,
Map<String, KylinGroupBuyActivityVo> activityCache,
Map<String, KylinPerformanceVo> performanceCache) {
if (order == null || vo == null || StringUtil.isBlank(order.getActivityId())) {
return;
}
KylinGroupBuyActivityVo activity = activityCache.get(order.getActivityId());
if (activity == null) {
activity = findActivity(order.getActivityId());
if (activity != null) {
activityCache.put(order.getActivityId(), activity);
}
}
if (activity == null || StringUtil.isBlank(activity.getPerformanceId())) {
return;
}
KylinPerformanceVo performance = performanceCache.get(activity.getPerformanceId());
if (performance == null) {
performance = dataUtils.getPerformanceVo(activity.getPerformanceId());
if (performance != null) {
performanceCache.put(activity.getPerformanceId(), performance);
}
}
if (performance == null) {
return;
}
vo.setPerformanceTitle(performance.getTitle());
vo.setPerformanceImg(performance.getImgPoster());
if (StringUtil.isBlank(order.getTimeId()) || performance.getTicketTimeList() == null) {
return;
}
for (KylinTicketTimesVo t : performance.getTicketTimeList()) {
if (!order.getTimeId().equals(t.getTimeId())) {
continue;
}
vo.setTimeTitle(t.getTitle());
if (StringUtil.isBlank(order.getTicketId()) || t.getTicketList() == null) {
return;
}
for (KylinTicketVo tk : t.getTicketList()) {
if (order.getTicketId().equals(tk.getTicketsId())) {
vo.setTicketTitle(tk.getTitle());
return;
}
}
return;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment