|
|
|
@ -126,6 +126,7 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
TemplateId = template.Id
|
|
|
|
|
};
|
|
|
|
|
await TenantDb.Insertable(record).ExecuteCommandAsync();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -177,7 +178,7 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(template.Condition)) //设置了自定义匹配条件
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
var conditionModel = JsonConvert.DeserializeObject<ConditionContent>(template.Condition);
|
|
|
|
|
if (!actionService.Value.IsMatch(order, conditionModel))
|
|
|
|
|
return null;
|
|
|
|
@ -296,7 +297,6 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
{
|
|
|
|
|
ArgumentNullException.ThrowIfNull(models, nameof(models));
|
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
|
DateTime dtNow = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
var custNames = models.Select(x => x.CustomerName).Distinct();
|
|
|
|
|
var custList = await TenantDb.Queryable<InfoClient>().Where(x => custNames.Contains(x.Name) && x.Status == 0).Select(x => new
|
|
|
|
@ -341,8 +341,15 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
// x.EdiCode
|
|
|
|
|
//}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
var sourceCodes = models.Select(x => x.SourceCode).Distinct();
|
|
|
|
|
var sources = await TenantDb.Queryable<CodeSource>().Where(x => sourceCodes.Contains(x.SourceCode)).Select(x => new
|
|
|
|
|
{
|
|
|
|
|
x.Id,
|
|
|
|
|
x.SourceCode
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
List<FeeCustTemplate> list = [];
|
|
|
|
|
var groups = models.GroupBy(x => new { x.CarrierName, x.POL, x.POD, x.LaneName, x.PaymentType, x.CustomerName }).ToList();
|
|
|
|
|
var groups = models.GroupBy(x => new { x.CarrierName, x.POL, x.POD, x.LaneName, x.PaymentType, x.CustomerName, x.SourceCode }).ToList();
|
|
|
|
|
foreach (var g in groups)
|
|
|
|
|
{
|
|
|
|
|
var first = g.First();
|
|
|
|
@ -363,8 +370,8 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
MBLFrtCode = g.Key.PaymentType,
|
|
|
|
|
POLCode = g.Key.POL,
|
|
|
|
|
PODCode = g.Key.POD,
|
|
|
|
|
SourceId = sources.Find(x => x.SourceCode == g.Key.SourceCode)?.Id,
|
|
|
|
|
CreateBy = userId,
|
|
|
|
|
CreateTime = dtNow,
|
|
|
|
|
Note = "系统导入",
|
|
|
|
|
Details = []
|
|
|
|
|
};
|
|
|
|
@ -376,15 +383,17 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
{
|
|
|
|
|
CustomerId = template.CustomerId.GetValueOrDefault(),
|
|
|
|
|
CustomerName = template.CustomerName,
|
|
|
|
|
CustomerType = "controller",
|
|
|
|
|
CustomerType = template.FeeType == FeeType.Receivable ? "controller" : null,
|
|
|
|
|
Currency = item.Currency,
|
|
|
|
|
FeeId = (fees.Find(x => x.Name == item.FeeName)?.Id).GetValueOrDefault(),
|
|
|
|
|
FeeCode = fees.Find(x => x.Name == item.FeeName)?.Code,
|
|
|
|
|
FeeName = item.FeeName,
|
|
|
|
|
IsCtn = item.UnitPrice == null,
|
|
|
|
|
Tax = 0,
|
|
|
|
|
TaxRate = 0,
|
|
|
|
|
AccTaxRate = 0,
|
|
|
|
|
IsInvoice = true,
|
|
|
|
|
CreateBy = userId,
|
|
|
|
|
CreateTime = dtNow,
|
|
|
|
|
CreateBy = userId
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (item.UnitPrice.HasValue)
|
|
|
|
@ -474,7 +483,6 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
if (string.IsNullOrEmpty(item.CustomerName))
|
|
|
|
|
item.CustomerName = model.CustomerName;
|
|
|
|
|
|
|
|
|
|
item.CustomerType = model.CustomerType;
|
|
|
|
|
item.CreateBy = userId;
|
|
|
|
|
item.CreateTime = dt;
|
|
|
|
|
}
|
|
|
|
|