Commit c199a27d by guojuxing

查询已购买应用类别接口修复

parent 4722ad4d
......@@ -144,4 +144,6 @@ public interface TabSysMenuMapper {
* @return java.util.List<com.gic.auth.entity.TabSysMenu>


 */
List<TabSysMenu> listMenuTree(@Param("project") String project);
List<TabSysMenu> selectByProjectList(@Param("projectList")List<String> projectList);
}
\ No newline at end of file
......@@ -114,4 +114,14 @@ public interface MenuService {
* @return java.util.List<com.gic.auth.dto.MenuDTO>


 */
List<TabSysMenu> listMenuTree(String project);
/**
* 根据项目查询
* @Title: selectByProjectList

* @Description:

 * @author guojuxing
* @param projectList

* @return java.util.List<com.gic.auth.entity.TabSysMenu>


 */
List<TabSysMenu> selectByProjectList(List<String> projectList);
}
......@@ -125,6 +125,11 @@ public class MenuServiceImpl implements MenuService {
return tabSysMenuMapper.listMenuTree(project);
}
@Override
public List<TabSysMenu> selectByProjectList(List<String> projectList) {
return tabSysMenuMapper.selectByProjectList(projectList);
}
private void updateSort(Integer sort, Integer id) {
TabSysMenu record = new TabSysMenu();
record.setMenuId(id);
......
......@@ -143,12 +143,12 @@ public class MenuApiServiceImpl implements MenuApiService {
List<ApplicationDTO> appList = appResult.getResult();
if (CollectionUtils.isNotEmpty(appList)) {
saveHasBuyAppMenu(appList);
List<Integer> menuIdList = new ArrayList<>(appList.size());
List<String> projectList = new ArrayList<>(appList.size());
for (ApplicationDTO app : appList) {
menuIdList.add(app.getApplicationId().intValue());
projectList.add(app.getApplicationId().toString());
}
List<MenuDTO> menuList = EntityUtil.changeEntityListNew(MenuDTO.class,
menuService.selectByIds(menuIdList));
menuService.selectByProjectList(projectList));
return ServiceResponse.success(menuList);
} else {
return ServiceResponse.success(new ArrayList<>());
......@@ -480,7 +480,7 @@ public class MenuApiServiceImpl implements MenuApiService {
if (appListResponse.isSuccess()) {
List<ApplicationDTO> appList = appListResponse.getResult();
for (ApplicationDTO app : appList) {
if (appMenu.containsKey(app.getApplicationId())) {
if (appMenu.containsKey(app.getApplicationId().toString())) {
//如果已存在,则更新版本信息
MenuDTO menuDTO = new MenuDTO();
menuDTO.setMenuName(app.getName());
......@@ -503,7 +503,7 @@ public class MenuApiServiceImpl implements MenuApiService {
private void saveHasBuyAppMenu(List<ApplicationDTO> hasBuyAppList) {
Map<String, TabSysMenu> appMenu = getFirstLevelAppMenu();
for (ApplicationDTO app : hasBuyAppList) {
if (appMenu.containsKey(app.getApplicationId())) {
if (appMenu.containsKey(app.getApplicationId().toString())) {
//如果已存在,则更新版本信息
MenuDTO menuDTO = new MenuDTO();
menuDTO.setMenuName(app.getName());
......
......@@ -375,4 +375,21 @@
order by level,sort
</select>
<select id="selectByProjectList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
and level = 1
and menu_type = 0
and project != 'gic'
<if test="null != projectList and projectList.size() > 0">
and project in
<foreach collection="projectList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -5,6 +5,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.gic.auth.constant.MenuTypeEnum;
import com.gic.auth.web.vo.AppMenuVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -107,7 +109,7 @@ public class RoleController {
@RequestMapping("/list-app-menu-tree")
public RestResponse listAppMenuTree() {
return EnterpriseRestResponse.failure(menuApiService.listAppPageOfHasBuy());
return ResultControllerUtils.commonResult(menuApiService.listAppPageOfHasBuy(), AppMenuVO.class);
}
public static List<Map<String, Object>> changeListToTree(int storeGroupId, List<MenuDTO> list) {
......@@ -119,6 +121,7 @@ public class RoleController {
data.put("menuId", menuDTO.getMenuId());
data.put("menuName", menuDTO.getMenuName());
data.put("project", menuDTO.getProject());
data.put("menuType", menuDTO.getMenuType());
List<Map<String, Object>> children = changeListToTree(menuDTO.getMenuId(), list);
if (children == null || children.size() < 1) {
data.put("children", null);
......
package com.gic.auth.web.vo;
import java.io.Serializable;
/**
* 已购买的应用列表
* @ClassName: AppMenuVO

* @Description: 

* @author guojuxing

* @date 2019/9/26 4:18 PM

*/
public class AppMenuVO implements Serializable{
private static final long serialVersionUID = 7795916812136309666L;
/**
*
*/
private Integer menuId;
private String menuName;
public Integer getMenuId() {
return menuId;
}
public void setMenuId(Integer menuId) {
this.menuId = menuId;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
}
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