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

Commit 3c1668c1 authored by wangyifan's avatar wangyifan

slime 修改场次删除演出阵容缓存

parent 49cef9f3
......@@ -1737,40 +1737,45 @@ public class DataUtils {
*/
public List<KylinPerformanceArtistLineupVo> getPerformanceArtists(String performancesId) {
final String redisKey = KylinRedisConst.PERFORMANCES_ARTISTS + performancesId;
Object obj = redisUtil.get(redisKey);
if (null == obj) {
KylinPerformanceVo performancesInfo = getPerformanceVo(performancesId);
if (null == performancesInfo) {
return Collections.emptyList();
}
List<KylinPerformanceArtistLineupVo> resultList = new ArrayList<>();
List<KylinTicketTimesVo> ticketTimeList = performancesInfo.getTicketTimeList();
try {
Object obj = redisUtil.get(redisKey);
if (null == obj) {
KylinPerformanceVo performancesInfo = getPerformanceVo(performancesId);
if (null == performancesInfo) {
return Collections.emptyList();
}
if (!CollectionUtils.isEmpty(ticketTimeList)) {
for (KylinTicketTimesVo timesVo : ticketTimeList) {
if (timesVo.getType().equals(2)) {
continue;
List<KylinPerformanceArtistLineupVo> resultList = new ArrayList<>();
List<KylinTicketTimesVo> ticketTimeList = performancesInfo.getTicketTimeList();
if (!CollectionUtils.isEmpty(ticketTimeList)) {
for (KylinTicketTimesVo timesVo : ticketTimeList) {
if (timesVo.getType().equals(2)) {
continue;
}
// 获取当前场次关联的艺人,按sort降序
List<KylinArtistPerformanceDao> artists = artistPerformanceMapper.selectArtistsByPerformanceAndTimes(performancesId, timesVo.getTicketTimesId());
KylinPerformanceArtistLineupVo lineupVo = new KylinPerformanceArtistLineupVo();
lineupVo.setTicketTimesId(timesVo.getTicketTimesId());
lineupVo.setTimeTitle(timesVo.getTitle());
lineupVo.setArtists(artists == null ? new ArrayList<>() :
artists.stream()
.map(KylinPerformanceArtistLineupVo.KylinPerformanceTimeArtist::from)
.filter(Objects::nonNull)
.collect(Collectors.toList()));
resultList.add(lineupVo);
}
// 获取当前场次关联的艺人,按sort降序
List<KylinArtistPerformanceDao> artists = artistPerformanceMapper.selectArtistsByPerformanceAndTimes(performancesId, timesVo.getTicketTimesId());
KylinPerformanceArtistLineupVo lineupVo = new KylinPerformanceArtistLineupVo();
lineupVo.setTicketTimesId(timesVo.getTicketTimesId());
lineupVo.setTimeTitle(timesVo.getTitle());
lineupVo.setArtists(artists == null ? new ArrayList<>() :
artists.stream()
.map(KylinPerformanceArtistLineupVo.KylinPerformanceTimeArtist::from)
.filter(Objects::nonNull)
.collect(Collectors.toList()));
resultList.add(lineupVo);
}
setPerformanceArtists(performancesId, resultList);
return resultList;
}else {
return (List<KylinPerformanceArtistLineupVo>)obj;
}
setPerformanceArtists(performancesId, resultList);
return resultList;
}else {
return (List<KylinPerformanceArtistLineupVo>)obj;
}catch (Exception e){
log.error("error:", e);
}
return Collections.emptyList();
}
public void setPerformanceArtists(String performancesId, List<KylinPerformanceArtistLineupVo> artistLineupVos){
......
......@@ -146,6 +146,7 @@ public class KylinTicketTimesPartnerServiceImpl implements IKylinTicketTimesPart
@Override
public ResponseDto<String> deleteTimes(String ticketTimesId, String performanceId) {
try {
redisSlimeUtils.delPerformanceArtists(performanceId);
LocalDateTime updatedAt = LocalDateTime.now();
KylinTicketTimesPartnerVo data = mongoSlimeUtils.getTicketTimesPartnerVo(ticketTimesId);
if (data.getStatus() == 0) {
......@@ -193,6 +194,7 @@ public class KylinTicketTimesPartnerServiceImpl implements IKylinTicketTimesPart
@Override
public ResponseDto<KylinTicketTimesPartnerVo> changeTimes(CreateTicketTimesParam createTicketTimesParam) {
try {
redisSlimeUtils.delPerformanceArtists(createTicketTimesParam.getPerformancesId());
LocalDateTime updatedAt = LocalDateTime.now();
String title = "";
if (createTicketTimesParam.getType() == 1) {
......
......@@ -332,4 +332,13 @@ public class RedisSlimeUtils {
String redisKey = KylinRedisConst.PERFORMANCES_NOTICE_REMIND_STATUS + performanceId;
redisUtil.set(redisKey, noticeRemindStatus);
}
/**
* 删除演出-场次阵容 缓存
* @param performancesId
*/
public void delPerformanceArtists(String performancesId) {
final String redisKey = KylinRedisConst.PERFORMANCES_ARTISTS + performancesId;
redisUtil.del(redisKey);
}
}
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