|
@@ -145,10 +145,27 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
if (param.getInsertOrUpdate() == InsertOrUpdateEnum.Update.getKey()){
|
|
|
- cacheFacade.clearCache(questionWrapper.getId());
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ ids.add(questionWrapper.getId());
|
|
|
+ clearAllCacheByIds(ids);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void clearAllCacheByIds(List<Long> ids){
|
|
|
+ if (ListUtil.isNotEmpty(ids)){
|
|
|
+ for (Long id : ids){
|
|
|
+ cacheFacade.clearCache(id);
|
|
|
+ }
|
|
|
+ //取父级
|
|
|
+ QueryWrapper<QuestionMapping> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.in("son_question", ids);
|
|
|
+
|
|
|
+ List<Long> pIds = questionMappingFacade.list(queryWrapper).stream()
|
|
|
+ .map(r->r.getParentQuestion())
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
+ clearAllCacheByIds(pIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 初始化参数
|