| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | | import com.ruoyi.project.system.domain.vo.SysUserDeptVo;
|
| | |
| | |
|
| | | @GetMapping("/userLoginFacotryList")
|
| | | public AjaxResult userLoginFacotryList(SysUserDeptVo sysUserDeptVo){
|
| | | return AjaxResult.success(userDeptService.userLoginFacotryList(sysUserDeptVo));
|
| | | List<SysUserDeptVo> sysUserDeptVoList = userDeptService.userLoginFacotryList(sysUserDeptVo);
|
| | | Map<Long, SysUserDeptVo> map = sysUserDeptVoList.stream()
|
| | | .collect(Collectors.toMap(
|
| | | SysUserDeptVo::getDeptId,
|
| | | item -> item,
|
| | | (existing, replacement) -> existing // 如果重复,保留第一个
|
| | | ));
|
| | | List<SysUserDeptVo> uniqueList = new ArrayList<>(map.values());
|
| | | return AjaxResult.success(uniqueList);
|
| | | }
|
| | |
|
| | | /**
|