From 1efce7b5b1bd0912d853d493f107a6a710a8e4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 1 Nov 2023 14:27:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B0=83=E6=95=B4=E8=A1=A8?= =?UTF-8?q?=E6=B2=A1=E6=9C=89ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/README.md | 66 +++++++++++++++++++ .../Entities/BQ/BBAC_BA_SERVICE.cs | 11 ++-- .../Entities/BQ/HBPO_BA_SERVICE.cs | 2 + .../Entities/BQ/HBPO_PD_SERVICE.cs | 2 + .../Entities/BQ/PUB_BA_SERVICE.cs | 13 +--- .../Entities/BQ/Managers/INV_MNG.cs | 1 + .../Entities/BQ/PUB_ADJ_DETAIL.cs | 6 ++ 7 files changed, 85 insertions(+), 16 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md index 53ab4401..ad739b2f 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md @@ -700,10 +700,76 @@ deallocate mycursor GO +/* 为了防止任何可能出现的数据丢失问题,您应该先仔细检查此脚本,然后再在数据库设计器的上下文之外运行此脚本。*/ +BEGIN TRANSACTION +SET QUOTED_IDENTIFIER ON +SET ARITHABORT ON +SET NUMERIC_ROUNDABORT OFF +SET CONCAT_NULL_YIELDS_NULL ON +SET ANSI_NULLS ON +SET ANSI_PADDING ON +SET ANSI_WARNINGS ON +COMMIT +BEGIN TRANSACTION +GO +ALTER TABLE dbo.Set_HBPO_SE_EDI ADD + State int NULL +GO +ALTER TABLE dbo.Set_HBPO_SE_EDI SET (LOCK_ESCALATION = TABLE) +GO +COMMIT + +/* 为了防止任何可能出现的数据丢失问题,您应该先仔细检查此脚本,然后再在数据库设计器的上下文之外运行此脚本。*/ +BEGIN TRANSACTION +SET QUOTED_IDENTIFIER ON +SET ARITHABORT ON +SET NUMERIC_ROUNDABORT OFF +SET CONCAT_NULL_YIELDS_NULL ON +SET ANSI_NULLS ON +SET ANSI_PADDING ON +SET ANSI_WARNINGS ON +COMMIT +BEGIN TRANSACTION +GO +ALTER TABLE dbo.Set_HBPO_SE_EDI ADD + State int NULL +GO +ALTER TABLE dbo.Set_HBPO_SE_EDI ADD CONSTRAINT + DF_Set_HBPO_SE_EDI_State DEFAULT 0 FOR State +GO +ALTER TABLE dbo.Set_HBPO_SE_EDI SET (LOCK_ESCALATION = TABLE) +GO +COMMIT + + +/* 为了防止任何可能出现的数据丢失问题,您应该先仔细检查此脚本,然后再在数据库设计器的上下文之外运行此脚本。*/ +BEGIN TRANSACTION +SET QUOTED_IDENTIFIER ON +SET ARITHABORT ON +SET NUMERIC_ROUNDABORT OFF +SET CONCAT_NULL_YIELDS_NULL ON +SET ANSI_NULLS ON +SET ANSI_PADDING ON +SET ANSI_WARNINGS ON +COMMIT +BEGIN TRANSACTION +GO +ALTER TABLE dbo.Set_BBAC_SE_EDI ADD + State int NULL +GO +ALTER TABLE dbo.Set_BBAC_SE_EDI ADD CONSTRAINT + DF_Set_HBPO_SE_EDI_State DEFAULT 0 FOR State +GO +ALTER TABLE dbo.Set_HBPO_SE_EDI SET (LOCK_ESCALATION = TABLE) +GO +COMMIT + + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index 0f43731f..57bdd48b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -344,9 +344,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var first = p_list.FirstOrDefault(); var invbillnum = first.InvBillNum; - - - var version = int.Parse(DateTime.Now.ToString("yyyymm")); var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); @@ -375,10 +372,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var relist= relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); + + + foreach (var itm in adjlist) { + + itm.SetId(GuidGenerator.Create()); + bbaclist.Add(new BBAC_CAN_SA_DETAIL( - guid: itm.Id, + guid: GuidGenerator.Create(), keyCode: itm.KeyCode, version: itm.Version, billNum: itm.InvGroupNum, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs index 267d6fe0..56d1823a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs @@ -364,6 +364,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } foreach (var itm in adjlist) { + itm.SetId(GuidGenerator.Create()); + hbpolist.Add(new HBPO_CAN_SA_DETAIL( guid: GuidGenerator.Create(), keyCode: itm.KeyCode, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs index 6ee928af..33d6b256 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs @@ -25,6 +25,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ HBPO_PD_DETAIL, HBPO_PD_DETAIL_DTO, HBPO_PD_REQ_DTO, HBPO_PD_DETAIL_REQ_DTO, HBPO_PD_DETAIL_EXP_DTO> { + + public HBPO_PD_SERVICE(INormalEfCoreRepository bbacSecRepository, INormalEfCoreRepository hbpoSecRepository, INormalEfCoreRepository pubSecRepository, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository repository, VmiAppService vimservice, INormalEfCoreRepository detailRepository, TaskJobService service, INormalEfCoreRepository invRepository) : base(bbacSecRepository, hbpoSecRepository, pubSecRepository, excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository, service, invRepository) { } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs index 95d7d1c4..b5313962 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs @@ -303,18 +303,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ foreach (var itm in adjlist) { - //{ "ContractDocID":"2200674763", - // "DeliveryNumber":"180054628", - // "VendorCode":"15663496", - // "VendorName":"", - // "PO":"4500028814", - // "DeliveryIndexNumber": - // "5600153638", - // "PartName":"\u9970\u4EF6", - // "PartGroup":"EXT", - // "PN":"15663496_231237", - // "SettleDate":"06/01/2023 00:00:00" - // } + itm.SetId(GuidGenerator.Create()); var entity = new PUB_CAN_SA_DETAIL( guid: GuidGenerator.Create(), keyCode: itm.KeyCode, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs index 4f9520ac..fe8c4e41 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs @@ -1304,6 +1304,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList(); foreach (var detail in adjdetails) { + detail.InvBillNum = key; adjlist.Add(detail); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs index 97492391..1c8fcfeb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs @@ -70,6 +70,12 @@ namespace SettleAccount.Domain.BQ [Display(Name = "是否是买单件")] public bool IsMaiDan { get; set; } + + public void SetId(Guid guid) + { + Id= guid; + } + public PUB_ADJ_DETAIL(Guid id, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, string extend1, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum, string oldinv, string inv, string partcode)