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