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());
csLedgerQueryWrapper.clear();
if(CollectionUtils.isEmpty(collect2)){
return new ArrayList<>();
return collect;
}
csLedgerQueryWrapper.in("id",collect2).eq("level",1);
csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
List<String> collect3 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
if(CollectionUtils.isEmpty(collect3)){
return new ArrayList<>();
return collect;
}
collect.addAll(collect3);
collect = collect.stream().distinct().collect(Collectors.toList());
@@ -121,16 +121,15 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
if(
Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode())){
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 -> {
wq.eq("primary_user_id", userIndex)
.or()
.eq("sub_user_id",userIndex);
});
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());
return collect1;