|
@@ -4,6 +4,7 @@ using Aspose.Words.Drawing;
|
|
using Aspose.Words.Tables;
|
|
using Aspose.Words.Tables;
|
|
using DiffMatchPatch;
|
|
using DiffMatchPatch;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
|
+using Microsoft.Extensions.Logging;
|
|
using NPOI.HSSF.UserModel;
|
|
using NPOI.HSSF.UserModel;
|
|
using NPOI.SS.UserModel;
|
|
using NPOI.SS.UserModel;
|
|
using NPOI.SS.Util;
|
|
using NPOI.SS.Util;
|
|
@@ -29,7 +30,6 @@ using OASystem.Domain.Entities.Groups;
|
|
using OASystem.Domain.ViewModels.Financial;
|
|
using OASystem.Domain.ViewModels.Financial;
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
using OASystem.Domain.ViewModels.OCR;
|
|
using OASystem.Domain.ViewModels.OCR;
|
|
-using OASystem.Domain.ViewModels.Statistics;
|
|
|
|
using OASystem.Infrastructure.Repositories.CRM;
|
|
using OASystem.Infrastructure.Repositories.CRM;
|
|
using OASystem.Infrastructure.Repositories.Financial;
|
|
using OASystem.Infrastructure.Repositories.Financial;
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
@@ -40,7 +40,6 @@ using System.Data;
|
|
using System.Diagnostics;
|
|
using System.Diagnostics;
|
|
using System.Globalization;
|
|
using System.Globalization;
|
|
using System.IO.Compression;
|
|
using System.IO.Compression;
|
|
-using System.Text.Json.Nodes;
|
|
|
|
using System.Web;
|
|
using System.Web;
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
@@ -802,7 +801,8 @@ namespace OASystem.API.Controllers
|
|
if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
if (dto.PageId < 1) return Ok(JsonView(false, "页面Id为空"));
|
|
if (dto.PageId < 1) return Ok(JsonView(false, "页面Id为空"));
|
|
|
|
|
|
- PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
+ PageFunAuthViewBase
|
|
|
|
+ pageFunAuthView = new PageFunAuthViewBase();
|
|
#region 页面操作权限验证
|
|
#region 页面操作权限验证
|
|
pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
@@ -4256,17 +4256,13 @@ FROM
|
|
int dataId = groupData.Data.GetType().GetProperty("dataId").GetValue(groupData.Data, null);
|
|
int dataId = groupData.Data.GetType().GetProperty("dataId").GetValue(groupData.Data, null);
|
|
|
|
|
|
|
|
|
|
- var autoAdit = await _feeAuditRep.FeeAutomaticAudit(5, diId, dataId);
|
|
+
|
|
-
|
|
+ (bool status,string auditMsg) = await AirTicketResAutoAudit(diId, dataId);
|
|
- #region 舱位单价方式
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- #endregion
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
+ _logger.LogInformation("【机票费用自动审核(KIMI-AI识别INIT)】请求参数:{RequstData} 返回结果:是否执行:{IsExecute}; 结果消息:{ResponseMsg};",
|
|
|
|
+ $"GroupId:{diId};airId:{dataId};",
|
|
|
|
+ status,
|
|
|
|
+ auditMsg);
|
|
|
|
|
|
await AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(ccpId, sign, QiyeWeChatEnum.GuoJiaoLeaderChat);
|
|
await AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(ccpId, sign, QiyeWeChatEnum.GuoJiaoLeaderChat);
|
|
|
|
|
|
@@ -4297,27 +4293,34 @@ FROM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- private async Task<(bool, string)> AirTicketResAutoAudit(int diId,int dataId)
|
|
+ private async Task<(bool, string)> AirTicketResAutoAudit(int diId, int dataId)
|
|
{
|
|
{
|
|
- var auditFeeTypeIds = new List<int>() {
|
|
+ var ecoTypeIds = new List<int>() {
|
|
- 457,
|
|
|
|
- 458,
|
|
|
|
459,
|
|
459,
|
|
460,
|
|
460,
|
|
1430,
|
|
1430,
|
|
- 1431,
|
|
|
|
1432,
|
|
1432,
|
|
};
|
|
};
|
|
|
|
+ var bizTypeIds = new List<int>() {
|
|
|
|
+ 457,
|
|
|
|
+ 458,
|
|
|
|
+ 1431,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ var auditFeeTypeIds = new List<int>() {};
|
|
|
|
+ auditFeeTypeIds.AddRange(ecoTypeIds);
|
|
|
|
+ auditFeeTypeIds.AddRange(bizTypeIds);
|
|
|
|
|
|
int currModule = 85;
|
|
int currModule = 85;
|
|
var airInfo = await _sqlSugar.Queryable<Grp_AirTicketReservations>()
|
|
var airInfo = await _sqlSugar.Queryable<Grp_AirTicketReservations>()
|
|
.InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && y.CTable == currModule && y.IsDel == 0)
|
|
.InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && y.CTable == currModule && y.IsDel == 0)
|
|
.Where((x, y) => x.Id == dataId && x.IsDel == 0 && auditFeeTypeIds.Contains(x.CType))
|
|
.Where((x, y) => x.Id == dataId && x.IsDel == 0 && auditFeeTypeIds.Contains(x.CType))
|
|
- .Select((x, y) => new {
|
|
+ .Select((x, y) => new
|
|
|
|
+ {
|
|
x.Id,
|
|
x.Id,
|
|
CcpId = y.Id,
|
|
CcpId = y.Id,
|
|
x.FlightsDate,
|
|
x.FlightsDate,
|
|
- x.Price,
|
|
+ x.PrePrice,
|
|
x.CType,
|
|
x.CType,
|
|
x.ClientNum,
|
|
x.ClientNum,
|
|
x.DIId
|
|
x.DIId
|
|
@@ -4339,6 +4342,7 @@ FROM
|
|
|
|
|
|
|
|
|
|
var airFeeLabel = new StringBuilder();
|
|
var airFeeLabel = new StringBuilder();
|
|
|
|
+ airFeeLabel.AppendLine("费用成本:");
|
|
for (int i = 0; i < groupCostContents.Count; i++)
|
|
for (int i = 0; i < groupCostContents.Count; i++)
|
|
{
|
|
{
|
|
if (string.IsNullOrEmpty(groupCostContents[i].Date))
|
|
if (string.IsNullOrEmpty(groupCostContents[i].Date))
|
|
@@ -4359,10 +4363,10 @@ FROM
|
|
|
|
|
|
var item = groupCostContents[i];
|
|
var item = groupCostContents[i];
|
|
airFeeLabel.AppendLine($"{item.Date}");
|
|
airFeeLabel.AppendLine($"{item.Date}");
|
|
- airFeeLabel.AppendLine($"{item.ITIN.Replace("\n"," ")}");
|
|
+ airFeeLabel.AppendLine($"{item.ITIN.Replace("\n", " ")}");
|
|
}
|
|
}
|
|
airFeeLabel.AppendLine($"注:费用:位置:航班号或者航班时间后面; 组成:经济舱/公务舱;");
|
|
airFeeLabel.AppendLine($"注:费用:位置:航班号或者航班时间后面; 组成:经济舱/公务舱;");
|
|
- airFeeLabel.AppendLine($"取出{airInfo.FlightsDate}费用金额,按照经济舱/公务舱格式返回,如果不存在的话则返回0.00/0.00,只返回金额格式文本;不需要其他文字描述;");
|
|
+ airFeeLabel.AppendLine($"取出“{airInfo.FlightsDate}”费用金额,按照经济舱/公务舱格式返回,如果不存在的话则返回0.00/0.00,只返回金额格式文本;不需要其他文字描述;");
|
|
|
|
|
|
|
|
|
|
var msgs = new List<SeedMessages>()
|
|
var msgs = new List<SeedMessages>()
|
|
@@ -4379,10 +4383,46 @@ FROM
|
|
var kimiApiResult_JObject = JObject.Parse(kimiApiResult);
|
|
var kimiApiResult_JObject = JObject.Parse(kimiApiResult);
|
|
string clients = kimiApiResult_JObject["content"].ToString();
|
|
string clients = kimiApiResult_JObject["content"].ToString();
|
|
|
|
|
|
|
|
+ decimal ecoPri_kimiAI = 0.00M,
|
|
|
|
+ bizPri_kimiAI = 0.00M;
|
|
|
|
+
|
|
|
|
+ if (decimal.TryParse(clients, out ecoPri_kimiAI)) { }
|
|
|
|
+
|
|
|
|
+ if (clients.Contains('/'))
|
|
|
|
+ {
|
|
|
|
+ var priArray = clients.Split('/');
|
|
|
|
+ decimal.TryParse(priArray[0], out ecoPri_kimiAI);
|
|
|
|
+ decimal.TryParse(priArray[1], out bizPri_kimiAI);
|
|
|
|
+ }
|
|
|
|
+ else return (false, "价格文本不存在价格或KIMI-AI未识别出价格,不可自动审核!");
|
|
|
|
|
|
|
|
+ var isAutoAudit = false;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (ecoTypeIds.Contains(airInfo.CType))
|
|
|
|
+ {
|
|
|
|
+ if (airInfo.PrePrice <= ecoPri_kimiAI) isAutoAudit = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ else if (bizTypeIds.Contains(airInfo.CType))
|
|
|
|
+ {
|
|
|
|
+ if (airInfo.PrePrice <= bizPri_kimiAI) isAutoAudit = true;
|
|
|
|
+ }
|
|
|
|
+ else return (false, "该舱位类型不在自动审核范围内,不可自动审核!");
|
|
|
|
|
|
|
|
+
|
|
|
|
+ if (isAutoAudit)
|
|
|
|
+ {
|
|
|
|
+ var auditStatus = await _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
|
+ .SetColumns(x => x.IsAuditGM == 3)
|
|
|
|
+ .SetColumns(x => x.AuditGMOperate == 4)
|
|
|
|
+ .SetColumns(x => x.AuditGMDate == DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
|
|
|
|
+ .Where(x => x.Id == airInfo.CcpId)
|
|
|
|
+ .ExecuteCommandAsync();
|
|
|
|
+ if (auditStatus > 0 ) return (true, "机票自动审核(KIMI-AI识别方式)执行成功!");
|
|
|
|
+ }
|
|
|
|
|
|
- return (false,"不可自动审核!");
|
|
+ return (false, "当前费用超过成本费用,不可自动审核!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -4396,7 +4436,7 @@ FROM
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
public async Task<IActionResult> AirTicketResAutoAuditTest(int groupId, int Id)
|
|
public async Task<IActionResult> AirTicketResAutoAuditTest(int groupId, int Id)
|
|
{
|
|
{
|
|
- (bool status,string msg) = await AirTicketResAutoAudit(groupId, Id);
|
|
+ (bool status, string msg) = await AirTicketResAutoAudit(groupId, Id);
|
|
|
|
|
|
return Ok(JsonView(status, msg));
|
|
return Ok(JsonView(status, msg));
|
|
}
|
|
}
|
|
@@ -25563,96 +25603,6 @@ ORDER BY
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|