优化和路径规划新适配

This commit is contained in:
2026-07-11 16:46:53 +08:00
parent 2124f3bc02
commit 1a4d0aedfd
43 changed files with 2454 additions and 685 deletions

View File

@@ -4,7 +4,7 @@ class ReferencePoint {
ReferencePoint({required this.lat, required this.lon});
Map<String, dynamic> toJson() => {'lat': lat, 'lng': lon};
Map<String, dynamic> toJson() => {'lat': lat, 'lon': lon};
}
class OuterBoundary {
@@ -86,5 +86,5 @@ class Position {
return Position(lat: lat, lon: lon);
}
Map<String, dynamic> toJson() => {'lat': lat, 'lng': lon};
Map<String, dynamic> toJson() => {'lat': lat, 'lon': lon};
}

View File

@@ -11,7 +11,7 @@ class WorkRecordEntity {
final int userId;
final int id;
final String workName;
final WorkRecordJsonData? jsonData;
final dynamic jsonData; // 支持 WorkRecordJsonData(JSON接口)或 String(XML接口原始JSON,避免二次序列化丢失数据)
final String? imgUrl;
WorkRecordEntity({
@@ -43,11 +43,8 @@ class WorkRecordEntity {
userId: int.tryParse(xmlData['userId']?.toString() ?? '0') ?? 0,
id: int.tryParse(xmlData['id']?.toString() ?? '0') ?? 0,
workName: xmlData['workName'] as String? ?? '',
jsonData: xmlData['jsonData'] != null
? WorkRecordJsonData.fromXml(
xmlData['jsonData'] as Map<String, dynamic>,
)
: null,
// 🔥 核心修复:_parseJsonDataNode 现在返回 JSON 字符串,直接存储,避免 Map→jsonEncode 丢失路径数据
jsonData: xmlData['jsonData'],
imgUrl: xmlData['imgUrl'] as String?,
);
}