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

Commit 3c1668c1 authored by wangyifan's avatar wangyifan

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

parent 49cef9f3
...@@ -1737,40 +1737,45 @@ public class DataUtils { ...@@ -1737,40 +1737,45 @@ public class DataUtils {
*/ */
public List<KylinPerformanceArtistLineupVo> getPerformanceArtists(String performancesId) { public List<KylinPerformanceArtistLineupVo> getPerformanceArtists(String performancesId) {
final String redisKey = KylinRedisConst.PERFORMANCES_ARTISTS + performancesId; final String redisKey = KylinRedisConst.PERFORMANCES_ARTISTS + performancesId;
Object obj = redisUtil.get(redisKey); try {
if (null == obj) { Object obj = redisUtil.get(redisKey);
KylinPerformanceVo performancesInfo = getPerformanceVo(performancesId); if (null == obj) {
if (null == performancesInfo) { KylinPerformanceVo performancesInfo = getPerformanceVo(performancesId);
return Collections.emptyList(); if (null == performancesInfo) {
} return Collections.emptyList();
}
List<KylinPerformanceArtistLineupVo> resultList = new ArrayList<>();
List<KylinTicketTimesVo> ticketTimeList = performancesInfo.getTicketTimeList();
if (!CollectionUtils.isEmpty(ticketTimeList)) { List<KylinPerformanceArtistLineupVo> resultList = new ArrayList<>();
for (KylinTicketTimesVo timesVo : ticketTimeList) { List<KylinTicketTimesVo> ticketTimeList = performancesInfo.getTicketTimeList();
if (timesVo.getType().equals(2)) {
continue; 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); }catch (Exception e){
return resultList; log.error("error:", e);
}else {
return (List<KylinPerformanceArtistLineupVo>)obj;
} }
return Collections.emptyList();
} }
public void setPerformanceArtists(String performancesId, List<KylinPerformanceArtistLineupVo> artistLineupVos){ public void setPerformanceArtists(String performancesId, List<KylinPerformanceArtistLineupVo> artistLineupVos){
......
...@@ -146,6 +146,7 @@ public class KylinTicketTimesPartnerServiceImpl implements IKylinTicketTimesPart ...@@ -146,6 +146,7 @@ public class KylinTicketTimesPartnerServiceImpl implements IKylinTicketTimesPart
@Override @Override
public ResponseDto<String> deleteTimes(String ticketTimesId, String performanceId) { public ResponseDto<String> deleteTimes(String ticketTimesId, String performanceId) {
try { try {
redisSlimeUtils.delPerformanceArtists(performanceId);
LocalDateTime updatedAt = LocalDateTime.now(); LocalDateTime updatedAt = LocalDateTime.now();
KylinTicketTimesPartnerVo data = mongoSlimeUtils.getTicketTimesPartnerVo(ticketTimesId); KylinTicketTimesPartnerVo data = mongoSlimeUtils.getTicketTimesPartnerVo(ticketTimesId);
if (data.getStatus() == 0) { if (data.getStatus() == 0) {
...@@ -193,6 +194,7 @@ public class KylinTicketTimesPartnerServiceImpl implements IKylinTicketTimesPart ...@@ -193,6 +194,7 @@ public class KylinTicketTimesPartnerServiceImpl implements IKylinTicketTimesPart
@Override @Override
public ResponseDto<KylinTicketTimesPartnerVo> changeTimes(CreateTicketTimesParam createTicketTimesParam) { public ResponseDto<KylinTicketTimesPartnerVo> changeTimes(CreateTicketTimesParam createTicketTimesParam) {
try { try {
redisSlimeUtils.delPerformanceArtists(createTicketTimesParam.getPerformancesId());
LocalDateTime updatedAt = LocalDateTime.now(); LocalDateTime updatedAt = LocalDateTime.now();
String title = ""; String title = "";
if (createTicketTimesParam.getType() == 1) { if (createTicketTimesParam.getType() == 1) {
......
...@@ -332,4 +332,13 @@ public class RedisSlimeUtils { ...@@ -332,4 +332,13 @@ public class RedisSlimeUtils {
String redisKey = KylinRedisConst.PERFORMANCES_NOTICE_REMIND_STATUS + performanceId; String redisKey = KylinRedisConst.PERFORMANCES_NOTICE_REMIND_STATUS + performanceId;
redisUtil.set(redisKey, noticeRemindStatus); 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