|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
using AngleSharp.Dom;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.Module.SqlSugar;
|
|
|
|
@ -11,8 +12,11 @@ using DS.WMS.Core.System.Interface;
|
|
|
|
|
using DS.WMS.Core.System.Method;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
|
using Org.BouncyCastle.Ocsp;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method;
|
|
|
|
|
|
|
|
|
@ -71,7 +75,7 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
return DataResult.Failed("海运出口信息分提单号已存在!", MultiLanguageConst.SeaExportHBLNOExist);
|
|
|
|
|
}
|
|
|
|
|
//TODO 会计期间不允许小于已结转期间
|
|
|
|
|
if (req.CloseDocDate.IsNotNull()&& req.CloseDocDate < req.ETD)
|
|
|
|
|
if (req.CloseDocDate.IsNotNull() && req.CloseDocDate < req.ETD)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("截单日期不允许小于开船日期!", MultiLanguageConst.SeaExportCloseDocDateLimit);
|
|
|
|
|
}
|
|
|
|
@ -89,6 +93,17 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
|
|
|
|
|
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
|
|
|
|
|
|
|
|
|
|
if (req.CtnInfo.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
foreach (var item in req.CtnInfo)
|
|
|
|
|
{
|
|
|
|
|
var ctn = item.Adapt<OpCtn>();
|
|
|
|
|
ctn.BSNO = entity.Id.ToString();
|
|
|
|
|
tenantDb.Insertable(ctn).ExecuteCommand();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -111,6 +126,20 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
return DataResult.Failed("截港日期不允许小于开船日期!", MultiLanguageConst.SeaExportCloseDateLimit);
|
|
|
|
|
}
|
|
|
|
|
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (req.CtnInfo.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var ctnList = tenantDb.Queryable<OpCtn>().Where(x => x.BSNO == req.Id.ToString()).ToList();
|
|
|
|
|
foreach (var item in req.CtnInfo)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var ctn = ctnList.First(x => x.Id == item.Id);
|
|
|
|
|
ctn = item.Adapt(ctn);
|
|
|
|
|
tenantDb.Updateable(ctn).ExecuteCommand();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -172,7 +201,7 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 业务单据复制
|
|
|
|
|
/// 业务单据单票复制
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">业务Id</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
@ -186,32 +215,51 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
}
|
|
|
|
|
//获取表单复制模板
|
|
|
|
|
var template = tenantDb.Queryable<CodeFormCopy>().Where(x => x.PermissionId == 1772509201441099776).First();
|
|
|
|
|
var sequence = commonService.GetSequenceNext<SeaExport>();
|
|
|
|
|
if (!sequence.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var entity = new SeaExport();
|
|
|
|
|
var data = new SeaExport();
|
|
|
|
|
if (template.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
data = info.Adapt(data);
|
|
|
|
|
data.Id = 0;
|
|
|
|
|
data.ParentId = 0;
|
|
|
|
|
data.IsBusinessLocking = false;
|
|
|
|
|
data.IsFeeLocking = false;
|
|
|
|
|
data.CustomerNo = sequence.Data;
|
|
|
|
|
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
|
|
|
|
|
return DataResult.Successed("复制成功!", entity.Id, MultiLanguageConst.DataCopySuccess);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var sequence = commonService.GetSequenceNext<SeaExport>();
|
|
|
|
|
if (!sequence.Succeeded)
|
|
|
|
|
data = info.Adapt(data);
|
|
|
|
|
data.Id = 0;
|
|
|
|
|
data.ParentId = 0;
|
|
|
|
|
data.IsBusinessLocking = false;
|
|
|
|
|
data.IsFeeLocking = false;
|
|
|
|
|
data.CustomerNo = sequence.Data;
|
|
|
|
|
|
|
|
|
|
var list0 = template.CopyFields.Split(",");
|
|
|
|
|
var list1 = new List<string>();
|
|
|
|
|
foreach (var item in list0)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);
|
|
|
|
|
list1.Add(item.ToUpperCamelCase());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
entity = info.Adapt(entity);
|
|
|
|
|
entity.Id = 0;
|
|
|
|
|
entity.ParentId = 0;
|
|
|
|
|
entity.IsBusinessLocking = false;
|
|
|
|
|
entity.IsFeeLocking = false;
|
|
|
|
|
entity.CustomerNo = sequence.Data;
|
|
|
|
|
list1.Add("IsBusinessLocking");
|
|
|
|
|
list1.Add("IsFeeLocking");
|
|
|
|
|
list1.Add("CustomerNo");
|
|
|
|
|
var insertColumns = list1.ToArray();
|
|
|
|
|
//insertColumns.AddRange(["Id", "ParentId", "IsBusinessLocking", "IsFeeLocking", "CustomerNo"]);
|
|
|
|
|
var entity = tenantDb.Insertable(data).InsertColumns(insertColumns).ExecuteReturnEntity();
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("复制成功!", entity.Id, MultiLanguageConst.DataCopySuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
info.IsFeeLocking = true;
|
|
|
|
|
|
|
|
|
|
var partList = tenantDb.Queryable<SeaExport>().Where(x => x.ParentId == long.Parse(id)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
|
|
|
|
|
}
|
|
|
|
|
#region 删除
|
|
|
|
|
|
|
|
|
@ -229,7 +277,7 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tenantDb.Queryable<SeaExport>().Where(x => x.ParentId == long.Parse(id)).Any())
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("海运出口存在分票信息,不能删除!", MultiLanguageConst.SeaExportPartExist);
|
|
|
|
@ -304,7 +352,7 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
item.DeleteBy = long.Parse(user.UserId);
|
|
|
|
|
tenantDb.Updateable(item).ExecuteCommand();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
@ -354,7 +402,7 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
|
|
|
|
|
info.IsFeeLocking = true;
|
|
|
|
|
tenantDb.Updateable(info).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
|
|
|
|
|
}
|
|
|
|
|