diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js index f0341dad..b48b1723 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js @@ -23,6 +23,14 @@ const schema = { title: "税后金额", type: "number", }, + realAmt: { + title: "税额", + type: "number", + }, + taxDiff: { + title: "税后金额含尾差", + type: "number", + }, invGroupNum: { title: "发票分组号", type: "number", @@ -39,10 +47,6 @@ const schema = { { value: 3, label: "提交" }, ], }, - taxDiff: { - title: "发票税后尾差", - type: "number", - }, clientCode: { title: "客户代码", type: "string", diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index ef620e83..ee4d2f05 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs @@ -335,7 +335,6 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase } bbacSaDetail.PN = Regex.Replace(bbacSaDetail.PN, "['‘’]", ""); }); - return GroupPnLu(bbacSaDetails); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs index 01fceaad..6e6a01c7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs @@ -297,7 +297,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase hbpoSaDetail.CustomerPartCodeNoSpace = hbpoSaDetail.LU.Replace(" ", ""); hbpoSaDetail.Version = Version; }); - return GroupPnLu(hbpoSaDetails); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs index 43a8b815..d01a4f99 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs @@ -406,7 +406,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase } pubSaDetail.PN = Regex.Replace(pubSaDetail.PN, "['‘’]", ""); }); - return GroupPnLu(pubSaDetails); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs new file mode 100644 index 00000000..4a3e7adc --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; + +namespace Win.Sfs.SettleAccount.Enums; + +/// +/// 匹配类型 +/// +public enum EnumMappingType +{ + /// + /// 未定义 + /// + [Display(Name = "未定义")] + None = 0, + /// + /// 完全匹配 + /// + [Display(Name = "完全匹配")] + PerfectMatch = 1 +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs index 02e6cbdc..db1370b0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs @@ -25,12 +25,6 @@ public class JisBBACEidSeCompareExport [ExporterHeader(DisplayName = "类别")] public string Category { get; set; } /// - /// 交货单号 - /// - [Display(Name = "交货单号")] - [ExporterHeader(DisplayName = "交货单号")] - public string WmsBillNum { get; set; } - /// /// 车型 /// [Display(Name = "车型")] @@ -49,42 +43,12 @@ public class JisBBACEidSeCompareExport [ExporterHeader(DisplayName = "生产码序列号日期")] public string SequenceNumber { get; set; } /// - /// ParType - /// - [Display(Name = "ParType")] - [ExporterHeader(DisplayName = "ParType")] - public string ParType { get; set; } - /// - /// 配置码 - /// - [Display(Name = "配置码")] - [ExporterHeader(DisplayName = "配置码")] - public string MESConfigCode { get; set; } - /// - /// 发货日期 - /// - [Display(Name = "发货日期")] - [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] - public DateTime? ShippingDate { get; set; } - /// /// 生产码 /// [Display(Name = "生产码")] [ExporterHeader(DisplayName = "生产码")] public string PN { get; set; } /// - /// 序列号 - /// - [Display(Name = "序列号")] - [ExporterHeader(DisplayName = "序列号")] - public string Seq { get; set; } - /// - /// PJIS日顺序号 - /// - [Display(Name = "PJIS日顺序号")] - [ExporterHeader(DisplayName = "PJIS日顺序号")] - public string PjsNum { get; set; } - /// /// 物料号 /// [Display(Name = "物料号")] @@ -115,6 +79,42 @@ public class JisBBACEidSeCompareExport [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] public decimal DiffQty => SEQty - EdiQty; /// + /// 交货单号 + /// + [Display(Name = "交货单号")] + [ExporterHeader(DisplayName = "交货单号")] + public string WmsBillNum { get; set; } + /// + /// ParType + /// + [Display(Name = "ParType")] + [ExporterHeader(DisplayName = "ParType")] + public string ParType { get; set; } + /// + /// 配置码 + /// + [Display(Name = "配置码")] + [ExporterHeader(DisplayName = "配置码")] + public string MESConfigCode { get; set; } + /// + /// 发货日期 + /// + [Display(Name = "发货日期")] + [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] + public DateTime? ShippingDate { get; set; } + /// + /// 序列号 + /// + [Display(Name = "序列号")] + [ExporterHeader(DisplayName = "序列号")] + public string Seq { get; set; } + /// + /// PJIS日顺序号 + /// + [Display(Name = "PJIS日顺序号")] + [ExporterHeader(DisplayName = "PJIS日顺序号")] + public string PjsNum { get; set; } + /// /// 客户下线时间 /// [Display(Name = "客户下线时间")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOEidSeCompareReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOEidSeCompareReport.cs index ce9e03bc..a4f6f4b6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOEidSeCompareReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOEidSeCompareReport.cs @@ -25,30 +25,66 @@ public class JisHBPOEidSeCompareExport [ExporterHeader(DisplayName = "类别")] public string Category { get; set; } /// - /// 交货单号 - /// - [Display(Name = "交货单号")] - [ExporterHeader(DisplayName = "交货单号")] - public string WmsBillNum { get; set; } - /// - /// CarModeCode + /// 车型 /// - [Display(Name = "CarModeCode")] - [ExporterHeader(DisplayName = "CarModeCode")] + [Display(Name = "车型")] + [ExporterHeader(DisplayName = "车型")] public string CarModeCode { get; set; } /// - /// LineStationcode + /// 生产线 /// - [Display(Name = "LineStationcode")] - [ExporterHeader(DisplayName = "LineStationcode")] + [Display(Name = "生产线")] + [ExporterHeader(DisplayName = "生产线")] public string LineStationcode { get; set; } /// - /// SequenceNumber + /// 生产码序列号日期 /// - [Display(Name = "SequenceNumber")] - [ExporterHeader(DisplayName = "SequenceNumber")] + [Display(Name = "生产码序列号日期")] + [ExporterHeader(DisplayName = "生产码序列号日期")] public string SequenceNumber { get; set; } /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "生产码")] + public string PN { get; set; } + /// + /// 物料号 + /// + [Display(Name = "物料号")] + [ExporterHeader(DisplayName = "物料号")] + public string MaterialNumber { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string MaterialDes { get; set; } + /// + /// WMS发货数量 + /// + [Display(Name = "WMS发货数量")] + [ExporterHeader(DisplayName = "WMS发货数量")] + public decimal SEQty { get; set; } + /// + /// EDI数量 + /// + [Display(Name = "EDI数量")] + [ExporterHeader(DisplayName = "EDI数量")] + public decimal EdiQty { get; set; } + /// + /// WMS发货与EDI数量差 + /// + [Display(Name = "WMS发货与EDI数量差")] + [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] + public decimal DiffQty => SEQty - EdiQty; + /// + /// 交货单号 + /// + [Display(Name = "交货单号")] + [ExporterHeader(DisplayName = "交货单号")] + public string WmsBillNum { get; set; } + /// /// ParType /// [Display(Name = "ParType")] @@ -73,12 +109,6 @@ public class JisHBPOEidSeCompareExport [ExporterHeader(DisplayName = "实际发货生产号")] public string RealCode { get; set; } /// - /// 生产码 - /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "生产码")] - public string PN { get; set; } - /// /// 序列号 /// [Display(Name = "序列号")] @@ -103,36 +133,6 @@ public class JisHBPOEidSeCompareExport [ExporterHeader(DisplayName = "ERP目标库位")] public string ErpToLoc { get; set; } /// - /// 物料号 - /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "物料号")] - public string MaterialNumber { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - /// - /// WMS发货数量 - /// - [Display(Name = "WMS发货数量")] - [ExporterHeader(DisplayName = "WMS发货数量")] - public decimal SEQty { get; set; } - /// - /// EDI数量 - /// - [Display(Name = "EDI数量")] - [ExporterHeader(DisplayName = "EDI数量")] - public decimal EdiQty { get; set; } - /// - /// WMS发货与EDI数量差 - /// - [Display(Name = "WMS发货与EDI数量差")] - [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] - public decimal DiffQty => SEQty - EdiQty; - /// /// 客户下线时间 /// [Display(Name = "客户下线时间")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs index 4809e404..391dfad3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; -using EFCore.BulkExtensions; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.SignalR; using Microsoft.OpenApi.Extensions; @@ -17,7 +16,6 @@ using Volo.Abp.ObjectMapping; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Entities.BQ; -using Win.Sfs.SettleAccount.Enums; using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; using Win.Sfs.Shared.RepositoryBase; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs index a2fb9ce6..ad469c7a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.SignalR; using SettleAccount.Bases; using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; +using Volo.Abp; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Consts; using Win.Sfs.SettleAccount.Enums; @@ -173,6 +174,38 @@ namespace SettleAccount.Job.Services.Report } } + /// + /// 处理发运数据 + /// 结算、发运对比上的数据修改结算数据状态 + /// + public virtual void HandLeSaDetailsMain(List pubSaSeCompareDiffs, EnumBusinessType businessType, int version) where T : SA_BASE + { + var haveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe); + if (haveSaHaveSes.Any()) + { + //结算详情 + var saDetails = (from sa in _settleAccountDbContext.Set() + where sa.BusinessType == businessType && sa.Version == version + select sa).ToList(); + if (saDetails.Any()) + { + var saDetailsUpdate = saDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, LU = i.CustomerPartCode }, (o, i) => + { + var mappingType = (i.SAQty - i.SEQty) switch + { + > 0 => EnumMappingType.None, + 0 => EnumMappingType.PerfectMatch, + < 0 => EnumMappingType.None, + _ => default, + }; + o.ExtraProperties.Add("MappingType", mappingType); + return o; + }).ToList(); + _settleAccountDbContext.BulkUpdate(saDetailsUpdate); + } + } + } + /// /// 创建导出文件结构 ///