1.用户多角色菜单重复bug修改 2.配置界面日志总量链接查询
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user