Commit 9bcab233 authored by 赵啸非's avatar 赵啸非

添加多级菜单ID

parent e176fceb
...@@ -7,6 +7,7 @@ import com.mortals.xhx.base.system.param.service.ParamService; ...@@ -7,6 +7,7 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.model.model.ModelQuery; import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService; import com.mortals.xhx.module.model.service.ModelService;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.model.SiteTreeSelect; import com.mortals.xhx.module.site.model.SiteTreeSelect;
import com.mortals.xhx.module.site.service.SiteService; import com.mortals.xhx.module.site.service.SiteService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -87,10 +88,10 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -87,10 +88,10 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
/** /**
* 根据区域查询站点列表 * 根据区域编码查询站点列表
*/ */
@PostMapping(value = "getFlatSitesByAreaCode") @PostMapping(value = "getFlatSitesByAreaCode")
public String getFlatSitesByAreaCode(@RequestBody SiteEntity site) { public String getFlatSitesByAreaCode(@RequestBody SiteQuery site) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
String busiDesc = "根据区域编码查询站点列表" + this.getModuleDesc(); String busiDesc = "根据区域编码查询站点列表" + this.getModuleDesc();
...@@ -109,27 +110,27 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -109,27 +110,27 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
} }
/* /**
public SiteTreeSelect reFucurs(List<SiteTreeSelect> siteTree, Set<String> siteSet) { * 根据区域id查询站点列表
SiteTreeSelect temp=null; */
for (SiteTreeSelect site : siteTree) { @PostMapping(value = "getFlatSitesByAreaIds")
public String getFlatSitesByAreaIds(@RequestBody SiteQuery site) {
JSONObject jsonObject = new JSONObject();
if (site.getId().equals(siteId)) { Map<String, Object> model = new HashMap<>();
log.info("curTree:{}", JSON.toJSONString(site)); String busiDesc = "根据区域编码查询站点列表" + this.getModuleDesc();
temp=site; try {
break; List<SiteEntity> siteEntityList = this.service.getFlatSitesByAreaCode(site.getAreaCode(), getContext());
} else { recordSysLog(request, busiDesc + " 【成功】");
if (!ObjectUtils.isEmpty(site.getChildren())) { jsonObject.put(KEY_RESULT_DATA, siteEntityList);
temp=reFucurs(site.getChildren(), siteId); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
if(temp!=null){ jsonObject.put(KEY_RESULT_MSG, "查询站点列表成功!");
break; } catch (Exception e) {
} log.error("获取异常", e);
} jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
} jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
} }
return temp; return jsonObject.toJSONString();
}*/ }
public static void main(String[] args) { public static void main(String[] args) {
//深度克隆 //深度克隆
......
...@@ -4,6 +4,7 @@ POST {{baseUrl}}/window/list ...@@ -4,6 +4,7 @@ POST {{baseUrl}}/window/list
Content-Type: application/json Content-Type: application/json
{ {
"siteId":8,
"page":1, "page":1,
"size":10 "size":10
} }
......
...@@ -845,8 +845,11 @@ data|object|数据对象 ...@@ -845,8 +845,11 @@ data|object|数据对象
&emsp;&emsp;authType|Integer|权限类型(0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看) &emsp;&emsp;authType|Integer|权限类型(0.无限制,1.无需登录查看,2.需要登录查看,3.需要角色权限查看)
&emsp;&emsp;orderId|Integer|排序编号 &emsp;&emsp;orderId|Integer|排序编号
&emsp;&emsp;firstLevel|String|一级菜单 &emsp;&emsp;firstLevel|String|一级菜单
&emsp;&emsp;firstLevel|Long|一级菜单ID
&emsp;&emsp;secondLevel|String|二级菜单 &emsp;&emsp;secondLevel|String|二级菜单
&emsp;&emsp;secondMenuId|Long|二级菜单ID
&emsp;&emsp;thirdLevel|String|三级菜单 &emsp;&emsp;thirdLevel|String|三级菜单
&emsp;&emsp;thirdMenuId|Long|三级菜单ID
&emsp;&emsp;createTime|Date|创建时间 &emsp;&emsp;createTime|Date|创建时间
&emsp;&emsp;createUserId|Long|创建用户 &emsp;&emsp;createUserId|Long|创建用户
&emsp;&emsp;createUserName|String|创建用户名称 &emsp;&emsp;createUserName|String|创建用户名称
......
...@@ -18,13 +18,30 @@ public class MenuVo extends BaseEntityLong { ...@@ -18,13 +18,30 @@ public class MenuVo extends BaseEntityLong {
* 一级菜单 * 一级菜单
*/ */
private String firstLevel; private String firstLevel;
/**
* 一级菜单Id
*/
private Long firstMenuId;
/** /**
* 二级菜单 * 二级菜单
*/ */
private String secondLevel; private String secondLevel;
/**
* 二级菜单Id
*/
private Long secondMenuId;
/** /**
* 三级菜单 * 三级菜单
*/ */
private String thirdLevel; private String thirdLevel;
/**
* 三级菜单Id
*/
private Long thirdMenuId;
} }
\ No newline at end of file
...@@ -38,16 +38,22 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity ...@@ -38,16 +38,22 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
if (map.size() == 0) { if (map.size() == 0) {
//当前菜单为顶级 //当前菜单为顶级
item.setFirstLevel(item.getName()); item.setFirstLevel(item.getName());
item.setFirstMenuId(item.getId());
item.setSecondLevel(""); item.setSecondLevel("");
item.setThirdLevel(""); item.setThirdLevel("");
} else if (map.size() == 1) { } else if (map.size() == 1) {
item.setFirstLevel(map.get(1).getName()); item.setFirstLevel(map.get(1).getName());
item.setFirstMenuId(map.get(1).getId());
item.setSecondLevel(item.getName()); item.setSecondLevel(item.getName());
item.setSecondMenuId(item.getId());
item.setThirdLevel(""); item.setThirdLevel("");
} else if (map.size() == 2) { } else if (map.size() == 2) {
item.setFirstLevel(map.get(2).getName()); item.setFirstLevel(map.get(2).getName());
item.setFirstMenuId(map.get(2).getId());
item.setSecondLevel(map.get(1).getName()); item.setSecondLevel(map.get(1).getName());
item.setSecondMenuId(map.get(1).getId());
item.setThirdLevel(item.getName()); item.setThirdLevel(item.getName());
item.setThirdMenuId(item.getId());
} else { } else {
} }
......
...@@ -26,7 +26,7 @@ Content-Type: application/json ...@@ -26,7 +26,7 @@ Content-Type: application/json
"loginPwd":"test", "loginPwd":"test",
"realName":"测试", "realName":"测试",
"mobile":"13281114856", "mobile":"13281114856",
"userType":1, "roleId": "1",
"siteIds":"", "siteIds":"",
"areaCodes":"" "areaCodes":""
} }
......
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