新增机构名称列表接口
This commit is contained in:
parent
22689c3fee
commit
e3aa1dec14
|
@ -84,4 +84,12 @@ public class SysOrgController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("nameList")
|
||||
@Operation(summary = "名称列表")
|
||||
public Result<List<String>> nameList(@RequestBody List<Long> idList) {
|
||||
List<String> list = sysOrgService.getNameList(idList);
|
||||
|
||||
return Result.ok(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -8,23 +8,31 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 机构管理
|
||||
*
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
* <a href="https://maku.net">MAKU</a>
|
||||
*/
|
||||
public interface SysOrgService extends BaseService<SysOrgEntity> {
|
||||
|
||||
List<SysOrgVO> getList();
|
||||
List<SysOrgVO> getList();
|
||||
|
||||
void save(SysOrgVO vo);
|
||||
void save(SysOrgVO vo);
|
||||
|
||||
void update(SysOrgVO vo);
|
||||
void update(SysOrgVO vo);
|
||||
|
||||
void delete(Long id);
|
||||
void delete(Long id);
|
||||
|
||||
/**
|
||||
* 根据机构ID,获取子机构ID列表(包含本机构ID)
|
||||
* @param id 机构ID
|
||||
*/
|
||||
List<Long> getSubOrgIdList(Long id);
|
||||
/**
|
||||
* 根据机构ID,获取子机构ID列表(包含本机构ID)
|
||||
*
|
||||
* @param id 机构ID
|
||||
*/
|
||||
List<Long> getSubOrgIdList(Long id);
|
||||
|
||||
/**
|
||||
* 根据机构ID列表,获取机构名称列表
|
||||
*
|
||||
* @param idList 机构ID列表
|
||||
*/
|
||||
List<String> getNameList(List<Long> idList);
|
||||
}
|
|
@ -107,6 +107,15 @@ public class SysOrgServiceImpl extends BaseServiceImpl<SysOrgDao, SysOrgEntity>
|
|||
return subIdList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNameList(List<Long> idList) {
|
||||
if (idList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return baseMapper.selectBatchIds(idList).stream().map(SysOrgEntity::getName).toList();
|
||||
}
|
||||
|
||||
private void getTree(Long id, List<SysOrgEntity> orgList, List<Long> subIdList) {
|
||||
for (SysOrgEntity org : orgList) {
|
||||
if (ObjectUtil.equals(org.getPid(), id)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user