diff --git a/Myshipping.Application/Service/Fee/Dto/FeeCustTemplateDto.cs b/Myshipping.Application/Service/Fee/Dto/FeeCustTemplateDto.cs index 43ebb9f5..2ba2ce30 100644 --- a/Myshipping.Application/Service/Fee/Dto/FeeCustTemplateDto.cs +++ b/Myshipping.Application/Service/Fee/Dto/FeeCustTemplateDto.cs @@ -1,16 +1,97 @@ using Myshipping.Application.Entity; using Myshipping.Core; +using SqlSugar; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Myshipping.Application.Service.Fee.Dto { - public class FeeCustTemplateDto : FeeCustTemplateDetail + public class FeeCustTemplateDto { + public long Id { get; set; } + /// + /// 费用名称 + /// + [Description("费用名称")] + public string FeeName { get; set; } + + /// + /// 客户名称 + /// + [Description("客户名称")] + public string CustomerName { get; set; } + + /// + /// 费用标准 + /// + [Description("费用标准")] + public string Unit { get; set; } + + /// + /// 币别 + /// + [Description("币别")] + public string Currency { get; set; } + + /// + /// 单价 + /// + [Description("单价")] + public decimal UnitPrice { get; set; } + + /// + /// 备注 + /// + [Description("备注")] + public string Remark { get; set; } + + /// + /// 排序号 + /// + [Description("排序号")] + public int Sort { get; set; } + + /// + /// 汇率 + /// + [SugarColumn(ColumnName = "ExchangeRate")] + [Description("汇率")] + public decimal ExchangeRate { get; set; } + + /// + /// 是否开票 + /// + [Description("是否开票")] + public bool IsInvoice { get; set; } + + /// + /// 是否垫付 + /// + [Description("是否垫付")] + public bool IsAdvancedPay { get; set; } + + /// + /// Frt PP CC + /// + [Description("Frt PP CC")] + public string FeeFrt { get; set; } + + /// + /// 税率 + /// + [Description("税率")] + public decimal TaxRate { get; set; } + + /// + /// 财务税率 + /// + [Description("财务税率")] + public decimal AccTaxRate { get; set; } } public class FeeCustTemplatePageInput : PageInputBase { diff --git a/Myshipping.Application/Service/Fee/Dto/FeeRecordDto.cs b/Myshipping.Application/Service/Fee/Dto/FeeRecordDto.cs index 36a447f2..19785b9b 100644 --- a/Myshipping.Application/Service/Fee/Dto/FeeRecordDto.cs +++ b/Myshipping.Application/Service/Fee/Dto/FeeRecordDto.cs @@ -6,11 +6,6 @@ namespace Myshipping.Application.Service.Fee.Dto { public class FeeRecordDto : FeeRecord { - /// - /// 是否标记为删除 - /// - public bool MarkDelete { get; set; } - /// /// 是否标记为修改 /// @@ -25,6 +20,14 @@ namespace Myshipping.Application.Service.Fee.Dto } public class FeeRecordSaveDto { - public List FeeRecordList { get; set; } + /// + /// 待新增或修改费用列表 + /// + public List SaveList { get; set; } + + /// + /// 待删除删除费用列表 + /// + public List DeleteList { get; set; } } } diff --git a/Myshipping.Application/Service/Fee/FeeCustTemplateService.cs b/Myshipping.Application/Service/Fee/FeeCustTemplateService.cs index dd9212b6..e0cd64d7 100644 --- a/Myshipping.Application/Service/Fee/FeeCustTemplateService.cs +++ b/Myshipping.Application/Service/Fee/FeeCustTemplateService.cs @@ -1,5 +1,4 @@ -using Furion.DatabaseAccessor; -using Furion.DependencyInjection; +using Furion.DependencyInjection; using Furion.DynamicApiController; using Furion.EventBus; using Furion.FriendlyException; @@ -10,8 +9,7 @@ using Myshipping.Application.Entity; using Myshipping.Application.Service.Fee.Dto; using Myshipping.Core; using Myshipping.Core.Service; -using SqlSugar; -using System.Collections.Generic; +using System; using System.Linq; using System.Threading.Tasks; @@ -45,6 +43,9 @@ namespace Myshipping.Application _repCustTemplete = repCustTemplete; } + /// + /// 分页查询往来单位固定费用列表 + /// [HttpGet("/FeeCustTemplate/Page")] public async Task Page(FeeCustTemplatePageInput input) { @@ -69,9 +70,13 @@ namespace Myshipping.Application return detail?.Adapt(); } + /// + /// 往来单位固定费用保存 + /// [HttpPost("/FeeCustTemplate/Save")] public async Task Save(FeeCustTemplateDto input) { + var entity = input.Adapt(); if (input.Id == 0) { // 判断是否已经存在同单位、同费用的记录 @@ -79,7 +84,7 @@ namespace Myshipping.Application { throw Oops.Bah("此往来单位下已存在此费用项"); } - await _repCustTemplete.InsertAsync(input); + await _repCustTemplete.InsertAsync(entity); } else { @@ -88,13 +93,23 @@ namespace Myshipping.Application { throw Oops.Bah("此往来单位下已存在此费用项"); } - await _repCustTemplete.AsUpdateable(input).IgnoreColumns(c => new { c.TenantId, c.TenantName }).ExecuteCommandAsync(); + await _repCustTemplete.AsUpdateable(entity).IgnoreColumns(c => new { c.TenantId, c.TenantName }).ExecuteCommandAsync(); } } - //[HttpPost("/FeeCustTemplate/Delete")] - //public async Task Delete() - //{ - //} + /// + /// 往来单位固定费用删除 + /// + [HttpPost("/FeeCustTemplate/Delete")] + public async Task Delete([FromBody] long[] ids) + { + await _repCustTemplete.UpdateAsync(c => ids.Contains(c.Id), c => new FeeCustTemplateDetail + { + IsDeleted = true, + UpdatedTime = DateTime.Now, + UpdatedUserId = UserManager.UserId, + UpdatedUserName = UserManager.Name + }); + } } } diff --git a/Myshipping.Application/Service/Fee/FeeRecordService.cs b/Myshipping.Application/Service/Fee/FeeRecordService.cs index 314651f2..b503cbe7 100644 --- a/Myshipping.Application/Service/Fee/FeeRecordService.cs +++ b/Myshipping.Application/Service/Fee/FeeRecordService.cs @@ -80,11 +80,11 @@ namespace Myshipping.Application [SqlSugarUnitOfWork] public async Task Save(FeeRecordSaveDto input) { - input.FeeRecordList ??= new List(); + input.SaveList ??= new List(); + input.DeleteList ??= new List(); - var waitDeleteList = input.FeeRecordList.Where(r => r.MarkDelete && r.Id != 0).ToList(); - var waitInsertList = input.FeeRecordList.Where(r => !r.MarkDelete && r.Id == 0).ToList(); - var waitUpdateList = input.FeeRecordList.Where(r => !r.MarkDelete && r.MarkModify && r.Id != 0).ToList(); + var waitInsertList = input.SaveList.Where(r => r.Id == 0).ToList(); + var waitUpdateList = input.SaveList.Where(r => r.Id != 0 && r.MarkModify).ToList(); #region 校验 foreach (var item in waitInsertList.Concat(waitUpdateList)) @@ -102,9 +102,9 @@ namespace Myshipping.Application #endregion // 删除 - if (waitDeleteList.Any()) + if (input.DeleteList.Any()) { - var waitDeleteListTemp = waitDeleteList.Select(r => r.Id).ToList(); + var waitDeleteListTemp = input.DeleteList.Select(r => r.Id).ToList(); await _repRecord.UpdateAsync(r => waitDeleteListTemp.Contains(r.Id), r => new FeeRecord() { IsDeleted = true }); } diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/BC/BookingOrSlotGenerateDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/BC/BookingOrSlotGenerateDto.cs index 8f0a4414..0d570737 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/BC/BookingOrSlotGenerateDto.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/BC/BookingOrSlotGenerateDto.cs @@ -128,6 +128,11 @@ namespace Myshipping.Application /// 委托单位联系人名称 /// public string CustomerContactName { get; set; } + + /// + /// 是否直接发送邮件给订舱联系人 + /// + public bool IsDirectSend { get; set; } = false; } } diff --git a/Myshipping.Web.Core/applicationconfig.json b/Myshipping.Web.Core/applicationconfig.json index e3a4959e..ea4d6795 100644 --- a/Myshipping.Web.Core/applicationconfig.json +++ b/Myshipping.Web.Core/applicationconfig.json @@ -56,7 +56,7 @@ }, "Cache": { "CacheType": "RedisCache", // RedisCache - "RedisConnectionString": "192.168.0.180:6379,password=,defaultDatabase=11" + "RedisConnectionString": "192.168.0.80:6379,password=,defaultDatabase=11" }, "SnowId": { "WorkerId": "1" // 取值范围0~63,默认1