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

添加多级菜单ID

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