From 125b643e835f4f2b73beb2f8ff46b2aec8b44284 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 4 Sep 2024 18:05:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20Booking=20Amendment=20?= =?UTF-8?q?MSK=E8=87=AA=E5=8A=A8=E8=BD=AC=E5=8F=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Templates/BookingAmendmentMSK.cshtml | 126 +++++++++++++--- .../TaskPlat/Dtos/BC/TaskBCShowBaseDto.cs | 5 + .../TaskPlat/Dtos/BC/TaskBCTransferDto.cs | 140 ++++++++++++++++++ .../Dtos/Mapper/AddTaskPlatMapsterSetup.cs | 3 +- 4 files changed, 252 insertions(+), 22 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/TaskBCTransferDto.cs diff --git a/ds-wms-service/DS.WMS.Core/Op/Templates/BookingAmendmentMSK.cshtml b/ds-wms-service/DS.WMS.Core/Op/Templates/BookingAmendmentMSK.cshtml index 217cf833..f00a56fe 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Templates/BookingAmendmentMSK.cshtml +++ b/ds-wms-service/DS.WMS.Core/Op/Templates/BookingAmendmentMSK.cshtml @@ -1,4 +1,4 @@ -@* @model DS.WMS.Core.Op.Entity.MailTemplateModel *@ +@* @model DS.WMS.Core.Op.Entity.MailTemplateModel *@ @{ var item = Model.Primary; } @@ -18,42 +18,125 @@ - +
-

尊敬的客户,

+

Dear Customer,

