package com.philisense.www.controller.web;

import com.philisense.www.annotation.log.OperateLog;
import com.philisense.www.common.config.CommonConst;
import com.philisense.www.constant.TreeConstant;
import com.philisense.www.controller.BaseUtilController;
import com.philisense.www.core.text.Convert;
import com.philisense.www.service.ProMenuService;
import com.philisense.www.utils.ActiveUserUtils;
import com.philisense.www.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

@RestController
@RequestMapping(CommonConst.WEB_REST_SERVICE_PREFICX + "promenu")
@Api(tags = "ProMenuControllerForWeb|一个用来操作-{菜单表}-业务模块的控制器")
public class ProMenuControllerForWeb extends BaseUtilController {

    @Autowired
    private ProMenuService proMenuService;


    @GetMapping("/delete")
    @ApiOperation(value = "根据-{菜单表}-主键删除记录", notes = "成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
    @ApiImplicitParam(paramType = "query", name = "recordid", value = "记录主键", required = true,  dataTypeClass = String.class)
    @OperateLog(name = "根据-{菜单表}-主键删除记录", value = "delete", type = "PC")
    public Map<String, Object> deleteByPrimaryKeyForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestParam String recordid) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            int flag = proMenuService.deleteByPrimaryKey(recordid);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, DELETE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, DELETE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @GetMapping("/get")
    @ApiOperation(value = "根据-{菜单表}-主键查询记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"datarecord\":\"{}\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParam(paramType = "body", name = "recordid", value = "记录主键", required = true,  dataTypeClass = String.class)
    @OperateLog(name = "根据-{菜单表}-主键查询记录", value = "query", type = "PC")
    public Map<String, Object> selectByPrimaryKeyForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestParam String recordid) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATARECORD, proMenuService.selectByPrimaryKey(recordid));
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/insert")
    @ApiOperation(value = "根据-{菜单表}-对象插入记录", notes = "成功返回:{\"success\":true,\"message\",\"数据插入成功\"},失败返回:{\"success\":false,\"message\",\"数据插入失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象插入记录", value = "insert", type = "PC")
    public Map<String, Object> insertForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            String ID = UUID.randomUUID().toString().replaceAll("-", "");
            map.put("recordid", ID);
            map.put("id", ID);
            map.put("key", ID);
            map.put("title", map.get("text"));
            map.put("levelcode", map.get("levelcode") + "/" + ID);
            map.put("enable", "1");
            map.put("valid", "1");
            proMenuService.insert(map);
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, INSERT_SUCCESS_MSG);
            result.put(DATARECORD, map);
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, INSERT_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/update")
    @ApiOperation(value = "根据-{菜单表}-对象更新记录", notes = "成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象更新记录", value = "update", type = "PC")
    public Map<String, Object> updateForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            String ID = map.get("id") + "";
            if (ID.equals("")) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG + "记录ID不能为空");
                return result;
            }
            Map<String, Object> temmap = proMenuService.selectByPrimaryKey(ID);

            if (null == temmap || temmap.size() == 0) {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG + ID + "记录不存在");
                return result;
            }


            /*temmap.put("component", map.get("component"));
            temmap.put("href", map.get("href"));
            temmap.put("i18n_name", map.get("i18n_name"));
            temmap.put("icon", map.get("icon"));
            temmap.put("id", map.get("id"));
            temmap.put("levelcode", map.get("levelcode"));
            temmap.put("parentid", map.get("parentid"));
            temmap.put("recordid", map.get("recordid"));
            temmap.put("redirect", map.get("redirect"));
            temmap.put("text", map.get("text"));*/
            temmap.putAll(map);


            int flag = proMenuService.update(temmap);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, UPDATE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/deleteByMap")
    @ApiOperation(value = "根据-{菜单表}-对象Map删除记录", notes = "成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map删除记录", value = "delete", type = "PC")
    public Map<String, Object> deleteByMapForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            int flag = proMenuService.deleteByMap(map);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, DELETE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, DELETE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/updateByMap")
    @ApiOperation(value = "根据-{菜单表}-对象Map更新记录", notes = "成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map更新记录", value = "update", type = "PC")
    public Map<String, Object> updateByMapForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {


            int flag = proMenuService.updateByMap(map);
            if (1 == flag) {
                result.put(DATASUCCESS, SUCCESSFLAG);
                result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);
            } else {
                result.put(DATASUCCESS, ERRORFLAG);
                result.put(DATAMESSAGE, UPDATE_FAIL_MSG);
            }

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, UPDATE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/getOne")
    @ApiOperation(value = "根据-{菜单表}-对象Map查询记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"datarecord\":\"{}\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map查询记录", value = "query", type = "PC")
    public Map<String, Object> getOneForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATARECORD, proMenuService.getOne(map));
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/getAll")
    @ApiOperation(value = "根据-{菜单表}-对象Map查询所有记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map查询所有记录", value = "query", type = "PC")
    public Map<String, Object> getAllForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST_VUE, proMenuService.getAll(map));
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping( "/queryPage")
    @ApiOperation(value="根据-{菜单表}-对象Map分页记录", notes="成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
        @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map分页记录",value = "query",type = "PC")
    public Map<String, Object>  queryPageForProMenuForWeb(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
    {
            Map<String, Object> result = new HashMap<String, Object>();
            try {

            int currentPage = map.get(DATACURRENT)!=null?Integer.parseInt(map.get(DATACURRENT)+"")-1:0;
            int pageSize = map.get(PAGESIZE)!=null?Integer.parseInt(map.get(PAGESIZE)+""):10;
            int pageStart = currentPage*pageSize ;


            map.put(PAGESIZE,pageSize);
            map.put(PAGESTART,pageStart);

            int total = proMenuService.count(map);
            List<Map<String, Object>> datalist = new ArrayList<Map<String, Object>>();
            if(total>0){
            datalist = proMenuService.queryPage(map);
            }
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST,datalist);
            Map<String, Object> pagemode = new HashMap<String, Object>();
            pagemode.put(DATATOTAL,total);
            pagemode.put(PAGESIZE,map.get(PAGESIZE)!=null?map.get(PAGESIZE):10);
            pagemode.put(DATACURRENT,map.get(DATACURRENT)!=null?map.get(DATACURRENT):0);
            result.put(PAGINATION,pagemode);
            }catch(Exception e){
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG+e.getMessage());
            }
            return result;
    }


    @PostMapping( "/queryPageVue")
    @ApiOperation(value="根据-{菜单表}-对象Map分页记录", notes="成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
        @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map分页记录",value = "query",type = "PC")
    public Map<String, Object>  queryPageVueForProMenuForWeb(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
    {
            Map<String, Object> result = new HashMap<String, Object>();
            try {

            int currentPage = map.get(DATACURRENT_VUE)!=null?Integer.parseInt(map.get(DATACURRENT_VUE)+"")-1:0;
            int pageSize = map.get(PAGESIZE_VUE)!=null?Integer.parseInt(map.get(PAGESIZE_VUE)+""):10;
            int pageStart = currentPage*pageSize ;


            map.put(PAGESIZE_VUE,pageSize);
            map.put(PAGESTART,pageStart);

            int total = proMenuService.count(map);
            List<Map<String, Object>> datalist = new ArrayList<Map<String, Object>>();
            if(total>0){
            datalist = proMenuService.queryPage(map);
            }
            Map<String, Object> tempresult = new HashMap<String, Object>();
            tempresult.put(DATASUCCESS, SUCCESSFLAG);
            tempresult.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            tempresult.put(DATALIST_VUE,datalist);
            tempresult.put(DATATOTAL_VUE,total);
            tempresult.put(PAGESIZE_VUE,map.get(PAGESIZE_VUE)!=null?map.get(PAGESIZE_VUE):10);
            tempresult.put(DATACURRENT_VUE,map.get(DATACURRENT_VUE)!=null?map.get(DATACURRENT_VUE):0);
            result.put(DATARESULT, tempresult);
            }catch(Exception e){
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG+e.getMessage());
            }
            return result;
    }



    @PostMapping( "/queryPageOracle")
    @ApiOperation(value="根据-{菜单表}-对象Map分页记录", notes="成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
        @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map分页记录",value = "query",type = "PC")
    public Map<String, Object>  queryPageOracleForProMenuForWeb(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
    {
            Map<String, Object> result = new HashMap<String, Object>();
            try {

            int currentPage = map.get(DATACURRENT)!=null?Integer.parseInt(map.get(DATACURRENT)+""):1;
            int pageSize = map.get(PAGESIZE)!=null?Integer.parseInt(map.get(PAGESIZE)+""):10;
            int pageStart = currentPage*pageSize ;


            map.put(PAGESTART,(currentPage-1)*pageSize);
            map.put(PAGEEND,currentPage*pageSize);

            int total = proMenuService.count(map);
            List<Map<String, Object>> datalist = new ArrayList<Map<String, Object>>();
            if(total>0){
            datalist = proMenuService.queryPage(map);
            }
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST,datalist);
            Map<String, Object> pagemode = new HashMap<String, Object>();
            pagemode.put(DATATOTAL,total);
            pagemode.put(PAGESIZE,map.get(PAGESIZE)!=null?map.get(PAGESIZE):10);
            pagemode.put(DATACURRENT,map.get(DATACURRENT)!=null?map.get(DATACURRENT):0);
            result.put(PAGINATION,pagemode);
            }catch(Exception e){
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG+e.getMessage());
            }
            return result;
    }

    @PostMapping("/count")
    @ApiOperation(value = "根据-{菜单表}-对象Map统计查询总数记录", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map统计查询总数记录", value = "query", type = "PC")
    public Map<String, Object> countForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATATOTAL_VUE, proMenuService.count(map));
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/insertBatch")
    @ApiOperation(value = "根据-{菜单表}-对象Map批量插入记录", notes = "成功返回:{\"success\":true,\"message\",\"数据插入成功\"},失败返回:{\"success\":false,\"message\",\"数据插入失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map批量插入记录", value = "insert", type = "PC")
    public Map<String, Object> insertBatchForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Map<String, Object>> list) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            for (Map<String, Object> map : list) {
                String ID = UUID.randomUUID().toString().replaceAll("-", "");
                map.put("recordid", ID);
                map.put("id", ID);
            }

            proMenuService.insertBatch(list);
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, INSERT_SUCCESS_MSG);
        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, INSERT_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/deleteBatch")
    @ApiOperation(value = "根据-{菜单表}-对象Map批量删除记录", notes = "成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map批量删除记录", value = "delete", type = "PC")
    public Map<String, Object> deleteBatchForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Map<String, Object>> list) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            proMenuService.deleteBatch(list);
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, DELETE_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/updateBatch")
    @ApiOperation(value = "根据-{菜单表}-对象Map批量更新记录", notes = "成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "recordid", value = "菜单Id", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "id", value = "菜单编号", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "text", value = "菜单名称", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "indexs", value = "位置", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "icon", value = "图标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "sequences", value = "顺序", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "href", value = "链接", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hreftarget", value = "弹出目标", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "enable", value = "是否可用", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "valid", value = "是否有效", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaf", value = "是否叶子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "isframe", value = "是否frame", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "leaftype", value = "节点级别", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "cls", value = "层叠样式", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "component", value = "前端动态组件路径", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "i18n_name", value = "菜单国际化", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "redirect", value = "重定向路由地址", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideInMenu", value = "本节隐藏", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideChildrenInMenu", value = "隐藏父节点的孩子", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "hideLayout", value = "是否使用layout布局", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "根据-{菜单表}-对象Map批量更新记录", value = "update", type = "PC")
    public Map<String, Object> updateBatchForProMenuForWeb(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Map<String, Object>> list) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {


            proMenuService.updateBatch(list);
            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, UPDATE_FAIL_MSG + e.getMessage());
        }
        return result;
    }


    @PostMapping("/getProMenuTreeByParentid")
    @ApiOperation(value = "查询所有菜单数据根据父节点id", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "查询所有菜单数据根据父节点id", value = "query", type = "PC")
    public Map<String, Object> getProMenuTreeByParentid(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            List<Map<String, Object>> treedata = proMenuService.getProMenuTreeByParentid(map);


            for (Map<String, Object> tree : treedata) {
                tree.put("key", tree.get("id"));
                tree.put("title", tree.get("text"));

            }

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST, treedata);


        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }
    @PostMapping("/getProMenuTreeByParentidVue")
    @ApiOperation(value = "查询所有菜单数据根据父节点id", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "查询所有菜单数据根据父节点id", value = "query", type = "PC")
    public Map<String, Object> getProMenuTreeByParentidVue(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            List<Map<String, Object>> treedata = proMenuService.getProMenuTreeByParentid(map);


            for (Map<String, Object> tree : treedata) {
                tree.put("key", tree.get("id"));
                tree.put("title", tree.get("text"));

            }

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST_VUE, treedata);


        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/getProMenuTreeByLevelCode")
    @ApiOperation(value = "查询所有菜单数据根据层次码", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "查询所有菜单数据根据层次码", value = "query", type = "PC")
    public Map<String, Object> getProMenuTreeByLevelCode(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            String parentid = map.get("parentid") + "";
            //查询子集节点
            List<Map<String, Object>> treedata = proMenuService.getProMenuTreeByLevelCode(map);

            List<Map<String, Object>> parenttreedata = new ArrayList<Map<String, Object>>();

            if (null != treedata && treedata.size() > 0) {

                //一级树节点
                for (Map<String, Object> tree : treedata) {
                    tree.put("key", tree.get("id"));
                    tree.put("title", tree.get("text"));

                    if (tree.get("parentid").equals(parentid)) {
                        parenttreedata.add(tree);
                    }
                }

                //二级树节点
                List<Map<String, Object>> second_treedata = new ArrayList<Map<String, Object>>();//二级树节点
                for (Map<String, Object> ptree : parenttreedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));

                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            second_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                List<Map<String, Object>> third_treedata = new ArrayList<Map<String, Object>>();//三级树节点
                List<Map<String, Object>> fourth_treedata = new ArrayList<Map<String, Object>>();//四级树节点
                List<Map<String, Object>> fifth_treedata = new ArrayList<Map<String, Object>>();//五级树节点
                List<Map<String, Object>> sixth_treedata = new ArrayList<Map<String, Object>>();//六级树节点

                //三级树节点
                for (Map<String, Object> ptree : second_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();

                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            third_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //四级树节点
                for (Map<String, Object> ptree : third_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            fourth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //五级树节点
                for (Map<String, Object> ptree : fourth_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            fifth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //六级树节点
                for (Map<String, Object> ptree : fifth_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            sixth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

            }

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST, parenttreedata);

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    @PostMapping("/getProMenuTreeByLevelCodeForGrading")
    @ApiOperation(value = "查询所有菜单数据根据层次码和用户", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "查询所有菜单数据根据层次码和用户", value = "query", type = "PC")
    public Map<String, Object> getProMenuTreeByLevelCodeForGrading(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            String parentid = map.get("parentid") + "";
            map.put("userId",ActiveUserUtils.getUserId());
            //查询子集节点
            List<Map<String, Object>> treedata = proMenuService.getProMenuTreeByLevelCode(map);

            List<Map<String, Object>> parenttreedata = new ArrayList<Map<String, Object>>();

            if (null != treedata && treedata.size() > 0) {

                //一级树节点
                for (Map<String, Object> tree : treedata) {
                    tree.put("key", tree.get("id"));
                    tree.put("title", tree.get("text"));

                    if (tree.get("parentid").equals(parentid)) {
                        parenttreedata.add(tree);
                    }
                }

                //二级树节点
                List<Map<String, Object>> second_treedata = new ArrayList<Map<String, Object>>();//二级树节点
                for (Map<String, Object> ptree : parenttreedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));

                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            second_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                List<Map<String, Object>> third_treedata = new ArrayList<Map<String, Object>>();//三级树节点
                List<Map<String, Object>> fourth_treedata = new ArrayList<Map<String, Object>>();//四级树节点
                List<Map<String, Object>> fifth_treedata = new ArrayList<Map<String, Object>>();//五级树节点
                List<Map<String, Object>> sixth_treedata = new ArrayList<Map<String, Object>>();//六级树节点

                //三级树节点
                for (Map<String, Object> ptree : second_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();

                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            third_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //四级树节点
                for (Map<String, Object> ptree : third_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            fourth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //五级树节点
                for (Map<String, Object> ptree : fourth_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            fifth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //六级树节点
                for (Map<String, Object> ptree : fifth_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            sixth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

            }

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST, parenttreedata);

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }
    @PostMapping("/getProMenuTreeByLevelCodeVue")
    @ApiOperation(value = "查询所有菜单数据根据层次码", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "levelcode", value = "层次码", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "查询所有菜单数据根据层次码", value = "query", type = "PC")
    public Map<String, Object> getProMenuTreeByLevelCodeVue(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            String parentid = map.get("parentid") + "";

            List<Map<String, Object>> treedata = proMenuService.getProMenuTreeByLevelCode(map);

            List<Map<String, Object>> parenttreedata = new ArrayList<Map<String, Object>>();

            if (null != treedata && treedata.size() > 0) {

                //一级树节点
                for (Map<String, Object> tree : treedata) {
                    tree.put("key", tree.get("id"));
                    tree.put("title", tree.get("text"));

                    if (tree.get("parentid").equals(parentid)) {
                        parenttreedata.add(tree);
                    }
                }

                //二级树节点
                List<Map<String, Object>> second_treedata = new ArrayList<Map<String, Object>>();//二级树节点
                for (Map<String, Object> ptree : parenttreedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));

                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            second_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                List<Map<String, Object>> third_treedata = new ArrayList<Map<String, Object>>();//三级树节点
                List<Map<String, Object>> fourth_treedata = new ArrayList<Map<String, Object>>();//四级树节点
                List<Map<String, Object>> fifth_treedata = new ArrayList<Map<String, Object>>();//五级树节点
                List<Map<String, Object>> sixth_treedata = new ArrayList<Map<String, Object>>();//六级树节点

                //三级树节点
                for (Map<String, Object> ptree : second_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();

                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            third_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //四级树节点
                for (Map<String, Object> ptree : third_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            fourth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //五级树节点
                for (Map<String, Object> ptree : fourth_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            fifth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //六级树节点
                for (Map<String, Object> ptree : fifth_treedata) {

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        tree.put("key", tree.get("id"));
                        tree.put("title", tree.get("text"));
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            sixth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

            }

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST_VUE, parenttreedata);

        } catch (Exception e) {
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    /*
    @PostMapping("/getAllForProMenuByUserId")
    @ApiOperation(value = "查询所有菜单数据用户ID", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "查询所有菜单数据用户ID", value = "query", type = "PC")
    public Map<String, Object> getAllForProMenuByUserId(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

            // 存放权限表中授权没有勾选到根节点的菜单数据
        	List<Map<String, Object>> firstleveltreedataNoParentidInAuth = new ArrayList<Map<String, Object>>();//如果父菜单的子菜单没授权完，将不会包括父菜单ID
        	Map<String, Object> parentMap = new HashMap<String, Object>(){{
        	   put("parentid", TreeConstant.SECOND_PARENT_ID);
            }};
        	// 查询出所有000000000000的菜单
            List<Map<String, Object>> temFirstTreeAll = proMenuService.getProMenuTreeByParentid(parentMap);//所有一级菜单

            List<Map<String, Object>> firstleveltreedata = proMenuService.getProMenuTreeByParentidByUserId(map);//根据用户ID查询授权表中已有的一级菜单

            List<Map<String, Object>> authtreedata = proMenuService.getAllForProMenuByUserId(map);//授权表中用户已有的所有菜单，但如果父菜单的子菜单没授权完，将不会包括父菜单ID

            List<Map<String, Object>> treedata = new ArrayList<Map<String, Object>>();

            Set<String>    treenodeids = new HashSet<String>();

            if (null != firstleveltreedata && firstleveltreedata.size() > 0) {

            	for (Map<String, Object> tempptree : firstleveltreedata) {//一级菜单
            		treenodeids.add(tempptree.get("id")+"");//根据用户ID查询授权表中已有的一级菜单ID
            	}

                //页面权限树菜单节点
                for (Map<String, Object> ptree : firstleveltreedata) {

                    Map<String, Object> tree_temp = new HashMap<String, Object>();
                    tree_temp.put("path", ptree.get("path"));
                    tree_temp.put("name", ptree.get("name"));
                    tree_temp.put("key", ptree.get("path"));
                    tree_temp.put("label", ptree.get("text"));
                    tree_temp.put("sequences", ptree.get("sequences"));
                    if(!("".equals(ptree.get("icon"))) && null != ptree.get("icon")){
                        tree_temp.put("icon", ptree.get("icon"));
                    }
                    if(!("".equals(ptree.get("component"))) && null != ptree.get("component")){
                        tree_temp.put("component", ptree.get("component"));
                    }
                    if(!("".equals(ptree.get("redirect"))) && null != ptree.get("redirect")){
                        tree_temp.put("redirect", ptree.get("redirect"));
                    }
                    if(!("".equals(ptree.get("hideInMenu"))) && null != ptree.get("hideInMenu")){
                        tree_temp.put("hideInMenu", Boolean.valueOf(ptree.get("hideInMenu") + ""));
                    }
                    if(!("".equals(ptree.get("hideLayout"))) && null != ptree.get("hideLayout")){
                        tree_temp.put("hideLayout", Boolean.valueOf(ptree.get("hideLayout") + ""));
                    }

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();//二级菜单

                    for (Map<String, Object> tree : authtreedata) {

                        if (tree.get("id").equals(ptree.get("id"))) {
                            continue;
                        }

                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            Map<String, Object> tree_temp2 = new HashMap<String, Object>();
                            tree_temp2.put("path", tree.get("path"));
                            tree_temp2.put("name", tree.get("name"));
                            tree_temp2.put("key", tree.get("path"));
                            tree_temp2.put("label", tree.get("text"));
                            tree_temp2.put("sequences", tree.get("sequences"));
                            if(!("".equals(tree.get("icon"))) && null != tree.get("icon")){
                                tree_temp2.put("icon", tree.get("icon"));
                            }
                            if(!("".equals(tree.get("component"))) && null != tree.get("component")){
                                tree_temp2.put("component", tree.get("component"));
                            }
                            if(!("".equals(tree.get("redirect"))) && null != tree.get("redirect")){
                                tree_temp2.put("redirect", tree.get("redirect"));
                            }
                            if(!("".equals(tree.get("hideInMenu"))) && null != tree.get("hideInMenu")){
                                tree_temp2.put("hideInMenu", Boolean.valueOf(tree.get("hideInMenu") + ""));
                            }
                            if(!("".equals(tree.get("hideLayout"))) && null != tree.get("hideLayout")){
                                tree_temp2.put("hideLayout", Boolean.valueOf(tree.get("hideLayout") + ""));
                            }
                            sontreedata.add(tree_temp2);

                        }else{
                            if(!treenodeids.contains(tree.get("parentid"))) {
                                for (Map<String, Object> stringObjectMap : temFirstTreeAll) {
                                    if(stringObjectMap.get("id").equals(tree.get("parentid"))) {
                                        if(!firstleveltreedataNoParentidInAuth.contains(stringObjectMap)) {
                                            firstleveltreedataNoParentidInAuth.add(stringObjectMap);
                                        }
                                    }
                                }
                            }

                        }

                    }

                    if (sontreedata.size() > 0) {
                        tree_temp.put("routes", sontreedata);

                    }

                    treedata.add(tree_temp);

                }

            }

            if (null != firstleveltreedataNoParentidInAuth && firstleveltreedataNoParentidInAuth.size() > 0) {

                //页面权限树菜单节点
                for (Map<String, Object> ptree : firstleveltreedataNoParentidInAuth) {

                    Map<String, Object> tree_temp = new HashMap<String, Object>();
                    tree_temp.put("path", ptree.get("path"));
                    tree_temp.put("name", ptree.get("name"));
                    tree_temp.put("key", ptree.get("path"));
                    tree_temp.put("label", ptree.get("text"));
                    tree_temp.put("sequences", ptree.get("sequences"));
                    if(!("".equals(ptree.get("icon"))) && null != ptree.get("icon")){
                        tree_temp.put("icon", ptree.get("icon"));
                    }
                    if(!("".equals(ptree.get("component"))) && null != ptree.get("component")){
                        tree_temp.put("component", ptree.get("component"));
                    }
                    if(!("".equals(ptree.get("redirect"))) && null != ptree.get("redirect")){
                        tree_temp.put("redirect", ptree.get("redirect"));
                    }
                    if(!("".equals(ptree.get("hideInMenu"))) && null != ptree.get("hideInMenu")){
                        tree_temp.put("hideInMenu", Boolean.valueOf(ptree.get("hideInMenu") + ""));
                    }
                    if(!("".equals(ptree.get("hideLayout"))) && null != ptree.get("hideLayout")){
                        tree_temp.put("hideLayout", Boolean.valueOf(ptree.get("hideLayout") + ""));
                    }

                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();//二级菜单

                    for (Map<String, Object> tree : authtreedata) {

                        if (tree.get("id").equals(ptree.get("id"))) {
                            continue;
                        }

                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            Map<String, Object> tree_temp2 = new HashMap<String, Object>();
                            tree_temp2.put("path", tree.get("path"));
                            tree_temp2.put("name", tree.get("name"));
                            tree_temp2.put("key", tree.get("path"));
                            tree_temp2.put("label", tree.get("text"));
                            tree_temp2.put("sequences", tree.get("sequences"));
                            if(!("".equals(tree.get("icon"))) && null != tree.get("icon")){
                                tree_temp2.put("icon", tree.get("icon"));
                            }
                            if(!("".equals(tree.get("component"))) && null != tree.get("component")){
                                tree_temp2.put("component", tree.get("component"));
                            }
                            if(!("".equals(tree.get("redirect"))) && null != tree.get("redirect")){
                                tree_temp2.put("redirect", tree.get("redirect"));
                            }
                            if(!("".equals(tree.get("hideInMenu"))) && null != tree.get("hideInMenu")){
                                tree_temp2.put("hideInMenu", Boolean.valueOf(tree.get("hideInMenu") + ""));
                            }
                            if(!("".equals(tree.get("hideLayout"))) && null != tree.get("hideLayout")){
                                tree_temp2.put("hideLayout", Boolean.valueOf(tree.get("hideLayout") + ""));
                            }
                            sontreedata.add(tree_temp2);

                        }


                    }

                    if (sontreedata.size() > 0) {
                        tree_temp.put("routes", sontreedata);

                    }

                    treedata.add(tree_temp);

                }


            }

            Collections.sort(treedata, new Comparator<Map<String, Object>>() {
                @Override
                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                    Integer name1 = Integer.valueOf(o1.get("sequences") == null ? "0" : o1.get("sequences").toString());//name1是从你list里面拿出来的一个
                    Integer name2 = Integer.valueOf(o2.get("sequences") == null ? "0" : o2.get("sequences").toString()); //name1是从你list里面拿出来的第二个name
                    return name1.compareTo(name2);
                }
            });


            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST, treedata);


        } catch (Exception e) {
            e.printStackTrace();
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }
    */

    @PostMapping("/getAllForProMenuByUserIdVue")
    @ApiOperation(value = "查询所有菜单数据用户ID", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "user_name", value = "用户ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "systemid", value = "系统ID", required = true,  dataTypeClass = String.class),
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "查询所有菜单数据用户ID", value = "query", type = "PC")
    public Map<String, Object> getAllForProMenuByUserIdVue(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            map.put("user_name", ActiveUserUtils.getUserId());

            List<Map<String, Object>> authtreedata = proMenuService.getAllForProMenuByUserId(map);
            List<Map<String, Object>> menudata = new ArrayList<>();
            for (Map<String, Object> authtreedatum : authtreedata) {
                if(TreeConstant.SECOND_PARENT_ID.equals(authtreedatum.get("id"))) {
                    continue;
                }
                Map<String, Object> tree_temp = new HashMap<String, Object>();
                tree_temp.put("id", authtreedatum.get("id"));
                tree_temp.put("parentId", TreeConstant.SECOND_PARENT_ID.equals(authtreedatum.get("parentid")) ? 0 : authtreedatum.get("parentid"));
                tree_temp.put("sequences", authtreedatum.get("sequences"));
                tree_temp.put("name", authtreedatum.get("alias"));
                if(StringUtils.isNotEmpty(Convert.toStr(authtreedatum.get("component")))){
                    tree_temp.put("component", authtreedatum.get("component"));
                }
                if(StringUtils.isNotEmpty(Convert.toStr(authtreedatum.get("redirect")))){
                    tree_temp.put("redirect", authtreedatum.get("redirect"));
                }
                if(StringUtils.isNotEmpty(Convert.toStr(authtreedatum.get("path")))){
                    tree_temp.put("path", authtreedatum.get("path"));
                }

                HashMap<String, Object> meta = new HashMap<>();
                if(StringUtils.isNotEmpty(Convert.toStr(authtreedatum.get("icon")))){
                    meta.put("icon", authtreedatum.get("icon"));
                }
                if(StringUtils.isNotEmpty(Convert.toStr(authtreedatum.get("name")))){
                    meta.put("title", authtreedatum.get("name"));
                }
                if(StringUtils.isNotEmpty(Convert.toStr(authtreedatum.get("hideInMenu")))){
                    meta.put("show", "0".equals(authtreedatum.get("hideInMenu")));
                }
                if(StringUtils.isNotEmpty(Convert.toStr(authtreedatum.get("hideChildrenInMenu")))){
                    meta.put("hideChildren", "0".equals(authtreedatum.get("hideChildrenInMenu")));
                }
                tree_temp.put("meta", meta);
                menudata.add(tree_temp);
            }
            //根据sequences排序
            sortBySequences(menudata);

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST_VUE, menudata);

        } catch (Exception e) {
            e.printStackTrace();
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }

    /**
     * 根据sequences排序
     * @param menudata
     */
    private void sortBySequences(List<Map<String, Object>> menudata) {
        menudata.sort((item1, item2)->{
            String sequences1 = Convert.toStr(item1.get("sequences")) ;
            String sequences2 = Convert.toStr(item2.get("sequences"));
            if(StringUtils.isEmpty(sequences1)){
                return 1;
            }
            if(StringUtils.isEmpty(sequences2)){
                return -1;
            }
            return Integer.parseInt(sequences1)-Integer.parseInt(sequences2);
        });
    }


    @PostMapping("/getAllForProMenuByUserId")
    @ApiOperation(value = "查询所有菜单数据用户ID", notes = "成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "parentid", value = "父菜单ID", required = true,  dataTypeClass = String.class)
    })
    @OperateLog(name = "查询所有菜单数据用户ID", value = "query", type = "PC")
    public Map<String, Object> getAllForProMenuByUserId(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> map) {
        //TODO
        Map<String, Object> result = new HashMap<String, Object>();
        try {
            String parentid = TreeConstant.SECOND_PARENT_ID;
            map.put("user_id", ActiveUserUtils.getUserId());

            // 查询授权表中用户已有的所有菜单
            List<Map<String, Object>> treedata = proMenuService.getAllForProMenuByUserId(map);

            List<Map<String, Object>> parenttreedata = new ArrayList<Map<String, Object>>();//顶级树节点
            List<Map<String, Object>> second_treedata = new ArrayList<Map<String, Object>>();//二级树节点
            List<Map<String, Object>> third_treedata = new ArrayList<Map<String, Object>>();//三级树节点
            List<Map<String, Object>> fourth_treedata = new ArrayList<Map<String, Object>>();//四级树节点
            List<Map<String, Object>> fifth_treedata = new ArrayList<Map<String, Object>>();//五级树节点
            List<Map<String, Object>> sixth_treedata = new ArrayList<Map<String, Object>>();//六级树节点
            List<Map<String, Object>> seventh_treedata = new ArrayList<Map<String, Object>>();//七级树节点
            List<Map<String, Object>> eighth_treedata = new ArrayList<Map<String, Object>>();//八级树节点
            List<Map<String, Object>> nineth_treedata = new ArrayList<Map<String, Object>>();//九级树节点
            List<Map<String, Object>> tenth_treedata = new ArrayList<Map<String, Object>>();//十级树节点

            if (null != treedata && treedata.size() > 0) {

                //一级树节点
                for (Map<String, Object> tree : treedata) {
                    if (tree.get("parentid").equals(parentid)) {
                        handleTree(tree);
                        parenttreedata.add(tree);
                    }
                }

                //二级树节点
                for (Map<String, Object> ptree : parenttreedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            second_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("children", sontreedata);
                }

                //三级树节点
                for (Map<String, Object> ptree : second_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            third_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("routes", sontreedata);
                }

                //四级树节点
                for (Map<String, Object> ptree : third_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            fourth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("routes", sontreedata);
                }

                //五级树节点
                for (Map<String, Object> ptree : fourth_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            fifth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("routes", sontreedata);
                }

                //六级树节点
                for (Map<String, Object> ptree : fifth_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            sixth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("routes", sontreedata);
                }

                //七级树节点
                for (Map<String, Object> ptree : sixth_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            seventh_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("routes", sontreedata);
                }

                //八级树节点
                for (Map<String, Object> ptree : seventh_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            eighth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("routes", sontreedata);
                }

                //九级树节点
                for (Map<String, Object> ptree : eighth_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            nineth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("routes", sontreedata);
                }

                //十级树节点
                for (Map<String, Object> ptree : nineth_treedata) {
                    List<Map<String, Object>> sontreedata = new ArrayList<Map<String, Object>>();
                    for (Map<String, Object> tree : treedata) {
                        if (tree.get("parentid").equals(ptree.get("id"))) {
                            handleTree(tree);
                            tenth_treedata.add(tree);
                            sontreedata.add(tree);
                        }
                    }
                    ptree.put("routes", sontreedata);
                }

            }

            result.put(DATASUCCESS, SUCCESSFLAG);
            result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
            result.put(DATALIST, parenttreedata);


        } catch (Exception e) {
            e.printStackTrace();
            result.put(DATASUCCESS, ERRORFLAG);
            result.put(DATAMESSAGE, QUERY_FAIL_MSG + e.getMessage());
        }
        return result;
    }


    /**
     * 处理树节点数据
     * @param tree
     * @return
     */
    private Map<String, Object> handleTree(Map<String, Object> tree) {
        tree.put("path", tree.get("path"));
        tree.put("name", tree.get("name"));
        tree.put("key", tree.get("path"));
        tree.put("label", tree.get("text"));
        tree.put("sequences", tree.get("sequences"));
        if(!("".equals(tree.get("icon"))) && null != tree.get("icon")){
            tree.put("icon", tree.get("icon"));
        }
        if(!("".equals(tree.get("component"))) && null != tree.get("component")){
            tree.put("component", tree.get("component"));
        }
        if(!("".equals(tree.get("redirect"))) && null != tree.get("redirect")){
            tree.put("redirect", tree.get("redirect"));
        }
        if(!("".equals(tree.get("hideInMenu"))) && null != tree.get("hideInMenu")){
            tree.put("hideInMenu", Boolean.valueOf(tree.get("hideInMenu") + ""));
        }
        if(!("".equals(tree.get("hideLayout"))) && null != tree.get("hideLayout")){
            tree.put("hideLayout", Boolean.valueOf(tree.get("hideLayout") + ""));
        }
        return tree;
    }




}
