|
|
@@ -5,14 +5,17 @@ using Aspose.Words.Layout;
|
|
|
using Aspose.Words.Saving;
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
using Microsoft.International.Converters.PinYinConverter;
|
|
|
-using NodaTime.TimeZones;
|
|
|
using NodaTime;
|
|
|
+using NodaTime.Extensions;
|
|
|
+using NodaTime.TimeZones;
|
|
|
using OASystem.API.OAMethodLib.APNs;
|
|
|
using OASystem.API.OAMethodLib.File;
|
|
|
using OASystem.API.OAMethodLib.Hub.HubClients;
|
|
|
using OASystem.API.OAMethodLib.Hub.Hubs;
|
|
|
using OASystem.API.OAMethodLib.JuHeAPI;
|
|
|
+using OASystem.API.OAMethodLib.KiMiApi;
|
|
|
using OASystem.API.OAMethodLib.SignalR.Hubs;
|
|
|
+using OASystem.Domain.AesEncryption;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
|
using OASystem.Domain.Entities.Customer;
|
|
|
using OASystem.Domain.Entities.Financial;
|
|
|
@@ -27,8 +30,6 @@ using OfficeOpenXml;
|
|
|
using System.Data;
|
|
|
using System.IdentityModel.Tokens.Jwt;
|
|
|
using System.Security.Claims;
|
|
|
-using NodaTime.Extensions;
|
|
|
-using OASystem.Domain.AesEncryption;
|
|
|
|
|
|
namespace OASystem.API.OAMethodLib
|
|
|
{
|
|
|
@@ -5492,6 +5493,89 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
|
|
|
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 机票费用提示
|
|
|
+ /// <summary>
|
|
|
+ /// 三公机票费用提示
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="diId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static async Task<EntryAndExitTipsView[]> EntryAndExitTips(int diId)
|
|
|
+ {
|
|
|
+ if (diId < 1) return Array.Empty<EntryAndExitTipsView>();
|
|
|
+
|
|
|
+ var airFees = await _sqlSugar.Queryable<Air_TicketBlackCode>().Where(a => a.IsDel == 0 && a.DiId == diId).ToListAsync();
|
|
|
+
|
|
|
+ if (airFees.Any())
|
|
|
+ {
|
|
|
+
|
|
|
+ var result = new List<EntryAndExitTipsView>();
|
|
|
+
|
|
|
+
|
|
|
+ foreach (var x in airFees)
|
|
|
+ {
|
|
|
+ string tripDesc = "";
|
|
|
+ if (!string.IsNullOrEmpty(x.BlackCode))
|
|
|
+ {
|
|
|
+ var redisKeyName = string.Format("AirTripDesc_{0}_{1}", x.DiId, x.Id);
|
|
|
+ tripDesc = await KIMIAirTripCodeRec(redisKeyName, x.BlackCode);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ result.Add(new EntryAndExitTipsView
|
|
|
+ {
|
|
|
+ jjcCurrentRate = x.ECPrice,
|
|
|
+ gwcCurrentRate = x.BCPrice,
|
|
|
+ tdcCurrentRate = x.FCPrice,
|
|
|
+ remark = $"经济舱全价:{x.ECPrice.ToString("#0.00")} 元/人 公务舱全价:{x.BCPrice.ToString("#0.00")} 元/人 头等舱全价:{x.FCPrice.ToString("#0.00")} 元/人",
|
|
|
+ TripDesc = tripDesc
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return result.OrderByDescending(x => x.jjcCurrentRate + x.gwcCurrentRate + x.tdcCurrentRate).ToArray();
|
|
|
+ }
|
|
|
+
|
|
|
+ return Array.Empty<EntryAndExitTipsView>();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 机票行程代码识别
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="redisKeyName">redis缓存名称(名称定义格式:AirTripDesc_Diid_Id)</param>
|
|
|
+ /// <param name="msg"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static async Task<string> KIMIAirTripCodeRec(string redisKeyName, string msg)
|
|
|
+ {
|
|
|
+ string result = string.Empty;
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(redisKeyName))
|
|
|
+ {
|
|
|
+ result = await RedisRepository.RedisFactory.CreateRedisRepository().StringGetAsync<string>(redisKeyName);//string 取
|
|
|
+ if (!string.IsNullOrEmpty(result)) return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(msg)) return result;
|
|
|
+
|
|
|
+ KiMiApiClient KiMiApi = new KiMiApiClient();
|
|
|
+
|
|
|
+ var kimiMsgs = new List<SeedMessages>() {
|
|
|
+ new SeedMessages { Role = KimiRole.system, Content = "你是 Kimi,由 Moonshot AI 提供的人工智能助手,你更擅长中文和英文的对话。你会为用户提供安全,有帮助,准确的回答。同时,你会拒绝一切涉及恐怖主义,种族歧视,黄色暴力等问题的回答。Moonshot AI 为专有名词,不可翻译成其他语言。" },
|
|
|
+ new SeedMessages { Role = KimiRole.user, Content = "请将提供的三字码行程信息翻译成中文,每条信息独立一行,并在次日到达的时间后加上“+1”以表示次日。日期(星期)格式请按照“04月14日(星期一)”标注。航站楼信息请按照“T1”、“T2”、“ ”等格式标注。只输出正文数据,不要除正文数据外的任何文字以及符号。格式示例如下:\r\n1. CA445 05月17日(星期六) 成都天府 T1 - 米兰马尔彭萨 T1 01:50 06:55" },
|
|
|
+ new SeedMessages { Role = KimiRole.user, Content = msg }
|
|
|
+ };
|
|
|
+
|
|
|
+ var kimiApiResult = await KiMiApi.SeedMessage(kimiMsgs);
|
|
|
+ var kimiApiResult_JObject = JObject.Parse(kimiApiResult);
|
|
|
+ result = kimiApiResult_JObject["content"].ToString();
|
|
|
+ if (!string.IsNullOrEmpty(result))
|
|
|
+ {
|
|
|
+ TimeSpan ts = TimeSpan.FromHours(2); //过期时间 2 小时
|
|
|
+ await RedisRepository.RedisFactory.CreateRedisRepository().StringSetAsync<string>(redisKeyName, result, ts);//string 存
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
#endregion
|
|
|
}
|