袁强 3 months ago
parent
commit
c6750c7cca
  1. 26
      dk-api/api-sample/pom.xml
  2. 19
      dk-api/api-sample/src/main/java/org/dromara/business/api/RemoteBusinessAlertService.java
  3. 17
      dk-api/api-sample/src/main/java/org/dromara/business/api/RemoteBusinessTaskService.java
  4. 10
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/device/DeviceEnum.java
  5. 2
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/device/OsdDock.java
  6. 12
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/FileUploadCallback.java
  7. 11
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/FileUploadCallbackFile.java
  8. 36
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/FilghtTypeEnum.java
  9. 54
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/FlightTask.java
  10. 2
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/MediaFileExtension.java
  11. 7
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/MediaFileMetadata.java
  12. 15
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/MediaUploadCallbackRequest.java
  13. 8
      dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/UploadCallbackFileMetadata.java
  14. 12
      dk-common/common-websocket/src/main/java/org/dromara/common/websocket/utils/WebSocketUtils.java
  15. 3
      dk-modules/sample/src/main/java/org/dromara/sample/manage/model/entity/DeviceHmsEntity.java
  16. 8
      dk-modules/sample/src/main/java/org/dromara/sample/manage/service/impl/DeviceHmsServiceImpl.java
  17. 13
      dk-modules/sample/src/main/java/org/dromara/sample/manage/service/impl/SDKDeviceService.java
  18. 45
      dk-modules/sample/src/main/java/org/dromara/sample/media/model/MediaFileEntity.java
  19. 3
      dk-modules/sample/src/main/java/org/dromara/sample/media/service/IFileService.java
  20. 27
      dk-modules/sample/src/main/java/org/dromara/sample/media/service/impl/FileServiceImpl.java
  21. 8
      dk-modules/sample/src/main/java/org/dromara/sample/media/service/impl/MediaServiceImpl.java
  22. 2
      pom.xml

26
dk-api/api-sample/pom.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.dromara</groupId>
<artifactId>dk-api</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>api-sample</artifactId>
<description>api-sample无人机接口模块
</description>
<dependencies>
<!-- RuoYi Common Core-->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>common-core</artifactId>
</dependency>
</dependencies>
</project>

19
dk-api/api-sample/src/main/java/org/dromara/business/api/RemoteBusinessAlertService.java

@ -0,0 +1,19 @@
package org.dromara.business.api;
/**
* 预警服务
*
* @author Lion Li
*/
public interface RemoteBusinessAlertService {
/**
* 更新此条预警审批时候的状态
* @param businessId 业务id(预警工单)
* @param flowStatus 流程状态
*/
void updateAlertStatus(String businessId, String flowStatus,Boolean isIllegal,String alertType,String message,String assignName);
}

17
dk-api/api-sample/src/main/java/org/dromara/business/api/RemoteBusinessTaskService.java

@ -0,0 +1,17 @@
package org.dromara.business.api;
/**
* @auther yq
* @data 2025/3/18
*/
public interface RemoteBusinessTaskService {
/**
* 更新预约工单状态
* @param fileId 航线id
* @param jobId 飞行记录id
* @param isJobStatus 飞行状态
*/
void updateTaskStatus(String fileId, String jobId,Boolean isJobStatus);
}

10
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/device/DeviceEnum.java

@ -3,6 +3,7 @@ package org.dromara.common.sdk.cloudapi.device;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.sdk.exception.CloudSDKException;
import java.util.Arrays;
@ -133,7 +134,12 @@ public enum DeviceEnum {
@JsonCreator
public static DeviceEnum find(String key) {
return Arrays.stream(values()).filter(device -> device.getDevice().equals(key))
.findAny().orElseThrow(() -> new CloudSDKException(DeviceEnum.class, key));
if(StringUtils.isEmpty(key)){
key = DeviceEnum.M3TD.getDevice();
}
String finalKey = key;
String finalKey1 = key;
return Arrays.stream(values()).filter(device -> device.getDevice().equals(finalKey))
.findAny().orElseThrow(() -> new CloudSDKException(DeviceEnum.class, finalKey1));
}
}

