|
@@ -99,7 +99,7 @@ public class WebSiteArticleService extends space.apps.moudules.website.template.
|
|
|
setRequestAttribute("educationActiveSidebarNavId", firstChild.get("navigationid"));
|
|
setRequestAttribute("educationActiveSidebarNavId", firstChild.get("navigationid"));
|
|
|
|
|
|
|
|
if (Long.valueOf(10060L).equals(childNav.getWntcode())) {
|
|
if (Long.valueOf(10060L).equals(childNav.getWntcode())) {
|
|
|
- Map<String, Object> articleMap = WebsiteArticleManager.getFristArticleByWn(gdba, website, childNav);
|
|
|
|
|
|
|
+ Map<String, Object> articleMap = findSinglePageArticle(gdba, website, childNav);
|
|
|
if (articleMap != null) {
|
|
if (articleMap != null) {
|
|
|
WebsiteTemplateArticleUtil.setArticleAttrToRequest(website, articleMap, getRequest());
|
|
WebsiteTemplateArticleUtil.setArticleAttrToRequest(website, articleMap, getRequest());
|
|
|
setRequestAttribute("educationSinglePage", Boolean.TRUE);
|
|
setRequestAttribute("educationSinglePage", Boolean.TRUE);
|
|
@@ -124,6 +124,32 @@ public class WebSiteArticleService extends space.apps.moudules.website.template.
|
|
|
setRequestAttribute("curPageNo", articleListView.getPage().getCurrentPageNo());
|
|
setRequestAttribute("curPageNo", articleListView.getPage().getCurrentPageNo());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 单页栏目优先展示真实发布文章,模板初始占位内容仅在没有真实文章时兜底。
|
|
|
|
|
+ */
|
|
|
|
|
+ private Map<String, Object> findSinglePageArticle(GeneralDBAccess gdba, Website website,
|
|
|
|
|
+ WebsiteNavigation navigation) throws Exception {
|
|
|
|
|
+ PageBean pb = new PageBean();
|
|
|
|
|
+ pb.setRowCountPerPage(100);
|
|
|
|
|
+ pb.setCurrentPageNo(1);
|
|
|
|
|
+ ArticleListView articleListView = WebsiteArticleManager.getArticleListView(gdba, website,
|
|
|
|
|
+ Long.valueOf(navigation.getNavigationid()), pb);
|
|
|
|
|
+ List<Map<String, Object>> articles = articleListView.getArticleList();
|
|
|
|
|
+ if (articles != null) {
|
|
|
|
|
+ for (Map<String, Object> article : articles) {
|
|
|
|
|
+ if (article != null && !isInitialArticle(article)) {
|
|
|
|
|
+ return article;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return WebsiteArticleManager.getFristArticleByWn(gdba, website, navigation);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private boolean isInitialArticle(Map<String, Object> article) {
|
|
|
|
|
+ Object source = article.get("source");
|
|
|
|
|
+ return source != null && "教育学院模板初始内容".equals(source.toString().trim());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void loadCommonData() throws Exception {
|
|
private void loadCommonData() throws Exception {
|
|
|
GeneralDBAccess gdba = getGdbaInstance();
|
|
GeneralDBAccess gdba = getGdbaInstance();
|
|
|
Website website = getWebsite();
|
|
Website website = getWebsite();
|