浏览代码

新增商邀资料AI无团组版全链路支持及优化

本次提交实现了“商邀资料AI-无团组版”功能,包括数据库实体、DTO、Controller接口、业务流程的全链路开发。支持无团组场景下的AI资料管理、AI与本地数据融合、SSE流式推送、批量操作、文件与邮件处理等。重构了AI提示词,强化真实性校验与输出规范,提升数据可靠性与系统健壮性。
Lyyyi 2 周之前
父节点
当前提交
3f7271ef74

+ 70 - 69
OASystem/EntitySync/Program.cs

@@ -94,8 +94,8 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Bus_ConfItemListInfo)
     //typeof(Res_CountryFeeCost)
     //typeof(Res_MemoInfo),
-    //typeof(Fin_DailyFeePayment),       // 财务 - 日付申请
-    //typeof(Fin_DailyFeePaymentContent),// 财务 - 日付申请详细类
+    //typeof(Fin_DailyFeePayment),       // 财务-日付申请
+    //typeof(Fin_DailyFeePaymentContent),// 财务-日付申请详细类
     //typeof(Grp_GroupsTaskAssignment),
     //typeof(Grp_AirTicketReservations),
     //typeof(Grp_GroupCostParameter),
@@ -103,87 +103,88 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Fin_ForeignReceivables),    // 对外收款账单
     //typeof(Fin_ProceedsReceived),      // 已收款项
     //typeof(Fin_OtherPrice),            // 其他款项
-    //typeof(Res_OfficialActivities)     //公务出访
-    //typeof(Res_AskData),//请示数据库
+    //typeof(Res_OfficialActivities)     // 公务出访
+    //typeof(Res_AskData),// 请示数据库
     //typeof(Grp_DelegationEnData),
     //typeof(Grp_EnterExitCost),
     //typeof(Grp_DayAndCost), 
     //typeof(Grp_NationalTravelFee),
     //typeof(Air_TicketBlackCode),
-    //typeof(Pm_WageSheet)       //人事模块 工资表单
+    //typeof(Pm_WageSheet)       // 人事模块 工资表单
     //typeof(Grp_VisaProgressCustomer),
     //typeof(Grp_VisaProgressCustomerPicture)
-    //typeof(Grp_CheckBoxs)  //成本选中
-    //typeof(Grp_GroupCost) //成本数据信息
-    //typeof(Grp_CostTypeHotelNumber)//分段房间数量
+    //typeof(Grp_CheckBoxs) // 成本选中
+    //typeof(Grp_GroupCost) // 成本数据信息
+    //typeof(Grp_CostTypeHotelNumber)// 分段房间数量
     //typeof(Grp_VisaInfo)
     //typeof(Grp_CarTouristGuideGroundReservations),
     //typeof(Grp_CarTouristGuideGroundReservationsContent),//
     //typeof(Fin_PaymentRefundAndOtherMoney),
     //typeof(Grp_InsuranceCost),
