This commit is contained in:
huangzj
2023-08-17 18:06:24 +08:00
parent ffa903afcc
commit 57df13c9ca

View File

@@ -72,13 +72,13 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
List<String> collect2 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList()); List<String> collect2 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
csLedgerQueryWrapper.clear(); csLedgerQueryWrapper.clear();
if(CollectionUtils.isEmpty(collect2)){ if(CollectionUtils.isEmpty(collect2)){
return new ArrayList<>(); return collect;
} }
csLedgerQueryWrapper.in("id",collect2).eq("level",1); csLedgerQueryWrapper.in("id",collect2).eq("level",1);
csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper); csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
List<String> collect3 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList()); List<String> collect3 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
if(CollectionUtils.isEmpty(collect3)){ if(CollectionUtils.isEmpty(collect3)){
return new ArrayList<>(); return collect;
} }
collect.addAll(collect3); collect.addAll(collect3);
collect = collect.stream().distinct().collect(Collectors.toList()); collect = collect.stream().distinct().collect(Collectors.toList());
@@ -121,16 +121,15 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
if( if(
Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode())){ Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode())){
csDeviceUserPOQueryWrapper.clear(); csDeviceUserPOQueryWrapper.clear();
csEngineeringUserPOQueryWrapper.clear();
csEngineeringUserPOQueryWrapper.lambda().eq(CsEngineeringUserPO::getUserId,userIndex);
List<CsEngineeringUserPO> csEngineeringUserPOS = csEngineeringUserMapper.selectList(csEngineeringUserPOQueryWrapper);
collect = csEngineeringUserPOS.stream().map(CsEngineeringUserPO::getEngineeringId).collect(Collectors.toList());
csDeviceUserPOQueryWrapper.eq("status","1").and(wq -> { csDeviceUserPOQueryWrapper.eq("status","1").and(wq -> {
wq.eq("primary_user_id", userIndex) wq.eq("primary_user_id", userIndex)
.or() .or()
.eq("sub_user_id",userIndex); .eq("sub_user_id",userIndex);
}); });
List<CsDeviceUserPO> csDeviceUserPOS = csDeviceUserPOMapper.selectList(csDeviceUserPOQueryWrapper); List<CsDeviceUserPO> csDeviceUserPOS = csDeviceUserPOMapper.selectList(csDeviceUserPOQueryWrapper);
if(CollectionUtils.isEmpty(csDeviceUserPOS)){
return new ArrayList<>();
}
List<String> collect1 = csDeviceUserPOS.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList()); List<String> collect1 = csDeviceUserPOS.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
return collect1; return collect1;