diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs index 764b10ab..0b9b319e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -136,6 +136,12 @@ namespace Win.Sfs.SettleAccount.Bases [UnitOfWork(false)] public virtual async Task ApprovalPassed(List p_list) { + var bussinessType=p_list.FirstOrDefault(); + + + + + return await InvokePD(p_list, _service); } [HttpPost] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index 6e2abfac..35d20ef6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -432,6 +432,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ bj.Extend1 = itm.Extend1;//合同号 bj.VendorCode = itm.GetProperty("VendorCode", "");//供应商代码 bj.VendorName = itm.GetProperty("VendorName", "");//供应商名称 + bj.ContractID = itm.GetProperty("ContractDocID", "");//协议编号 bj.DeliveryNumber = itm.GetProperty("DeliveryNumber", "");//交货号; bj.PN = itm.GetProperty("PN", "");// bj.PO = itm.GetProperty("PO", ""); @@ -483,7 +484,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ TaxAmt = itm.TaxAmt, SettleDate = itm.SettleDate, ProductionGroup = itm.ProductionGroup, - LineCode = itm.LineCode + LineCode = itm.LineCode, + ContractID=itm.ContractID + }; entity.INVOICE_WAIT_DETAIL_BJ = bjquery.OrderBy(p => p.LineCode).ToList(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs index e83e842f..84c0726f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs @@ -80,7 +80,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单 foreach (var itm in priceListbj) { - priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049"}); + priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049", ContractNo=itm.ContractNo}); } } else @@ -117,9 +117,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ MaterialDesc = d.MaterialDesc, PN = d.PN, Qty = d.Qty, - GroupNum = d.GroupNum, + GroupNum = d.GroupNum, Amt = Math.Round(d.Qty * p.Price, 2), - ContractDocID = "no", + ContractDocID = (d.BusinessType != EnumBusinessType.BeiJian) ? string.Empty : p.ContractNo, BeginDate = p.BeginTime, EndDate = p.EndTime, PartCode = d.PartCode,//客户零件号 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index cfa7add5..33a49f40 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -129,8 +129,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs itm.Extend2 = "CC017"; } } - Sync(detailist, EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); - var mdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianHBPO);//买单件 + if(detailist.Count>0) + { + Sync(detailist, EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); + } + + var mdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianHBPO).ToList();//买单件 foreach (var itm in mdetail) { if (string.IsNullOrEmpty(itm.Extend2)) @@ -138,7 +142,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs itm.Extend2 = "CC017"; } } - Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); + if (mdetail.Count > 0) + { + Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); + } + var detailist1 = _dbcontext.Set().Where(p => list.Contains(p.BillNum)).ToList(); var zgbbaclist = detailist1.Where(p => p.BusinessType == EnumBusinessType.ZhiGongJianHBPO).ToList(); foreach (var itm in zgbbaclist) @@ -148,7 +156,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs itm.Extend2 = "CC017"; } } - Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); + if (zgbbaclist.Count > 0) + { + + Sync(zgbbaclist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); + } + } return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs index 1c1ef48e..a860d19a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs @@ -120,7 +120,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task SetBackwardState(string p_billNum, SettleBillState state) { - var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count == 0) { 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 5327e444..c100254d 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 @@ -348,6 +348,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// + [UnitOfWork(false)] public virtual async Task> GetInvoiceListAsync(List invs) { return await _repository.Where(p => invs.Contains(p.InvbillNum)).ToListAsync().ConfigureAwait(false); @@ -611,7 +612,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers partcode: itm.PartCode); entity.ErpLoc = itm.ErpLoc;//补字段库位 entity.PartCode = itm.RealPartCode;//真实零件号 - entityDetail.Add(entity); } } @@ -809,8 +809,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers bbacDetail.Add(entity ); } - await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); - await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(bbacmainlist); + await _repository.DbContext.BulkInsertAsync(bbacDetail); foreach (var itm in invList) { @@ -2249,6 +2249,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers BeginDate = dto1.BeginDate, EndDate = dto1.EndDate, LineCode = dto1.LineCode, + ContractDocID = dto1.ContractDocID, DeliveryNumber = inv1.GetProperty("DeliveryNumber", ""),//交货号 InvoiceNumber = inv1.GetProperty("InvoiceNumber", ""),//发票号 VendorCode = inv1.GetProperty("VendorCode", ""),//供应商代码 @@ -2301,15 +2302,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers beginDate: detail.BeginDate, endDate: detail.EndDate, partcode: detail.PartCode); - entity.LineCode = detail.LineCode; - entity.SetProperty("DeliveryNumber", detail.DeliveryNumber);//交货号 - entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码 - entity.SetProperty("VendorName", detail.VendorName);//供应商名称 - entity.SetProperty("PO", detail.PO);//采购订单号 - entity.SetProperty("DeliveryIndexNumber", detail.DeliveryIndexNumber);//交付索引号 - entity.SetProperty("PartName", detail.PartName);//零件名称 - entity.SetProperty("PartGroup", detail.PartGroup); - entity.SetProperty("PN", detail.PN); + entity.LineCode = detail.LineCode; + + entity.SetProperty("ContractDocID", detail.ContractDocID);//交货号 + entity.SetProperty("DeliveryNumber", detail.DeliveryNumber);//交货号 + entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码 + entity.SetProperty("VendorName", detail.VendorName);//供应商名称 + entity.SetProperty("PO", detail.PO);//采购订单号 + entity.SetProperty("DeliveryIndexNumber", detail.DeliveryIndexNumber);//交付索引号 + entity.SetProperty("PartName", detail.PartName);//零件名称 + entity.SetProperty("PartGroup", detail.PartGroup); + entity.SetProperty("PN", detail.PN); _entityDetailList.Add(entity); } if (_entityDetailList.Count > 0) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs index 7262a234..652f95c9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs @@ -186,7 +186,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } break; } - await _repository.UpdateAsync(p_entiy).ConfigureAwait(false); + await _repository.DbContext.BulkUpdateAsync(new List { p_entiy }).ConfigureAwait(false); return true; } return false; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs index 995c6933..7565beac 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs @@ -41,8 +41,7 @@ namespace SettleAccount.Domain.BQ /// /// 1、JIT 2、买单件 3、备件 3、印度件 /// - [Display(Name = "业务类别")] - public EnumBusinessType BusinessType { get; set; } + //[Display(Name = "发票分组号")] //public string InvGroupNum { get; set; } = null!;