|
|
@@ -41,6 +41,7 @@ public class NavigationService extends BaseTransaction {
|
|
|
private static final String COLLEGE_BOTTOM_CUSTOM_IDCARD = "FFKJ_COLLEGE_FOOTER_LINKS";
|
|
|
private static final Long NAVIGATION_CHARGE_MANAGE_CODE = 10020L;
|
|
|
private static final Long DEPARTMENT_MANAGE_TYPE_CODE = 10000L;
|
|
|
+ private static final Long DEFAULT_SORT_NUMBER = 9999L;
|
|
|
|
|
|
static Logger log = LogManager.getLogger(NavigationService.class);
|
|
|
|
|
|
@@ -56,6 +57,7 @@ public class NavigationService extends BaseTransaction {
|
|
|
|
|
|
WebsiteNavigation wn = (WebsiteNavigation) PojoUtil.formatRequest(getRequest(), WebsiteNavigation.class);
|
|
|
GeneralDBAccess gdba = getGdbaInstance();
|
|
|
+ applyDefaultSortNumber(wn);
|
|
|
|
|
|
if (!verifyNavigation(gdba, wn)) {
|
|
|
setResponsePackage(getResponseErrorMsgPackage());
|
|
|
@@ -119,6 +121,7 @@ public class NavigationService extends BaseTransaction {
|
|
|
WebsiteNavigation wn = (WebsiteNavigation) PojoUtil.formatRequest(getRequest(), WebsiteNavigation.class);
|
|
|
GeneralDBAccess gdba = getGdbaInstance();
|
|
|
WebsiteNavigation oldWn = getNavigationBeforeUpdate(gdba, wn);
|
|
|
+ applyDefaultSortNumber(wn);
|
|
|
|
|
|
if (!verifyNavigation(gdba, wn)) {
|
|
|
setResponsePackage(getResponseErrorMsgPackage());
|
|
|
@@ -155,7 +158,19 @@ public class NavigationService extends BaseTransaction {
|
|
|
return;
|
|
|
}
|
|
|
SortOrderUtil.updateSortNumber(gdba, "website_navigation", "navigationid", navigationid,
|
|
|
- SortOrderUtil.parseSortNumber(getParameter("sortNumber")));
|
|
|
+ getSubmittedSortNumberOrDefault());
|
|
|
+ }
|
|
|
+
|
|
|
+ private void applyDefaultSortNumber(WebsiteNavigation wn) {
|
|
|
+ if (wn == null || !hasSortNumberParameter()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ wn.setSortNumber(getSubmittedSortNumberOrDefault());
|
|
|
+ }
|
|
|
+
|
|
|
+ private Long getSubmittedSortNumberOrDefault() {
|
|
|
+ Long sortNumber = SortOrderUtil.parseSortNumber(getParameter("sortNumber"));
|
|
|
+ return sortNumber == null ? DEFAULT_SORT_NUMBER : sortNumber;
|
|
|
}
|
|
|
|
|
|
private WebsiteNavigation getNavigationBeforeUpdate(GeneralDBAccess gdba, WebsiteNavigation wn) {
|