Index: standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/controller/AdminDirectChatController.java =================================================================== diff -u -r6df0f3daa6240912227cc4bd250e822fd9529778 -rcb3f0e3e039178e43ef21197958a8a3f4c48dde4 --- standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/controller/AdminDirectChatController.java (.../AdminDirectChatController.java) (revision 6df0f3daa6240912227cc4bd250e822fd9529778) +++ standard/project/web/src/main/java/egovframework/api/rivalWar/directChat/controller/AdminDirectChatController.java (.../AdminDirectChatController.java) (revision cb3f0e3e039178e43ef21197958a8a3f4c48dde4) @@ -9,6 +9,7 @@ import egovframework.com.ext.jstree.springiBatis.core.validation.group.*; import egovframework.com.ext.jstree.support.mvc.GenericAbstractController; import egovframework.com.ext.jstree.support.util.DateUtils; +import egovframework.com.ext.jstree.support.util.ParameterParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +24,7 @@ import javax.servlet.http.HttpServletRequest; import java.util.HashSet; +import java.util.List; /** * Created by Administrator on 2017-09-24. @@ -52,17 +54,29 @@ */ @ResponseBody @RequestMapping(value = "/addNode.do", method = RequestMethod.POST) - public ModelAndView addNode(@Validated(value = AddNode.class) DirectChatDTO jsTreeHibernateDTO, BindingResult bindingResult, ModelMap model) throws Exception { + public ModelAndView addNode(@Validated(value = AddNode.class) DirectChatDTO jsTreeHibernateDTO, BindingResult bindingResult, ModelMap model, HttpServletRequest request) throws Exception { if (bindingResult.hasErrors()) throw new RuntimeException(); MenuDTO searchMenuDTO = new MenuDTO(); - Long menuCId = new Long(92); - searchMenuDTO.setC_id(menuCId); + ParameterParser parser = new ParameterParser(request); - MenuDTO menuDTO = menuService.getNode(searchMenuDTO); - jsTreeHibernateDTO.setMenuDTO(menuDTO); + if(null == parser.get("menuCId")){ + Long menuCId = new Long(3); + searchMenuDTO.setC_id(menuCId); + menuService.getChildNode(searchMenuDTO); + searchMenuDTO.setWhere("c_parentid", menuCId); + List list = menuService.getChildNode(searchMenuDTO); + MenuDTO recentMenuNode = list.get(0); + jsTreeHibernateDTO.setMenuDTO(recentMenuNode); + + }else{ + searchMenuDTO.setC_id(parser.getLong("menuCId")); + MenuDTO targetMenuNode = menuService.getNode(searchMenuDTO); + jsTreeHibernateDTO.setMenuDTO(targetMenuNode); + } + ModelAndView modelAndView = new ModelAndView("jsonView"); modelAndView.addObject("result", directChatService.addNode(jsTreeHibernateDTO));