From eda5d0e998204c7a49ab84d8528569b765bec2f9 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期五, 20 十二月 2019 10:05:10 +0800 Subject: [PATCH] 品牌日志 --- fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java index d5876da..f2f8c16 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java @@ -285,7 +285,7 @@ } @Override - @Transactional + @Transactional(rollbackFor=Exception.class) public void updateOrder(Long id, Integer moveType, Integer sex) throws SpecialException { if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1)) || sex == null) { @@ -337,7 +337,7 @@ } @Override - @Transactional + @Transactional(rollbackFor = Exception.class) public int deleteBatchByPrimaryKey(List<Long> list) throws Exception { List<Special> listSpecial = specialMapper.queryByListPrimaryKey(list); for (Special special : listSpecial) { @@ -351,6 +351,15 @@ COSManager.getInstance().deleteFile(subPicture); } } + + if (listSpecial != null) + for (Special special : listSpecial) { + List<AdActivityVersionControl> versionList = adActivityVersionControlService + .listByTypeAndSourceId(AdActivityType.special, special.getId()); + if (versionList != null) + for (AdActivityVersionControl control : versionList) + adActivityVersionControlService.deleteByPrimaryKey(control.getId()); + } return specialMapper.deleteBatchByPrimaryKey(list); } @@ -448,8 +457,10 @@ @Override @Cacheable(value = "specialCache", key = "'listByVersion-'+#start+'-'+#count+'-'+#card+'-'+#platform+'-'+#versionCode") - public List<Special> listByVersion(long start, int count, String card, Integer platform, Integer versionCode) { - return specialMapper.listByVersion(start, count, card, platform, versionCode); + public List<Special> listByVersion(long start, int count, String card, String platform, Integer versionCode) { + List<Special> specialList = specialMapper.listByPlaceKey(card, null, null, null); + filterSpecial(specialList, platform, versionCode); + return specialList; } /** -- Gitblit v1.8.0