|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
using Amazon.S3.Model;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.Module.SqlSugar;
|
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
@ -15,17 +14,18 @@ using DS.WMS.Core.Sys.Entity;
|
|
|
|
|
using DS.WMS.Core.Sys.Interface;
|
|
|
|
|
using LanguageExt.Pipes;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Masuit.Tools;
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NPOI.HSSF.UserModel;
|
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using Logger = NLog.Logger;
|
|
|
|
|
using AnyDiff.Extensions;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
@ -53,6 +53,78 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
_environment = _serviceProvider.GetRequiredService<IWebHostEnvironment>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 忽略的字段
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static readonly List<string> IgnoreColumns = new List<string>()
|
|
|
|
|
{
|
|
|
|
|
"CreateTime",
|
|
|
|
|
"CreateUserName",
|
|
|
|
|
"CreateBy",
|
|
|
|
|
"UpdateTime",
|
|
|
|
|
"UpdateUserName",
|
|
|
|
|
"UpdateBy",
|
|
|
|
|
"DeleteTime",
|
|
|
|
|
"DeleteUserName",
|
|
|
|
|
"DeleteBy",
|
|
|
|
|
"TenantId",
|
|
|
|
|
"TenantName",
|
|
|
|
|
};
|
|
|
|
|
public async Task SaveSeaExportLog(SeaExportSaveLog req) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool flag = true;
|
|
|
|
|
long bid = 0;
|
|
|
|
|
|
|
|
|
|
var diff = req.NewOrder.Diff(req.OldOrder);
|
|
|
|
|
//var obj1 = new { Name = "Tom", Age = 20 };
|
|
|
|
|
//var obj2 = new { Name = "Jerry", Age = 21 };
|
|
|
|
|
//var diff = obj1.Diff(obj2).ToList();
|
|
|
|
|
foreach (var change in diff)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"{change.PropertyType} - {change.Property}: {change.LeftValue} => {change.RightValue}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(req.NewOrder))
|
|
|
|
|
//{
|
|
|
|
|
// //基础字段不记录
|
|
|
|
|
// string name = descriptor.Name;
|
|
|
|
|
// if (IgnoreColumns.Contains(name))
|
|
|
|
|
// {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// // 如果已经明确了被修改的字段,且当前字段不在其中,则跳过
|
|
|
|
|
// if (req.UpdateFields.IsNotNull() && !req.UpdateFields.Contains(name))
|
|
|
|
|
// {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// object value = descriptor.GetValue(req.NewOrder);
|
|
|
|
|
// var oldvalue = req.OldOrder.GetType().GetProperty(name).GetValue(req.OldOrder, null);
|
|
|
|
|
// //数值类型转换比较
|
|
|
|
|
// if (name == "KGS" || name == "CBM")
|
|
|
|
|
// {
|
|
|
|
|
// if (Convert.ToDecimal(value) == Convert.ToDecimal(oldvalue))
|
|
|
|
|
// {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// string _oldvalue = oldvalue != null ? oldvalue.ToString() : "";
|
|
|
|
|
// string _value = value != null ? value.ToString() : "";
|
|
|
|
|
|
|
|
|
|
// if (_oldvalue != _value && !string.IsNullOrWhiteSpace(descriptor.Description))
|
|
|
|
|
// {
|
|
|
|
|
// var data = new OpBusinessLog()
|
|
|
|
|
// {
|
|
|
|
|
// BusinessId = req.OldOrder.Id,
|
|
|
|
|
// OldValue = JsonConvert.SerializeObject(req.OldOrder),
|
|
|
|
|
// NewValue= JsonConvert.SerializeObject(req.NewOrder),
|
|
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取客户结算方式及结算日期
|
|
|
|
|