1.用户多角色菜单重复bug修改 2.配置界面日志总量链接查询

This commit is contained in:
zhangwenqing
2018-08-29 21:58:56 +08:00
parent db37557139
commit dd59389e0a
10 changed files with 111 additions and 5 deletions

View File

@@ -435,6 +435,8 @@ public final class Constants {
public static final Integer BUSINESSTYPE_REPORT=Configurations.getIntProperty("businesstype_report", 2);
//默认日志查询时长(ms)
public static final Integer LOG_TIME_RANGE = Configurations.getIntProperty("log_time_range", 300000);
//日志检索菜单ID
public static final Integer LOGSEARCH_MENU_ID = Configurations.getIntProperty("logsearch_menu_id", 152);
/**请求头参数*/
public static final Map<String,Object> REQUEST_HEADER = new HashMap<String,Object>();
public static final Integer CLIENT_CONNECT_TIMEOUT = Configurations.getIntProperty("client_connect_timeout",1000);

View File

@@ -0,0 +1,35 @@
package com.nis.web.controller.configuration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.log.BaseLogEntity;
import com.nis.web.controller.BaseController;
@Controller
@RequestMapping("${adminPath}/toLogSearch")
public class LogSearchController extends BaseController{
@RequestMapping(value = {"list",""})
public String LogSearch(BaseLogEntity<Object> entity, Integer compileId,RedirectAttributes attr,
HttpServletRequest request, HttpServletResponse response) {
/**
* url: logUrl
* searchCfgId: compileId
* searchService: serviceId
*/
// 获取相应日志检索菜单URL
String logUrl = menuService.getLogUrl(entity.getFunctionId());
Integer serviceId = menuService.getServiceId(entity.getFunctionId(),entity.getAction());
attr.addAttribute("cfgId", compileId);
attr.addAttribute("service", serviceId);
attr.addAttribute("functionId", entity.getFunctionId());
return "redirect:"+adminPath+logUrl;
}
}

View File

@@ -19,5 +19,9 @@ public interface SysMenuDao extends CrudDao<SysMenu>{
void updateParentIds(SysMenu e);
void updateSort(SysMenu menu);
String getLogUrl(@Param("functionId")Integer function,@Param("logSearchId")Integer logSearchId);
Integer getServiceId(@Param("functionId")Integer functionId, @Param("action")Integer action);
}

View File

@@ -50,7 +50,7 @@
</select>
<select id="findSysMenuByUserId" resultType="sysMenu">
SELECT
SELECT DISTINCT
<include refid="menuColumns"/>
FROM sys_menu a
LEFT JOIN sys_menu p ON p.id = a.parent_id
@@ -165,6 +165,21 @@
<if test="dbName == 'mysql'">CONCAT('%,', #{id}, ',%')</if>
</update>
<select id="getLogUrl" resultType="String">
SELECT
m.href
FROM
sys_menu m
WHERE
m.function_id = #{functionId} AND m.parent_ids LIKE '%${logSearchId}%'
</select>
<select id="getServiceId" resultType="Integer">
SELECT
s.service_id
FROM
function_service_dict s
WHERE
s.function_id = #{functionId} AND s.action = #{action}
</select>
</mapper>

View File

@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import com.nis.domain.SysMenu;
import com.nis.domain.SysUser;
import com.nis.util.CacheUtils;
import com.nis.util.Constants;
import com.nis.util.LogUtils;
import com.nis.util.StringUtil;
import com.nis.web.dao.SysMenuDao;
@@ -93,5 +94,15 @@ public class MenuService extends BaseService {
// 清除日志相关缓存
CacheUtils.remove(LogUtils.CACHE_MENU_NAME_PATH_MAP);
}
// 根据functionId查找日志检索的URL
public String getLogUrl(Integer function) {
Integer logSearchId = Constants.LOGSEARCH_MENU_ID;
return menuDao.getLogUrl(function,logSearchId);
}
// 根据functionId,action查找日志检索条件ServiceId
public Integer getServiceId(Integer functionId, Integer action) {
return menuDao.getServiceId(functionId,action);
}
}