@@ -41,7 +41,7 @@ public class FileDownloadController { | |||||
@RequestParam(value = "absolutePath", required = false) Boolean absolutePath, | @RequestParam(value = "absolutePath", required = false) Boolean absolutePath, | ||||
HttpServletRequest request | HttpServletRequest request | ||||
) throws FileNotFoundException { | ) throws FileNotFoundException { | ||||
String filePath = request.getRequestURI().substring(10); | |||||
String filePath = request.getServletPath().substring(10); | |||||
return download(filePath, name, noCache,absolutePath, request); | return download(filePath, name, noCache,absolutePath, request); | ||||
} | } | ||||
@@ -91,7 +91,7 @@ public class FileDownloadController { | |||||
@RequestParam(value = "noCache", required = false) Boolean noCache, | @RequestParam(value = "noCache", required = false) Boolean noCache, | ||||
@RequestHeader(value = "If-Modified-Since", required = false) String ifModifiedSince, | @RequestHeader(value = "If-Modified-Since", required = false) String ifModifiedSince, | ||||
HttpServletRequest request) throws FileNotFoundException { | HttpServletRequest request) throws FileNotFoundException { | ||||
String filePath = request.getRequestURI().substring(11); | |||||
String filePath = request.getServletPath().substring(11); | |||||
HttpHeaders headers = new HttpHeaders(); | HttpHeaders headers = new HttpHeaders(); | ||||
@@ -14,7 +14,6 @@ import java.util.Set; | |||||
public class MenuPlanCache extends AbstractEntityCache<MenuPlan> { | public class MenuPlanCache extends AbstractEntityCache<MenuPlan> { | ||||
//缓存key:按项目缓存 | //缓存key:按项目缓存 | ||||
public final static String mk_p = "p"; | public final static String mk_p = "p"; | ||||
public static MenuPlanCache getInstance() { | public static MenuPlanCache getInstance() { | ||||
return CacheManager.getIntance().getCache(MenuPlanCache.class); | return CacheManager.getIntance().getCache(MenuPlanCache.class); | ||||
} | } | ||||
@@ -0,0 +1,21 @@ | |||||
package cc.smtweb.system.bpm.web.sys.user.menuPlan; | |||||
/** | |||||
* @Author: tanghp | |||||
* @Date: 2022-09-26 10:19 | |||||
* @Desc: 菜单方案辅助类 | |||||
*/ | |||||
public class MenuPlanHelper { | |||||
/** | |||||
* 获取命中菜单方案明细ID | |||||
* @param menuId 菜单方案明细ID | |||||
* @param pageId 页面ID | |||||
* @param fullPath 带参数的路径 | |||||
* @return | |||||
*/ | |||||
public long findMenuId(long menuId,long pageId,String fullPath){ | |||||
// | |||||
return 0L; | |||||
} | |||||
} |
@@ -0,0 +1,45 @@ | |||||
package cc.smtweb.system.bpm.web.sys.user.menuPlan; | |||||
import cc.smtweb.framework.core.cache.SessionCacheFactory; | |||||
import cc.smtweb.framework.core.util.CommUtil; | |||||
import java.util.Collection; | |||||
import java.util.HashMap; | |||||
import java.util.Map; | |||||
/** | |||||
* @Author: tanghp | |||||
* @Date: 2022-09-26 11:12 | |||||
* @Desc: 菜单明细加载类 | |||||
*/ | |||||
public class MenuPlanItemProvider { | |||||
private volatile MenuPlanItemProvider provider; | |||||
private Map<Long, MenuPlanItem> map = new HashMap<>(); | |||||
private MenuPlanItemProvider() { | |||||
} | |||||
public MenuPlanItemProvider getInstance(){ | |||||
if (provider == null) { | |||||
synchronized (SessionCacheFactory.class) { | |||||
if (provider == null) { | |||||
provider = new MenuPlanItemProvider(); | |||||
} | |||||
} | |||||
} | |||||
return provider; | |||||
} | |||||
// 获取菜单方案明细ID | |||||
public MenuPlanItem getMenuPlanItem(long menuId){ | |||||
MenuPlanItem menuPlanItem = map.get(menuId); | |||||
if(menuPlanItem!=null)return menuPlanItem; | |||||
Collection<MenuPlan> plans = MenuPlanCache.getInstance().getAll(); | |||||
if(CommUtil.isEmpty(plans))return null; | |||||
for(MenuPlan menuPlan: plans){ | |||||
menuPlanItem = MenuPlanCache.getInstance().getById(menuPlan.getEntityId(),menuId); | |||||
if(menuPlanItem!=null){ | |||||
map.put(menuId,menuPlanItem); | |||||
return menuPlanItem; | |||||
} | |||||
} | |||||
return null; | |||||
} | |||||
} |