using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; namespace OASystem.Domain.Entities.Resource { /// /// 商邀公务AI /// [SugarTable("Res_InvitationAI", "商邀公务AI")] public class Res_InvitationAI: EntityBase { /// /// 名称 /// [SugarColumn(ColumnName = "InvName", ColumnDescription = "名称", IsNullable = true, ColumnDataType = "varchar(150)")] public string InvName { get; set; } /// /// 团组ID /// 注:自定义命名时,GroupID = 0;使用团组名称时,GroupID = Grp_DelegationInfo.Id /// [SugarColumn(ColumnName = "GroupId", ColumnDescription = "团组ID", IsNullable = true, ColumnDataType = "int")] public int GroupId { get; set; } /// /// ai 抓取信息存储(含本地数据信息) /// [SugarColumn(ColumnName = "AiCrawledDetails", ColumnDescription = "ai 抓取信息存储(含本地数据信息)", IsJson = true, IsNullable = true, ColumnDataType = "varchar(max)")] public List AiCrawledDetails { get; set; } = new List(); /// /// 词条信息 /// [SugarColumn(ColumnName = "Entries", ColumnDescription = "词条信息", IsJson = true, IsNullable = true, ColumnDataType = "varchar(max)")] public EntryInfo EntryInfo { get; set; } = new EntryInfo(); } /// /// 单位信息 /// public class InvitationAIInfo { /// /// Guid /// public string Guid { get; set; } /// /// 复选框是否选中 /// public bool IsChecked { get; set; } = false; /// /// 数据来源 /// 0-本地数据;1-第三方AI接口数据;2-用户手动输入数据 /// public int Source { get; set; } = 0; /// /// 归属区域 /// public string Region { get; set; } /// /// 标准行业:信息技术、金融与财会、工业制造、医疗保健、政府与公共服务、消费与贸易 /// public string Industry { get; set; } /// /// 名称(中文) /// public string NameCn { get; set; } /// /// 名称(英文) /// public string NameEn { get; set; } /// /// 地址 /// public string Address { get; set; } /// /// 经营范围 /// public string Scope { get; set; } /// /// 联系人 /// public string Contact { get; set; } /// /// 联系电话 /// public string Phone { get; set; } /// /// 联系邮箱 /// public string Email { get; set; } /// /// 官网地址 /// public string SiteUrl { get; set; } /// /// 文章地址 /// public List PostUrl { get; set; } = new List(); /// /// 推荐等级 /// public string RecLevel { get; set; } /// /// 对接建议 /// public string IntgAdvice { get; set; } /// /// 邮件信息 /// public EmailInfo EmailInfo { get; set; } = new EmailInfo(); /// /// 备注 /// public string Remark { get; set; } /// /// 操作时间 /// public DateTime OperatedAt { get; set; } /// /// 操作人 /// public string Operator { get; set; } } /// /// 新闻链接信息 /// public class PostNewsItem { public string Date { get; set; } public string Description { get; set; } public string Url { get; set; } } public class EntryInfo { /// /// 出访单位 /// public string OriginUnit { get; set; } /// /// 拜访国家 /// public List TargetCountry { get; set; } = new List(); /// /// 行业信息 /// 信息技术、金融与财会、工业制造、医疗保健、政府与公共服务、消费与贸易 /// public List Industries { get; set; } = new List(); /// /// 规模类型 /// public List ScaleTypes { get; set; } = new List(); /// /// 是否需要华人单位背景 /// public bool IsBackground { get; set; } = false; /// /// 出访目的 /// public string Objective { get; set; } /// /// 数据条数 /// 每个国家获取数据总条数,默认20条 /// public int NeedCount { get; set; } = 20; /// /// 其他规则 /// public string OtherConstraints { get; set; } /// /// 操作时间 /// public DateTime OperatedAt { get; set; } = new DateTime(); /// /// 操作人 /// public string Operator { get; set; } } public class EmailInfo { /// /// 邮件标题 /// public string EmailTitle { get; set; } /// /// 邮箱内容 /// public string EmailContent { get; set; } /// /// 附件地址 /// public List AttachmentPaths { get; set; } = new List(); /// /// 发送状态 /// 1.未开始 /// 2.AI生成成功 /// 3.手动编辑 /// 4.发送完成 /// 5.发送失败 /// public int Status { get; set; } = 1; /// /// 操作时间 /// public DateTime OperatedAt { get; set; } /// /// 操作人 /// public string Operator { get; set; } } public class AICreateEmailInfo { public string Guid { get; set; } public string NameCn { get; set; } public string Scope { get; set; } public string Subject { get; set; } public string Content { get; set; } } public class CountryAIPormptInfo { public string Country { get; set; } public int Count { get; set; } } public class AITaskItem { public string Region { get; set; } // 如 "North America" public string Industry { get; set; } // 如 "Software" public string Scale { get; set; } // 如 "Large" } #region 单位规模信息 /// /// 单位规模 /// public class OrgScale { public string Name { get; init; } public int MinStaff { get; init; } public int MaxStaff { get; init; } public static List BuildInitialData() => new() { new() { Name = "微型 (1-10人)", MinStaff = 1, MaxStaff = 10 }, new() { Name = "小型 (11-50人)", MinStaff = 11, MaxStaff = 50 }, new() { Name = "中型 (51-200人)", MinStaff = 51, MaxStaff = 200 }, new() { Name = "大型 (201-1000人)", MinStaff = 201, MaxStaff = 1000 }, new() { Name = "超大型 (1000人以上)", MinStaff = 1001, MaxStaff = int.MaxValue } }; /// /// 根据人数自动匹配规模标签 /// public static string GetLabel(int count) => BuildInitialData().FirstOrDefault(s => count >= s.MinStaff && count <= s.MaxStaff)?.Name ?? "未知规模"; } #endregion #region AI 行业匹配结果实体 /// /// AI 行业匹配结果实体 /// public class IndustryMatchResult { /// /// 原始出访单位名称 /// public string SourceUnitName { get; set; } = string.Empty; /// /// 匹配到的目标单位名称(必须与输入 NameCn 一致) /// public string TargetUnitName { get; set; } = string.Empty; /// /// 目标单位所属国家 /// public string TargetCountry { get; set; } = string.Empty; /// /// 识别出的行业分类(来自动态传入的行业标准) /// public string MatchedIndustry { get; set; } = string.Empty; /// /// 匹配置信度 (0.0 - 1.0) /// public double ConfidenceScore { get; set; } /// /// AI 给出的匹配理由说明 /// public string MatchReason { get; set; } = string.Empty; // --- 辅助属性 (非 AI 返回内容) --- /// /// 判断是否为高价值匹配(业务逻辑判定) /// [JsonIgnore] public bool IsHighValue => ConfidenceScore >= 0.8; } #endregion }