menuKey.append(KEY_SPLIT);
menuKey.append(autoMenu.level() == null ? "" : autoMenu.level());
menuKey.append(KEY_SPLIT);
menuKey.append(autoMenu.url() == null ? "" : autoMenu.url());
TSFunction function = null;
//判断菜单map的key是否包含当前key,不包含则插入一条菜单数据
if (!functionMap.containsKey(menuKey.toString())) {
function = new TSFunction();
function.setFunctionName(autoMenu.name());
function.setFunctionIframe(null);
function.setFunctionLevel(Short.valueOf(autoMenu.level()));
function.setFunctionOrder(Integer.toString(autoMenu.order()));
function.setFunctionUrl(autoMenu.url());
function.setTSFunction(null);
String iconId = autoMenu.icon();
if (StringUtil.isNotEmpty(iconId)) {
Object obj = this.get(TSIcon.class, iconId);
if(obj!=null){
function.setTSIcon((TSIcon)obj);
}else{
function.setTSIcon(null);
}
} else {
function.setTSIcon(null);
}
Serializable id = this.save(function);
function.setId(id.toString());
} else {
function = functionMap.get(menuKey.toString());
}
//获取该类的所有方法
Method[] methods = clazz.getDeclaredMethods();
for(Method method : methods){
//判断当前方法是否设置了菜单操作按钮注解
if (method.isAnnotationPresent(AutoMenuOperation.class)) {
AutoMenuOperation autoMenuOperation = method.getAnnotation(AutoMenuOperation.class);
//操作码必须填写,否则不进行菜单操作按钮的匹配
if (StringUtil.isNotEmpty(autoMenuOperation.code())) {
StringBuffer menuOperationKey = new StringBuffer();
menuOperationKey.append(function == null ? "" : function.getId());
menuOperationKey.append(KEY_SPLIT);
String code = "";
//设置code前缀
if (autoMenuOperation.codeType() == MenuCodeType.TAG) {