|
@@ -32,6 +32,7 @@ import space.apps.moudules.website.common.ConstVars.articleJumpTypeCode;
|
|
|
import space.apps.moudules.website.common.ConstVars.articleStatusCode;
|
|
import space.apps.moudules.website.common.ConstVars.articleStatusCode;
|
|
|
import space.apps.moudules.website.template.util.WebsiteTemplateArticleUtil;
|
|
import space.apps.moudules.website.template.util.WebsiteTemplateArticleUtil;
|
|
|
import space.apps.moudules.website.template.util.WebsiteTemplateNavUtil;
|
|
import space.apps.moudules.website.template.util.WebsiteTemplateNavUtil;
|
|
|
|
|
+import space.apps.moudules.website.template.util.WebsiteUtil;
|
|
|
import space.apps.moudules.website.util.AppWebsiteManageUtil;
|
|
import space.apps.moudules.website.util.AppWebsiteManageUtil;
|
|
|
import space.core.apps.common.BaseTransaction;
|
|
import space.core.apps.common.BaseTransaction;
|
|
|
import space.core.apps.common.ConstVars;
|
|
import space.core.apps.common.ConstVars;
|
|
@@ -63,6 +64,8 @@ public class ArticleService extends BaseTransaction {
|
|
|
private static final long serialVersionUID = 1L;
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
private static final String ARTICLE_PREVIEW_SESSION_PREFIX = "articlePreviewPath_";
|
|
private static final String ARTICLE_PREVIEW_SESSION_PREFIX = "articlePreviewPath_";
|
|
|
|
|
+ private static final Long NAVIGATION_STYLE_GRAPHIC_LIST = 10010L;
|
|
|
|
|
+ private static final String COLLEGE_RED_TEMPLATE_ID_CODE = "ffkjcollegered1";
|
|
|
private static final String ARTICLE_PUBLISHED_HISTORY_ROOT = "/web/upload/article-history/";
|
|
private static final String ARTICLE_PUBLISHED_HISTORY_ROOT = "/web/upload/article-history/";
|
|
|
private static final String PUBLISHED_CONTENT_SNAPSHOT_FIELD = "publishedContentSnapshot";
|
|
private static final String PUBLISHED_CONTENT_SNAPSHOT_FIELD = "publishedContentSnapshot";
|
|
|
private static final String PUBLISHED_EDIT_CONTENT_SNAPSHOT_FIELD = "publishedEditContentSnapshot";
|
|
private static final String PUBLISHED_EDIT_CONTENT_SNAPSHOT_FIELD = "publishedEditContentSnapshot";
|
|
@@ -216,7 +219,10 @@ public class ArticleService extends BaseTransaction {
|
|
|
if (wn == null) {
|
|
if (wn == null) {
|
|
|
return DEFAULT_FORWARD;
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
}
|
|
|
- if (!verifyArticleCopyNavigationList(gdba, navIdList)) {
|
|
|
|
|
|
|
+ if (!verifyGraphicListThumbnailRequired(gdba, wn, article, "发布栏目")) {
|
|
|
|
|
+ return DEFAULT_FORWARD;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!verifyArticleCopyNavigationList(gdba, navIdList, article)) {
|
|
|
return DEFAULT_FORWARD;
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -330,7 +336,10 @@ public class ArticleService extends BaseTransaction {
|
|
|
if (wn == null) {
|
|
if (wn == null) {
|
|
|
return DEFAULT_FORWARD;
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
}
|
|
|
- if (!verifyArticleCopyNavigationList(gdba, navIdList)) {
|
|
|
|
|
|
|
+ if (!verifyGraphicListThumbnailRequired(gdba, wn, article, "发布栏目")) {
|
|
|
|
|
+ return DEFAULT_FORWARD;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!verifyArticleCopyNavigationList(gdba, navIdList, article)) {
|
|
|
return DEFAULT_FORWARD;
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -410,7 +419,8 @@ public class ArticleService extends BaseTransaction {
|
|
|
return wn;
|
|
return wn;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private boolean verifyArticleCopyNavigationList(GeneralDBAccess gdba, String navIdList) throws Exception {
|
|
|
|
|
|
|
+ private boolean verifyArticleCopyNavigationList(GeneralDBAccess gdba, String navIdList, Article article)
|
|
|
|
|
+ throws Exception {
|
|
|
if (StringUtil.isNull(navIdList)) {
|
|
if (StringUtil.isNull(navIdList)) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -426,10 +436,55 @@ public class ArticleService extends BaseTransaction {
|
|
|
if (wn == null) {
|
|
if (wn == null) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!verifyGraphicListThumbnailRequired(gdba, wn, article, "抄送栏目")) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private boolean verifyGraphicListThumbnailRequired(GeneralDBAccess gdba, WebsiteNavigation wn, Article article,
|
|
|
|
|
+ String targetName) throws Exception {
|
|
|
|
|
+ if (!isCollegeRedGraphicListNavigation(gdba, wn)) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (article != null && StringUtil.notNull(article.getThumbnail())) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ setResponsePackage(getResponseWarningMsgPackage(targetName + "为图文列表时必须上传缩略图"));
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private boolean isCollegeRedGraphicListNavigation(GeneralDBAccess gdba, WebsiteNavigation wn) throws Exception {
|
|
|
|
|
+ if (wn == null || !NAVIGATION_STYLE_GRAPHIC_LIST.equals(wn.getWnlscode())) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return isCollegeRedTemplateNavigation(gdba, wn);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private boolean isCollegeRedTemplateNavigation(GeneralDBAccess gdba, WebsiteNavigation wn) throws Exception {
|
|
|
|
|
+ Long wtid = wn == null ? null : wn.getWtid();
|
|
|
|
|
+ if (wtid == null && wn != null && wn.getWebsiteid() != null) {
|
|
|
|
|
+ Website website = WebsiteUtil.getWebsiteByID(gdba, wn.getWebsiteid());
|
|
|
|
|
+ wtid = website == null ? null : website.getWtid();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (wtid == null) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return isCollegeRedTemplateIdCode(gdba, wtid);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private boolean isCollegeRedTemplateIdCode(GeneralDBAccess gdba, Long wtid) throws Exception {
|
|
|
|
|
+ String sql = " select id_code from website_template where wtid = :wtid ";
|
|
|
|
|
+ SqlCommandImpl sqlCmd = new SqlCommandImpl(sql);
|
|
|
|
|
+ sqlCmd.setString("wtid", wtid);
|
|
|
|
|
+ Map<String, Object> templateMap = gdba.selectAsMap(sqlCmd);
|
|
|
|
|
+ Object idCode = templateMap == null ? null : templateMap.get("id_code");
|
|
|
|
|
+ return idCode != null && idCode.toString().indexOf(COLLEGE_RED_TEMPLATE_ID_CODE) >= 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private boolean isArticleTargetNavigation(WebsiteNavigation wn) {
|
|
private boolean isArticleTargetNavigation(WebsiteNavigation wn) {
|
|
|
if (wn == null || wn.getWntcode() == null) {
|
|
if (wn == null || wn.getWntcode() == null) {
|
|
|
return false;
|
|
return false;
|
|
@@ -537,7 +592,10 @@ public class ArticleService extends BaseTransaction {
|
|
|
if (wn == null) {
|
|
if (wn == null) {
|
|
|
return TIPS_FORWARD;
|
|
return TIPS_FORWARD;
|
|
|
}
|
|
}
|
|
|
- if (!verifyArticleCopyNavigationList(gdba, navIdList)) {
|
|
|
|
|
|
|
+ if (!verifyGraphicListThumbnailRequired(gdba, wn, article, "发布栏目")) {
|
|
|
|
|
+ return TIPS_FORWARD;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!verifyArticleCopyNavigationList(gdba, navIdList, article)) {
|
|
|
return TIPS_FORWARD;
|
|
return TIPS_FORWARD;
|
|
|
}
|
|
}
|
|
|
|
|
|