Commit 765ff8f8 authored by Cheng C Yang's avatar Cheng C Yang

Pom Add analysis_excel_init

parent 6c1997f5
......@@ -20,9 +20,10 @@ import java.util.List;
import java.util.stream.Collectors;
/**
*
*/
@Service
public class MenuServiceImpl extends BaseService{
public class MenuServiceImpl extends BaseService {
private static final Logger logger = LoggerFactory.getLogger(MenuServiceImpl.class);
......@@ -47,14 +48,17 @@ public class MenuServiceImpl extends BaseService{
}
List<MenuDisplayDto> menuDisplayDtos = new ArrayList<>();
List<Menu> menus = findByServiceTypeId(moduleId);
List<String> mendIds = getMenuIds(moduleId,userId);
List<String> mendIds = getMenuIds(moduleId, userId);
List<Menu> rootNodes = menus.stream().filter(oneMenu -> !StringUtils.hasText(oneMenu.getParentId()))
.collect(Collectors.toList());
for (Menu menu : rootNodes) {
// 把EF获取的menu转化为Dto形式
MenuDisplayDto menuDisplayDto = rotateMenuToMenuDisplayDto(menu);
getSubMenuDto(menuDisplayDto, menus, mendIds);
menuDisplayDtos.add(menuDisplayDto);
if (menuDisplayDto.getSubMenus().size() > 0) {
menuDisplayDtos.add(menuDisplayDto);
}
}
return menuDisplayDtos;
}
......@@ -65,7 +69,7 @@ public class MenuServiceImpl extends BaseService{
return menuDisplayDto;
}
;
private MenuDto rotateMenuToMenuDto(Menu menu) {
MenuDto menuDto = new MenuDto();
......@@ -73,13 +77,13 @@ public class MenuServiceImpl extends BaseService{
return menuDto;
}
;
private void getSubMenuDto(MenuDisplayDto menu, List<Menu> menus, List<String> menuIds) {
List<MenuDisplayDto> subMenuDtos = menus.stream()
.filter(oneMenu -> menu.getId().equals(oneMenu.getParentId())
&& CommonConstants.ACTIVE_STATUS.equals(oneMenu.getIsActive())
&& menuIds.contains(oneMenu.getId()))
&& menuIds.contains(oneMenu.getId()))
.map(this::rotateMenuToMenuDisplayDto).collect(Collectors.toList());
menu.setSubMenus(subMenuDtos);
for (MenuDisplayDto subMenu : subMenuDtos) {
......@@ -87,8 +91,8 @@ public class MenuServiceImpl extends BaseService{
}
}
public List<MenuDto> getFilterMenus(Integer moduleId, String userId){
List<String> menuIds = getMenuIds(moduleId,userId);
public List<MenuDto> getFilterMenus(Integer moduleId, String userId) {
List<String> menuIds = getMenuIds(moduleId, userId);
logger.debug("Start to get menus");
if (moduleId == null) {
throw new ApplicationException("serviceId for getMenus can't be null");
......@@ -105,6 +109,9 @@ public class MenuServiceImpl extends BaseService{
menuDto.setSubMenus(subMenuDtos);
iteratorMenu2(menus, menuDto, menuIds);
}
menuDtos = menuDtos.stream().filter(menuDto -> menuDto.getSubMenus().size() > 0).collect(Collectors.toList());
return menuDtos;
}
......@@ -170,7 +177,7 @@ public class MenuServiceImpl extends BaseService{
.collect(Collectors.toList());
if (!subMenus.isEmpty()) {
List<MenuDto> subMenuDtos = subMenus.stream()
.map(this::rotateMenuToMenuDto).collect(Collectors.toList());
.map(this::rotateMenuToMenuDto).collect(Collectors.toList());
menu.setSubMenus(subMenuDtos);
for (MenuDto m : subMenuDtos) {
iteratorMenu(menus, m);
......
......@@ -22,10 +22,16 @@
<!--<div ui-view="orangization-structure" ng-show="state.includes('basicData.orangizationStructureManage')"></div>
<div ui-view="business-unit" ng-show="state.includes('basicData.businessUnit')"></div>
<div ui-view="region" ng-show="state.includes('basicData.regionManage')"></div>-->
<div ui-view="enterprise-account" ng-show="state.includes('financialData.enterpriseAccountManage')"></div>
<!-- <div ui-view="enterprise-account" ng-show="state.includes('financialData.enterpriseAccountManage')"></div>-->
<div ui-view="enterprise-account" ng-show="enterpriseAccountSetShow"></div>
<!--<div ui-view="word-library" ng-show="state.includes('basicData.wordLibraryManage')"></div>-->
<!--<div ui-view="key-value" ng-show="state.includes('basicData.keyvalueManage')"></div>-->
<div ui-view="customer-list" ng-show="state.includes('financialData.customerListManage')"></div>
<!-- <div ui-view="customer-list" ng-show="state.includes('financialData.customerListManage')"></div>-->
<div ui-view="customer-list" ng-show="customerListShow"></div>
<!--<div ui-view="product-manage" ng-show="state.includes('financialData.productManage')"></div>-->
<!--<div ui-view="standardAccountManage" ng-show="state.includes('basicData.standardAccountManage')"></div>-->
</div>
......
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