fix:部门新增查询接口

This commit is contained in:
zhangzhiqiang
2022-12-08 17:40:36 +08:00
parent 45eb611a57
commit e6e459b038
2 changed files with 9 additions and 7 deletions

View File

@@ -62,13 +62,15 @@ public class DeptController {
@ApiOperation("查询部门") @ApiOperation("查询部门")
@GetMapping("/vo") @GetMapping("/vo")
public ResponseEntity<Object> queryvo(DeptQueryCriteria criteria) throws Exception { public ResponseEntity<Object> queryvo(DeptQueryCriteria criteria) throws Exception {
if (criteria.getPid() == null){
criteria.setPidIsNull(true);
}
Boolean hasChild = false; Boolean hasChild = false;
if (StringUtils.isNotEmpty(criteria.getName()) || StringUtils.isNotEmpty(criteria.getIs_used())){ if (criteria.getPidIsNull() == null){
criteria.setPidIsNull(null); if (criteria.getPid() == null){
hasChild=true; criteria.setPidIsNull(true);
}
if (StringUtils.isNotEmpty(criteria.getName()) || StringUtils.isNotEmpty(criteria.getIs_used())){
criteria.setPidIsNull(null);
hasChild=true;
}
} }
List<Dept> deptDtos = deptService.queryAll(criteria, true); List<Dept> deptDtos = deptService.queryAll(criteria, true);
List<DeptVo> deptVos = CopyUtil.copyList(deptDtos, DeptVo.class); List<DeptVo> deptVos = CopyUtil.copyList(deptDtos, DeptVo.class);

View File

@@ -164,7 +164,7 @@ public class MenuServiceImpl implements MenuService {
WQLObject menuTab = WQLObject.getWQLObject("sys_menu"); WQLObject menuTab = WQLObject.getWQLObject("sys_menu");
JSONObject rootMenuObj = menuTab.query("menu_id = '" + rootMenuId + "'").uniqueResult(0); JSONObject rootMenuObj = menuTab.query("menu_id = '" + rootMenuId + "'").uniqueResult(0);
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("system_type", rootMenuObj.getString("title")); param.put("system_type", rootMenuObj.getString("system_type"));
param.put("menu_id", menu_id); param.put("menu_id", menu_id);
menuTab.update(param); menuTab.update(param);
} }