-    //typeof(Grp_TourClientList), //接团客户名单
-    //typeof(Dis_Intercontinental), //洲
-    //typeof(Dis_Country), //国家
-    //typeof(Dis_City), //城市 
-    //typeof(Fin_GroupExtraCost), //超支费用 
-    //typeof(Pm_TaskAllocation), //任务分配 
-    //typeof(Pm_TaskRelevanceUser) //任务分配关联人员(完成者) 
-    //typeof(Pm_TaskJobRelevancy), //任务分配关联人员(完成者) 
-    //typeof(Crm_TableOperationRecord), //表操作记录 
-    //typeof(Grp_InvertedList), //倒推表 
-    //typeof(Grp_InvertedListVisaCountry), //倒推表签证国家 
-    //typeof(Grp_VisaFeeInfo),  //签证费用info 
-    //typeof(Grp_HotelInquiry),  //酒店询价 
-    //typeof(Grp_HotelReservationsContent),  //酒店费用子表
-    //typeof(Grp_VisitingClients),  //拜访团组客户
-    //typeof(Grp_ApprovalTravelDetails),  //公务出访表
-    //typeof(Sys_Countries),  //洲
-    //typeof(Sys_Continent),  //国家
-    //typeof(Sys_Cities),  //城市
-    //typeof(Grp_GroupModelFile),//团组文件 
-    //typeof(Grp_VisaCommission),//签证费用录入 
-    //typeof(Pm_GoodsReceive),//物品领用表 
-    //typeof(Pm_GoodsStorage),//物品入库表 
-    //typeof(Pm_GoodsInfo),//物品详细表 
-    //typeof(Grp_Opinionaire),//团组接待意见调查 
-    //typeof(Sys_ExchangeRateRecord),//团组接待意见调查 
-    //typeof(Res_TranslatorLibrary),//翻译人员库 
-    //typeof(Grp_OfficialDutyLinkTranslator),//公务信息关联翻译人员 
+    //typeof(Grp_TourClientList), // 接团客户名单
+    //typeof(Dis_Intercontinental), // 
+    //typeof(Dis_Country),  // 国家
+    //typeof(Dis_City),     // 城市 
+    //typeof(Fin_GroupExtraCost), // 超支费用 
+    //typeof(Pm_TaskAllocation),  // 任务分配 
+    //typeof(Pm_TaskRelevanceUser) // 任务分配关联人员(完成者) 
+    //typeof(Pm_TaskJobRelevancy), // 任务分配关联人员(完成者) 
+    //typeof(Crm_TableOperationRecord), // 表操作记录 
+    //typeof(Grp_InvertedList), // 倒推表 
+    //typeof(Grp_InvertedListVisaCountry), // 倒推表签证国家 
+    //typeof(Grp_VisaFeeInfo),   // 签证费用info 
+    //typeof(Grp_HotelInquiry),  // 酒店询价 
+    //typeof(Grp_HotelReservationsContent),  // 酒店费用子表
+    //typeof(Grp_VisitingClients),  // 拜访团组客户
+    //typeof(Grp_ApprovalTravelDetails),  // 公务出访表
+    //typeof(Sys_Countries),  // 
+    //typeof(Sys_Continent),  // 国家
+    //typeof(Sys_Cities),     // 城市
+    //typeof(Grp_GroupModelFile),// 团组文件 
+    //typeof(Grp_VisaCommission),// 签证费用录入 
+    //typeof(Pm_GoodsReceive),// 物品领用表 
+    //typeof(Pm_GoodsStorage),// 物品入库表 
+    //typeof(Pm_GoodsInfo),// 物品详细表 
+    //typeof(Grp_Opinionaire),// 团组接待意见调查 
+    //typeof(Sys_ExchangeRateRecord),// 团组接待意见调查 
+    //typeof(Res_TranslatorLibrary),// 翻译人员库 
+    //typeof(Grp_OfficialDutyLinkTranslator),// 公务信息关联翻译人员 
     //typeof(Sys_DeviceToken),
-    //typeof(Res_MediaSuppliers),//策划部供应商资料 
-    //typeof(Res_BasicInsuranceCost)//保险国家基础费用 
-    //typeof(Grp_EnterExitCostPermission),//团组 - 出入境费用 --> 操作权限
-    //typeof(Grp_EnterExitCostDraftPermission)//团组 - 出入境费用 --> 操作权限-草稿
+    //typeof(Res_MediaSuppliers),// 策划部供应商资料 
+    //typeof(Res_BasicInsuranceCost)// 保险国家基础费用 
+    //typeof(Grp_EnterExitCostPermission),// 团组-出入境费用 --> 操作权限
+    //typeof(Grp_EnterExitCostDraftPermission)// 团组-出入境费用 --> 操作权限-草稿
     //typeof(Grp_RestaurantInfo),
-    //ypeof(Grp_EnterExitCostQuote), //团组 - 出入境费用报价表
-    //ypeof(Grp_EnterExitCostQuoteItem), //团组 - 出入境费用报价表
-    //typeof(Sys_FormTemp), //表单模板
-    //typeof(Grp_OrderPreInfo), //团组下单前信息
-    //typeof(Grp_OrderPreItem), //团组下单前信息Item
-    //typeof(Grp_GroupShareFile),//团组共享文件 
-    //typeof(Pm_GoodsAudit),//物品确认审核表
-    //typeof(Pm_GoodsReceiveDetails),//物品领用明细表 
+    //ypeof(Grp_EnterExitCostQuote), // 团组 - 出入境费用报价表
+    //ypeof(Grp_EnterExitCostQuoteItem), // 团组 - 出入境费用报价表
+    //typeof(Sys_FormTemp), // 表单模板
+    //typeof(Grp_OrderPreInfo), // 团组下单前信息
+    //typeof(Grp_OrderPreItem), // 团组下单前信息Item
+    //typeof(Grp_GroupShareFile),// 团组共享文件 
+    //typeof(Pm_GoodsAudit),// 物品确认审核表
+    //typeof(Pm_GoodsReceiveDetails),// 物品领用明细表 
     /*审核流程相关表*/
