Commit 1240b289 by guojuxing

商品权限代码回滚

parent 039fed30
...@@ -511,6 +511,14 @@ public interface MenuApiService { ...@@ -511,6 +511,14 @@ public interface MenuApiService {
ServiceResponse<Void> switchGicMenuToApp(String gicMenuCode, String appMenuCode); ServiceResponse<Void> switchGicMenuToApp(String gicMenuCode, String appMenuCode);
/** /**
* app菜单转到gic下面
* @param gicMenuCode
* @param appMenuCode
* @return
*/
ServiceResponse<Void> switchAppMenuToGic(String gicMenuCode, String appMenuCode);
/**
* test * test
* @Title: test * @Title: test
* @Description: * @Description:
......
...@@ -845,6 +845,48 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -845,6 +845,48 @@ public class MenuApiServiceImpl implements MenuApiService {
} }
@Override @Override
public ServiceResponse<Void> switchAppMenuToGic(String gicMenuCode, String appMenuCode) {
TabSysMenu appMenu = menuService.getMenuByMenuCode(appMenuCode);
boolean isNotAppMenu = appMenu == null || appMenu.getLevel() != 1 || appMenu.getProject().equals(MenuProjectConstants.DEFAULT_PROJECT)
|| appMenu.getPlatformType() != MenuPlatformTypeEnum.GIC.getCode();
if (isNotAppMenu) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不存在或者不是应用对应的code");
}
TabSysMenu gicMenu = menuService.getMenuByMenuCode(gicMenuCode);
boolean isNotGicMenu = gicMenu == null || gicMenu.getLevel() != 1 || !gicMenu.getProject().equals(MenuProjectConstants.DEFAULT_PROJECT)
|| gicMenu.getPlatformType() != MenuPlatformTypeEnum.GIC.getCode();
if (isNotGicMenu) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不存在或者不是gic对应的code");
}
Integer parentId = gicMenu.getMenuId();
String parentCode = gicMenu.getMenuCode();
String menuVersion = gicMenu.getMenuVersion();
String menuVersionName = gicMenu.getMenuVersionName();
//第二层级需要修改的数据
//1:修改project 为gic
//2:修改parent_id, parent_code
//3:menu_version,menu_version_name
List<TabSysMenu> list = menuService.listByParentMenuIdList(Arrays.asList(appMenu.getMenuId()));
if (CollectionUtils.isNotEmpty(list)) {
List<Integer> menuIdList = list.stream().filter(e -> e != null).map(e -> e.getMenuId()).collect(Collectors.toList());
menuService.updateMenuTmp(menuIdList, MenuProjectConstants.DEFAULT_PROJECT, parentId, parentCode, menuVersion, menuVersionName);
//下面层级需要修改的
//1:修改project
//2:menu_version menu_version_name
List<TabSysMenu> childList = menuService.listMenuForGicContainChild(menuIdList);
if (CollectionUtils.isNotEmpty(childList)) {
List<Integer> childMenuIdList = childList.stream().filter(e -> e != null).map(e -> e.getMenuId()).collect(Collectors.toList());
menuService.updateMenuTmp(childMenuIdList, MenuProjectConstants.DEFAULT_PROJECT, null, null, menuVersion, menuVersionName);
}
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<List<MenuDTO>> filterOperationUserDepartAuth(List<MenuDTO> resultList, UserDTO tabSysUser) { public ServiceResponse<List<MenuDTO>> filterOperationUserDepartAuth(List<MenuDTO> resultList, UserDTO tabSysUser) {
List<TabSysMenu> list = filterOperationUserDepartAuth(EntityUtil.changeEntityListNew(TabSysMenu.class, resultList), List<TabSysMenu> list = filterOperationUserDepartAuth(EntityUtil.changeEntityListNew(TabSysMenu.class, resultList),
EntityUtil.changeEntityNew(TabSysUser.class, tabSysUser)); EntityUtil.changeEntityNew(TabSysUser.class, tabSysUser));
...@@ -1456,12 +1498,8 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -1456,12 +1498,8 @@ public class MenuApiServiceImpl implements MenuApiService {
*/ */
private Set<String> getBusinessFrontRes(Integer enterpriseId) { private Set<String> getBusinessFrontRes(Integer enterpriseId) {
Set<String> resourcePage = new HashSet<>(16); Set<String> resourcePage = new HashSet<>(16);
//商品资源获取接口调整 //todo 是否商品资源变成应用
ServiceResponse<MenuDTO> goods = getHasBuyAppByMenuCode(AppMenuCodeConstants.GOODS_APP, enterpriseId);
boolean hasGoodsAuth = goods.isSuccess();
if (!hasGoodsAuth) {
resourcePage.add(AppMenuCodeConstants.GOODS_GIC);
}
//过滤商品资源页面 //过滤商品资源页面
ServiceResponse<List<EnterpriseResourceRelDTO>> resourceResult = enterpriseApiService.getBusinessFrontRes(enterpriseId); ServiceResponse<List<EnterpriseResourceRelDTO>> resourceResult = enterpriseApiService.getBusinessFrontRes(enterpriseId);
if (resourceResult.isSuccess()) { if (resourceResult.isSuccess()) {
......
...@@ -128,8 +128,13 @@ public class MenuController { ...@@ -128,8 +128,13 @@ public class MenuController {
@IgnoreLogin @IgnoreLogin
@HeaderSignIgnore @HeaderSignIgnore
@RequestMapping("switch-gic-menu-to-app") @RequestMapping("switch-gic-menu-to-app")
public RestResponse switchGicMenuToApp(String gicMenuCode, String appMenuCode) { public RestResponse switchGicMenuToApp(String gicMenuCode, String appMenuCode, Boolean appToGic) {
return RestResponse.success(menuApiService.switchGicMenuToApp(gicMenuCode, appMenuCode)); if (appToGic != null && appToGic) {
menuApiService.switchAppMenuToGic(gicMenuCode, appMenuCode);
} else {
menuApiService.switchGicMenuToApp(gicMenuCode, appMenuCode);
}
return RestResponse.success();
} }
@RequestMapping("login-collaborator-menu-of-app") @RequestMapping("login-collaborator-menu-of-app")
......
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