Commit 55d6c618e51a76ce20a73c05058d648478fbc922
1 parent
ab1d5b4a
2022年10月1日20:11:12 删除封面图文件的时候, 找到已经逻辑删除的主题
Showing
5 changed files
with
33 additions
and
1 deletions
fw-dalaran-dao/src/main/java/cn/fw/dalaran/dao/ActivityThemeDao.java
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | import org.apache.ibatis.annotations.Mapper; | 5 | import org.apache.ibatis.annotations.Mapper; |
6 | import org.apache.ibatis.annotations.Param; | 6 | import org.apache.ibatis.annotations.Param; |
7 | 7 | ||
8 | +import java.util.List; | ||
9 | + | ||
8 | /** | 10 | /** |
9 | * @author wmy3969 | 11 | * @author wmy3969 |
10 | * @version 1.0 | 12 | * @version 1.0 |
@@ -19,4 +21,11 @@ public interface ActivityThemeDao extends BaseMapper<ActivityTheme> { | @@ -19,4 +21,11 @@ public interface ActivityThemeDao extends BaseMapper<ActivityTheme> { | ||
19 | * @param param 修改的参数封装 | 21 | * @param param 修改的参数封装 |
20 | */ | 22 | */ |
21 | boolean alertTheme(@Param("param") ActivityTheme param); | 23 | boolean alertTheme(@Param("param") ActivityTheme param); |
24 | + | ||
25 | + /** | ||
26 | + * 获取已经逻辑删除的主题列表 | ||
27 | + * | ||
28 | + * @return 已经逻辑删除的主题列表 | ||
29 | + */ | ||
30 | + List<ActivityTheme> getHasDelActivityTheme(); | ||
22 | } | 31 | } |
fw-dalaran-dao/src/main/resources/mapper/ActivityThemeDaoMapper.xml
@@ -43,4 +43,9 @@ | @@ -43,4 +43,9 @@ | ||
43 | </if> | 43 | </if> |
44 | </where> | 44 | </where> |
45 | </update> | 45 | </update> |
46 | + | ||
47 | + <select id="getHasDelActivityTheme" resultType="cn.fw.dalaran.domain.db.ActivityTheme"> | ||
48 | + SELECT * from activity_theme where logic_del = 1 | ||
49 | + </select> | ||
50 | + | ||
46 | </mapper> | 51 | </mapper> |
fw-dalaran-server/src/main/java/cn/fw/dalaran/server/task/OtherTask.java
@@ -38,7 +38,8 @@ public class OtherTask { | @@ -38,7 +38,8 @@ public class OtherTask { | ||
38 | .list() | 38 | .list() |
39 | .stream() | 39 | .stream() |
40 | .filter(item -> activityThemeService.themeHaveStopCatchData(item.getEndTime(), 7)) | 40 | .filter(item -> activityThemeService.themeHaveStopCatchData(item.getEndTime(), 7)) |
41 | - .collect(Collectors.toList());// 找到需要审计的主题 | 41 | + .collect(Collectors.toList());// 找到需要删除的主题 |
42 | + themeList.addAll(activityThemeService.getHasDelActivityTheme());// 找到已经逻辑删除的主题 | ||
42 | if (CollectionUtils.isEmpty(themeList)) | 43 | if (CollectionUtils.isEmpty(themeList)) |
43 | return; | 44 | return; |
44 | String tempDir = common.getActivityThemeCoverDir(); | 45 | String tempDir = common.getActivityThemeCoverDir(); |
fw-dalaran-service/src/main/java/cn/fw/dalaran/service/data/ActivityThemeService.java
@@ -111,4 +111,11 @@ public interface ActivityThemeService extends IService<ActivityTheme> { | @@ -111,4 +111,11 @@ public interface ActivityThemeService extends IService<ActivityTheme> { | ||
111 | * @return 主题是否结束数据抓取 | 111 | * @return 主题是否结束数据抓取 |
112 | */ | 112 | */ |
113 | boolean themeHaveStopCatchData(Date themeEndTime, int delayDays); | 113 | boolean themeHaveStopCatchData(Date themeEndTime, int delayDays); |
114 | + | ||
115 | + /** | ||
116 | + * 获取已经逻辑删除的主题列表 | ||
117 | + * | ||
118 | + * @return 已经逻辑删除的主题列表 | ||
119 | + */ | ||
120 | + List<ActivityTheme> getHasDelActivityTheme(); | ||
114 | } | 121 | } |
fw-dalaran-service/src/main/java/cn/fw/dalaran/service/data/impl/ActivityThemeServiceImpl.java
@@ -435,4 +435,14 @@ public class ActivityThemeServiceImpl extends ServiceImpl<ActivityThemeDao, Acti | @@ -435,4 +435,14 @@ public class ActivityThemeServiceImpl extends ServiceImpl<ActivityThemeDao, Acti | ||
435 | );// 设置文件信息 | 435 | );// 设置文件信息 |
436 | } | 436 | } |
437 | 437 | ||
438 | + /** | ||
439 | + * 获取已经逻辑删除的主题列表 | ||
440 | + * | ||
441 | + * @return 已经逻辑删除的主题列表 | ||
442 | + */ | ||
443 | + @Override | ||
444 | + public List<ActivityTheme> getHasDelActivityTheme() { | ||
445 | + return activityThemeDao.getHasDelActivityTheme(); | ||
446 | + } | ||
447 | + | ||
438 | } | 448 | } |