Commit adcba540 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-auth into developer
parents 9a502956 1e1f9191
......@@ -109,9 +109,10 @@ public interface MenuApiService {
* @Title: listAppPageOfHasBuy

* @Description:

 * @author guojuxing
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


 */
ServiceResponse<List<MenuDTO>> listAppPageOfHasBuy();
ServiceResponse<List<MenuDTO>> listAppPageOfHasBuy(Integer enterpriseId);
/**
* 编辑gic页面
......
......@@ -140,8 +140,7 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public ServiceResponse<List<MenuDTO>> listAppPageOfHasBuy() {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
public ServiceResponse<List<MenuDTO>> listAppPageOfHasBuy(Integer enterpriseId) {
ServiceResponse<List<ApplicationDTO>> appResult = appTokenApiService
.listApplicationByEnterpriseId(Long.valueOf(enterpriseId), null);
if (appResult.isSuccess()) {
......
......@@ -56,7 +56,8 @@ public class RoleController {
}
ServiceResponse<List<MenuDTO>> menuListResult = menuApiService.listByMenuIdList(menuIdList);
ServiceResponse<List<MenuDTO>> gicResult = menuApiService.listMenuTreeForRole(MenuProjectConstants.DEFAULT_PROJECT);
ServiceResponse<List<MenuDTO>> gicResult = menuApiService
.listMenuTreeForRole(MenuProjectConstants.DEFAULT_PROJECT);
Map<Integer, Object> gicMap = new HashMap<>(16);
if (gicResult.isSuccess()) {
List<MenuDTO> gicMenuList = gicResult.getResult();
......@@ -64,10 +65,12 @@ public class RoleController {
gicMap.put(menuDTO.getMenuId(), 1);
}
}
vo.setGicMap(changeListToSelectTree(MenuLevelConstants.FIRST_LEVEL_PARENT_ID, menuListResult.getResult(), gicMap));
vo.setGicMap(changeListToSelectTree(MenuLevelConstants.FIRST_LEVEL_PARENT_ID, menuListResult.getResult(),
gicMap));
//app已购买应用
ServiceResponse<List<MenuDTO>> appResult = menuApiService.listAppPageOfHasBuy();
ServiceResponse<List<MenuDTO>> appResult = menuApiService
.listAppPageOfHasBuy(UserDetailUtils.getUserDetail().getEnterpriseId());
Map<Integer, Object> appMap = new HashMap<>(16);
if (gicResult.isSuccess()) {
List<MenuDTO> appMenuList = appResult.getResult();
......@@ -75,7 +78,8 @@ public class RoleController {
appMap.put(menuDTO.getMenuId(), 1);
}
}
vo.setAppMap(changeListToSelectTree(MenuLevelConstants.FIRST_LEVEL_PARENT_ID, menuListResult.getResult(), appMap));
vo.setAppMap(changeListToSelectTree(MenuLevelConstants.FIRST_LEVEL_PARENT_ID, menuListResult.getResult(),
appMap));
return RestResponse.success(vo);
}
return EnterpriseRestResponse.failure(roleResult);
......@@ -137,18 +141,20 @@ public class RoleController {

 */
@RequestMapping("/list-gic-menu-tree")
public RestResponse listMenuTree() {
ServiceResponse<List<MenuDTO>> result = menuApiService.listMenuTreeForRole(MenuProjectConstants.DEFAULT_PROJECT);
ServiceResponse<List<MenuDTO>> result = menuApiService
.listMenuTreeForRole(MenuProjectConstants.DEFAULT_PROJECT);
if (result.isSuccess()) {
return RestResponse.success(changeListToTree(MenuLevelConstants.FIRST_LEVEL_PARENT_ID, result.getResult()));
return RestResponse.success(changeListToTree(MenuLevelConstants.FIRST_LEVEL_PARENT_ID, result.getResult()));
}
return EnterpriseRestResponse.failure(result);
}
@RequestMapping("/list-app-menu-tree")
public RestResponse listAppMenuTree() {
ServiceResponse<List<MenuDTO>> result = menuApiService.listAppPageOfHasBuy();
ServiceResponse<List<MenuDTO>> result = menuApiService
.listAppPageOfHasBuy(UserDetailUtils.getUserDetail().getEnterpriseId());
if (result.isSuccess()) {
return RestResponse.success(changeListToTree(MenuLevelConstants.FIRST_LEVEL_PARENT_ID, result.getResult()));
return RestResponse.success(changeListToTree(MenuLevelConstants.FIRST_LEVEL_PARENT_ID, result.getResult()));
}
return EnterpriseRestResponse.failure(result);
}
......@@ -176,7 +182,8 @@ public class RoleController {
return result;
}
public static List<Map<String, Object>> changeListToSelectTree(int storeGroupId, List<MenuDTO> list, Map<Integer, Object> menuIdMap) {
public static List<Map<String, Object>> changeListToSelectTree(int storeGroupId, List<MenuDTO> list,
Map<Integer, Object> menuIdMap) {
List<Map<String, Object>> result = new ArrayList<>();
if (list != null) {
for (MenuDTO menuDTO : list) {
......
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