|
|
|
@ -40,6 +40,7 @@ using LanguageExt.Pretty;
|
|
|
|
|
using Amazon.Runtime.Internal.Transform;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using NPOI.XSSF.Streaming.Values;
|
|
|
|
|
using AngleSharp.Text;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
@ -139,7 +140,63 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 手动更新海运出口服务项目
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <param name="code"></param>
|
|
|
|
|
/// <param name="type">类型 true 勾选保存 false 勾选取消</param>
|
|
|
|
|
public async void UpdateSeaExportServiceItem(long id, string code, bool type = true)
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var order = tenantDb.Queryable<SeaExport>().Filter(null, true).First(x => x.Id == id);
|
|
|
|
|
var oldOrder = order.Adapt<SeaExport>();
|
|
|
|
|
var items = order.ServiceItem.Split(',').ToList();
|
|
|
|
|
var codeStr = String.Empty;
|
|
|
|
|
var isUpdate = false;
|
|
|
|
|
if (type)
|
|
|
|
|
{
|
|
|
|
|
if (!items.Contains(code))
|
|
|
|
|
{
|
|
|
|
|
items.Add(code);
|
|
|
|
|
codeStr = String.Join(",", items.ToArray());
|
|
|
|
|
isUpdate = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
isUpdate = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (items.Contains(code))
|
|
|
|
|
{
|
|
|
|
|
items.RemoveAll(x => x == code);
|
|
|
|
|
codeStr = String.Join(",", items.ToArray());
|
|
|
|
|
isUpdate = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
isUpdate = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isUpdate && !codeStr.Equals(order.ServiceItem))
|
|
|
|
|
{
|
|
|
|
|
order.ServiceItem = codeStr;
|
|
|
|
|
await tenantDb.Updateable(order).UpdateColumns(x => new { x.ServiceItem })
|
|
|
|
|
.EnableDiffLogEvent().ExecuteCommandAsync();
|
|
|
|
|
// 记录日志
|
|
|
|
|
await SaveSeaExportLogAsync(new SeaExportSaveLog()
|
|
|
|
|
{
|
|
|
|
|
OperateType = "Update",
|
|
|
|
|
OldOrder = oldOrder,
|
|
|
|
|
NewOrder = order,
|
|
|
|
|
SourceCode = "UpdateSeaExportServiceItem",
|
|
|
|
|
SourceName = "手动更新海运出口服务项目",
|
|
|
|
|
}, tenantDb);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#region 海运出口差异日志
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 忽略的字段
|
|
|
|
|