Commit 1e873f59 by guojuxing

应用列表接口调整:区分是gic应用还是好办应用

parent f3ffdf70
package com.gic.auth.constant;
/**
* 权限菜单平台类型
* @ClassName: MenuPlatformTypeEnum

* @Description: 

* @author guojuxing

* @date 2020/10/23 9:52 AM

*/
public enum MenuPlatformTypeEnum {
GIC(0, "gic"),
HAOBAN_PC(1, "好办后台"),
HAOBAN_APPLET(2, "好办小程序"),
HAOBAN_APP(3, "好办应用"),
HAOBAN_APPLET_APP(4, "好办小程序应用");
private Integer code;
private String message;
private MenuPlatformTypeEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public MenuPlatformTypeEnum setCode(Integer code) {
this.code = code;
return this;
}
public String getMessage() {
return message;
}
public MenuPlatformTypeEnum setMessage(String message) {
this.message = message;
return this;
}
}
...@@ -955,7 +955,7 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -955,7 +955,7 @@ public class MenuApiServiceImpl implements MenuApiService {
*/ */
private void saveAppMenu() { private void saveAppMenu() {
ServiceResponse<List<ApplicationDTO>> appListResponse = applicationApiService.listApplicationAndServeProp(); ServiceResponse<List<ApplicationDTO>> appListResponse = applicationApiService.listApplicationAndServeProp();
Map<String, TabSysMenu> appMenu = getFirstLevelAppMenu(); Map<String, Integer> appMenu = getFirstLevelAppMenu();
if (appListResponse.isSuccess()) { if (appListResponse.isSuccess()) {
List<ApplicationDTO> appList = appListResponse.getResult(); List<ApplicationDTO> appList = appListResponse.getResult();
//删除已经不存在的应用 //删除已经不存在的应用
...@@ -974,7 +974,7 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -974,7 +974,7 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO.setProject(app.getApplicationId().toString()); menuDTO.setProject(app.getApplicationId().toString());
setMenuVersion(app.getPropDTOList(), app.getServeExpanList(), menuDTO); setMenuVersion(app.getPropDTOList(), app.getServeExpanList(), menuDTO);
// setMenuAuthType(menuDTO); // setMenuAuthType(menuDTO);
menuDTO.setMenuId(appMenu.get(app.getApplicationId().toString()).getMenuId()); menuDTO.setMenuId(appMenu.get(app.getApplicationId().toString()));
menuService.updatePage(menuDTO); menuService.updatePage(menuDTO);
} else { } else {
MenuDTO menuDTO = new MenuDTO(); MenuDTO menuDTO = new MenuDTO();
...@@ -985,8 +985,8 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -985,8 +985,8 @@ public class MenuApiServiceImpl implements MenuApiService {
setNormalFieldValue(menuDTO); setNormalFieldValue(menuDTO);
//3:好办应用 //3:好办应用
Integer appType = app.getAppType(); Integer appType = app.getAppType();
boolean isGicApp = appType == null || app.getAppType() == 0; boolean isGicApp = appType == null || app.getAppType().equals(MenuPlatformTypeEnum.GIC.getCode());
menuDTO.setPlatformType(isGicApp ? 0 : 3); menuDTO.setPlatformType(isGicApp ? MenuPlatformTypeEnum.GIC.getCode() : MenuPlatformTypeEnum.HAOBAN_APP.getCode());
menuService.savePage(menuDTO); menuService.savePage(menuDTO);
} }
} }
...@@ -1035,18 +1035,26 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -1035,18 +1035,26 @@ public class MenuApiServiceImpl implements MenuApiService {
} }
/** /**
* 获取应用第一级菜单(应用列表) * 获取应用第一级菜单(应用列表)(gic和好办应用)
* @return * @return
*/ */
private Map<String, TabSysMenu> getFirstLevelAppMenu() { private Map<String, Integer> getFirstLevelAppMenu() {
MenuListQO params = new MenuListQO(); MenuListQO params = new MenuListQO();
params.setIsGIC(MenuProjectConstants.APP_PROJECT_CODE); params.setIsGIC(MenuProjectConstants.APP_PROJECT_CODE);
params.setLevel(MenuLevelConstants.FIRST_LEVEL); params.setLevel(MenuLevelConstants.FIRST_LEVEL);
List<TabSysMenu> menuList = menuService.listMenu(params); params.setPlatformType(MenuPlatformTypeEnum.GIC.getCode());
Map<String, TabSysMenu> map = new HashMap<>(16); List<TabSysMenu> menuListOfGic = menuService.listMenu(params);
if (menuList != null) { Map<String, Integer> map = new HashMap<>(16);
for (TabSysMenu menu : menuList) { if (menuListOfGic != null) {
map.put(menu.getProject(), menu); for (TabSysMenu menu : menuListOfGic) {
map.put(menu.getProject(), menu.getMenuId());
}
}
params.setPlatformType(MenuPlatformTypeEnum.HAOBAN_APP.getCode());
List<TabSysMenu> menuListOfHaoBanApp = menuService.listMenu(params);
if (menuListOfHaoBanApp != null) {
for (TabSysMenu menu : menuListOfHaoBanApp) {
map.put(menu.getProject(), menu.getMenuId());
} }
} }
return map; return map;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment