Commit cc8b73a9 by guojuxing

商品前置资源改成应用

parent e46dad67
......@@ -10,7 +10,7 @@ public class AppMenuCodeConstants {
/**
* 商品应用菜单code
*/
public static final String GOODS = "goods_app";
public static final String GOODS_APP = "goods_app";
/**
* gic权限页面code
*/
......
......@@ -482,6 +482,14 @@ public interface MenuApiService {
ServiceResponse<MenuDTO> getMenuByMenuCode(String menuCode);
/**
* 获取已经购买的应用
* @param menuCode 权限菜单code
* @param enterpriseId
* @return
*/
ServiceResponse<MenuDTO> getHasBuyAppByMenuCode(String menuCode, Integer enterpriseId);
/**
* 同步测试菜单数据到生产
* @Title: syncProductMenu

* @Description:
......
......@@ -707,6 +707,24 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public ServiceResponse<MenuDTO> getHasBuyAppByMenuCode(String menuCode, Integer enterpriseId) {
TabSysMenu record = menuService.getMenuByMenuCode(menuCode);
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "菜单code错误,无数据");
}
ServiceResponse<List<ApplicationTokenDTO>> appResult = appTokenApiService
.listApplicationByeId(Long.valueOf(enterpriseId));
if (appResult.isSuccess()) {
List<ApplicationTokenDTO> appList = appResult.getResult();
boolean existApp = appList.stream().anyMatch(e -> e.getApplicationId().toString().equals(record.getProject()));
if (existApp) {
return ServiceResponse.success(EntityUtil.changeEntityNew(MenuDTO.class, record));
}
}
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "菜单code错误,无数据");
}
@Override
public ServiceResponse<List<MenuDTO>> test(String menuCode) {
TabSysMenu tabSysMenu = menuService.getMenuByMenuCode(menuCode);
List<TabSysMenu> devMenuList = menuService.listMenuTempForGic(menuCode);
......@@ -1373,7 +1391,7 @@ public class MenuApiServiceImpl implements MenuApiService {
private Set<String> getBusinessFrontRes(Integer enterpriseId) {
Set<String> resourcePage = new HashSet<>(16);
//商品资源获取接口调整
ServiceResponse<MenuDTO> goods = getMenuByMenuCode(AppMenuCodeConstants.GOODS);
ServiceResponse<MenuDTO> goods = getHasBuyAppByMenuCode(AppMenuCodeConstants.GOODS_APP, enterpriseId);
boolean hasGoodsAuth = goods.isSuccess();
if (!hasGoodsAuth) {
resourcePage.add(AppMenuCodeConstants.GOODS_GIC);
......
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