Kaynağa Gözat

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_freeway into develop

tags/v1.2.0^2
wanjing 1 yıl önce
ebeveyn
işleme
76a49d2b1d
10 değiştirilmiş dosya ile 105 ekleme ve 6 silme
  1. +9
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java
  2. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/QueryVideoServiceEnum.java
  3. +12
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentNoticeService.java
  4. +4
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/TimeAxisService.java
  5. +7
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/IInspectionService.java
  6. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/InspectionServiceImpl.java
  7. +36
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryVideoService.java
  8. +16
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/InspectionVideoVo.java
  9. +7
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/accident/AccidentTimeAxisVo.java
  10. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml

+ 9
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java Dosyayı Görüntüle

@@ -100,6 +100,15 @@ public class InspectionController {
return iInspectionService.getVideoById(id);
}

/**
* 根据机场id获取正在巡任务的直播
* @param id
* @return
*/
@GetMapping("/videoByAirportId/{id}")
public JsonResult videoByAirportId(@PathVariable("id") String id){
return iInspectionService.videoByAirportId(id);
}

/**
* 获取飞行轨迹

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/QueryVideoServiceEnum.java Dosyayı Görüntüle

@@ -11,7 +11,8 @@ public enum QueryVideoServiceEnum {
LIVE_CHANNEL_IS_NOT_EXIST(1230702, "直播通道为空"),
AIPULL_URL_IS_NOT_NULL(1230703, "直播地址为空"),
AIVIDEO_URL_IS_NOT_NULL(1230704, "回放地址为空"),
INSPECTION_IS_NOT_EXIST(1230705, "任务不存在");
INSPECTION_IS_NOT_EXIST(1230705, "任务不存在"),
AIRPORT_ID_IS_NULL(1230706, "机场id为空");

/**
* 错误码

+ 12
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentNoticeService.java Dosyayı Görüntüle

@@ -83,11 +83,19 @@ public class AccidentNoticeService {
}
List<String> accidentIdList = oldList.stream().map(o -> o.getId()).collect(Collectors.toList());
newList = accidentMapper.selectList(Wrappers.<Accident>lambdaQuery()
.notIn(Accident::getId, accidentIdList));

.in(Accident::getId, accidentIdList));
accidentList.removeAll(newList);
//下面可以同样实现,只是要查数据库接口影响性能
// newList = accidentMapper.selectList(Wrappers.<Accident>lambdaQuery()
// .notIn(Accident::getId, accidentIdList)
// .eq(Accident::getTenantId, tenantId)
// .eq(Accident::getStatus, AccidentStatusEnum.UNTREATED.getCode())
// .eq(Accident::getFlag, FlagEnum.INSPECTION_ACCIDENT.getCode())
// .eq(Accident::getMark, MarkEnum.VALID.getCode()));
//
//对应list集合排序
newList = newList.stream().sorted(Comparator.comparing(Accident::getCreateTime)).collect(Collectors.toList());
accidentList = accidentList.stream().sorted(Comparator.comparing(Accident::getCreateTime)).collect(Collectors.toList());

return JsonResult.success(newList);
return JsonResult.success(accidentList);
}
}

+ 4
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/TimeAxisService.java Dosyayı Görüntüle

@@ -80,6 +80,10 @@ public class TimeAxisService {
if(accident.getReportTime() != null){
vo.setReportTime(accident.getReportTime());
}
//忽略时间
if(accident.getIgnoreTime() != null){
vo.setIgnoreTime(accident.getIgnoreTime());
}
//无事故时间
if(accident.getNoAccidentTime() != null){
vo.setNoAccidentTime(accident.getNoAccidentTime());

+ 7
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/IInspectionService.java Dosyayı Görüntüle

@@ -145,4 +145,11 @@ public interface IInspectionService {
* @return
*/
JsonResult updateTaskByCode(UpdateTaskByCodeRequest request);

/**
* 根据机场id获取正在巡任务的直播
* @param id
* @return
*/
JsonResult videoByAirportId(String id);
}

+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/InspectionServiceImpl.java Dosyayı Görüntüle

@@ -289,4 +289,14 @@ public class InspectionServiceImpl implements IInspectionService {
return updateFlyerService.update(request);
}

/**
* 根据机场id获取正在巡任务的直播
* @param id
* @return
*/
@Override
public JsonResult videoByAirportId(String id) {
return queryVideoService.videoByAirportId(id);
}

}

+ 36
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryVideoService.java Dosyayı Görüntüle

@@ -2,11 +2,16 @@ package com.tuoheng.admin.service.inspection.query;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.LiveChannel;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.QueryVideoServiceEnum;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.mapper.LiveChannelMapper;
import com.tuoheng.admin.vo.InspectionVideoVo;
import com.tuoheng.admin.vo.LiveChannelVo;
import com.tuoheng.common.core.config.common.CommonConfig;
import com.tuoheng.common.core.utils.JsonResult;
@@ -67,4 +72,35 @@ public class QueryVideoService {
}
return JsonResult.success(liveChannelVo);
}

public JsonResult videoByAirportId(String id) {
if (StringUtils.isEmpty(id)) {
return JsonResult.error(QueryVideoServiceEnum.AIRPORT_ID_IS_NULL.getCode(), QueryVideoServiceEnum.AIRPORT_ID_IS_NULL.getMsg());
}
//根据机场id查询对应正在巡检的任务
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery()
.eq(Inspection::getAirportId, id)
.eq(Inspection::getStatus, InspectionStatusEnum.IN_FLIGHT.getCode())
.eq(Inspection::getMark, MarkEnum.VALID.getCode()));
if(ObjectUtils.isEmpty(inspection)){
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getMsg());
}
InspectionVideoVo vo = new InspectionVideoVo();
if (10 == inspection.getStatus()) {
//任务状态为任务飞行中10视频直播
LiveChannel liveChannel = liveChannelMapper.selectOne(new LambdaQueryWrapper<LiveChannel>()
.eq(LiveChannel::getMark, 1)
.eq(LiveChannel::getInspectionId, inspection.getId())
.eq(LiveChannel::getStatus, 1));
if (ObjectUtil.isNull(liveChannel)) {
return JsonResult.error(QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getMsg());
}
if (StringUtils.isEmpty(liveChannel.getAipullUrl())) {
return JsonResult.error(QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getCode(), QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getMsg());
}
vo.setAipullUrl(liveChannel.getAipullUrl());
}

return JsonResult.success(vo);
}
}

+ 16
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/InspectionVideoVo.java Dosyayı Görüntüle

@@ -0,0 +1,16 @@
package com.tuoheng.admin.vo;

import lombok.Data;

/**
* @Author ChengWang
* @Date 2023/3/20
*/
@Data
public class InspectionVideoVo {

/**
* 直播地址
*/
private String aipullUrl;
}

+ 7
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/accident/AccidentTimeAxisVo.java Dosyayı Görüntüle

@@ -33,6 +33,13 @@ public class AccidentTimeAxisVo {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date verificationTime;

/**
* 忽略时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date ignoreTime;

/**
* 上报时间
*/

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml Dosyayı Görüntüle

@@ -144,7 +144,8 @@ tuoheng:
#飞手平台地址
pilot-url: http://192.168.11.11:7011/pilot/web/
#airport配置地址
airport-url: http://192.168.11.22:9060
#airport-url: http://192.168.11.22:9060
airport-url: https://airport-test.t-aaron.com
# 文件配置
uploads:
#上传的服务器上的映射文件夹

Yükleniyor…
İptal
Kaydet