fix: 流域下拉优化
This commit is contained in:
parent
5f7179949a
commit
272b85b275
@ -118,14 +118,9 @@ public class SdRvcdDicServiceImpl extends ServiceImpl<SdRvcdDicMapper, SdRvcdDic
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SdRvcdDic> selectForDropdown(String rvnm, String rvcd) {
|
public List<SdRvcdDic> selectForDropdown(String rvnm, String rvcd) {
|
||||||
|
List<SdRvcdDic> dropdownList = this.baseMapper.selectRegDropdown(rvnm, rvcd);
|
||||||
LambdaQueryWrapper<SdRvcdDic> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.like(rvnm != null && !rvnm.isEmpty(), SdRvcdDic::getRvnm, rvnm)
|
|
||||||
.eq(rvcd != null && !rvcd.isEmpty(), SdRvcdDic::getRvcd, rvcd)
|
|
||||||
.eq(SdRvcdDic::getEnabled, 1)
|
|
||||||
.orderByAsc(SdRvcdDic::getBaseid,SdRvcdDic::getOrderIndex);
|
|
||||||
if("admin".equals(SecurityUtils.getCurrentUsername())){
|
if("admin".equals(SecurityUtils.getCurrentUsername())){
|
||||||
return this.list(wrapper);
|
return dropdownList;
|
||||||
}
|
}
|
||||||
Set<String> authorizedStations = getUserAuthorizedStationCodes();
|
Set<String> authorizedStations = getUserAuthorizedStationCodes();
|
||||||
if (authorizedStations != null && !authorizedStations.isEmpty()) {
|
if (authorizedStations != null && !authorizedStations.isEmpty()) {
|
||||||
@ -141,8 +136,7 @@ public class SdRvcdDicServiceImpl extends ServiceImpl<SdRvcdDicMapper, SdRvcdDic
|
|||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if (!rvcds.isEmpty()) {
|
if (!rvcds.isEmpty()) {
|
||||||
List<SdRvcdDic> list = this.list(wrapper);
|
return dropdownList.stream()
|
||||||
return list.stream()
|
|
||||||
.filter(rvcdDic -> rvcds.contains(rvcdDic.getRvcd()))
|
.filter(rvcdDic -> rvcds.contains(rvcdDic.getRvcd()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user