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

Commit 53c23bb8 authored by jiangxiulong's avatar jiangxiulong

增加Ar演出艺人时间表接口

parent 2e70ded7
...@@ -5,6 +5,7 @@ public class SweetConstant { ...@@ -5,6 +5,7 @@ public class SweetConstant {
public final static String SWEET = "sweet:"; public final static String SWEET = "sweet:";
public final static String REDIS_KEY_SWEET_MANUAL_PUSH_LIST = "sweet:manual:pushList"; public final static String REDIS_KEY_SWEET_MANUAL_PUSH_LIST = "sweet:manual:pushList";
public final static String REDIS_KEY_SWEET_MANUAL_TIME_LIST = "sweet:manual:timeList:manual:"; public final static String REDIS_KEY_SWEET_MANUAL_TIME_LIST = "sweet:manual:timeList:manual:";
public final static String REDIS_KEY_SWEET_MANUAL_ARTIST_TIME_LIST = "sweet:manual:artistTimeList:performanceId:";
public final static String REDIS_KEY_SWEET_MANUAL_NOTIFY_LIST = "sweet:manual:notify:manual:"; public final static String REDIS_KEY_SWEET_MANUAL_NOTIFY_LIST = "sweet:manual:notify:manual:";
public final static String REDIS_KEY_SWEET_MANUAL_RICH_TEXT = "sweet:manual:richText:manual:"; public final static String REDIS_KEY_SWEET_MANUAL_RICH_TEXT = "sweet:manual:richText:manual:";
public final static String REDIS_KEY_SWEET_MANUAL_SORT = "sweet:manual:sort:manual:"; public final static String REDIS_KEY_SWEET_MANUAL_SORT = "sweet:manual:sort:manual:";
......
package com.liquidnet.service.sweet.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel
public class SweetManualAppletArDto implements Serializable, Cloneable {
private static final long serialVersionUID = 6770975190927622554L;
@ApiModelProperty("电子手册id")
private String manualId;
@ApiModelProperty("演出id")
private String performancesId;
@ApiModelProperty("演出标题")
private String title;
@ApiModelProperty("场地id")
private String fieldId;
@ApiModelProperty("场地名称")
private String fieldName;
@ApiModelProperty("城市名称")
private String cityName;
@ApiModelProperty("演出开始时间")
private String timeStart;
@ApiModelProperty("演出结束时间")
private String timeEnd;
@ApiModelProperty("演出开售时间")
private String timeSell;
@ApiModelProperty("是否会员")
private Integer isMember;
@ApiModelProperty("提前时间")
private Integer payCountdownMinute;
@ApiModelProperty("经度")
private String longitude;
@ApiModelProperty("纬度")
private String latitude;
private static final SweetManualAppletArDto obj = new SweetManualAppletArDto();
public static SweetManualAppletArDto getNew() {
try {
return (SweetManualAppletArDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new SweetManualAppletArDto();
}
}
}
package com.liquidnet.service.sweet.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel
public class SweetManualArtistListArDto implements Serializable, Cloneable {
private static final long serialVersionUID = -5997109354033494326L;
@ApiModelProperty("电子手册关联id")
private String manualRelationId;
@ApiModelProperty("艺人id")
private String artistId;
@ApiModelProperty("艺人名称")
private String name;
@ApiModelProperty("艺人拼音")
private String pinyin;
@ApiModelProperty("艺人简介")
private String describes;
@ApiModelProperty("艺人头像图片")
private String picUrl;
@ApiModelProperty("舞台id")
private String stageId;
@ApiModelProperty("舞台名称")
private String title;
@ApiModelProperty("艺人演出开始")
private String performanceStart;
@ApiModelProperty("艺人演出结束")
private String performanceEnd;
@ApiModelProperty("艺人签售开始")
private String signatureStart;
@ApiModelProperty("艺人签售结束")
private String signatureEnd;
@ApiModelProperty("艺人资源url 目前是视频和图片")
private List<SweetManualArtistResourceUrlArDto> resourceUrl;
private static final SweetManualArtistListArDto obj = new SweetManualArtistListArDto();
public static SweetManualArtistListArDto getNew() {
try {
return (SweetManualArtistListArDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new SweetManualArtistListArDto();
}
}
/*public SweetManualArtistListArDto copy(SweetManualArtistListArDto source) {
if (null == source) return this;
this.setArtistId(source.getArtistId());
return this;
}*/
}
package com.liquidnet.service.sweet.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel
public class SweetManualArtistResourceUrlArDto implements Serializable, Cloneable {
private static final long serialVersionUID = 9217024935897257884L;
@ApiModelProperty("url地址")
private String url;
@ApiModelProperty("类型1:图片 2:视频")
private String type;
private static final SweetManualArtistResourceUrlArDto obj = new SweetManualArtistResourceUrlArDto();
public static SweetManualArtistResourceUrlArDto getNew() {
try {
return (SweetManualArtistResourceUrlArDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new SweetManualArtistResourceUrlArDto();
}
}
}
package com.liquidnet.service.sweet.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel
public class SweetManualArtistStageListArDto implements Serializable, Cloneable {
private static final long serialVersionUID = 4113494130809902656L;
@ApiModelProperty("舞台名称")
private String title;
@ApiModelProperty("舞台ID")
private String stageId;
@ApiModelProperty("艺人数据")
private List<SweetManualArtistListArDto> artistList;
private static final SweetManualArtistStageListArDto obj = new SweetManualArtistStageListArDto();
public static SweetManualArtistStageListArDto getNew() {
try {
return (SweetManualArtistStageListArDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new SweetManualArtistStageListArDto();
}
}
}
package com.liquidnet.service.sweet.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel
public class SweetPerformArtistTimeListDto implements Serializable, Cloneable {
private static final long serialVersionUID = 1285742725281098300L;
@ApiModelProperty("演出日期")
private String startTime;
@ApiModelProperty("舞台数据")
private List<SweetManualArtistStageListArDto> stageList;
private static final SweetPerformArtistTimeListDto obj = new SweetPerformArtistTimeListDto();
public static SweetPerformArtistTimeListDto getNew() {
try {
return (SweetPerformArtistTimeListDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new SweetPerformArtistTimeListDto();
}
}
}
package com.liquidnet.service.sweet.mapper; package com.liquidnet.service.sweet.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.sweet.dto.SweetManualArtistResourceUrlArDto;
import com.liquidnet.service.sweet.entity.SweetArtistsUrl; import com.liquidnet.service.sweet.entity.SweetArtistsUrl;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SweetArtistsUrlMapper extends BaseMapper<SweetArtistsUrl> { public interface SweetArtistsUrlMapper extends BaseMapper<SweetArtistsUrl> {
List<SweetManualArtistResourceUrlArDto> selectListOfAid(@Param("artistId") String artistId);
} }
package com.liquidnet.service.sweet.mapper; package com.liquidnet.service.sweet.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.sweet.dto.SweetManualArtistListArDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistListDto; import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistStageListArDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistStageListDto; import com.liquidnet.service.sweet.dto.SweetManualArtistStageListDto;
import com.liquidnet.service.sweet.entity.SweetManualArtists; import com.liquidnet.service.sweet.entity.SweetManualArtists;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -23,4 +26,8 @@ public interface SweetManualArtistsMapper extends BaseMapper<SweetManualArtists> ...@@ -23,4 +26,8 @@ public interface SweetManualArtistsMapper extends BaseMapper<SweetManualArtists>
SweetManualArtistListDto getManualDetails(Map<String, Object> map); SweetManualArtistListDto getManualDetails(Map<String, Object> map);
List<SweetManualArtistStageListDto> getStageNameList(Map<String, Object> map); List<SweetManualArtistStageListDto> getStageNameList(Map<String, Object> map);
List<SweetManualArtistStageListArDto> getStageNameListAr(@Param("performanceId") String performanceId);
List<SweetManualArtistListArDto> getManualListAr(@Param("performanceId") String performanceId);
} }
package com.liquidnet.service.sweet.mapper; package com.liquidnet.service.sweet.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.sweet.dto.SweetManualAppletArDto;
import com.liquidnet.service.sweet.dto.SweetManualAppletDto; import com.liquidnet.service.sweet.dto.SweetManualAppletDto;
import com.liquidnet.service.sweet.dto.SweetManualDto; import com.liquidnet.service.sweet.dto.SweetManualDto;
import com.liquidnet.service.sweet.entity.SweetManual; import com.liquidnet.service.sweet.entity.SweetManual;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -18,9 +20,11 @@ import java.util.Map; ...@@ -18,9 +20,11 @@ import java.util.Map;
*/ */
public interface SweetManualMapper extends BaseMapper<SweetManual> { public interface SweetManualMapper extends BaseMapper<SweetManual> {
List<SweetManualDto> getManualList(Map<String,Object> map); List<SweetManualDto> getManualList(Map<String, Object> map);
SweetManualDto getManualDetails(Map<String,Object> map); SweetManualDto getManualDetails(Map<String, Object> map);
List<SweetManualAppletDto> getManualAppletDto(); List<SweetManualAppletDto> getManualAppletDto();
List<SweetManualAppletArDto> getManualAppletArDto(@Param("performanceId") String performanceId);
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.sweet.mapper.SweetArtistsUrlMapper">
<select id="selectListOfAid"
resultType="com.liquidnet.service.sweet.dto.SweetManualArtistResourceUrlArDto">
select url, type
from sweet_artists_url
where artists_id = #{artistId}
</select>
</mapper>
...@@ -69,4 +69,37 @@ ...@@ -69,4 +69,37 @@
group by ss.title; group by ss.title;
</select> </select>
<select id="getStageNameListAr"
resultType="com.liquidnet.service.sweet.dto.SweetManualArtistStageListArDto">
select ss.title, ss.stage_id
from sweet_manual_artists as sma
join sweet_manual as sm on sm.manual_id = sma.manual_id
left join sweet_artists as sa on sa.artists_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where sma.status = 1
and sm.performance_id = #{performanceId}
group by ss.stage_id;
</select>
<select id="getManualListAr" resultType="com.liquidnet.service.sweet.dto.SweetManualArtistListArDto">
select manual_relation_id,
sa.`artists_id`,
sa.`name`,
sa.pinyin,
sa.describes,
sa.pic_url,
ss.stage_id,
ss.title,
performance_start,
performance_end,
signature_start,
signature_end
from sweet_manual_artists as sma
join sweet_manual as sm on sm.manual_id = sma.manual_id
left join sweet_artists as sa on sa.artists_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
<where>
sma.status = 1 and sm.performance_id = #{performanceId}
</where>
ORDER BY sma.updated_at DESC
</select>
</mapper> </mapper>
...@@ -83,16 +83,14 @@ ...@@ -83,16 +83,14 @@
<!-- 电子手册详情 --> <!-- 电子手册详情 -->
<select id="getManualDetails" parameterType="java.util.Map" resultMap="partnerPerformanceListResult"> <select id="getManualDetails" parameterType="java.util.Map" resultMap="partnerPerformanceListResult">
SELECT IFNULL(sm.manual_id, 0) as 'manual_id', SELECT IFNULL(sm.manual_id, 0) as 'manual_id', p.performances_id,
p.performances_id,
p.title, p.title,
p.time_start, p.time_start,
p.time_end, p.time_end,
ps.status, ps.status,
t.time_sell, t.time_sell,
t.time_stop, t.time_stop,
IFNULL(sm.status, 0) as 'manualStatus', IFNULL(sm.status, 0) as 'manualStatus', IFNULL(sm.is_release, 0) as 'is_release'
IFNULL(sm.is_release, 0) as 'is_release'
FROM kylin_performances AS p FROM kylin_performances AS p
LEFT JOIN kylin_performance_status AS ps ON p.performances_id = ps.performance_id LEFT JOIN kylin_performance_status AS ps ON p.performances_id = ps.performance_id
LEFT JOIN kylin_performance_relations AS pr ON p.performances_id = pr.performance_id LEFT JOIN kylin_performance_relations AS pr ON p.performances_id = pr.performance_id
...@@ -104,8 +102,7 @@ ...@@ -104,8 +102,7 @@
t.time_start, t.time_start,
INTERVAL pay_countdown_minute MINUTE INTERVAL pay_countdown_minute MINUTE
) )
) AS 'time_sell', ) AS 'time_sell', MAX(t.time_end) AS 'time_stop'
MAX(t.time_end) AS 'time_stop'
FROM kylin_ticket_status AS ts FROM kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id
...@@ -127,60 +124,96 @@ ...@@ -127,60 +124,96 @@
</select> </select>
<select id="getManualAppletDto" resultMap="getManualAppletDtoResult"> <select id="getManualAppletDto" resultMap="getManualAppletDtoResult">
SELECT SELECT IFNULL(sm.manual_id, 0) AS 'manual_id' , p.performances_id,
IFNULL(sm.manual_id , 0) AS 'manual_id' , p.title,
p.performances_id , pr.field_id,
p.title , p.time_start,
pr.field_id ,
p.time_start ,
p.time_end, p.time_end,
t1.time_sell, t1.time_sell,
t1.pay_countdown_minute, t1.pay_countdown_minute,
t1.is_member t1.is_member
FROM FROM kylin_performances AS p
kylin_performances AS p
LEFT JOIN kylin_performance_status AS ps ON p.performances_id = ps.performance_id LEFT JOIN kylin_performance_status AS ps ON p.performances_id = ps.performance_id
LEFT JOIN kylin_performance_relations AS pr ON p.performances_id = pr.performance_id LEFT JOIN kylin_performance_relations AS pr ON p.performances_id = pr.performance_id
LEFT JOIN sweet_manual AS sm ON p.performances_id = sm.performance_id LEFT JOIN sweet_manual AS sm ON p.performances_id = sm.performance_id
LEFT JOIN( LEFT JOIN(
SELECT SELECT ttr.performance_id,
ttr.performance_id ,
MIN( MIN(
DATE_SUB( DATE_SUB(
t.time_start , t.time_start,
INTERVAL pay_countdown_minute MINUTE INTERVAL pay_countdown_minute MINUTE
) )
) AS 'time_sell' , ) AS 'time_sell' , MAX(t.time_end) AS 'time_stop'
MAX(t.time_end) AS 'time_stop' FROM kylin_ticket_status AS ts
FROM
kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id
LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id
GROUP BY GROUP BY ttr.performance_id
ttr.performance_id
) AS t ON p.performances_id = t.performance_id ) AS t ON p.performances_id = t.performance_id
LEFT JOIN( LEFT JOIN(
SELECT SELECT ttr.performance_id,
ttr.performance_id ,
ts.is_member, ts.is_member,
pay_countdown_minute, pay_countdown_minute,
sum(ts.total_general) AS 'total_general' , sum(ts.total_general) AS 'total_general' , MIN(
DATE_SUB(
t.time_start,
INTERVAL pay_countdown_minute MINUTE
)
) AS 'time_sell' , MAX(t.time_end) AS 'time_stop'
FROM kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id
LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id
GROUP BY ttr.performance_id
) AS t1 ON p.performances_id = t1.performance_id
where sm.`status` = 1
and sm.is_release = 1
</select>
<select id="getManualAppletArDto" resultType="com.liquidnet.service.sweet.dto.SweetManualAppletArDto">
SELECT IFNULL(sm.manual_id, 0) AS 'manual_id' , p.performances_id,
p.title,
pr.field_id,
p.time_start,
p.time_end,
t1.time_sell,
t1.pay_countdown_minute,
t1.is_member
FROM kylin_performances AS p
LEFT JOIN kylin_performance_status AS ps ON p.performances_id = ps.performance_id
LEFT JOIN kylin_performance_relations AS pr ON p.performances_id = pr.performance_id
LEFT JOIN sweet_manual AS sm ON p.performances_id = sm.performance_id
LEFT JOIN(
SELECT ttr.performance_id,
MIN( MIN(
DATE_SUB( DATE_SUB(
t.time_start , t.time_start,
INTERVAL pay_countdown_minute MINUTE INTERVAL pay_countdown_minute MINUTE
) )
) AS 'time_sell' , ) AS 'time_sell' , MAX(t.time_end) AS 'time_stop'
MAX(t.time_end) AS 'time_stop' FROM kylin_ticket_status AS ts
FROM
kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id
LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id
GROUP BY GROUP BY ttr.performance_id
ttr.performance_id ) AS t ON p.performances_id = t.performance_id
LEFT JOIN(
SELECT ttr.performance_id,
ts.is_member,
pay_countdown_minute,
sum(ts.total_general) AS 'total_general' , MIN(
DATE_SUB(
t.time_start,
INTERVAL pay_countdown_minute MINUTE
)
) AS 'time_sell' , MAX(t.time_end) AS 'time_stop'
FROM kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id
LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id
GROUP BY ttr.performance_id
) AS t1 ON p.performances_id = t1.performance_id ) AS t1 ON p.performances_id = t1.performance_id
where sm.`status` = 1 and sm.is_release = 1 where sm.`status` = 1
and sm.is_release = 1
and p.performances_id = #{performanceId}
</select> </select>
</mapper> </mapper>
...@@ -5,19 +5,23 @@ import com.liquidnet.service.base.ResponseDto; ...@@ -5,19 +5,23 @@ import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.sweet.dto.SweetManualAppletDto; import com.liquidnet.service.sweet.dto.SweetManualAppletDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistList2Dto; import com.liquidnet.service.sweet.dto.SweetManualArtistList2Dto;
import com.liquidnet.service.sweet.dto.SweetManualArtistListDto; import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
import com.liquidnet.service.sweet.dto.SweetPerformArtistTimeListDto;
import com.liquidnet.service.sweet.entity.SweetManualNotify; import com.liquidnet.service.sweet.entity.SweetManualNotify;
import com.liquidnet.service.sweet.entity.SweetManualShop; import com.liquidnet.service.sweet.entity.SweetManualShop;
import com.liquidnet.service.sweet.entity.SweetRichtext; import com.liquidnet.service.sweet.entity.SweetRichtext;
import com.liquidnet.service.sweet.utils.ObjectUtil; import com.liquidnet.service.sweet.utils.ObjectUtil;
import com.liquidnet.service.sweet.utils.RedisArDataUtils;
import com.liquidnet.service.sweet.utils.RedisDataUtils; import com.liquidnet.service.sweet.utils.RedisDataUtils;
import com.liquidnet.service.sweet.vo.SweetArtistsRelationVo; import com.liquidnet.service.sweet.vo.SweetArtistsRelationVo;
import com.liquidnet.service.sweet.vo.SweetManualShopAllVo; import com.liquidnet.service.sweet.vo.SweetManualShopAllVo;
import com.liquidnet.service.sweet.vo.SweetPrizeVo; import com.liquidnet.service.sweet.vo.SweetPrizeVo;
import io.swagger.annotations.*; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -30,6 +34,9 @@ public class SweetAppletController { ...@@ -30,6 +34,9 @@ public class SweetAppletController {
@Autowired @Autowired
private RedisDataUtils redisDataUtils; private RedisDataUtils redisDataUtils;
@Autowired
private RedisArDataUtils arDataUtils;
@GetMapping("timeSelect") @GetMapping("timeSelect")
@ApiOperation("场次选择") @ApiOperation("场次选择")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -179,6 +186,22 @@ public class SweetAppletController { ...@@ -179,6 +186,22 @@ public class SweetAppletController {
} }
} }
@GetMapping("performArtistTimeList")
@ApiOperation("演出艺人时间表")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "performanceId", value = "演出ID", required = true)
})
public ResponseDto<List<SweetPerformArtistTimeListDto>> performArtistTimeList(
@RequestParam String performanceId
) {
try {
List<SweetPerformArtistTimeListDto> artistTimeList = arDataUtils.getArtistTimeList(performanceId);
return ResponseDto.success(artistTimeList);
} catch (Exception e) {
return ResponseDto.failure("获取失败");
}
}
@GetMapping("richText") @GetMapping("richText")
@ApiOperation("富文本") @ApiOperation("富文本")
@ApiImplicitParams({ @ApiImplicitParams({
......
package com.liquidnet.service.sweet.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.sweet.constant.SweetConstant;
import com.liquidnet.service.sweet.dto.*;
import com.liquidnet.service.sweet.mapper.SweetArtistsUrlMapper;
import com.liquidnet.service.sweet.mapper.SweetManualArtistsMapper;
import com.liquidnet.service.sweet.mapper.SweetManualMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Component
@Slf4j
public class RedisArDataUtils {
@Autowired
private RedisUtil redisUtil;
@Autowired
private SweetManualArtistsMapper sweetManualArtistsMapper;
@Autowired
private SweetArtistsUrlMapper sweetArtistsUrlMapper;
@Autowired
private SweetManualMapper sweetManualMapper;
public List<SweetPerformArtistTimeListDto> getArtistTimeList(String performanceId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_MANUAL_ARTIST_TIME_LIST.concat(performanceId);
redisUtil.del(redisKey);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
List<SweetPerformArtistTimeListDto> performArtistTimeList = new ArrayList<>();
// 演出日期
List<SweetManualAppletArDto> performTime = sweetManualMapper.getManualAppletArDto(performanceId);
Date dateEnd = DateUtil.parse(performTime.get(0).getTimeEnd(), DateUtil.DATE_SMALL_STR);
Date dateStart = DateUtil.parse(performTime.get(0).getTimeStart(), DateUtil.DATE_SMALL_STR);
int intervalDay = (int) DateUtil.intervalDays(dateStart, dateEnd);
for (int i = 0; i <= intervalDay; i++) {
String time = DateUtil.format(DateUtil.addDay(dateStart, i), DateUtil.Formatter.yyyy_MM_dd);
SweetPerformArtistTimeListDto performArtistTimeListDto = SweetPerformArtistTimeListDto.getNew();
performArtistTimeListDto.setStartTime(time);
// 场地
List<SweetManualArtistStageListArDto> stageList = sweetManualArtistsMapper.getStageNameListAr(performanceId);
// 艺人
List<SweetManualArtistListArDto> artistList = sweetManualArtistsMapper.getManualListAr(performanceId);
for (SweetManualArtistListArDto artist : artistList) {
List<SweetManualArtistResourceUrlArDto> urlList = sweetArtistsUrlMapper.selectListOfAid(artist.getArtistId());
artist.setResourceUrl(urlList);
}
for (SweetManualArtistStageListArDto stage : stageList) {
List<SweetManualArtistListArDto> artistListArList = new ArrayList<>();
for (SweetManualArtistListArDto artist : artistList) {
if (artist.getPerformanceStart().contains(time) && stage.getStageId().equals(artist.getStageId())) {
artistListArList.add(artist);
}
}
stage.setArtistList(artistListArList);
}
performArtistTimeListDto.setStageList(stageList);
performArtistTimeList.add(performArtistTimeListDto);
}
redisUtil.set(redisKey, performArtistTimeList);
return performArtistTimeList;
} else {
return (List<SweetPerformArtistTimeListDto>) obj;
}
}
}
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