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

Commit 0e22266b authored by wangyifan's avatar wangyifan

修改演出阵容删除缓存

parent 0e2230c0
...@@ -140,8 +140,13 @@ public class KylinArtistServiceImpl extends ServiceImpl<KylinArtistMapper, Kylin ...@@ -140,8 +140,13 @@ public class KylinArtistServiceImpl extends ServiceImpl<KylinArtistMapper, Kylin
operationLogService.recordLog(artistId, 2, logContent); operationLogService.recordLog(artistId, 2, logContent);
} }
// TODO 根据艺人ID查询所有关联的演出,然后删除缓存中对应的演出阵容 // 根据艺人ID查询所有关联的演出,然后删除缓存中对应的演出阵容
List<String> performanceIdList = artistPerformanceMapper.selectPerformanceIdsByArtistIds(Collections.singletonList(artistId));
if (!performanceIdList.isEmpty()) {
for (String p : performanceIdList) {
dataUtils.delPerformanceArtists(p);
}
}
return true; return true;
} catch (Exception e) { } catch (Exception e) {
log.error("修改艺人失败", e); log.error("修改艺人失败", e);
...@@ -281,7 +286,13 @@ public class KylinArtistServiceImpl extends ServiceImpl<KylinArtistMapper, Kylin ...@@ -281,7 +286,13 @@ public class KylinArtistServiceImpl extends ServiceImpl<KylinArtistMapper, Kylin
operationLogService.recordLog(artistId, 3, logContent); operationLogService.recordLog(artistId, 3, logContent);
} }
// TODO 根据艺人ID查询所有关联的演出 // 根据艺人ID查询所有关联的演出
List<String> performanceIdList = artistPerformanceMapper.selectPerformanceIdsByArtistIds(artistIds);
if (!performanceIdList.isEmpty()) {
for (String p : performanceIdList) {
dataUtils.delPerformanceArtists(p);
}
}
return true; return true;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -26,4 +26,12 @@ public interface KylinArtistPerformanceMapper extends BaseMapper<KylinArtistPerf ...@@ -26,4 +26,12 @@ public interface KylinArtistPerformanceMapper extends BaseMapper<KylinArtistPerf
*/ */
List<KylinArtistPerformanceDao> selectArtistsByPerformanceAndTimes(@Param("performancesId") String performancesId, @Param("timesId") String timesId); List<KylinArtistPerformanceDao> selectArtistsByPerformanceAndTimes(@Param("performancesId") String performancesId, @Param("timesId") String timesId);
/**
* 根据艺人ID列表查询关联的演出ID列表
*
* @param artistIds 艺人ID集合
* @return 演出ID列表
*/
List<String> selectPerformanceIdsByArtistIds(@Param("artistIds") List<String> artistIds);
} }
...@@ -53,5 +53,14 @@ ...@@ -53,5 +53,14 @@
</if> </if>
ORDER BY ap.sort DESC, ap.created_at ASC ORDER BY ap.sort DESC, ap.created_at ASC
</select> </select>
<!-- 根据艺人ID列表查询关联的演出ID列表 -->
<select id="selectPerformanceIdsByArtistIds" resultType="java.lang.String">
SELECT DISTINCT performances_id
FROM kylin_artist_performance
WHERE artist_id IN
<foreach collection="artistIds" item="artistId" open="(" separator="," close=")">
#{artistId}
</foreach>
</select>
</mapper> </mapper>
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