This commit is contained in:
cdf
2025-12-23 13:49:10 +08:00
parent 29168bbd9f
commit e7dbee2df5

View File

@@ -64,13 +64,9 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
private final ICsDataSetService csDataSetService;
private final DictTreeFeignClient dictTreeFeignClient;
private final EngineeringController engineeringController;
private final CsDeviceUserPOMapper csDeviceUserPOMapper;
private final CsCommTerminalServiceImpl csCommTerminalServiceImpl;
private final PqSensitiveUserFeignClient pqSensitiveUserFeignClient;
private final UserFeignClient userFeignClient;
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
private final CsDeviceUserPOService csDeviceUserPOService;
@Override
@@ -682,11 +678,13 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
UserVO userVO = userFeignClient.getUserById(userId).getData();
List<String> devIds;
if (userVO.getType().equals(UserType.SUPER_ADMINISTRATOR) || userVO.getType().equals(UserType.ADMINISTRATOR)) {
devIds = csEquipmentDeliveryService.getAll().stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
devIds = csEquipmentDeliveryMapper.selectList(null).stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
} else {
List<CsDeviceUserPO> devList = csDeviceUserPOService.lambdaQuery().select(CsDeviceUserPO::getDeviceId)
LambdaQueryWrapper<CsDeviceUserPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.select(CsDeviceUserPO::getDeviceId)
.and(w -> w.eq(CsDeviceUserPO::getPrimaryUserId, userId).or().eq(CsDeviceUserPO::getSubUserId, userId))
.eq(CsDeviceUserPO::getStatus, DataStateEnum.ENABLE.getCode()).list();
.eq(CsDeviceUserPO::getStatus, DataStateEnum.ENABLE.getCode());
List<CsDeviceUserPO> devList = csDeviceUserPOMapper.selectList(lambdaQueryWrapper);
devIds = devList.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
}
if (CollUtil.isEmpty(devIds)) {