diff --git a/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs b/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs
index 01a8f11..0bfc7db 100644
--- a/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs
+++ b/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs
@@ -762,7 +762,8 @@ namespace ZR.Admin.WebApi.Controllers.Business
///
/// 原始字符串
/// 日期+原因集合
- private List<(DateTime Date, string Reason)> ParseHistory(string historyRemarks)
+ [Obsolete]
+ private List<(DateTime Date, string Reason)> ParseHistoryf(string historyRemarks)
{
var result = new List<(DateTime, string)>();
@@ -801,6 +802,86 @@ namespace ZR.Admin.WebApi.Controllers.Business
return result;
}
+ ///
+ /// 超强健壮型历史备注解析器,支持以下所有日期格式:
+ /// - 英文:2022/5/3, 2022-10 24, 2022-10-24, 2021/ 12/2
+ /// - 中文:2022年5月3日, 2022年5月3号 9:20
+ /// - 时间:支持无秒,如 8:20、8:5、8:5:1、自动补零
+ /// - 自动修复多余空格
+ ///
+ /// 最终统一输出 yyyy-MM-dd HH:mm:ss
+ ///
+ private List<(DateTime Date, string Reason)> ParseHistory(string historyRemarks)
+ {
+ var list = new List<(DateTime, string)>();
+
+ if (string.IsNullOrWhiteSpace(historyRemarks))
+ return list;
+
+ // 支持:
+ // - yyyy/MM/dd
+ // - yyyy- MM dd
+ // - yyyy年M月d日
+ // - yyyy年M月d号
+ // - 时间可为 HH:mm 或 HH:mm:ss
+ var regex = new Regex(
+ @"(?\d{4})\s*(?:[-/年]\s*)?(?\d{1,2})\s*(?:[-/月]\s*)?(?\d{1,2})\s*(?:日|号)?\s+(?