|
@@ -70,15 +70,19 @@ public class NewPageFirstNavigationController extends BaseController {
|
|
|
}
|
|
|
newPageFirstNavigation.setStatisticsType("4");
|
|
|
Page<NewPageFirstNavigation> page = newPageFirstNavigationService.findPage(new Page<NewPageFirstNavigation>(request, response), newPageFirstNavigation);
|
|
|
+ Integer number = newPageFirstNavigationService.getNumber("www", null);
|
|
|
model.addAttribute("page", page);
|
|
|
model.addAttribute("newPageFirstNavigation", newPageFirstNavigation);
|
|
|
+ model.addAttribute("number", number);
|
|
|
return "modules/newhome/newPageFirstNavigationList";
|
|
|
}
|
|
|
|
|
|
@RequiresPermissions("newhome:newPageFirstNavigation:view")
|
|
|
@RequestMapping(value = "form")
|
|
|
public String form(NewPageFirstNavigation newPageFirstNavigation, Model model) {
|
|
|
+ Integer number = newPageFirstNavigationService.getNumber("www", null);
|
|
|
model.addAttribute("newPageFirstNavigation", newPageFirstNavigation);
|
|
|
+ model.addAttribute("number", number);
|
|
|
return "modules/newhome/newPageFirstNavigationForm";
|
|
|
}
|
|
|
|
|
@@ -89,15 +93,21 @@ public class NewPageFirstNavigationController extends BaseController {
|
|
|
return form(newPageFirstNavigation, model);
|
|
|
}
|
|
|
// 判断如果已经存在10条数据则不允许添加(产品控制数量显示)
|
|
|
- NewPageFirstNavigation navigation = new NewPageFirstNavigation();
|
|
|
+ /*NewPageFirstNavigation navigation = new NewPageFirstNavigation();
|
|
|
navigation.setType(newPageFirstNavigation.getType());
|
|
|
- /*List<NewPageFirstNavigation> list = newPageFirstNavigationService.findList(navigation);
|
|
|
+ List<NewPageFirstNavigation> list = newPageFirstNavigationService.findList(navigation);
|
|
|
if (StringUtils.isEmpty(newPageFirstNavigation.getId())) {
|
|
|
if (CollectionUtils.isNotEmpty(list) && list.size() >= 10) {
|
|
|
addMessage(model, "最多添加10个主菜单!删除旧菜单后才能继续添加");
|
|
|
return form(newPageFirstNavigation, model);
|
|
|
}
|
|
|
}*/
|
|
|
+ Integer number = newPageFirstNavigationService.getNumber("www", null);
|
|
|
+ if (!"2".equals(newPageFirstNavigation.getType()) && null != number && number >= 8 && "1".equals(newPageFirstNavigation.getWwwEnabledStatus())) {
|
|
|
+ addMessage(redirectAttributes, "网站端最多只能启用8个菜单,请停用其他菜单后再重新添加");
|
|
|
+ model.addAttribute("message", "网站端最多只能启用8个菜单,请停用其他菜单后再重新添加");
|
|
|
+ return form(newPageFirstNavigation, model);
|
|
|
+ }
|
|
|
// 上传图片
|
|
|
if ("2".equals(newPageFirstNavigation.getType())) {
|
|
|
String image = newPageFirstNavigation.getIcon();
|
|
@@ -132,12 +142,24 @@ public class NewPageFirstNavigationController extends BaseController {
|
|
|
@RequiresPermissions("newhome:newPageFirstNavigation:edit")
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "updateEnabledStatus")
|
|
|
- public Map<String, Object> updateEnabledStatus(String enabledStatus, String[] ids, String www, String[] supplierIDs, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ public Map<String, Object> updateEnabledStatus(String enabledStatus, String[] ids, String www, String type, String[] supplierIDs, HttpServletRequest request, HttpServletResponse response) {
|
|
|
Map<String, Object> map = Maps.newLinkedHashMap();
|
|
|
try {
|
|
|
- newPageFirstNavigationService.updateEnabledStatusByIds(enabledStatus, ids);
|
|
|
- map.put("success", true);
|
|
|
- map.put("msg", "修改成功");
|
|
|
+ Integer number = newPageFirstNavigationService.getNumber(www, null);
|
|
|
+ if ("0".equals(enabledStatus)) {
|
|
|
+ newPageFirstNavigationService.updateEnabledStatusByIds(enabledStatus, ids);
|
|
|
+ map.put("success", true);
|
|
|
+ map.put("msg", "修改成功");
|
|
|
+ } else {
|
|
|
+ if (("0".equals(type) && null != number && number < 8) || "2".equals(type)) {
|
|
|
+ newPageFirstNavigationService.updateEnabledStatusByIds(enabledStatus, ids);
|
|
|
+ map.put("success", true);
|
|
|
+ map.put("msg", "修改成功");
|
|
|
+ } else {
|
|
|
+ map.put("success", false);
|
|
|
+ map.put("msg", "网站端最多只能启用8个菜单,请停用其他菜单后再重新启用本菜单。");
|
|
|
+ }
|
|
|
+ }
|
|
|
cleanRedisCache();// 清理缓存
|
|
|
} catch (Exception e) {
|
|
|
logger.debug(e.toString(), e);
|