| | |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import com.moral.common.bean.PageBean; |
| | | import com.moral.common.util.ExampleUtil; |
| | | import com.moral.entity.Menu; |
| | | import com.moral.entity.RoleMenu; |
| | | import com.moral.mapper.MenuMapper; |
| | | import com.moral.mapper.RoleMenuMapper; |
| | | import com.moral.service.MenuService; |
| | | import com.moral.util.TkMybatisUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import tk.mybatis.mapper.entity.Example; |
| | | |
| | | @Service |
| | |
| | | Example example = new Example(ENTITY_CLASS); |
| | | example.or().andIn("id", Arrays.asList(ids)); |
| | | menuMapper.updateByExampleSelective(menu, example); |
| | | Example roleMenuExample = new Example(RoleMenu.class); |
| | | roleMenuExample.or().andIn("menuId", Arrays.asList(ids)); |
| | | roleMenuMapper.deleteByExample(roleMenuExample); |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<Menu> menuList = menuMapper.getMenuListInfo(); |
| | | List<Menu> zNodes = new ArrayList<>(); |
| | | for (Menu menu : menuList) { |
| | | if (menu.getMenuOrder().toString().length() == 2) { |
| | | if (menu.getMenuOrder().toString().substring(0, 1).equals("1")) { |
| | | menu.setMenuParentId(Integer.valueOf(menu.getMenuOrder().toString().substring(0, 1))); |
| | | } else if (menu.getMenuOrder().toString().length() == 3) { |
| | | menu.setMenuParentId(Integer.valueOf(menu.getMenuOrder().toString().substring(0, 2))); |
| | | } else { |
| | | if (menu.getMenuOrder().toString().length() == 2) { |
| | | menu.setMenuParentId(Integer.valueOf(menu.getMenuOrder().toString().substring(0, 1))); |
| | | } else if (menu.getMenuOrder().toString().length() == 3) { |
| | | menu.setMenuParentId(Integer.valueOf(menu.getMenuOrder().toString().substring(0, 2))); |
| | | } |
| | | } |
| | | zNodes.add(menu); |
| | | } |