Commit e28e2ca3 by 吴博

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

parent 9f817115
......@@ -4,6 +4,7 @@ import cn.hutool.core.util.PageUtil;
import com.alibaba.druid.sql.PagerUtils;
import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.biz.AppletNewsPoolBiz;
import com.pcloud.book.applet.dao.AppletNewsDao;
import com.pcloud.book.applet.dao.AppletNewsPoolDAO;
import com.pcloud.book.applet.dto.AppletNewsPoolDTO;
import com.pcloud.book.applet.entity.AppletNews;
......@@ -41,6 +42,8 @@ public class AppletNewsPoolBizImpl implements AppletNewsPoolBiz {
private AppletNewsBiz appletNewsBiz;
@Autowired
private RightsSettingBiz rightsSettingBiz;
@Autowired
private AppletNewsDao appletNewsDao;
@Override
@ParamLog("根据id获取详情")
......@@ -90,6 +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);
......@@ -112,6 +116,15 @@ public class AppletNewsPoolBizImpl implements AppletNewsPoolBiz {
}
}
private void addResource(AppletNewsPoolDTO appletNewsPoolDTO) {
String resource = appletNewsPoolDTO.getSource();
Boolean exist = appletNewsDao.newsSourceExist(resource);
if (!exist) {
appletNewsDao.insertSource(resource);
}
return;
}
private void importCheck(AppletNewsPoolDTO appletNewsPoolDTO) {
if (null == appletNewsPoolDTO) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "导入资讯不能为空");
......
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