Commit 43727918 by 吴博

feat:[1003350] 小程序首页栏目资讯自更新

parent e28e2ca3
......@@ -93,7 +93,7 @@ public class AppletNewsPoolBizImpl implements AppletNewsPoolBiz {
if (MapUtils.isEmpty(appletNewsPoolMap)) {
return;
}
addResource(appletNewsPoolDTO);
appletNewsPoolIds.stream().forEach(id -> {
AppletNews appletNews = new AppletNews();
BeanUtils.copyProperties(appletNewsPoolDTO, appletNews);
......@@ -102,6 +102,7 @@ public class AppletNewsPoolBizImpl implements AppletNewsPoolBiz {
if (null == appletNewsPool) {
return;
}
addResource(appletNewsPool.getSource());
appletNews.setNewsName(appletNewsPool.getNewsName());
appletNews.setSource(appletNewsPool.getSource());
appletNews.setContent(appletNewsPool.getContent());
......@@ -116,11 +117,10 @@ public class AppletNewsPoolBizImpl implements AppletNewsPoolBiz {
}
}
private void addResource(AppletNewsPoolDTO appletNewsPoolDTO) {
String resource = appletNewsPoolDTO.getSource();
Boolean exist = appletNewsDao.newsSourceExist(resource);
private void addResource(String source) {
Boolean exist = appletNewsDao.newsSourceExist(source);
if (!exist) {
appletNewsDao.insertSource(resource);
appletNewsDao.insertSource(source);
}
return;
}
......
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