Commit c078827f by zhengxj

finish 菜单搜索 on 20190121 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@16863 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 159a15b4
...@@ -13,12 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,12 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.glsx.common.utils.StringUtils; import com.glsx.common.utils.StringUtils;
import com.glsx.manager.constants.Constants;
import com.glsx.manager.mapper.SysMenuMapper; import com.glsx.manager.mapper.SysMenuMapper;
import com.glsx.manager.pojo.menu.SysMenu; import com.glsx.manager.pojo.menu.SysMenu;
import com.glsx.manager.pojo.menu.SysMenuExample; import com.glsx.manager.pojo.menu.SysMenuExample;
import com.glsx.manager.pojo.menu.SysMenuExample.Criteria; import com.glsx.manager.pojo.menu.SysMenuExample.Criteria;
import com.glsx.manager.service.ISysMenuService; import com.glsx.manager.service.ISysMenuService;
import com.glsx.manager.utils.CodeUtils;
/** /**
* @ClassName: SysMenuServiceImpl * @ClassName: SysMenuServiceImpl
...@@ -72,10 +72,16 @@ public class SysMenuServiceImpl implements ISysMenuService { ...@@ -72,10 +72,16 @@ public class SysMenuServiceImpl implements ISysMenuService {
list = menuDao.selectByExample(example); list = menuDao.selectByExample(example);
if (list == null || list.size() == 0) { if (list == null || list.size() == 0) {
sysMenu.setCreateTime(new Date()); sysMenu.setCreateTime(new Date());
sysMenu.setMenuGroup(CodeUtils.generateUniqueRandomCode(4));
}
} }
sysMenu.setMenuGroup(list.get(0).getMenuGroup()); byte label=(byte)1;
// 设置有无下级菜单
if(Constants.BUTTON==sysMenu.getMenuType() ){
label=(byte)0;
} }
sysMenu.setLabel(label);
i = menuDao.insertSelective(sysMenu); i = menuDao.insertSelective(sysMenu);
} }
...@@ -117,6 +123,7 @@ public class SysMenuServiceImpl implements ISysMenuService { ...@@ -117,6 +123,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
// 根据名字和状态所搜索 // 根据名字和状态所搜索
if (StringUtils.isNotNull(name)&&menuStatus != null) { if (StringUtils.isNotNull(name)&&menuStatus != null) {
example.setOrderByClause("sort asc");
criteria.andMenuStatusEqualTo(menuStatus); criteria.andMenuStatusEqualTo(menuStatus);
resultList = menuDao.selectByExample(example); resultList = menuDao.selectByExample(example);
return useListRecordToTreeByKeywords(resultList,name); return useListRecordToTreeByKeywords(resultList,name);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!