菜单修改

This commit is contained in:
xu_lw
2019-09-07 10:30:57 +08:00
parent 1b3d282fab
commit a6670bd3af
4 changed files with 12 additions and 32 deletions
@@ -62,7 +62,7 @@ public class BuiMenuNavAction extends BaseAction {
pageEntity.setPag_no(1);
pageEntity.setLimit(9999);
BuiMenuDO menuDO = new BuiMenuDO();
List<BuiMenuDO> list = buiMenuMapper.selectPage(pageEntity, menuDO);
List<BuiMenuDO> list = buiMenuMapper.selectMenuPage(pageEntity, menuDO);
List<BuiMenuDTO> list2 = PUBUtils.menuProc1(list);
@@ -9,6 +9,8 @@ import com.yuangou.ecp.bp.core.common.message.YGBizMessage;
import com.yuangou.ecp.bp.core.common.message.YGBizMessageContext;
import com.yuangou.ecp.bp.core.common.message.YGEDB;
import com.yuangou.ecp.bp.core.common.yglib.YGATLParam;
import com.yuangou.ecp.bp.core.common.yglog4j.Logger;
import com.yuangou.ecp.bp.core.common.yglog4j.YGLogger;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -37,25 +39,15 @@ public class PUBUtils {
}
BuiMenuDTO menuDTO = new BuiMenuDTO();
BeanUtils.copyProperties(menuDO, menuDTO);
if( "0".equals(menuDTO.getMenuId())) {
if( menuDTO.getMenuId() == 0) {
list.add(menuDTO);
continue;
}
BuiMenuDTO parentMenuDTO = getParentMenuDTO(list, parentId);
if (parentMenuDTO == null) {
BuiMenuDO parentMenuDO = geParentMenuDO(menus, parentId);
if (parentMenuDO == null) {
// root
list.add(menuDTO);
continue;
} else {
parentMenuDTO = new BuiMenuDTO();
BeanUtils.copyProperties(parentMenuDO, parentMenuDTO);
list.add(parentMenuDTO);
}
throw new IllegalArgumentException("menu:[" + menuDO.getName() + "] not found parent:[" + menuDO.getParentName() + "]");
}
List<BuiMenuDTO> list1 = parentMenuDTO.getList();
list1.add(menuDTO);
}
@@ -181,23 +173,4 @@ public class PUBUtils {
root.setData(arrNam + "_num", String.valueOf(tmp1s.length));
return 1;
}
// public static String getPermissions(List<BuiMenuDO> menus) {
// List<String> permissions = new ArrayList<String>();
// for (BuiMenuDO menuDO : menus) {
// String perms = menuDO.getPerms();
// if (StringUtils.isNotBlank(perms)) {
// String[] values = StringUtils.split(perms, ",");
// for (String value : values) {
// if (!permissions.contains(value)) {
// permissions.add(value);
// }
// }
// }
// if (2 == menuDO.getType()) {
// continue;
// }
// }
// return StringUtils.join(permissions, "|");
// }
}
@@ -39,5 +39,6 @@ public interface BuiMenuMapper {
int deleteByIdCascade(Long menuId);
List<BuiMenuDO> selectMenuPage(YGPageEntity pageEntity, BuiMenuDO entity);
}
@@ -142,4 +142,10 @@
delete from t_bui_menu where menu_id in (select menu_id from t_bui_menu start with menu_id=${menuId} connect by prior menu_id = parent_id)
</delete>
<select id="selectMenuPage" resultType="com.murong.ecp.netpay.mbu.web.pub.dal.entity.BuiMenuDO">
select <include refid="base_column_list"/>, (select name from T_BUI_MENU where menu_id=a.parent_id) parent_name
from T_BUI_MENU a order by parent_id,menu_id
</select>
</mapper>