|
|
@@ -11,8 +11,10 @@ import java.util.Map;
|
|
|
import space.apps.moudules.website.template.common.WebsiteCommonService;
|
|
|
import space.apps.moudules.website.template.common.WebsiteNavManager;
|
|
|
import space.apps.moudules.website.template.common.bean.NavigationMiniView;
|
|
|
+import space.apps.moudules.website.template.util.WebsiteTemplateArticleUtil;
|
|
|
import space.apps.moudules.website.template.util.WebsiteTemplateNavUtil;
|
|
|
import space.core.apps.common.BaseTransaction;
|
|
|
+import space.core.db.bean.base.PageBean;
|
|
|
import space.core.db.jdbc.GeneralDBAccess;
|
|
|
|
|
|
/**
|
|
|
@@ -33,6 +35,8 @@ public class WebSiteArticleService extends BaseTransaction {
|
|
|
private static final String FOOTER_LOGO_IDCARD = "FFKJ_DEPT_FOOTER_LOGO";
|
|
|
// 首页只展示 8 条,但需要多取候选,避免审核中的新稿被过滤后不足 8 条。
|
|
|
private static final int HOME_NEWS_FETCH_SIZE = 64;
|
|
|
+ // 首页专业介绍固定展示 6 条,多取候选避免审核中的文章被过滤后不足。
|
|
|
+ private static final int HOME_MAJOR_FETCH_SIZE = 12;
|
|
|
|
|
|
private static final String[] INDUSTRY_TABS = {
|
|
|
"FFKJ_XG_HOME_INDUSTRY_COOP", "FFKJ_XG_HOME_INDUSTRY_TRAINING", "FFKJ_XG_HOME_INDUSTRY_AWARD"
|
|
|
@@ -110,10 +114,25 @@ public class WebSiteArticleService extends BaseTransaction {
|
|
|
List<Map<String, Object>> majors = majorNav == null ? null
|
|
|
: WebsiteTemplateNavUtil.getChildrenNav(gdba, website, majorNav.getNavigationid());
|
|
|
setRequestAttribute("homeMajors", majors == null ? new ArrayList<Map<String, Object>>() : majors);
|
|
|
+ setRequestAttribute("homeMajorArticles", getMajorArticles(gdba, majorNav, HOME_MAJOR_FETCH_SIZE));
|
|
|
setRequestAttribute("homeAdmissionTabs", getHomeAdmissionTabs(gdba, website, majorNav));
|
|
|
setRequestAttribute("homeAdmissionTabsUnified", Boolean.TRUE);
|
|
|
}
|
|
|
|
|
|
+ private List<Map<String, Object>> getMajorArticles(GeneralDBAccess gdba, WebsiteNavigation majorNav, int size) {
|
|
|
+ if (majorNav == null) {
|
|
|
+ return new ArrayList<Map<String, Object>>();
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ PageBean pb = new PageBean();
|
|
|
+ pb.setRowCountPerPage(size);
|
|
|
+ List<Map<String, Object>> articles = WebsiteTemplateArticleUtil.getArticleList(gdba, majorNav, pb);
|
|
|
+ return articles == null ? new ArrayList<Map<String, Object>>() : articles;
|
|
|
+ } catch (Exception e) {
|
|
|
+ return new ArrayList<Map<String, Object>>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private List<NavigationMiniView> getHomeAdmissionTabs(GeneralDBAccess gdba, Website website,
|
|
|
WebsiteNavigation majorNav) throws Exception {
|
|
|
List<AdmissionTabConfig> configs = new ArrayList<AdmissionTabConfig>();
|