Procházet zdrojové kódy

查看正在执行任务的直播-添加vo返回字段

pull/381/head
suqin před 10 měsíci
rodič
revize
a5f4ce780e
2 změnil soubory, kde provedl 36 přidání a 0 odebrání
  1. +10
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/QueryVideoService.java
  2. +26
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/LiveChannelVo.java

+ 10
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/QueryVideoService.java Zobrazit soubor

@@ -14,9 +14,11 @@ import com.tuoheng.miniprogram.entity.LiveChannel;
import com.tuoheng.miniprogram.enums.InspectionStatusEnum;
import com.tuoheng.miniprogram.enums.MarkEnum;
import com.tuoheng.miniprogram.enums.code.inspection.QueryVideoServiceEnum;
import com.tuoheng.miniprogram.utils.CurrentUserUtil;
import com.tuoheng.miniprogram.vo.InspectionVideoVo;
import com.tuoheng.miniprogram.vo.LiveChannelVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@@ -42,6 +44,13 @@ public class QueryVideoService {
if (StringUtils.isEmpty(id)) {
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getCode(), QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getMsg());
}

//获取租户id
String tenantId = CurrentUserUtil.getTenantId();
if (StringUtils.isEmpty(tenantId)) {
return JsonResult.error("租户id为空");
}

//根据id查询对应的任务
Inspection inspection = inspectionMapper.selectById(id);
if (ObjectUtil.isNull(inspection)) {
@@ -49,6 +58,7 @@ public class QueryVideoService {

}
LiveChannelVo liveChannelVo = new LiveChannelVo();
BeanUtils.copyProperties(inspection, liveChannelVo);
//任务状态为任务飞行中10视频直播
if (10 == inspection.getStatus()) {
LiveChannel liveChannel = liveChannelMapper.selectOne(new LambdaQueryWrapper<LiveChannel>()

+ 26
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/LiveChannelVo.java Zobrazit soubor

@@ -1,6 +1,10 @@
package com.tuoheng.miniprogram.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
* @Author suqin
@@ -9,6 +13,28 @@ import lombok.Data;
@Data
public class LiveChannelVo {

/**
* 任务执行时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date executionStartTime;

/**
* 任务名称
*/
private String name;

/**
* 任务编号
*/
private String code;

/**
* 巡检任务类型 0周期任务 1 单次任务|周期子任务
*/
private Integer type;

/**
* 直播地址
*/

Načítá se…
Zrušit
Uložit