| | |
| | | * @return live capability |
| | | */ |
| | | @GetMapping("/capacity/{workspace_id}") |
| | | public ResponseResult<List<CapacityDeviceDTO>> getLiveCapacity(@PathVariable("workspace_id") String workspaceId) { |
| | | public ResponseResult<List<CapacityDeviceDTO>> getLiveCapacity(@PathVariable("workspace_id") String workspaceId,String sn) { |
| | | // Get information about the current user. 获取当前登录用户的信息 |
| | | // CustomClaim customClaim = (CustomClaim)request.getAttribute(TOKEN_CLAIM); |
| | | |
| | | List<CapacityDeviceDTO> liveCapacity = liveStreamService.getLiveCapacity(workspaceId); |
| | | List<CapacityDeviceDTO> liveCapacity = liveStreamService.getLiveCapacity(workspaceId,sn); |
| | | |
| | | return ResponseResult.success(liveCapacity); |
| | | } |
| | |
| | | * @param workspaceId |
| | | * @return |
| | | */ |
| | | List<CapacityDeviceDTO> getLiveCapacity(String workspaceId); |
| | | List<CapacityDeviceDTO> getLiveCapacity(String workspaceId,String sn); |
| | | |
| | | /** |
| | | * Save live capability data. |
| | |
| | | private IDeviceRedisService deviceRedisService; |
| | | |
| | | @Override |
| | | public List<CapacityDeviceDTO> getLiveCapacity(String workspaceId) { |
| | | public List<CapacityDeviceDTO> getLiveCapacity(String workspaceId,String sn) { |
| | | |
| | | // Query all devices in this workspace. |
| | | //查询该工作区中的所有设备。 |
| | | List<DeviceDTO> devicesList = deviceService.getDevicesByParams( |
| | | DeviceQueryParam.builder() |
| | | .workspaceId(workspaceId) |
| | | .deviceSn(sn) |
| | | .domains(List.of(DeviceDomainEnum.SUB_DEVICE.getVal(), DeviceDomainEnum.DOCK.getVal())) |
| | | .build()); |
| | | |
| | |
| | | <if test="param.endTime !=null and param.endTime !=null"> |
| | | AND DATE_FORMAT(FROM_UNIXTIME(j.create_time/1000,'%Y-%m-%d'),'%Y-%m-%d') <= DATE_FORMAT(#{param.endTime},'%Y-%m-%d') |
| | | </if> |
| | | <if test="param.sort != null and param.sort = 2"> |
| | | <if test="param.sort eq 2"> |
| | | and j.collect_status = 1 |
| | | </if> |
| | | <if test="param.sort != null and param.sort = 3"> |
| | | <if test="param.sort eq 3"> |
| | | and m.collect_status = 1 |
| | | </if> |
| | | GROUP BY m.job_id |