-    //typeof(Sys_AuditFlow),//审核流程表 
-    //typeof(Sys_AuditRecord),//审核记录表 
-    //typeof(Sys_AuditTemplate),//审核模板表 
-    //typeof(Sys_AuditTemplateNode),//审核模板节点表 
-    //typeof(Sys_AuditTemplateNodeUser),//审核模板节点人员表 
-    //typeof(Fin_ApplicationLinkGoods),//日服申请单物品关联表 
-    //typeof(Grp_GamesBudgetMaster‌),//世运会成本预算明细 
-    //typeof(Res_VisaFeeStandard),//签证费用标准 
-    //typeof(Res_VisaFeeStandardDetails),//签证费用标准详情 
-    //typeof(Grp_ProcessOverview),//团组流程总览表
-    //typeof(Grp_ProcessNode),//流程节点
-    //typeof(Grp_VisaProcessSteps_Log),//流程节点 
-    //typeof(Grp_ProcessLog),//流程节点 
-    //typeof(Grp_FeeEntryAcknowledge),//团组费用录入通知记录表 
-    //typeof(Res_OverseaVehicle),//境外用车信息 
-    //typeof(Res_OverseaVehicleTypePrice),//境外用车类型价格信息   
-    //typeof(Pm_CompanyDailyKpi),//财务部绩效考核    
-    //typeof(Grp_ConfProcessOverview),//会务流程总览    
-    //typeof(Grp_ConfProcessNode),//会务流程节点     
-    //typeof(Grp_ConfProcessLog),//团组会务流程总览操作日志  
-    typeof(Res_InvitationAI),//团组会务流程总览操作日志  
+    //typeof(Sys_AuditFlow),// 审核流程表 
+    //typeof(Sys_AuditRecord),// 审核记录表 
+    //typeof(Sys_AuditTemplate),// 审核模板表 
+    //typeof(Sys_AuditTemplateNode),// 审核模板节点表 
+    //typeof(Sys_AuditTemplateNodeUser),// 审核模板节点人员表 
+    //typeof(Fin_ApplicationLinkGoods),// 日服申请单物品关联表 
+    //typeof(Grp_GamesBudgetMaster‌),// 世运会成本预算明细 
+    //typeof(Res_VisaFeeStandard),// 签证费用标准 
+    //typeof(Res_VisaFeeStandardDetails),// 签证费用标准详情 
+    //typeof(Grp_ProcessOverview),// 团组流程总览表
+    //typeof(Grp_ProcessNode),// 流程节点
+    //typeof(Grp_VisaProcessSteps_Log),// 流程节点 
+    //typeof(Grp_ProcessLog),// 流程节点 
+    //typeof(Grp_FeeEntryAcknowledge),// 团组费用录入通知记录表 
+    //typeof(Res_OverseaVehicle),// 境外用车信息 
+    //typeof(Res_OverseaVehicleTypePrice),// 境外用车类型价格信息   
+    //typeof(Pm_CompanyDailyKpi),// 财务部绩效考核    
+    //typeof(Grp_ConfProcessOverview),// 会务流程总览    
+    //typeof(Grp_ConfProcessNode),// 会务流程节点     
+    //typeof(Grp_ConfProcessLog),// 团组会务流程总览操作日志  
+    //typeof(Res_InvitationAI),// 商邀公务AI  
+    typeof(Res_InvitationAI_NoGroup),// 商邀公务AI-无团组版  
 });
 Console.WriteLine("数据库结构同步完成!");

文件差异内容过多而无法显示
+ 1649 - 216
OASystem/OASystem.Api/Controllers/ResourceController.cs


+ 15 - 0
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -1367,6 +1367,21 @@ namespace OASystem.API.OAMethodLib
                     .ToListAsync();
         }
 
+        /// <summary>
+        /// 商邀AI-无团组 invName 整合
+        /// </summary>
+        /// <returns></returns>
+        public static async Task<List<InvitationAIInvNameView>> InvitationAI_NoGroupInvName()
+        {
+            // 将去重后的结果包装,再进行全局
+            return await _sqlSugar.Queryable<Res_InvitationAI>()
+                    .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.InvName))
+                    .Select(x => new InvitationAIInvNameView { Id = x.Id, Name = x.InvName, Source = 2, SortTime = x.CreateTime })
+                    .OrderByDescending(it => it.Source)
+                    .OrderByDescending(it => it.SortTime)
+                    .ToListAsync();
+        }
+
         /// <summary>
         /// 商邀AI ClientName 处理
         /// </summary>