- +
- - + + - - + + - + + + + + + + + + + + + + @if (!string.IsNullOrWhiteSpace(@item.Vessel)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.VoyNo)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.ETD)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.ETA)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.CustomSICutDate)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.CYCutoffTime)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.ManifestCutDate)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.VGMCutoffTime)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.MDGFCutDate)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.PlaceReceipt)) + { + + + + + } + @if (!string.IsNullOrWhiteSpace(@item.PlaceDelivery)) + { + + + + + }
船名/航次:@item.Vessel/@item.Voyno提单号:@item.MBLNo
定舱号码:@item.MBlNo提箱提单号:@item.RealMBLNo
POL:@item.OrigPlaceReceipt
POD:@item.OrigPlaceDelivery
箱型箱量:@item.CtnStat
船名 变更为:@item.Vessel
航次号 变更为:@item.Vessel
ETD 变更为:@item.ETD
ETA 变更为:@item.ETA
样单截止日期 变更为:@item.CustomSICutDate
截港时间 变更为:@item.CYCutoffTime
舱单截止时间 变更为:@item.ManifestCutDate
截VGM时间 变更为:@item.VGMCutoffTime
MDGF提交截止时间 变更为:@item.MDGFCutDate
收货地 变更为:@item.PlaceReceipt
交货地 变更为:@item.PlaceDelivery
@@ -64,3 +147,4 @@ + diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/TaskBCShowBaseDto.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/TaskBCShowBaseDto.cs index c1a71411..61e7a0da 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/TaskBCShowBaseDto.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/TaskBCShowBaseDto.cs @@ -370,6 +370,11 @@ /// 批次号 /// public string BatchNo { get; set; } + + /// + /// 样单截止日期 + /// + public Nullable CustomSICutDate { get; set; } } public class TaskBCShowBaseKeywordDto diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/TaskBCTransferDto.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/TaskBCTransferDto.cs new file mode 100644 index 00000000..d847a1c7 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/TaskBCTransferDto.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.TaskPlat.Dtos +{ + /// + /// + /// + public class TaskBCTransferDto + { + /// + /// 主任务ID + /// + public long TaskPkId { get; set; } + + /// + /// 业务主键 + /// + public long Id { get; set; } + + /// + /// 订舱ID + /// + public Nullable BookingId { get; set; } + + /// + /// 原主单号 + /// + public string OrigMBLNo { get; set; } + + /// + /// 主单号 + /// + public string MBLNo { get; set; } + + /// + /// 真提单号 + /// + public string RealMBLNo { get; set; } + + /// + /// 收货地 + /// + public string PlaceReceipt { get; set; } + + /// + /// 原收货地 + /// + public string OrigPlaceReceipt { get; set; } + + /// + /// 交货地 + /// + public string PlaceDelivery { get; set; } + + /// + /// 原交货地 + /// + public string OrigPlaceDelivery { get; set; } + + /// + /// 箱型箱量 + /// + public string CtnStat { get; set; } + + /// + /// 船名 + /// + public string Vessel { get; set; } + + /// + /// 航次 + /// + public string VoyNo { get; set; } + + /// + /// 船公司 + /// + public string Carrier { get; set; } + + /// + /// ETD(预计离港时间) + /// + public string ETD { get; set; } + + /// + /// ETA(预计到港时间) + /// + public string ETA { get; set; } + + /// + /// 样单截止日期 + /// + public string SICutDate { get; set; } + + /// + /// 截VGM时间 + /// + public string VGMCutoffTime { get; set; } + + /// + /// 舱单截止时间 + /// + public string ManifestCutDate { get; set; } + + /// + /// MDGF提交截止时间 + /// + public string MDGFCutDate { get; set; } + + /// + /// 样单截止日期 + /// + public string CustomSICutDate { get; set; } + + /// + /// 截港时间 + /// + public string CYCutoffTime { get; set; } + + /// + /// 租户ID + /// + public long TenantId { get; set; } + + /// + /// 租户名称 + /// + public string TenantCompanyName { get; set; } + + /// + /// 比对差异标签内容 + /// + public string CompareDiffLabels { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/Mapper/AddTaskPlatMapsterSetup.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/Mapper/AddTaskPlatMapsterSetup.cs index 0d1eac77..ce99e160 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/Mapper/AddTaskPlatMapsterSetup.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/Mapper/AddTaskPlatMapsterSetup.cs @@ -156,7 +156,8 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper .Map(dest => dest.SecondETA, src => src.SECOND_ETA) .Map(dest => dest.BookingSlotId, src => src.BOOKING_SLOT_ID) .Map(dest => dest.BookingConfirmDate, src => src.BOOKING_COMFIRM_DATE) - .Map(dest => dest.BatchNo, src => src.BATCH_NO); + .Map(dest => dest.BatchNo, src => src.BATCH_NO) + .Map(dest => dest.CustomSICutDate, src => src.CUSTOM_SI_CUT_DATE); } // BC子任务箱信息转前端Dto TaskBCCTNInfo, TaskBCCTNInfoDto From c6ec025950638ffe78aeb83f7f6c0b2a509719f9 Mon Sep 17 00:00:00 2001 From: cjy Date: Wed, 4 Sep 2024 18:25:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BD=95=E5=85=A5=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs index 17e36ecd..4af05483 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs @@ -4,6 +4,7 @@ using DS.WMS.Core.Code.Dtos; using DS.WMS.Core.Op.Entity; using Masuit.Tools.Systems; using SqlSugar; +using System.ComponentModel; namespace DS.WMS.Core.Op.Dtos; @@ -1458,4 +1459,10 @@ public class SeaExportRes /// /// public long OrgId { get; set; } + + /// + /// 创建人名称 + /// + [Description("创建人名称")] + public string CreateUserName { get; set; } } \ No newline at end of file From 1c147f416997222aa5c2d96560a55da08b9ed1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Wed, 4 Sep 2024 18:31:04 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8F=91=E8=B5=B7=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E8=AF=81?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Application/Entity/InvoiceDetail.cs | 12 +++++ .../Method/InvoiceApplicationService.cs | 44 ++++++++++++++----- .../DS.WMS.Core/Code/Entity/CodeInvoice.cs | 24 ++++++++++ .../IFeeCustTemplateDetailService.cs | 7 --- .../Method/FeeCustTemplateDetailService.cs | 14 ------ .../Invoice/Method/InvoiceIssuanceService.cs | 7 +++ 6 files changed, 77 insertions(+), 31 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Application/Entity/InvoiceDetail.cs b/ds-wms-service/DS.WMS.Core/Application/Entity/InvoiceDetail.cs index 8e30a353..f465c4ad 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Entity/InvoiceDetail.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Entity/InvoiceDetail.cs @@ -21,6 +21,18 @@ namespace DS.WMS.Core.Application.Entity [SugarColumn(ColumnDescription = "申请单ID", IsNullable = false)] public long ApplicationId { get; set; } + /// + /// 发票商品编码ID + /// + [SugarColumn(ColumnDescription = "发票商品编码ID", IsNullable = true)] + public long? CodeId { get; set; } + + ///// + ///// 发票商品编码 + ///// + //[Navigate(NavigateType.OneToOne, nameof(CodeId))] + //public CodeInvoice? CodeInvoice { get; set; } + /// /// 明细项名称 /// 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 07adac31..6d1cce05 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs @@ -5,6 +5,7 @@ using DS.Module.Core.Extensions; using DS.WMS.Core.Application.Dtos; using DS.WMS.Core.Application.Entity; using DS.WMS.Core.Application.Interface; +using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Info.Entity; @@ -511,7 +512,7 @@ namespace DS.WMS.Core.Application.Method await TenantDb.Deleteable().Where(x => x.ApplicationId == application.Id).ExecuteCommandAsync(); //然后根据申请单明细重新生成 - await CreateInvoiceDetailsAsync([application]); + await FillInvoiceDetailsAsync([application]); if (application.InvoiceDetails?.Count > 0) { @@ -528,8 +529,8 @@ namespace DS.WMS.Core.Application.Method await base.OnSaveAsync(application, fees); } - //生成发票明细 - async Task CreateInvoiceDetailsAsync(IEnumerable applications) + //根据费用明细填充发票明细 + async Task FillInvoiceDetailsAsync(IEnumerable applications) { foreach (var application in applications) { @@ -539,7 +540,8 @@ namespace DS.WMS.Core.Application.Method if (application.Details.Count > 0 && (application.InvoiceDetails == null || application.InvoiceDetails.Count == 0)) { var ids = application.Details.Select(x => x.RecordId).ToList(); - var feesCodes = await TenantDb.Queryable().InnerJoin((f, c) => f.FeeId == c.Id && ids.Contains(f.Id)) + var feesCodes = await TenantDb.Queryable() + .InnerJoin((f, c) => f.FeeId == c.Id && ids.Contains(f.Id)) .Select((f, c) => new { FeeId = c.Id, @@ -551,10 +553,24 @@ namespace DS.WMS.Core.Application.Method Name = x.Key, FeeIds = x.Select(y => y.FeeId) }).ToList(); + + var goodsNames = list.Select(x => x.Name); + var invCodes = await TenantDb.Queryable().Where(x => goodsNames.Contains(x.Name)) + .Select(x => new + { + x.Id, + x.Name, + x.DefaultCurrency, + x.TaxRate, + x.Specification, + x.Unit + }).ToListAsync(); + application.InvoiceDetails = new List(list.Count); foreach (var item in list) { - var invDetail = new InvoiceDetail + var invCode = invCodes.Find(x => x.Name == item.Name); + var detail = new InvoiceDetail { ApplicationId = application.Id, Name = item.Name, @@ -563,10 +579,18 @@ namespace DS.WMS.Core.Application.Method TaxUnitPrice = application.Details.FindAll(x => item.FeeIds.Contains(x.FeeId)).Sum(x => x.ApplyAmount), Category = DetailCategory.InvoiceApplication }; - invDetail.TaxAmount = invDetail.TaxUnitPrice * application.TaxRate; - invDetail.UnitPrice = invDetail.TaxUnitPrice - invDetail.TaxAmount; - invDetail.Amount = invDetail.TaxUnitPrice * invDetail.Quantity; - application.InvoiceDetails.Add(invDetail); + + if (invCode != null) + { + detail.TaxRate = invCode.TaxRate; + detail.Specification = invCode.Specification; + detail.Unit = invCode.Unit; + } + + detail.TaxAmount = detail.TaxUnitPrice * application.TaxRate; + detail.UnitPrice = detail.TaxUnitPrice - detail.TaxAmount; + detail.Amount = detail.TaxUnitPrice * detail.Quantity; + application.InvoiceDetails.Add(detail); } } } @@ -615,7 +639,7 @@ namespace DS.WMS.Core.Application.Method await TenantDb.Deleteable().Where(x => appIds.Contains(x.ApplicationId)).ExecuteCommandAsync(); - await CreateInvoiceDetailsAsync(applications); + await FillInvoiceDetailsAsync(applications); var invDetails = applications.SelectMany(x => x.InvoiceDetails).ToList(); if (invDetails.Count > 0) await TenantDb.Insertable(invDetails).ExecuteCommandAsync(); diff --git a/ds-wms-service/DS.WMS.Core/Code/Entity/CodeInvoice.cs b/ds-wms-service/DS.WMS.Core/Code/Entity/CodeInvoice.cs index f75e2467..9a8c65c9 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Entity/CodeInvoice.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Entity/CodeInvoice.cs @@ -40,12 +40,36 @@ namespace DS.WMS.Core.Code.Entity [SugarColumn(ColumnDescription = "零税率标识")] public ZeroTaxRateIdentification Identification { get; set; } + /// + /// 税收分类编码 + /// + [SugarColumn(ColumnDescription = "税收分类编码", Length = 100, IsNullable = true)] + public string? TaxClassificationCode { get; set; } + + /// + /// 税收分类名称 + /// + [SugarColumn(ColumnDescription = "税收分类名称", Length = 100, IsNullable = true)] + public string? TaxClassificationName { get; set; } + /// /// 是否含税 /// [SugarColumn(ColumnDescription = "是否含税")] public bool IsIncludingTax { get; set; } + /// + /// 是否享受优惠政策 + /// + [SugarColumn(ColumnDescription = "是否享受优惠政策")] + public bool HasPreferentialPolicy { get; set; } + + /// + /// 优惠政策说明 + /// + [SugarColumn(ColumnDescription = "优惠政策说明", Length = 200, IsNullable = true)] + public string? PreferentialPolicyDescription { get; set; } + /// /// 是否默认商品名 /// diff --git a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeCustTemplateDetailService.cs b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeCustTemplateDetailService.cs index a3a8a954..da3c8fef 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeCustTemplateDetailService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeCustTemplateDetailService.cs @@ -22,13 +22,6 @@ public interface IFeeCustTemplateDetailService /// /// Task EditAsync(FeeCustTemplateDetailReq model); - - /// - /// 获取详情 - /// - /// - /// - DataResult GetFeeCustTemplateDetailInfo(string id); /// /// 根据ID批量删除 diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeCustTemplateDetailService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeCustTemplateDetailService.cs index b0444d45..3a2bc6cb 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeCustTemplateDetailService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeCustTemplateDetailService.cs @@ -61,20 +61,6 @@ namespace DS.WMS.Core.Fee.Method } } - /// - /// 详情 - /// - /// - /// - public DataResult GetFeeCustTemplateDetailInfo(string id) - { - var data = TenantDb.Queryable() - .Where(x => x.Id == long.Parse(id)) - .Select() - .First(); - return DataResult.Success(data, MultiLanguageConst.DataQuerySuccess); - } - /// /// 根据ID批量删除 /// diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceIssuanceService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceIssuanceService.cs index 175c13bd..36c030c0 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceIssuanceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceIssuanceService.cs @@ -1,6 +1,7 @@ using DS.Module.Core; using DS.WMS.Core.Application.Method; using DS.WMS.Core.Invoice.Dtos; +using DS.WMS.Core.Sys.Entity; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using SqlSugar; @@ -33,6 +34,12 @@ namespace DS.WMS.Core.Invoice.Method { ArgumentNullException.ThrowIfNull(ids, nameof(ids)); + long userId = long.Parse(User.UserId); + var userInfo = await Db.Queryable().Where(x => x.Id == userId).Select(x => new + { + x.Id, + }).FirstAsync(); + //请求参数设置 InvoiceIssuanceRequest request = new() {