获得分组标签列表接口添加组织id参数筛选

This commit is contained in:
yangsb
2024-04-11 11:53:52 +08:00
parent 86824ebc49
commit 1149d126e7
3 changed files with 5 additions and 5 deletions
@@ -92,8 +92,8 @@ public class LabelController {
@Operation(summary = "获得分组标签列表")
@PreAuthorize("@ss.hasPermission('system:label:query')")
@OperateLog(enable = false)
public CommonResult<Map<String, List<LabelRespVO>>> getGroupList() {
return success(labelService.getGroupList());
public CommonResult<Map<String, List<LabelRespVO>>> getGroupList(@RequestParam(value = "organId", required = false) Long organId) {
return success(labelService.getGroupList(organId));
}
@GetMapping("/export-excel")
@@ -56,7 +56,7 @@ public interface LabelService {
PageResult<LabelDO> getLabelPage(LabelPageReqVO pageReqVO);
Map<String, List<LabelRespVO>> getGroupList();
Map<String, List<LabelRespVO>> getGroupList(Long organId);
List<LabelDO> list(String type);
}
@@ -97,8 +97,8 @@ public class LabelServiceImpl implements LabelService {
@Override
public Map<String, List<LabelRespVO>> getGroupList() {
List<LabelDO> LabelDOS = labelMapper.selectList();
public Map<String, List<LabelRespVO>> getGroupList(Long organId) {
List<LabelDO> LabelDOS = labelMapper.selectList(new LambdaQueryWrapperX<LabelDO>().eqIfPresent(LabelDO::getOrganId, organId));
List<LabelRespVO> LabelRespVOS = BeanUtils.toBean(LabelDOS, LabelRespVO.class);
return LabelRespVOS.stream().collect(Collectors.groupingBy(LabelRespVO::getType));
}