+ 61 - 0
OASystem/OASystem.Domain/Dtos/Resource/InvitationAI.cs

@@ -148,4 +148,65 @@ namespace OASystem.Domain.Dtos.Resource
     public class InvitationAIInsertResourceDto: InvitationAIGenerateEmailDto
     { }
 
+
+    #region 无团组版
+
+    public class InvitationAI_NoGroupSearchDto:InvitationAISearchDto
+    {
+    }
+
+    public class InvitationAI_NoGroupSetPromptDto : InvitationAISetPromptDto
+    {
+        /// <summary>
+        /// 出访时间(eg:2026-04-16)
+        /// </summary>
+        public string VisitDate { get; set; }
+    }
+
+    public class InvitationAI_NoGroupSetCheckedDto : InvitationAISetCheckedDto
+    {
+    }
+
+    public class InvitationAI_NoGroupSaveDto : InvitationAISaveDto
+    {
+        public new InvitationAI_NoGroupInfo AiCrawledDetail { get; set; }
+    }
+
+    public class InvitationAI_NoGroupSingleDelDto : InvitationAISingleDelDto
+    {
+    }
+
+    public class InvitationAI_NoGroupInsertResourceDto : InvitationAIInsertResourceDto
+    {
+    }
+
+    public class InvitationAI_NoGroupCompleteTextDto : InvitationAICompleteTextDto
+    {
+    }
+
+    public class InvitationAI_NoGroupGenerateEmailDto : InvitationAIGenerateEmailDto
+    {
+    }
+
+    public class InvitationAI_NoGroupEmailSaveDto : InvitationAIEmailSaveDto
+    {
+    }
+
+    public class InvitationAI_NoGroupFileSaveDto:InvitationAIFileSaveDto
+    {
+        
+    }
+
+    public class InvitationAI_NoGroupFileDelDto : InvitationAIFileDelDto
+    {
+
+    }
+
+    public class InvitationAI_NoGroupSeedEmailDto : InvitationAISeedEmailDto
+    {
+    }
+
+
+    #endregion
+
 }

+ 0 - 1
OASystem/OASystem.Domain/Entities/Resource/Res_InvitationAI.cs

@@ -237,7 +237,6 @@ namespace OASystem.Domain.Entities.Resource
 
     public class AICreateEmailInfo
     {
-
         public string Guid { get; set; }
         public string NameCn { get; set; }
         public string Scope { get; set; }

+ 43 - 0
OASystem/OASystem.Domain/Entities/Resource/Res_InvitationAI_NoGroup.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Resource
+{
+    /// <summary>
+    /// 商邀公务AI-无团组
+    /// </summary>
+    [SugarTable("Res_InvitationAI_NoGroup", "商邀公务AI-无团组")]
+    public class Res_InvitationAI_NoGroup : EntityBase
+    {
+        /// <summary>
+        /// 名称
+        /// </summary>
+        [SugarColumn(ColumnName = "InvName", ColumnDescription = "名称", IsNullable = true, ColumnDataType = "varchar(150)")]
+        public string InvName { get; set; }
+
+        /// <summary>
+        /// ai 抓取信息存储(含本地数据信息)
+        /// </summary>
+        [SugarColumn(ColumnName = "AiCrawledDetails", ColumnDescription = "ai 抓取信息存储(含本地数据信息)", IsJson = true, IsNullable = true, ColumnDataType = "varchar(max)")]
+        public List<InvitationAI_NoGroupInfo> AiCrawledDetails { get; set; } = new List<InvitationAI_NoGroupInfo>();
+
+        /// <summary>
+        /// 词条信息
+        /// </summary>
+        [SugarColumn(ColumnName = "Entries", ColumnDescription = "词条信息", IsJson = true, IsNullable = true, ColumnDataType = "varchar(max)")]
+        public Entry_NoGroupInfo EntryInfo { get; set; } = new Entry_NoGroupInfo();
+    }
+
+    public class InvitationAI_NoGroupInfo : InvitationAIInfo { }
+
+    public class Entry_NoGroupInfo : EntryInfo 
+    {
+        /// <summary>
+        /// 出访时间
+        /// </summary>
+        public string VisitDate { get; set; }
+    }
+}