diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs index fff1230e..b2fced98 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs @@ -44,7 +44,7 @@ namespace DS.WMS.Core.Application.Method /// public async Task> SaveAsync(TEntity application) { - TEntity dbValue = null; + TEntity? dbValue = null; if (application.Id > 0) { //修改需检查申请单状态 @@ -110,8 +110,6 @@ namespace DS.WMS.Core.Application.Method { detail.ApplicationId = application.Id; var fee = fees.Find(x => x.Id == detail.RecordId); - //detail.BusinessId = fee.BusinessId; - //detail.BusinessType = fee.BusinessType; detail.ExchangeRate = detail.ExchangeRate ?? fee.ExchangeRate; detail.FeeId = fee.FeeId; detail.FeeName = fee.FeeName; @@ -189,7 +187,7 @@ namespace DS.WMS.Core.Application.Method /// 提交的申请单 /// 数据库值,新增时为null /// - protected virtual DataResult EnsureApplication(TEntity application, TEntity dbValue) + protected virtual DataResult EnsureApplication(TEntity application, TEntity? dbValue) { return DataResult.Success; } diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs index 3d3375e0..c484e93c 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs @@ -305,12 +305,9 @@ namespace DS.WMS.Core.Application.Method CustomerAddTel = a.CustomerAddTel, CustomerBankId = a.CustomerBankId, - CustomerBankName = b1.BankName, - CustomerAccount = b1.Account, - + CustomerBankName = b1.BankName + " " + b1.Account, USDCustomerBankId = a.USDCustomerBankId, - USDCustomerBankName = b2.BankName, - USDCustomerAccount = b2.Account + USDCustomerBankName = b2.BankName + " " + b2.Account }).FirstAsync(); if (dto != null) @@ -434,14 +431,11 @@ namespace DS.WMS.Core.Application.Method return list; } - protected override DataResult EnsureApplication(InvoiceApplication application, InvoiceApplication dbValue) + protected override DataResult EnsureApplication(InvoiceApplication application, InvoiceApplication? dbValue) { if (dbValue != null && dbValue.Status != InvoiceApplicationStatus.Pending && dbValue.Status != InvoiceApplicationStatus.AuditRejected) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.ApplicationSaveStatusError)); - if (application.Currency.IsNullOrEmpty()) - application.Currency = FeeCurrency.RMB_CODE; - return DataResult.Success; } diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs index 3534198f..6ece1721 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs @@ -400,7 +400,7 @@ namespace DS.WMS.Core.Application.Method } - protected override DataResult EnsureApplication(PaymentApplication application, PaymentApplication dbValue) + protected override DataResult EnsureApplication(PaymentApplication application, PaymentApplication? dbValue) { if (dbValue != null) { diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskMailService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskMailService.cs index 78fbff77..4de9dc2e 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskMailService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskMailService.cs @@ -7,7 +7,7 @@ using DS.WMS.Core.Op.Interface.TaskInteraction; namespace DS.WMS.Core.Op.Method.TaskInteraction { /// - /// 邮件配置服务 + /// 邮件模板配置服务 /// public class TaskMailService : ServiceBase, ITaskMailService { @@ -27,7 +27,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction public async Task>> GetListAsync(PageRequest request) { var whereList = request.GetConditionalModels(Db); - return await TenantDb.Queryable().Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.CC) + return await TenantDb.Queryable() + .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.CC) .Where(whereList).ToQueryPageAsync(request.PageCondition); } @@ -39,7 +40,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction public async Task> GetAsync(long id) { var entity = await TenantDb.Queryable() - .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Attachments).Includes(x => x.CC) + .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.CC).Includes(x => x.Attachments) .Where(x => x.Id == id).FirstAsync(); return DataResult.Success(entity); @@ -53,8 +54,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction public async Task GetAsync(string name) { return await TenantDb.Queryable() - .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Attachments).Includes(x => x.CC) - .Where(x => x.Name == name).FirstAsync(); + .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.CC).Includes(x => x.Attachments) + .Where(x => x.Name.Contains(name)).FirstAsync(); } /// @@ -73,11 +74,15 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction taskMail.Sender ??= new(); taskMail.CC ??= new(); - taskMail = await TenantDb.InsertNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteReturnEntityAsync(); + taskMail = await TenantDb.InsertNav(taskMail) + .Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.CC) + .ExecuteReturnEntityAsync(); } else { - await TenantDb.UpdateNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteCommandAsync(); + await TenantDb.UpdateNav(taskMail) + .Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.CC) + .ExecuteCommandAsync(); } if (taskMail.Attachments?.Count > 0) @@ -86,8 +91,10 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction foreach (var item in list) item.TaskMailId = taskMail.Id; - await TenantDb.Deleteable().Where(x => x.TaskMailId == taskMail.Id).ExecuteCommandAsync(); - await TenantDb.Insertable(taskMail.Attachments).ExecuteCommandAsync(); + //await TenantDb.Deleteable().Where(x => x.TaskMailId == taskMail.Id).ExecuteCommandAsync(); + //await TenantDb.Insertable(taskMail.Attachments).ExecuteCommandAsync(); + + await TenantDb.Storageable(taskMail.Attachments).DefaultAddElseUpdate().ExecuteCommandAsync(); } await TenantDb.Ado.CommitTranAsync(); @@ -113,7 +120,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction try { await TenantDb.DeleteNav(x => model.Ids.Contains(x.Id)) - .Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Attachments) + .Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.CC).Include(x => x.Attachments) .ExecuteCommandAsync(); await TenantDb.Ado.CommitTranAsync(); @@ -127,6 +134,5 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction } } - } }