Compare commits
2 Commits
b945420446
...
1e4ee840a3
Author | SHA1 | Date | |
---|---|---|---|
1e4ee840a3 | |||
374a03b83d |
@ -8,8 +8,6 @@ import com.fuyuanshen.common.idempotent.annotation.RepeatSubmit;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
import com.fuyuanshen.common.web.core.BaseController;
|
||||
import com.fuyuanshen.equipment.domain.bo.DeviceAlarmBo;
|
||||
import com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo;
|
||||
import com.fuyuanshen.web.service.DeviceShareService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -53,6 +53,7 @@ public class DeviceLogServiceImpl implements IDeviceLogService {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询设备日志列表
|
||||
*
|
||||
@ -62,13 +63,12 @@ public class DeviceLogServiceImpl implements IDeviceLogService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DeviceLogVo> queryPageList(DeviceLogBo bo, PageQuery pageQuery) {
|
||||
|
||||
|
||||
LambdaQueryWrapper<DeviceLog> lqw = buildQueryWrapper(bo);
|
||||
Page<DeviceLogVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的设备日志列表
|
||||
*
|
||||
@ -83,13 +83,17 @@ public class DeviceLogServiceImpl implements IDeviceLogService {
|
||||
|
||||
private LambdaQueryWrapper<DeviceLog> buildQueryWrapper(DeviceLogBo bo) {
|
||||
|
||||
Long userId = LoginHelper.getUserId();
|
||||
List<DeviceAssignments> assignments = deviceAssignmentsMapper.selectList(new QueryWrapper<DeviceAssignments>().eq("assignee_id", userId));
|
||||
List<Long> deviceIds = assignments.stream().map(DeviceAssignments::getDeviceId).collect(Collectors.toList());
|
||||
if (deviceIds.isEmpty()) {
|
||||
deviceIds.add(-1L);
|
||||
// 管理员
|
||||
String username = LoginHelper.getUsername();
|
||||
if (!username.equals("admin")) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
List<DeviceAssignments> assignments = deviceAssignmentsMapper.selectList(new QueryWrapper<DeviceAssignments>().eq("assignee_id", userId));
|
||||
List<Long> deviceIds = assignments.stream().map(DeviceAssignments::getDeviceId).collect(Collectors.toList());
|
||||
if (deviceIds.isEmpty()) {
|
||||
deviceIds.add(-1L);
|
||||
}
|
||||
bo.setDeviceIds(deviceIds);
|
||||
}
|
||||
bo.setDeviceIds(deviceIds);
|
||||
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<DeviceLog> lqw = Wrappers.lambdaQuery();
|
||||
|
Reference in New Issue
Block a user