2
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/device/OsdDock.java

@ -86,6 +86,8 @@ public class OsdDock {
private DrcStateEnum drcState;
/**
* User experience improvement program
*/

12
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/FileUploadCallback.java

@ -13,6 +13,9 @@ public class FileUploadCallback {
private FileUploadCallbackFile file;
private FlightTask flightTask;
public FileUploadCallback() {
}
@ -22,6 +25,7 @@ public class FileUploadCallback {
"result=" + result +
", progress=" + progress +
", file=" + file +
", flightTask =" + flightTask +
'}';
}
@ -51,4 +55,12 @@ public class FileUploadCallback {
this.file = file;
return this;
}
public FlightTask getFlightTask() {
return flightTask;
}
public void setFlightTask(FlightTask flightTask) {
this.flightTask = flightTask;
}
}

11
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/FileUploadCallbackFile.java

@ -16,6 +16,7 @@ public class FileUploadCallbackFile {
private String objectKey;
private UploadCallbackFileMetadata metadata;
private String cloudToCloudId;
public FileUploadCallbackFile() {
}
@ -28,6 +29,7 @@ public class FileUploadCallbackFile {
", path='" + path + '\'' +
", objectKey='" + objectKey + '\'' +
", metadata=" + metadata +
", cloudToCloudId= " + cloudToCloudId +
'}';
}
@ -75,4 +77,13 @@ public class FileUploadCallbackFile {
this.metadata = metadata;
return this;
}
public String getCloudToCloudId() {
return cloudToCloudId;
}
public FileUploadCallbackFile setCloudToCloudId(String cloudToCloudId) {
this.cloudToCloudId = cloudToCloudId;
return this;
}
}

36
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/FilghtTypeEnum.java

@ -0,0 +1,36 @@
package org.dromara.common.sdk.cloudapi.media;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.dromara.common.sdk.exception.CloudSDKException;
import java.util.Arrays;
/**
* @author sean
* @version 1.3
* @date 2022/11/14
*/
public enum FilghtTypeEnum {
ROUTE(0),
ONECLIKE(1);
private final int type;
FilghtTypeEnum(int type) {
this.type = type;
}
@JsonValue
public int getType() {
return type;
}
@JsonCreator
public static FilghtTypeEnum find(int type) {
return Arrays.stream(values()).filter(subFile -> subFile.type == type).findAny()
.orElseThrow(() -> new CloudSDKException(MediaSubFileTypeEnum.class, type));
}
}

54
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/FlightTask.java

@ -0,0 +1,54 @@
package org.dromara.common.sdk.cloudapi.media;
/**
* @author sean
* @version 1.1
* @date 2022/6/9
*/
public class FlightTask {
private Integer uploadedFileCount;
private Integer expectedFileCount;
private FilghtTypeEnum flightType;
public FlightTask() {
}
@Override
public String toString() {
return "FlightTask{" +
"uploadedFileCount=" + uploadedFileCount +
", expectedFileCount=" + expectedFileCount +
", flightType=" + flightType +
'}';
}
public Integer getUploadedFileCount() {
return uploadedFileCount;
}
public void setUploadedFileCount(Integer uploadedFileCount) {
this.uploadedFileCount = uploadedFileCount;
}
public Integer getExpectedFileCount() {
return expectedFileCount;
}
public void setExpectedFileCount(Integer expectedFileCount) {
this.expectedFileCount = expectedFileCount;
}
public FilghtTypeEnum getFlightType() {
return flightType;
}
public void setFlightType(FilghtTypeEnum flightType) {
this.flightType = flightType;
}
}

2
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/MediaFileExtension.java

@ -19,13 +19,11 @@ public class MediaFileExtension {
@Schema(description = "drone device product enum")
private DeviceEnum droneModelKey;
@NotNull
@JsonProperty("file_group_id")
@Schema(description = "If the media file was shot during the wayline, this value will not be null.", format = "uuid")
private String fileGroupId;
@JsonProperty("is_original")
@NotNull
@Schema(description = "Whether the image is the original image.")
private Boolean original;

7
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/MediaFileMetadata.java

@ -7,6 +7,7 @@ import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @author sean
@ -25,7 +26,7 @@ public class MediaFileMetadata {
@NotNull
@Schema(description = "media create time", example = "2023-01-01T20:00:00+08:00")
@JsonProperty("created_time")
private LocalDateTime createdTime;
private Date createdTime;
@NotNull
@JsonProperty("gimbal_yaw_degree")
@ -66,11 +67,11 @@ public class MediaFileMetadata {
return this;
}
public LocalDateTime getCreatedTime() {
public Date getCreatedTime() {
return createdTime;
}
public MediaFileMetadata setCreatedTime(LocalDateTime createdTime) {
public MediaFileMetadata setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
return this;
}

15
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/MediaUploadCallbackRequest.java

@ -43,6 +43,9 @@ public class MediaUploadCallbackRequest {
@NotNull
private MediaFileMetadata metadata;
private String cloudToCloudId;
public MediaUploadCallbackRequest() {
}
@ -56,7 +59,8 @@ public class MediaUploadCallbackRequest {
", objectKey='" + objectKey + '\'' +
", subFileType=" + subFileType +
", metadata=" + metadata +
'}';
", cloudToCloudId= " + cloudToCloudId +
"}";
}
public MediaFileExtension getExt() {
@ -121,4 +125,13 @@ public class MediaUploadCallbackRequest {
this.metadata = metadata;
return this;
}
public String getCloudToCloudId() {
return cloudToCloudId;
}
public MediaUploadCallbackRequest setCloudToCloudId(String cloudToCloudId) {
this.cloudToCloudId = cloudToCloudId;
return this;
}
}

8
dk-common/common-cloudsdk/src/main/java/org/dromara/common/sdk/cloudapi/media/UploadCallbackFileMetadata.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @author sean
@ -15,8 +16,7 @@ public class UploadCallbackFileMetadata {
private Double absoluteAltitude;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssVV")
private LocalDateTime createdTime;
private Date createdTime;
private Double gimbalYawDegree;
@ -47,11 +47,11 @@ public class UploadCallbackFileMetadata {
return this;
}
public LocalDateTime getCreatedTime() {
public Date getCreatedTime() {
return createdTime;
}
public UploadCallbackFileMetadata setCreatedTime(LocalDateTime createdTime) {
public UploadCallbackFileMetadata setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
return this;
}

12
dk-common/common-websocket/src/main/java/org/dromara/common/websocket/utils/WebSocketUtils.java

@ -98,11 +98,15 @@ public class WebSocketUtils {
ObjectMapper mapper = new ObjectMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
String jsonString = mapper.writeValueAsString(message);
WebSocketSessionHolder.getSessionsAll().forEach(key -> {
WebSocketSession session = WebSocketSessionHolder.getSessions(key);
sendMessage(session, jsonString);
WebSocketMessageDto broadcastMessage = new WebSocketMessageDto();
broadcastMessage.setMessage(mapper.writeValueAsString(message));
RedisUtils.publish(WEB_SOCKET_TOPIC, broadcastMessage, consumer -> {
log.info("WebSocket发送主题订阅消息topic:{} message:{}", WEB_SOCKET_TOPIC, message);
});
// WebSocketSessionHolder.getSessionsAll().forEach(key -> {
// WebSocketSession session = WebSocketSessionHolder.getSessions(key);
// sendMessage(session, jsonString);
// });
}catch (Exception e) {
e.printStackTrace();
}

3
dk-modules/sample/src/main/java/org/dromara/sample/manage/model/entity/DeviceHmsEntity.java

@ -59,8 +59,6 @@ public class DeviceHmsEntity implements Serializable, Cloneable {
@TableField("create_time")
private Date createTime;
@TableField("update_time")
private Date updateTime;
@Override
public DeviceHmsEntity clone() {
@ -71,7 +69,6 @@ public class DeviceHmsEntity implements Serializable, Cloneable {
.bid(this.getBid())
.tid(this.getTid())
.createTime(this.getCreateTime())
.updateTime(this.getUpdateTime())
.sn(this.getSn())
.build();
}

8
dk-modules/sample/src/main/java/org/dromara/sample/manage/service/impl/DeviceHmsServiceImpl.java

@ -74,7 +74,6 @@ public class DeviceHmsServiceImpl extends AbstractHmsService implements IDeviceH
.bid(response.getBid())
.tid(response.getTid())
.createTime(new Date(response.getTimestamp()))
.updateTime(null)
.sn(sn)
.build();
// Query all unread hms messages of the device in redis.
@ -113,7 +112,6 @@ public class DeviceHmsServiceImpl extends AbstractHmsService implements IDeviceH
.and(wrapper -> param.getDeviceSn().forEach(sn -> wrapper.eq(DeviceHmsEntity::getSn, sn).or()))
.between(param.getBeginTime() != null && param.getEndTime() != null,
DeviceHmsEntity::getCreateTime, param.getBeginTime(), param.getEndTime())
.eq(param.getUpdateTime() != null, DeviceHmsEntity::getUpdateTime, param.getUpdateTime())
.eq(param.getLevel() != null, DeviceHmsEntity::getLevel, param.getLevel())
.like(StringUtils.hasText(param.getMessage()) &&
HmsMessageLanguageEnum.ZH.getLanguage().equals(param.getLanguage()),
@ -136,10 +134,9 @@ public class DeviceHmsServiceImpl extends AbstractHmsService implements IDeviceH
@Override
public void updateUnreadHms(String deviceSn) {
mapper.update(DeviceHmsEntity.builder().updateTime(new Date()).build(),
mapper.update(DeviceHmsEntity.builder().build(),
new LambdaUpdateWrapper<DeviceHmsEntity>()
.eq(DeviceHmsEntity::getSn, deviceSn)
.eq(DeviceHmsEntity::getUpdateTime, 0L));
.eq(DeviceHmsEntity::getSn, deviceSn));
// Delete unread messages cached in redis.
deviceRedisService.delHmsKeysBySn(deviceSn);
}
@ -152,7 +149,6 @@ public class DeviceHmsServiceImpl extends AbstractHmsService implements IDeviceH
.bid(entity.getBid())
.tid(entity.getTid())
.createTime(entity.getCreateTime())
.updateTime(entity.getUpdateTime())
.sn(entity.getSn())
.hmsId(entity.getHmsId())
.key(entity.getHmsKey())

13
dk-modules/sample/src/main/java/org/dromara/sample/manage/service/impl/SDKDeviceService.java

@ -16,10 +16,7 @@ import org.dromara.sample.manage.model.dto.DeviceDTO;
import org.dromara.sample.manage.model.dto.DevicePayloadReceiver;
import org.dromara.sample.manage.model.enums.DeviceFirmwareStatusEnum;
import org.dromara.sample.manage.model.param.DeviceQueryParam;
import org.dromara.sample.manage.service.IDeviceDictionaryService;
import org.dromara.sample.manage.service.IDevicePayloadService;
import org.dromara.sample.manage.service.IDeviceRedisService;
import org.dromara.sample.manage.service.IDeviceService;
import org.dromara.sample.manage.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.MessageHeaders;
@ -53,6 +50,9 @@ public class SDKDeviceService extends AbstractDeviceService {
@Autowired
private IDevicePayloadService devicePayloadService;
@Autowired
private IDeviceQrtzService deviceQrtzService;
@Override
public TopicStatusResponse<MqttReply> updateTopoOnline(TopicStatusRequest<UpdateTopo> request, MessageHeaders headers) {
UpdateTopoSubDevice updateTopoSubDevice = request.getData().getSubDevices().get(0);
@ -147,6 +147,11 @@ public class SDKDeviceService extends AbstractDeviceService {
if (StringUtils.hasText(device.getChildDeviceSn())) {
deviceService.getDeviceBySn(device.getChildDeviceSn()).ifPresent(device::setChildren);
}
if(request.getData().getDroneChargeState() != null
&& request.getData().getDroneChargeState().getState() == false
&& request.getData().getDroneChargeState().getCapacityPercent() >= 80){
deviceQrtzService.getDeviceQrtzFileEntity(device.getDeviceSn());
}
deviceRedisService.setDeviceOnline(device);
fillDockOsd(from, request.getData());

45
dk-modules/sample/src/main/java/org/dromara/sample/media/model/MediaFileEntity.java

@ -7,6 +7,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
@ -65,5 +66,49 @@ public class MediaFileEntity implements Serializable {
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
@TableField("lat")
private Double lat;
@TableField("lng")
private Double lng;
@TableField("absolute_altitude")
private Double absoluteAltitude;
@TableField("relative_altitude")
private Double relativeAltitude;
@TableField("shoot_time")
private Date shootTime;
@TableField("gimbal_yaw_degree")
private Double gimbalYawDegree;
@TableField("cloud_to_cloud_id")
private String cloudToCloudId;
@TableField("uploaded_file_count")
private Integer uploadedFileCount;
@TableField("expected_file_count")
private Integer expectedFileCount;
@TableField("flight_type")
private Integer flightType;
/**
* 文件类型jpegmp4RTKOBSNAVMRKDAT
*/
@TableField("file_type")
private String fileType;
/**
* 后缀类型广角 W广角 V红外 T变焦 ZRTCM文件 D PPK
*/
@TableField("file_status")
private String fileStatus;
private Integer fileIndex;
}

3
dk-modules/sample/src/main/java/org/dromara/sample/media/service/IFileService.java

@ -1,5 +1,6 @@
package org.dromara.sample.media.service;
import org.dromara.common.sdk.cloudapi.media.FlightTask;
import org.dromara.common.sdk.cloudapi.media.MediaUploadCallbackRequest;
import org.dromara.common.sdk.common.PaginationData;
import org.dromara.sample.media.model.MediaFileDTO;
@ -28,7 +29,7 @@ public interface IFileService {
* @param file
* @return
*/
Integer saveFile(String workspaceId, MediaUploadCallbackRequest file);
Integer saveFile(String workspaceId, MediaUploadCallbackRequest file, FlightTask flightTask);
/**
* Query information about all files in this workspace based on the workspace id.

27
dk-modules/sample/src/main/java/org/dromara/sample/media/service/impl/FileServiceImpl.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.dromara.common.oss.core.OssClient;
import org.dromara.common.oss.factory.OssFactory;
import org.dromara.common.sdk.cloudapi.device.DeviceEnum;
import org.dromara.common.sdk.cloudapi.media.FlightTask;
import org.dromara.common.sdk.cloudapi.media.MediaSubFileTypeEnum;
import org.dromara.common.sdk.cloudapi.media.MediaUploadCallbackRequest;
import org.dromara.common.sdk.common.Pagination;
@ -20,9 +21,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.net.URL;
import java.sql.Time;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
@ -65,10 +68,16 @@ public class FileServiceImpl implements IFileService {
}
@Override
public Integer saveFile(String workspaceId, MediaUploadCallbackRequest file) {
MediaFileEntity fileEntity = this.fileUploadConvertToEntity(file);
public Integer saveFile(String workspaceId, MediaUploadCallbackRequest file, FlightTask flightTask) {
MediaFileEntity fileEntity = this.fileUploadConvertToEntity(file,flightTask);
fileEntity.setWorkspaceId(workspaceId);
fileEntity.setFileId(UUID.randomUUID().toString());
fileEntity.setFileType(fileEntity.getFileName().substring( fileEntity.getFileName().lastIndexOf(".")+1));
fileEntity.setFileStatus(fileEntity.getFileName().substring( fileEntity.getFileName().lastIndexOf("_")+1, fileEntity.getFileName().lastIndexOf(".")));
int firstUnderscore = fileEntity.getFileName().indexOf("_");
int secondUnderscore = fileEntity.getFileName().indexOf("_", firstUnderscore + 1);
int thirdUnderscore = fileEntity.getFileName().indexOf("_", secondUnderscore + 1);
fileEntity.setFileIndex(Integer.parseInt(fileEntity.getFileName().substring(secondUnderscore+1,thirdUnderscore)));
return mapper.insert(fileEntity);
}
@ -120,7 +129,7 @@ public class FileServiceImpl implements IFileService {
* @param file
* @return
*/
private MediaFileEntity fileUploadConvertToEntity(MediaUploadCallbackRequest file) {
private MediaFileEntity fileUploadConvertToEntity(MediaUploadCallbackRequest file,FlightTask flightTask) {
MediaFileEntity.MediaFileEntityBuilder builder = MediaFileEntity.builder();
if (file != null) {
@ -133,7 +142,17 @@ public class FileServiceImpl implements IFileService {
.jobId(file.getExt().getFileGroupId())
.drone(file.getExt().getSn())
.tinnyFingerprint(file.getExt().getTinnyFingerprint())
.payload(file.getExt().getPayloadModelKey().getDevice());
.payload(file.getExt().getPayloadModelKey().getDevice())
.lat(file.getMetadata().getShootPosition().getLat())
.lng(file.getMetadata().getShootPosition().getLng())
.gimbalYawDegree(file.getMetadata().getGimbalYawDegree())
.absoluteAltitude(file.getMetadata().getAbsoluteAltitude())
.relativeAltitude(file.getMetadata().getRelativeAltitude())
.shootTime(file.getMetadata().getCreatedTime())
.cloudToCloudId(file.getCloudToCloudId())
.flightType(flightTask.getFlightType().getType())
.uploadedFileCount(flightTask != null ? flightTask.getUploadedFileCount() : null)
.expectedFileCount(flightTask != null ? flightTask.getExpectedFileCount() : null);
// domain-type-subType
DeviceEnum payloadModelKey = file.getExt().getPayloadModelKey();

8
dk-modules/sample/src/main/java/org/dromara/sample/media/service/impl/MediaServiceImpl.java

@ -64,7 +64,7 @@ public class MediaServiceImpl extends AbstractMediaService implements IMediaServ
@Override
public Integer saveMediaFile(String workspaceId, MediaUploadCallbackRequest file) {
return fileService.saveFile(workspaceId, file);
return fileService.saveFile(workspaceId, file,null);
}
@Override
@ -156,8 +156,9 @@ public class MediaServiceImpl extends AbstractMediaService implements IMediaServ
file.setPath(objectKey.substring(Optional.of(objectKey.indexOf("mediafile"))
.filter(index -> index > 0).map(index -> index++).orElse(0),
objectKey.lastIndexOf("/")));
Integer fileFlag = fileService.saveFile(device.getWorkspaceId(), file, callback.getFlightTask());
return fileService.saveFile(device.getWorkspaceId(), file) > 0;
return fileFlag> 0;
}
private void notifyUploadedCount(MediaFileCountDTO mediaFileCount, TopicEventsRequest<FileUploadCallback> request, String jobId, DeviceDTO dock) {
@ -208,6 +209,7 @@ public class MediaServiceImpl extends AbstractMediaService implements IMediaServ
.get())
.setName(file.getName())
.setObjectKey(file.getObjectKey())
.setPath(file.getPath());
.setPath(file.getPath())
.setCloudToCloudId(file.getCloudToCloudId());
}
}

2
pom.xml

@ -85,7 +85,7 @@
<id>dev</id>
<properties>
<!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>dev</profiles.active>
<profiles.active>wuyuan</profiles.active>
<nacos.server>127.0.0.1:8848</nacos.server>
<nacos.discovery.group>DEFAULT_GROUP</nacos.discovery.group>
<nacos.config.group>DEFAULT_GROUP</nacos.config.group>

Loading…
Cancel
Save