feat:航线编辑接口新的航点动作保存
This commit is contained in:
parent
73e1deae4e
commit
337694250a
|
|
@ -203,6 +203,25 @@ public class AirlineFileServiceImpl implements IAirlineFileService {
|
|||
@Override
|
||||
public Long update(AirlineFileDTO dto) {
|
||||
log.info("更新航线文件信息,DTO: {}", dto);
|
||||
|
||||
if (dto.getLinePointDtoList() != null && !dto.getLinePointDtoList().isEmpty()) {
|
||||
log.info("检测到航点数据,需要生成新的 waypoint 文件");
|
||||
StringBuilder waypointBuilder = new StringBuilder("QGC WPL 110\n");
|
||||
List<AirLinePointDTO> linePoints = dto.getLinePointDtoList();
|
||||
|
||||
for (int i = 0; i < linePoints.size(); i++) {
|
||||
AirLinePointDTO point = linePoints.get(i);
|
||||
waypointBuilder.append(WayPointUitls.formatWaypointLine(point, i)).append("\n");
|
||||
}
|
||||
|
||||
String waypointContent = waypointBuilder.toString();
|
||||
log.info("生成的 waypoint 文件内容长度: {}", waypointContent.length());
|
||||
|
||||
R<String> fileUrl = remoteFileService.uploadFileByData(UUID.randomUUID().toString(), "waypoints", waypointContent);
|
||||
dto.setFileUrl(fileUrl.getData());
|
||||
log.info("上传新的 waypoint 文件成功,URL: {}", fileUrl.getData());
|
||||
}
|
||||
|
||||
AirlineFile model = AirlineFileServiceConvert.to(dto);
|
||||
log.info("转换后的模型: {}", model);
|
||||
Long result = iAirlineFileDomain.update(model);
|
||||
|
|
|
|||
Loading…
Reference in New Issue