From 8ace5d9a12887fe4ea6ab0377cf50d91a88ad252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 8 Sep 2023 13:56:10 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 2 +- .../Bases/ADJ_SERVICE.cs | 2 +- .../Bases/BA_SERVICE.cs | 4 +- .../Bases/CAN_SA_SERVICE.cs | 28 +- .../Entities/BQ/BBAC_BA_SERVICE.cs | 87 +++--- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 25 +- .../Entities/BQ/BBAC_NOT_SA_SERVICE.cs | 2 +- .../Entities/BQ/BBAC_SA_SERVICE.cs | 2 +- .../Entities/BQ/HBPO_BA_SERVICE.cs | 225 ++++++++------- .../Entities/BQ/HBPO_CAN_SA_SERVICE.cs | 17 +- .../Entities/BQ/HBPO_NOT_SA_SERVICE.cs | 2 +- .../Entities/BQ/HBPO_SA_SERVICE.cs | 4 +- .../Entities/BQ/INVOICE_SERVICE.cs | 17 +- .../Entities/BQ/PUB_BA_SERVICE.cs | 261 +++++++++++------- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 40 ++- .../Entities/BQ/PUB_NOT_SA_SERVICE.cs | 2 +- .../Entities/BQ/PUB_SA_SERVICE.cs | 8 +- .../Entities/BQ/PURCHASE_PRICE_SERVICE.cs | 2 +- .../BQ/Syncs/JisBBACSeEdiCompareAppService.cs | 5 - .../BQ/TB_RePartsRelationship_SERVICE.cs | 2 +- .../MaterialRelationshipAppService.cs | 2 +- .../Entities/BQ/Managers/INV_MNG_EXT.cs | 84 +++--- 22 files changed, 476 insertions(+), 347 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs index 0e6a4f29..1f7b77a5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs @@ -90,7 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "税后金额")] public decimal TaxAmt { get; set; } - [Display(Name = "金税发票金额")] + [Display(Name = "税额")] public decimal RealAmt { get; set; } /// ///发票分组号 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs index 5d085ff5..3615febe 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs @@ -275,7 +275,7 @@ public class ADJ_SERVICE : BASE_SERVICE } if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message= "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); } List ls = new List(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index 20f754c1..523fb058 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -473,7 +473,7 @@ namespace Win.Sfs.SettleAccount.Bases throw new BusinessException("8989", "生成失败,请检查调整表和旧发票内容"); } - + [UnitOfWork(false)] /// /// hbpo、jit、备件等 /// @@ -493,7 +493,7 @@ namespace Win.Sfs.SettleAccount.Bases } - + [UnitOfWork(false)] /// /// 第一次开票 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index 98b1cc9b..7e37ee37 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -258,17 +258,43 @@ namespace Win.Sfs.SettleAccount.Bases /// protected async Task> CheckInvoiceGenerationRules(List dto1s, List p_pricelist,EnumBusinessType p_businessType) where T : SA_CAN_BASE { + + var maxDate = p_pricelist.Max(p => p.Date); + + var prices = p_pricelist.Where(p => p.Date == maxDate).ToList(); + var inner = from d in dto1s - join p in p_pricelist on d.LU equals p.LU + join p in prices on d.LU equals p.LU where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime select d; + var ls = inner.ToList(); var left = from d in dto1s join p in inner on new { d.LU, d.PN } equals new { p.LU, p.PN } into temp from tm in temp.DefaultIfEmpty()//校验错误项 where tm == null select d; + + + + + //var maxDate = p_pricelist.Max(p => p.Date); + + //var left = from a in dto1s + // join b in (from p in p_pricelist + // where p.Date == maxDate + // select p) on a.LU equals b.LU into joinedResult + // from jr in joinedResult.DefaultIfEmpty() + // where a.SettleDate >= jr.BeginTime && a.SettleDate <= jr.EndTime && jr.LU == null + // select a; + + + + + + + List errorList = new List (); string name = string.Empty; string keyname = string.Empty; 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 35f4ca01..ec0a6cb1 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 @@ -15,6 +15,7 @@ using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Services; using Volo.Abp.ObjectMapping; +using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; @@ -151,16 +152,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 var priceList = _priceRepository.ToList();//价格单 - - priceList.GroupBy(p => new { p.BeginTime, p.EndTime }).Select(p => p.First()); - - + // priceList.GroupBy(p => new { p.BeginTime, p.EndTime }).Select(p => p.First()); var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode,Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); } var dto1s = ObjectMapper.Map, List>(entitys); @@ -288,7 +286,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList =await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); } var dto1s = ObjectMapper.Map, List>(entitys); @@ -343,15 +341,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } [HttpPost] + [UnitOfWork(false)] /// /// 发票重开列表 /// /// /// - public virtual async Task ReissueInvoiceList(List p_list) + public virtual async Task> ReissueInvoiceList(List p_list) { - - var invBill = new INVOICE_REPEAT_DTO(); + + var invBilllist = new List(); var adjlist=ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count==0) { @@ -423,7 +422,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //} var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s - join p in priceList on d.PartCode equals p.LU + join p in priceList on d.LU equals p.LU where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 select new TEMP_CAN_SA_DETAIL { @@ -452,38 +451,54 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); - var ls = ObjectMapper.Map, List>(entities); - - var tax = inv.Tax; - var amt = entities.Sum(p => p.Amt); - var taxamt =amt+ Math.Round(amt * tax, 2); - var billnum = string.Empty; - invBill.Amt = amt; - invBill.TaxAmt = taxamt; - invBill.Tax = tax; - invBill.BusinessType=inv.BusinessType; - invBill.DETIAL = ls; - - + + if (ls.Count > 0) + { + var invlist = ls.Select(p => p.InvbillNum).Distinct(); + foreach (var itm in invlist) + { + var invBill = new INVOICE_REPEAT_DTO(); + var invls= ls.Where(p => p.InvbillNum == itm).ToList(); + var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + var tax = inv.Tax;//税率 + var amt = entitylist.Sum(p => p.Amt);//税前 + var taxamt = amt + Math.Round(amt * tax, 2);//税后 + var realamt = Math.Round(amt*tax,2);//税额 + invBill.Amt = amt; + invBill.TaxAmt = taxamt; + invBill.Tax = tax; + invBill.BusinessType = inv.BusinessType; + invBill.DETIAL =invls ; + invBill.RealAmt = realamt; + invBilllist.Add(invBill); + } + } } else//二次开票 { var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); var ls = ObjectMapper.Map, List>(entities); - - var tax = inv.Tax; - var amt = entities.Sum(p => p.Amt); - var taxamt = amt + Math.Round(amt * tax, 2); - var billnum = string.Empty; - invBill.Amt = amt; - invBill.TaxAmt = taxamt; - invBill.Tax = tax; - invBill.BusinessType = inv.BusinessType; - invBill.DETIAL = ls; + + var invlist = ls.Select(p => p.InvbillNum).Distinct(); + foreach (var itm in invlist) + { + var invBill = new INVOICE_REPEAT_DTO(); + var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + var tax = inv.Tax;//税率 + var amt = entitylist.Sum(p => p.Amt);//税前 + var taxamt = amt + Math.Round(amt * tax, 2);//税后 + var realamt = Math.Round(amt * tax, 2);//税额 + invBill.Amt = amt; + invBill.TaxAmt = taxamt; + invBill.Tax = tax; + invBill.BusinessType = inv.BusinessType; + invBill.DETIAL = invls; + invBill.RealAmt = realamt; + invBilllist.Add(invBill); + } } } } @@ -496,7 +511,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException($"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return invBill; + return invBilllist; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index d18e85a4..681d6545 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -87,32 +87,33 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task GenerateInvoice([FromBody] string invbillNum) { var main =await _bbacMng.GetMainAsync(invbillNum); - if (main != null) { if (main.State != SettleBillState.未结状态) { return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } - if (await _bbacMng.SetForwardState(main, SettleBillState.已开票)) + var entitys = await _bbacMng.GetDetalListAsync(invbillNum);//可结算 + var priceList = _priceRepository.ToList(); + var datetime = priceList.Select(p => p.Date).Max(); + var prices = priceList.Where(p => p.Date == datetime).ToList(); + ;//价格单 + var errorList = await CheckInvoiceGenerationRules(entitys, prices, main.BusinessType);//校验生成规则 + if (errorList.Count() > 0) { - var entitys = await _bbacMng.GetDetalListAsync(invbillNum);//可结算 + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + } + if (await _bbacMng.SetForwardState(main, SettleBillState.已开票)) + { var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); - var notQuery = _notRepository.Where(p => groupNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.ToList();//价格单 - var errorList = await CheckInvoiceGenerationRules(entitys, priceList,main.BusinessType);//校验生成规则 - if (errorList.Count() > 0) - { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); - } + var notQuery = _notRepository.Where(p => groupNumList.Contains(p.GroupNum)).ToList();//不能结算 var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s - join p in priceList on d.LU equals p.LU + join p in prices on d.LU equals p.LU where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime select new TEMP_CAN_SA_DETAIL { - SettleBillNum = d.SettleBillNum, Site = d.Site, Version = d.Version, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs index 0061cfa3..d881a771 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs @@ -61,7 +61,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorlist) }); } } return new JsonResult(new { Code = 200, Message = "生成成功" }); 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 ee4d2f05..490401be 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 @@ -175,7 +175,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message= "请下载错误信息", fileName = fileName }); } #endregion 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 8bf67c65..be53ba10 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 @@ -115,13 +115,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); ; } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys - join p in priceList on d.PartCode equals p.LU + join p in priceList on d.LU equals p.LU where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime select new TEMP_CAN_SA_DETAIL { @@ -243,7 +243,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -304,9 +304,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public virtual async Task> ReissueInvoiceList( List p_list) + public virtual async Task> ReissueInvoiceList(List p_list) { - List ls = new List(); + var invBilllist = new List(); var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) @@ -319,120 +319,153 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) //{ - var version = int.Parse(DateTime.Now.ToString("yyyymm")); - //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + var version = int.Parse(DateTime.Now.ToString("yyyymm")); + //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + var inv = await GetInvoiceGroupByInvBillNum(invbillnum); - var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum); + var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum); - if (settle == null) + if (settle == null) + { + throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); + } + version = settle.Version; + if (inv != null) + { + if (inv.InvoiceState == InvoiceBillState.报废) { - throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!","400"); + throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!", "400"); } - version = settle.Version; - if (inv != null) + if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) { - if (inv.InvoiceState == InvoiceBillState.报废) - { - throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!","400"); - } - if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) + throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); + } + + var bbaclist = await _hbpoMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count() > 0) + { + foreach (var itm in adjlist) { - throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!","400"); + bbaclist.Add(new HBPO_CAN_SA_DETAIL( + guid: itm.Id, + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + businessType: itm.BusinessType, + + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + + invbillnum: string.Empty, + partcode: itm.PartCode + )); } + } + var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - var bbaclist = await _hbpoMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + var priceList = _priceRepository.ToList();//价格单 + //var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); + //if (errorList.Count() > 0) + //{ + // return await ExportErrorReportAsync(errorList); + //} + var dto1s = ObjectMapper.Map, List>(entitys); + var q = from d in dto1s + join p in priceList on d.PartCode equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 + select new TEMP_CAN_SA_DETAIL + { + Id = d.Id, + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = "N", + BeginDate = p.BeginTime, + EndDate = p.EndTime, + PartCode = d.PartCode + + }; + var dtos = q.ToList(); + if (dtos != null && dtos.Count > 0) + { + if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - foreach (var itm in adjlist) + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var ls = ObjectMapper.Map, List>(entities); + var invlist = ls.Select(p => p.InvbillNum).Distinct(); + foreach (var itm in invlist) { - bbaclist.Add(new HBPO_CAN_SA_DETAIL( - guid: itm.Id, - keyCode: itm.KeyCode, - version: itm.Version, - billNum: itm.InvGroupNum, - settleBillNum: itm.SettleBillNum, - lU: itm.LU, - pN: itm.PN, - site: itm.Site, - qty: itm.Qty, - price: itm.Price, - businessType: itm.BusinessType, - - settleDate: itm.SettleDate, - groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, - - invbillnum: string.Empty, - partcode: itm.PartCode - )); + var invBill = new INVOICE_REPEAT_DTO(); + var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + var tax = inv.Tax;//税率 + var amt = entitylist.Sum(p => p.Amt);//税前 + var taxamt = amt + Math.Round(amt * tax, 2);//税后 + var realamt = Math.Round(amt * tax, 2);//税额 + invBill.Amt = amt; + invBill.TaxAmt = taxamt; + invBill.Tax = tax; + invBill.BusinessType = inv.BusinessType; + invBill.DETIAL = invls; + invBill.RealAmt = realamt; + invBilllist.Add(invBill); } } - var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 - var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - - var priceList = _priceRepository.ToList();//价格单 - //var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); - //if (errorList.Count() > 0) - //{ - // return await ExportErrorReportAsync(errorList); - //} - var dto1s = ObjectMapper.Map, List>(entitys); - var q = from d in dto1s - join p in priceList on d.PartCode equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 - select new TEMP_CAN_SA_DETAIL - { - Id = d.Id, - SettleBillNum = d.SettleBillNum, - Site = d.Site, - Version = d.Version, - Price = p.Price, - BillNum = d.BillNum, - SettleDate = d.SettleDate, - InvGroupNum = d.InvGroupNum, - LU = d.LU, - MaterialDesc = d.MaterialDesc, - PN = d.PN, - Qty = d.Qty, - GroupNum = d.GroupNum, - Amt = Math.Round(d.Qty * p.Price, 2), - ContractDocID = "N", - BeginDate = p.BeginTime, - EndDate = p.EndTime, - PartCode = d.PartCode - - }; - var dtos = q.ToList(); - if (dtos != null && dtos.Count > 0) + else//二次开票 { - if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var ls = ObjectMapper.Map, List>(entities); + var invlist = ls.Select(p => p.InvbillNum).Distinct(); + foreach (var itm in invlist) { - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); - - ls = ObjectMapper.Map, List>(entities); - - + var invBill = new INVOICE_REPEAT_DTO(); + var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + var tax = inv.Tax;//税率 + var amt = entitylist.Sum(p => p.Amt);//税前 + var taxamt = amt + Math.Round(amt * tax, 2);//税后 + var realamt = Math.Round(amt * tax, 2);//税额 + invBill.Amt = amt; + invBill.TaxAmt = taxamt; + invBill.Tax = tax; + invBill.BusinessType = inv.BusinessType; + invBill.DETIAL = invls; + invBill.RealAmt = realamt; + invBilllist.Add(invBill); } - else//二次开票 - { - var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); - ls = ObjectMapper.Map, List>(entities); - } } } - else - { - throw new UserFriendlyException($"不存发票号为:{invbillnum}发票","400"); - } + } + else + { + throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); + } //} //else //{ // throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号"); //} - return ls; + return invBilllist; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs index c0defb0d..7549e87b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs @@ -87,18 +87,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } + var entitys = await _hbpoMng.GetDetalListAsync(invbillnum); + var priceList = _priceRepository.ToList();//价格单 + var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 + if (errorList.Count() > 0) + { + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + } + if (await _hbpoMng.SetForwardState(main, SettleBillState.已开票)) { - var entitys = await _hbpoMng.GetDetalListAsync(invbillnum); + var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var notQuery = _notRepository.Where(p => groupNumList.Contains(p.GroupNum)).ToList(); - - var priceList = _priceRepository.ToList();//价格单 - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 - if (errorList.Count() > 0) - { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); - } var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs index 11422a08..39ff9027 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs @@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorlist) }); } } return new JsonResult(new { Code = 200, Message = "生成成功" }); 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 6e6a01c7..93f7db6c 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 @@ -230,7 +230,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } #endregion @@ -269,7 +269,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } #endregion 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 ff3a8438..34b87e8c 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 @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Management; using System.Reflection; using System.Text; using System.Threading.Tasks; @@ -110,7 +111,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } if (errors.Count() > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errors) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errors) }); } } await _invMng.SetForwardState(p_invs, SettleBillState.财务已审核); @@ -161,7 +162,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var wquery = from itm in AMap join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp - select from tm in temp.DefaultIfEmpty() + from tm in temp.DefaultIfEmpty() select new INVOICE_WAIT_DETAIL_BBAC_DTO() { @@ -181,7 +182,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BeginDate = itm.BeginDate, EndDate = itm.EndDate, }; - entity.INVOICE_WAIT_DETAIL_BBAC = AMap; + entity.INVOICE_WAIT_DETAIL_BBAC = wquery.ToList(); } else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) { @@ -191,7 +192,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var wquery = from itm in BMap join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp - select from tm in temp.DefaultIfEmpty() + from tm in temp.DefaultIfEmpty() select new INVOICE_WAIT_DETAIL_BJ_DTO() { @@ -211,7 +212,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BeginDate = itm.BeginDate, EndDate = itm.EndDate, }; - entity.INVOICE_WAIT_DETAIL_BJ = BMap; + entity.INVOICE_WAIT_DETAIL_BJ = wquery.ToList(); } else { @@ -221,7 +222,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var wquery = from itm in wdtos join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp - select from tm in temp.DefaultIfEmpty() + from tm in temp.DefaultIfEmpty() select new INVOICE_WAIT_DETAIL_DTO() { @@ -243,7 +244,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ EndDate = itm.EndDate, }; - entity.INVOICE_WAIT_DETAIL = wdtos; + entity.INVOICE_WAIT_DETAIL= wquery.ToList(); } var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); @@ -437,6 +438,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (number + 1 > lineN) { INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); + + entity.RealInvBillNum = lsC[number].RealInvBillNum; entity.InvDate = lsC[number].InvDate; entity.InvBillNum = lsC[number].InvBillNum; 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 ee7cce20..c23aeb93 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 @@ -32,18 +32,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly INormalEfCoreRepository _priceRepository; - + private readonly INormalEfCoreRepository _pricebjRepository; public PUB_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository pubRepository, INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, INormalEfCoreRepository adjRepository, BBAC_CAN_SA_MNG bbacMng, HBPO_CAN_SA_MNG hbpoMng, PUB_CAN_SA_MNG pubMng, INV_MNG invMng, TaskJobService service, BaseDomainService baseservice, - INormalEfCoreRepository priceRepository + INormalEfCoreRepository priceRepository, + INormalEfCoreRepository pricebjRepository ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service,baseservice) { _priceRepository = priceRepository; + _pricebjRepository = pricebjRepository; } @@ -124,11 +126,28 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.ToList();//价格单 + + List priceList = new List(); + if (inv.BusinessType == EnumBusinessType.BeiJian) + { + var priceListbj = _pricebjRepository.ToList();//价格单 + foreach (var itm in priceListbj) + { + priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price }); + } + } + else + { + priceList = _priceRepository.ToList();//价格单 + } + + + var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); + if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -161,6 +180,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { await ReissueFirstInvoice(publist, adjlist, dtos, version, invbillnum); + + + + + } else//二次开票 { @@ -240,8 +264,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invbillnum: string.Empty, partcode:itm.PartCode, pobillnum:string.Empty - - )); } } @@ -249,12 +271,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.ToList();//价格单 var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -310,11 +331,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public virtual async Task> ReissueInvoiceList(List p_list) + public virtual async Task> ReissueInvoiceList(List p_list) { - var first=p_list.FirstOrDefault(); - var invbillnum=first.InvBillNum; + var first = p_list.FirstOrDefault(); + var invbillnum = first.InvBillNum; + + var invBilllist = new List(); + List ls = new List(); var adjlist = ObjectMapper.Map, List>(p_list); @@ -326,121 +350,156 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) //{ - var version = int.Parse(DateTime.Now.ToString("yyyymm")); - //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + var version = int.Parse(DateTime.Now.ToString("yyyymm")); + //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + var inv = await GetInvoiceGroupByInvBillNum(invbillnum); - var settle = await _pubMng.GetMainAsync(inv.InvGroupNum); + var settle = await _pubMng.GetMainAsync(inv.InvGroupNum); - if (settle == null) + if (settle == null) + { + throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); + } + version = settle.Version; + if (inv != null) + { + if (inv.InvoiceState == InvoiceBillState.报废) { - throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); + throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!", "400"); } - version = settle.Version; - if (inv != null) + if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) { - if (inv.InvoiceState == InvoiceBillState.报废) - { - throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!", "400"); - } - if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) - { - throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); - } + throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); + } - var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count() > 0) + { + foreach (var itm in adjlist) { - foreach (var itm in adjlist) - { - bbaclist.Add(new PUB_CAN_SA_DETAIL( - guid: itm.Id, - keyCode: itm.KeyCode, - version: itm.Version, - billNum: itm.InvGroupNum, - settleBillNum: itm.SettleBillNum, - lU: itm.LU, - pN: itm.PN, - site: itm.Site, - qty: itm.Qty, - price: itm.Price, - businessType: itm.BusinessType, + bbaclist.Add(new PUB_CAN_SA_DETAIL( + guid: itm.Id, + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + businessType: itm.BusinessType, - settleDate: itm.SettleDate, - groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, - invbillnum: string.Empty, - partcode: itm.PartCode, - pobillnum:string.Empty - )); - } + invbillnum: string.Empty, + partcode: itm.PartCode, + pobillnum: string.Empty + )); } - var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 - var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - - var priceList = _priceRepository.ToList();//价格单 - //var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); - //if (errorList.Count() > 0) - //{ - // return await ExportErrorReportAsync(errorList); - //} - var dto1s = ObjectMapper.Map, List>(entitys); - var q = from d in dto1s - join p in priceList on d.PartCode equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 - select new TEMP_CAN_SA_DETAIL - { - Id = d.Id, - SettleBillNum = d.SettleBillNum, - Site = d.Site, - Version = d.Version, - Price = p.Price, - BillNum = d.BillNum, - SettleDate = d.SettleDate, - InvGroupNum = d.InvGroupNum, - LU = d.LU, - MaterialDesc = d.MaterialDesc, - PN = d.PN, - Qty = d.Qty, - GroupNum = d.GroupNum, - Amt = Math.Round(d.Qty * p.Price, 2), - ContractDocID = "N", - BeginDate = p.BeginTime, - EndDate = p.EndTime, - PartCode = d.PartCode + } + var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - }; - var dtos = q.ToList(); - if (dtos != null && dtos.Count > 0) - { - if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 + var priceList = _priceRepository.ToList();//价格单 + //var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); + //if (errorList.Count() > 0) + //{ + // return await ExportErrorReportAsync(errorList); + //} + var dto1s = ObjectMapper.Map, List>(entitys); + var q = from d in dto1s + join p in priceList on d.PartCode equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 + select new TEMP_CAN_SA_DETAIL { - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + Id = d.Id, + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = "N", + BeginDate = p.BeginTime, + EndDate = p.EndTime, + PartCode = d.PartCode - ls = ObjectMapper.Map, List>(entities); + }; + var dtos = q.ToList(); + if (dtos != null && dtos.Count > 0) + { + if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 + { + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + ls = ObjectMapper.Map, List>(entities); + var invlist = ls.Select(p => p.InvbillNum).Distinct(); + foreach (var itm in invlist) + { + var invBill = new INVOICE_REPEAT_DTO(); + var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + var tax = inv.Tax;//税率 + var amt = entitylist.Sum(p => p.Amt);//税前 + var taxamt = amt + Math.Round(amt * tax, 2);//税后 + var realamt = Math.Round(amt * tax, 2);//税额 + invBill.Amt = amt; + invBill.TaxAmt = taxamt; + invBill.Tax = tax; + invBill.BusinessType = inv.BusinessType; + invBill.DETIAL = invls; + invBill.RealAmt = realamt; + invBilllist.Add(invBill); } - else//二次开票 + } + else//二次开票 + { + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + ls = ObjectMapper.Map, List>(entities); + var invlist = ls.Select(p => p.InvbillNum).Distinct(); + foreach (var itm in invlist) { - var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); - ls = ObjectMapper.Map, List>(entities); - + var invBill = new INVOICE_REPEAT_DTO(); + var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + var tax = inv.Tax;//税率 + var amt = entitylist.Sum(p => p.Amt);//税前 + var taxamt = amt + Math.Round(amt * tax, 2);//税后 + var realamt = Math.Round(amt * tax, 2);//税额 + invBill.Amt = amt; + invBill.TaxAmt = taxamt; + invBill.Tax = tax; + invBill.BusinessType = inv.BusinessType; + invBill.DETIAL = invls; + invBill.RealAmt = realamt; + invBilllist.Add(invBill); } + } } - else - { - throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); - } + } + else + { + throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); + } //} //else //{ // throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号"); //} - return ls; + return invBilllist; } 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 4a424a05..2c46017a 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 @@ -77,29 +77,29 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } - if (await _pubMng.SetForwardState(main, SettleBillState.已开票)) + var entitys = await _pubMng.GetDetalListAsync(billnum); + List priceList = new List(); + if (main.BusinessType == EnumBusinessType.BeiJian) { - var entitys = await _pubMng.GetDetalListAsync(billnum); - var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - List priceList = new List(); - if (main.BusinessType == EnumBusinessType.BeiJian) + var priceListbj = _pricebjRepository.ToList();//价格单 + foreach (var itm in priceListbj) { - var priceListbj = _pricebjRepository.ToList();//价格单 - foreach (var itm in priceListbj) - { - priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price }); - } - } - else - { - priceList = _priceRepository.ToList();//价格单 - } - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 - if (errorList.Count() > 0) - { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price }); } + } + else + { + priceList = _priceRepository.ToList();//价格单 + } + var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 + if (errorList.Count() > 0) + { + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + } + if (await _pubMng.SetForwardState(main, SettleBillState.已开票)) + { + var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU @@ -130,9 +130,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (billnum.Substring(0, 1) == "C")//一次开票 { - await FirstInvoice(entitys, new List(), dtos, new List(), main.Version, main.InvGroupNum, string.Empty, main.BusinessType); - } else//二次开票 { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs index a383ab95..b57ac692 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs @@ -61,7 +61,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorlist) }); } } 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 d01a4f99..c883354a 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 @@ -244,7 +244,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } #endregion @@ -281,7 +281,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } #endregion @@ -311,7 +311,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } #endregion @@ -342,7 +342,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase if (checkList.Count > 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } #endregion diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs index 4186abef..08ba22cb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs @@ -73,7 +73,7 @@ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase 0) { string fileName = await ExportErrorReportAsync(checkList); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } foreach (var itm in _ls) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs index c75341b6..29e7155e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs @@ -34,12 +34,9 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable { using var serviceScope = _serviceProvider.CreateScope(); var db = serviceScope.ServiceProvider.GetRequiredService(); - await HandDelEdiDataAsync().ConfigureAwait(false); - var seDetailGroup = db.Set().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace }); var ediDetailGroup = db.Set().Where(t => t.IsDeleted == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }); - var keyCodes = from se in seDetailGroup from edi in ediDetailGroup where se.PN == edi.PN && se.LU == edi.LU @@ -52,7 +49,6 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable from keyCode in keyCodes where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false select edi; - var seDetails = seDetailsQuery.Take(5000).ToList(); var ediDetails = ediDetailsQuery.Take(5000).ToList(); seDetails.ForEach(t => t.IsHaveEdiData = true); @@ -92,7 +88,6 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable var db = serviceScope.ServiceProvider.GetRequiredService(); //Edi 删除的数据(有发运数据) var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).Select(t => new { t.PN, t.LU }).Distinct().ToList(); - if (ediDelKeyCodes.Any()) { var seDetails = db.Set().Join(ediDelKeyCodes, a => new { a.PN, LU = a.CustomerPartCodeNoSpace }, b => new { b.PN, b.LU }, (a, b) => a); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs index 65e208ae..01be258d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs @@ -91,7 +91,7 @@ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } foreach (var itm in _ls) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs index c381f71c..a119cb87 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs @@ -75,7 +75,7 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase 0) { string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = fileName }); } foreach (var itm in _ls) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs index 681038e7..4507787b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs @@ -21,6 +21,7 @@ using Volo.Abp.Data; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; +using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; @@ -261,7 +262,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers return detailList; } - + [UnitOfWork(false)] public async Task> FirstInvoiceExtend(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) where TDetail : SA_CAN_BASE { @@ -315,35 +316,32 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } if (invoiceMap.Keys.Count > 0) { - var groupList = new List(); var notDetialList = new List(); - var invlist = new List(); var salist = new List(); var adjlist = new List(); - foreach (var itm in invoiceMap)//分组影响和 { var key = itm.Key;//发票票号 var ls = itm.Value;//结算分组号列表 //反向查找结算数据 var invdetails = p_list.Where(p => ls.Contains(p.GroupNum)).ToList(); - foreach (var detail in invdetails) - { - detail.InvbillNum = key; - salist.Add(detail); - } - if (!string.IsNullOrEmpty(p_parentInvBillNum)) - { - //反向查找调整数据 - var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList(); - foreach (var detail in adjdetails) - { - detail.InvBillNum = key; - adjdetails.Add(detail); - } - } + //foreach (var detail in invdetails) + //{ + // detail.InvbillNum = key; + // salist.Add(detail); + //} + //if (!string.IsNullOrEmpty(p_parentInvBillNum)) + //{ + // //反向查找调整数据 + // var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList(); + // foreach (var detail in adjdetails) + // { + // detail.InvBillNum = key; + // adjdetails.Add(detail); + // } + //} var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) .Select(itm => new @@ -405,31 +403,31 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { detailList.AddRange(_entityDetailList); } - var innotls = new List(); - if (p_notlist != null && p_notlist.Count > 0) - { - var notls = p_notlist.Where(p=>ls.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); - foreach (var nitm in notls) - { - innotls.Add(new INVOICE_NOT_SETTLE( - guid: GuidGenerator.Create(), - version: p_version, - invGroupNum: p_InvGroupNum, - settleGroupNum: nitm.GroupNum, - lU: string.Empty, - lU1: nitm.LU, - extend1: string.Empty, - extend2: string.Empty, - qty: nitm.Qty, - p_invbillnum:key + //var innotls = new List(); + //if (p_notlist != null && p_notlist.Count > 0) + //{ + // var notls = p_notlist.Where(p=>ls.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); + // foreach (var nitm in notls) + // { + // innotls.Add(new INVOICE_NOT_SETTLE( + // guid: GuidGenerator.Create(), + // version: p_version, + // invGroupNum: p_InvGroupNum, + // settleGroupNum: nitm.GroupNum, + // lU: string.Empty, + // lU1: nitm.LU, + // extend1: string.Empty, + // extend2: string.Empty, + // qty: nitm.Qty, + // p_invbillnum:key - )); - } - if (innotls.Count > 0) - { - notDetialList.AddRange(innotls); - } - } + // )); + // } + // if (innotls.Count > 0) + // { + // notDetialList.AddRange(innotls); + // } + //} var invbill = new INVOICE_GRP (guid: GuidGenerator.Create(), realnvBillNum: string.Empty, From 6650ac5aa0df00caf7e07ba2cf55272c3655780b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 8 Sep 2023 16:22:54 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 2 +- .../Bases/CAN_SA_SERVICE.cs | 4 +- .../Entities/BQ/BBAC_BA_SERVICE.cs | 2 +- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 2 +- .../Entities/BQ/HBPO_BA_SERVICE.cs | 2 +- .../Entities/BQ/HBPO_CAN_SA_SERVICE.cs | 2 +- .../Entities/BQ/INVOICE_SERVICE.cs | 276 ++++++++++-------- .../Entities/BQ/PUB_BA_SERVICE.cs | 2 +- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 4 +- 9 files changed, 166 insertions(+), 130 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs index 1f7b77a5..056ced23 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs @@ -657,7 +657,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public string LU { get; set; } [Display(Name = "数量")] - public string Qty { get; set; } + public decimal? Qty { get; set; } /// ///不可结算零件号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index 7e37ee37..9b62c79c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -259,9 +259,9 @@ namespace Win.Sfs.SettleAccount.Bases protected async Task> CheckInvoiceGenerationRules(List dto1s, List p_pricelist,EnumBusinessType p_businessType) where T : SA_CAN_BASE { - var maxDate = p_pricelist.Max(p => p.Date); + //var maxDate = p_pricelist.Max(p => p.Date); - var prices = p_pricelist.Where(p => p.Date == maxDate).ToList(); + var prices = p_pricelist.Where(p => p.IsCancel == false).ToList(); var inner = from d in dto1s join p in prices on d.LU equals p.LU 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 ec0a6cb1..23fbd21b 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 @@ -150,7 +150,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.ToList();//价格单 + var priceList = _priceRepository.Where(p=>p.IsCancel==false).ToList();//价格单 // priceList.GroupBy(p => new { p.BeginTime, p.EndTime }).Select(p => p.First()); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index 681d6545..184cc433 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -94,7 +94,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } var entitys = await _bbacMng.GetDetalListAsync(invbillNum);//可结算 - var priceList = _priceRepository.ToList(); + var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); var datetime = priceList.Select(p => p.Date).Max(); var prices = priceList.Where(p => p.Date == datetime).ToList(); ;//价格单 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 be53ba10..696e6d0a 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 @@ -239,7 +239,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.ToList();//价格单 + var priceList = _priceRepository.Where(p=>p.IsCancel==false).ToList();//价格单 var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs index 7549e87b..801b203c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs @@ -88,7 +88,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } var entitys = await _hbpoMng.GetDetalListAsync(invbillnum); - var priceList = _priceRepository.ToList();//价格单 + var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); //价格单 var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { 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 34b87e8c..063e18b4 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 @@ -350,6 +350,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var materialList = await _baseservice.GetMaterialList(); + + + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); var dtoDetails = ObjectMapper.Map, List>(entities); var invdetail= await DetailQueryAsync(input); @@ -379,139 +382,172 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var mgroup =m.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); var adjp = adj.Where(p => p.InvBillNum == itm.InvbillNum).ToList(); var nolist = not.Where(p => p.InvBillNum == itm.InvbillNum).ToList(); - var lsC =nolist.Where(p => p.Extend1 == "可结算").ToList(); - var lsN = nolist.Where(p => p.Extend1 == "不可结算").ToList(); - // var r = (from t1 in lsC - // join t2 in lsN on new { t1.LU, t1.SettleGroupNum } - // equals new { t2.LU, t2.SettleGroupNum } - - // into temp - // from tm in temp.DefaultIfEmpty() - // select new INVOICE_NOT_SETTLE_EXT_DTO - // { - // RealInvBillNum = t1.RealInvBillNum, - // InvDate = t1.InvDate, - // InvBillNum = t1.InvBillNum, - // InvGroupNum = t1.InvGroupNum, - // SettleGroupNum = t1.SettleGroupNum, - // SettleLU = t1.LU, - // NotSettleLU = tm == null ? string.Empty : tm.LU, - // Qty = tm == null ? string.Empty : tm.Qty - - // } - // ) - //.Union - //(from t2 in lsN - // join t1 in lsC - // on new { t2.LU, t2.SettleGroupNum } - // equals new { t1.LU, t1.SettleGroupNum } - // into temp - // from tm in temp.DefaultIfEmpty() - // where tm == null - // select new INVOICE_NOT_SETTLE_EXT_DTO - // { - // RealInvBillNum = t2.RealInvBillNum, - // InvDate = t2.InvDate, - // InvBillNum = t2.InvBillNum, - // InvGroupNum = t2.InvGroupNum, - // SettleGroupNum = t2.SettleGroupNum, - // SettleLU = string.Empty, - // NotSettleLU = t2.LU, - // Qty = t2.Qty - - // } - // ); - - //_excel.Append(r.OrderBy(p=>p.SettleGroupNum).ToList(), "结算分组零件" + itm.InvbillNum); - - - + var lsC = nolist.Where(p => p.Extend1 == "可结算") + .GroupBy(p => new + { + p.LU, + p.RealInvBillNum, + p.InvDate, + p.InvBillNum, + p.InvGroupNum, + + }).Select(p => new INVOICE_NOT_SETTLE_DTO() { + LU =p.Key.LU, + RealInvBillNum =p.Key.RealInvBillNum, + InvDate =p.Key.InvDate, + InvBillNum =p.Key.InvBillNum, + InvGroupNum =p.Key.InvGroupNum, + Qty=p.Sum(itm=>itm.Qty) + + }).ToList(); + + var lsN = nolist.Where(p => p.Extend1 == "不可结算").ToList() + .GroupBy(p => new + { + p.LU, + p.RealInvBillNum, + p.InvDate, + p.InvBillNum, + p.InvGroupNum, + + }).Select(p => new INVOICE_NOT_SETTLE_DTO() + { + LU = p.Key.LU, + RealInvBillNum = p.Key.RealInvBillNum, + InvDate = p.Key.InvDate, + InvBillNum = p.Key.InvBillNum, + InvGroupNum = p.Key.InvGroupNum, + Qty = p.Sum(itm => itm.Qty) + }).ToList(); var lineC = lsC.Count; var lineN = lsN.Count; List ls = new List(); - if (lineC > lineN)//可结大于不可结行数时 + + for (int i = 0; i < 10000; i++) { - for (int number = 0; number < lineC; number++) - { - if (number + 1 > lineN) - { - INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); - - - entity.RealInvBillNum = lsC[number].RealInvBillNum; - entity.InvDate = lsC[number].InvDate; - entity.InvBillNum = lsC[number].InvBillNum; - entity.InvGroupNum = lsC[number].InvGroupNum; - entity.SettleGroupNum = lsC[number].SettleGroupNum; - entity.SettleLU = lsC[number].LU; - entity.SettleQty = lsC[number].Qty; - entity.NotSettleLU = string.Empty; - entity.Qty = string.Empty; - ls.Add(entity); - - } - else - { - INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); - entity.RealInvBillNum = lsC[number].RealInvBillNum; - entity.InvDate = lsC[number].InvDate; - entity.InvBillNum = lsC[number].InvBillNum; - entity.InvGroupNum = lsC[number].InvGroupNum; - entity.SettleGroupNum = lsC[number].SettleGroupNum; - entity.SettleLU = lsC[number].LU; - entity.SettleQty= lsC[number].Qty; - entity.NotSettleLU = lsN[number].LU; - entity.Qty = lsN[number].Qty; - ls.Add(entity); - } - } + INVOICE_NOT_SETTLE_EXT_DTO invnot = new INVOICE_NOT_SETTLE_EXT_DTO(); + invnot.RealInvBillNum = string.Empty; + invnot.InvDate = null; + invnot.InvBillNum = string.Empty; + invnot.InvGroupNum = string.Empty; + invnot.SettleGroupNum = string.Empty; + invnot.SettleLU = string.Empty; + invnot.SettleQty = null; + invnot.NotSettleLU = string.Empty; + invnot.Qty = string.Empty; + ls.Add(invnot); } - else + var entity= nolist.FirstOrDefault(); + var disList = lsC.Select(p => p.SettleGroupNum).Distinct().ToList(); + + for (int i = 0; i < disList.Count; i++) { - for (int number = 0; number < lineN; number++) - { - if (number + 1 > lineC)//不可结大于可结行数时 - { - INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); - entity.RealInvBillNum = lsN[number].RealInvBillNum; - entity.InvDate = lsN[number].InvDate; - entity.InvBillNum = lsN[number].InvBillNum; - entity.InvGroupNum = lsN[number].InvGroupNum; - entity.SettleGroupNum = lsN[number].SettleGroupNum; - entity.SettleLU = string.Empty; - entity.SettleQty = string.Empty; - entity.NotSettleLU = lsN[number].LU; - entity.Qty = lsN[number].Qty; - ls.Add(entity); - } - else - { - INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); - entity.RealInvBillNum = lsN[number].RealInvBillNum; - entity.InvDate = lsN[number].InvDate; - entity.InvBillNum = lsN[number].InvBillNum; - entity.InvGroupNum = lsN[number].InvGroupNum; - entity.SettleGroupNum = lsN[number].SettleGroupNum; - entity.SettleLU = lsC[number].LU; - entity.NotSettleLU = lsN[number].LU; - entity.Qty = lsN[number].Qty; - entity.SettleQty = lsC[number].Qty; - ls.Add(entity); - } - } + ls[i].SettleGroupNum = disList[i]; } - - var disList= ls.Select(p => p.SettleGroupNum).Distinct().ToList(); - foreach (var de in ls) + for (int i = 0; i < lineC; i++) { - de.SettleGroupNum = string.Empty; + ls[i].RealInvBillNum = entity.RealInvBillNum; + ls[i].InvDate = entity.InvDate; + ls[i].InvBillNum = entity.InvBillNum; + ls[i].InvGroupNum = entity.InvGroupNum; + ls[i].SettleGroupNum = entity.SettleGroupNum; + ls[i].SettleLU = lsC[i].LU; + ls[i].SettleQty = lsC[i].Qty == null ? string.Empty : lsC[i].Qty.ToString(); } - for (int i = 0; i < disList.Count; i++) + for (int i = 0; i < lineN; i++) { - ls[i].SettleGroupNum = disList[i]; + ls[i].RealInvBillNum = entity.RealInvBillNum; + ls[i].InvDate = entity.InvDate; + ls[i].InvBillNum = entity.InvBillNum; + ls[i].InvGroupNum = entity.InvGroupNum; + ls[i].SettleGroupNum = entity.SettleGroupNum; + ls[i].NotSettleLU = lsN[i].LU; + ls[i].Qty = lsN[i].Qty == null ? string.Empty : lsN[i].Qty.ToString(); } + + + + //if (lineC > lineN)//可结大于不可结行数时 + //{ + // for (int number = 0; number < lineC; number++) + // { + // if (number + 1 > lineN) + // { + // INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); + // entity.RealInvBillNum = lsC[number].RealInvBillNum; + // entity.InvDate = lsC[number].InvDate; + // entity.InvBillNum = lsC[number].InvBillNum; + // entity.InvGroupNum = lsC[number].InvGroupNum; + // entity.SettleGroupNum = lsC[number].SettleGroupNum; + // entity.SettleLU = lsC[number].LU; + // entity.SettleQty = lsC[number].Qty == null ? string.Empty : lsC[number].Qty.ToString(); + // entity.NotSettleLU = string.Empty; + // entity.Qty = string.Empty; + // ls.Add(entity); + + // } + // else + // { + // INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); + // entity.RealInvBillNum = lsC[number].RealInvBillNum; + // entity.InvDate = lsC[number].InvDate; + // entity.InvBillNum = lsC[number].InvBillNum; + // entity.InvGroupNum = lsC[number].InvGroupNum; + // entity.SettleGroupNum = lsC[number].SettleGroupNum; + // entity.SettleLU = lsC[number].LU; + // entity.SettleQty= lsC[number].Qty==null?string.Empty:lsC[number].Qty.ToString(); + // entity.NotSettleLU = lsN[number].LU; + // entity.Qty = lsN[number].Qty == null ? string.Empty : lsC[number].Qty.ToString(); + // ls.Add(entity); + // } + // } + //} + //else + //{ + // for (int number = 0; number < lineN; number++) + // { + // if (number + 1 > lineC)//不可结大于可结行数时 + // { + // INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); + // entity.RealInvBillNum = lsN[number].RealInvBillNum; + // entity.InvDate = lsN[number].InvDate; + // entity.InvBillNum = lsN[number].InvBillNum; + // entity.InvGroupNum = lsN[number].InvGroupNum; + // entity.SettleGroupNum = lsN[number].SettleGroupNum; + // entity.SettleLU = string.Empty; + // entity.SettleQty = string.Empty; + // entity.NotSettleLU = lsN[number].LU; + // entity.Qty = lsN[number].Qty == null ? string.Empty : lsN[number].Qty.ToString(); + // ls.Add(entity); + // } + // else + // { + // INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO(); + // entity.RealInvBillNum = lsN[number].RealInvBillNum; + // entity.InvDate = lsN[number].InvDate; + // entity.InvBillNum = lsN[number].InvBillNum; + // entity.InvGroupNum = lsN[number].InvGroupNum; + // entity.SettleGroupNum = lsN[number].SettleGroupNum; + // entity.SettleLU = lsC[number].LU; + // entity.NotSettleLU = lsN[number].LU; + // entity.Qty = lsN[number].Qty == null ? string.Empty : lsN[number].Qty.ToString(); ; + // entity.SettleQty = lsC[number].Qty == null ? string.Empty : lsC[number].Qty.ToString(); ; + // ls.Add(entity); + // } + // } + //} + + //var disList= ls.Select(p => p.SettleGroupNum).Distinct().ToList(); + //foreach (var de in ls) + //{ + // de.SettleGroupNum = string.Empty; + //} + //for (int i = 0; i < disList.Count; i++) + //{ + // ls[i].SettleGroupNum = disList[i]; + //} _excel.Append(ls, "结算分组零件" + itm.InvbillNum); _excel.Append(mgroup, "发票结算分组对应" + itm.InvbillNum).SeparateBySheet(); _excel.Append(adjp, "发票调整数据" + itm.InvbillNum).SeparateBySheet(); 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 c23aeb93..90d9c5b1 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 @@ -271,7 +271,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.ToList();//价格单 + var priceList = _priceRepository.Where(p=>p.IsCancel==false).ToList();//价格单 var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count > 0) { 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 2c46017a..da1143dd 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 @@ -81,7 +81,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ List priceList = new List(); if (main.BusinessType == EnumBusinessType.BeiJian) { - var priceListbj = _pricebjRepository.ToList();//价格单 + 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 }); @@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else { - priceList = _priceRepository.ToList();//价格单 + priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 } var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) From f09ef5dc75ce5bf1071c872b82c70f9e93ec3835 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 8 Sep 2023 18:13:54 +0800 Subject: [PATCH 03/14] up --- .../wwwroot/components/table/index.js | 2 +- .../wwwroot/models/base-data/bei-jian.js | 29 +++++++++++++++++-- .../wwwroot/views/settle/_check.js | 2 ++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js index d820c71a..859d9289 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js @@ -18,7 +18,7 @@ export default {
-
{{item.title}}
+
{{item.title}}
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js index aa02e8a0..1dbaf4c1 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/bei-jian.js @@ -12,11 +12,15 @@ const schema = { }, beginDate: { title: "开始时间", - type: "DateTime", + type: "string", + input: "datetime", + clearable: true, }, endDate: { title: "结束时间", - type: "DateTime", + type: "string", + input: "datetime", + clearable: true, }, clientCode: { title: "客户编码", @@ -72,6 +76,20 @@ export default function () { }, }, default: [ + { + logic: "and", + column: "beginDate", + action: "biggerThanOrEqual", + value: null, + readOnly: true, + }, + { + logic: "and", + column: "endDate", + action: "smallThanOrEqual", + value: null, + readOnly: true, + }, { logic: "and", column: "lu", @@ -79,6 +97,13 @@ export default function () { value: null, readOnly: true, }, + { + logic: "and", + column: "contractNo", + action: "like", + value: null, + readOnly: true, + }, ], }, skipCount: { diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js index 11ee5aee..d6d9ba8b 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js @@ -374,10 +374,12 @@ export default { qty: { type: "number", title: "数量", + reduce: (x, y) => x + y, }, amt: { type: "number", title: "金额", + reduce: (x, y) => x + y, }, }, }; From 16dd3c6acf3f0f9ad2dd0bf693f2ae538e283cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 9 Sep 2023 09:31:42 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/ADJ_SERVICE.cs | 20 ++++--- .../Bases/BA_SERVICE.cs | 52 +++++++++---------- .../Bases/CAN_SA_SERVICE.cs | 6 +-- .../Entities/BQ/BBAC_BA_SERVICE.cs | 9 ++-- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 5 +- .../Entities/BQ/HBPO_BA_SERVICE.cs | 4 +- .../Entities/BQ/HBPO_CAN_SA_SERVICE.cs | 4 +- .../Entities/BQ/INVOICE_SERVICE.cs | 11 ++++ .../Entities/BQ/PUB_BA_SERVICE.cs | 6 +-- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 5 +- .../BaseDomainServices/BaseDomainService.cs | 7 +-- .../SettleAccount.Domain/Bases/EntityBase.cs | 7 +++ .../Entities/BQ/BBAC_CAN_SA.cs | 4 +- .../Entities/BQ/HBPO_CAN_SA.cs | 4 +- .../Entities/BQ/INVOICE_GRP.cs | 3 ++ .../Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs | 4 +- .../Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs | 4 +- .../Entities/BQ/Managers/INV_MNG.cs | 25 ++++++++- .../Entities/BQ/Managers/PUB_NOT_SA_MNG.cs | 6 ++- .../Entities/BQ/PUB_CAN_SA.cs | 4 +- 20 files changed, 123 insertions(+), 67 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs index 3615febe..450d0719 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs @@ -133,7 +133,7 @@ public class ADJ_SERVICE : BASE_SERVICE errorList.Add( new ErrorExportDto() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" }); } - var errorEntitylist = await _baseDomainService.CheckPriceList(entityList); + var errorEntitylist = await _baseDomainService.CheckPriceList(entityList,"1040"); if (errorEntitylist.Count > 0) { foreach (var itm in errorEntitylist) @@ -193,10 +193,14 @@ public class ADJ_SERVICE : BASE_SERVICE int flag = 0; var keylist = p_list.Select(p => p.KeyCode).Distinct(); List errorList = new List(); + //var inv = _invRepository.Where(p => p.InvbillNum == first.InvBillNum).FirstOrDefault(); + var first = p_list.FirstOrDefault(); + var inv = _invRepository.Where(p => p.InvbillNum == first.InvBillNum).FirstOrDefault(); + if (first != null) { - var inv = _invRepository.Where(p => p.InvbillNum == first.InvBillNum).FirstOrDefault(); + string keyname = string.Empty; List adjlist = new List(); @@ -257,6 +261,10 @@ public class ADJ_SERVICE : BASE_SERVICE } } + + + + var entityList = ObjectMapper.Map, List>(p_list); var codelist = entityList.Select(p => p.LU).ToList(); var errors = await _baseDomainService.CheckBase(codelist, new BASE_CONF() { IsRelationShip = true }); @@ -265,7 +273,7 @@ public class ADJ_SERVICE : BASE_SERVICE errorList.Add( new ERR_EXP_DTO() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" }); } - var errorEntitylist = await _baseDomainService.CheckPriceList(entityList); + var errorEntitylist = await _baseDomainService.CheckPriceList(entityList,inv.Site); if (errorEntitylist.Count > 0) { foreach (var itm in errorEntitylist) @@ -275,7 +283,7 @@ public class ADJ_SERVICE : BASE_SERVICE } if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message= "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); } List ls = new List(); @@ -287,7 +295,7 @@ public class ADJ_SERVICE : BASE_SERVICE var inner = from d in p_list join p in pricebjlist on d.LU equals p.LU where - d.SettleDate >= p.BeginDate && d.SettleDate <= p.EndDate + d.SettleDate >= p.BeginDate && d.SettleDate <= p.EndDate select new PUB_ADJ_DETAIL_DTO() { @@ -310,7 +318,7 @@ public class ADJ_SERVICE : BASE_SERVICE var inner = from d in p_list join p in pricelist on d.LU equals p.LU where - d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode== inv.Site select new PUB_ADJ_DETAIL_DTO() { InvBillNum = d.InvBillNum, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index 523fb058..c85fa2f2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -164,28 +164,28 @@ namespace Win.Sfs.SettleAccount.Bases var wquery = from itm in AMap join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp - select from tm in temp.DefaultIfEmpty() - select - new INVOICE_WAIT_DETAIL_BBAC_DTO() - { - - PartDesc=tm==null?string.Empty:itm.PartDesc, - InvDate = itm1.CreationTime, - RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, - Version = itm.Version, - InvbillNum = itm.InvbillNum, - InvGroupNum = itm.InvGroupNum, - LU = itm.LU, - PartCode = itm.PartCode, - PRICE = itm.PRICE, - Qty = itm.Qty, - Amt = itm.Amt, - BussiessType = itm.BussiessType, - Extend1 = itm.Extend1, - BeginDate = itm.BeginDate, - EndDate = itm.EndDate, - }; - entity.INVOICE_WAIT_DETAIL_BBAC = AMap; + from tm in temp.DefaultIfEmpty() + select + new INVOICE_WAIT_DETAIL_BBAC_DTO() + { + + PartDesc = tm == null ? string.Empty : itm.PartDesc, + InvDate = itm1.CreationTime, + RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, + Version = itm.Version, + InvbillNum = itm.InvbillNum, + InvGroupNum = itm.InvGroupNum, + LU = itm.LU, + PartCode = itm.PartCode, + PRICE = itm.PRICE, + Qty = itm.Qty, + Amt = itm.Amt, + BussiessType = itm.BussiessType, + Extend1 = itm.Extend1, + BeginDate = itm.BeginDate, + EndDate = itm.EndDate, + }; + entity.INVOICE_WAIT_DETAIL_BBAC = wquery.ToList(); } else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) { @@ -195,7 +195,7 @@ namespace Win.Sfs.SettleAccount.Bases var wquery = from itm in BMap join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp - select from tm in temp.DefaultIfEmpty() + from tm in temp.DefaultIfEmpty() select new INVOICE_WAIT_DETAIL_BJ_DTO() { @@ -215,7 +215,7 @@ namespace Win.Sfs.SettleAccount.Bases BeginDate = itm.BeginDate, EndDate = itm.EndDate, }; - entity.INVOICE_WAIT_DETAIL_BJ = BMap; + entity.INVOICE_WAIT_DETAIL_BJ = wquery.ToList(); } else { @@ -224,7 +224,7 @@ namespace Win.Sfs.SettleAccount.Bases var wquery = from itm in wdtos join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp - select from tm in temp.DefaultIfEmpty() + from tm in temp.DefaultIfEmpty() select new INVOICE_WAIT_DETAIL_DTO() { @@ -550,7 +550,7 @@ namespace Win.Sfs.SettleAccount.Bases var inner = from d in dto1s join p in p_pricelist on d.LU equals p.LU where - d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && d.Site==p.ClientCode && p.IsCancel==false select d; var left = from d in dto1s join p in inner on new { d.LU, d.PN } equals new { p.LU, p.PN } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index 9b62c79c..013bec78 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -256,17 +256,17 @@ namespace Win.Sfs.SettleAccount.Bases /// /// /// - protected async Task> CheckInvoiceGenerationRules(List dto1s, List p_pricelist,EnumBusinessType p_businessType) where T : SA_CAN_BASE + protected async Task> CheckInvoiceGenerationRules(List dto1s,string p_site, List p_pricelist,EnumBusinessType p_businessType) where T : SA_CAN_BASE { //var maxDate = p_pricelist.Max(p => p.Date); - var prices = p_pricelist.Where(p => p.IsCancel == false).ToList(); + var prices = p_pricelist.Where(p =>p.ClientCode==p_site && p.IsCancel == false).ToList(); var inner = from d in dto1s join p in prices on d.LU equals p.LU where - d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode==d.Site && p.IsCancel == false select d; var ls = inner.ToList(); var left = from d in dto1s 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 23fbd21b..da51134d 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 @@ -164,7 +164,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.PartCode equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && d.Site==p.ClientCode && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 select new TEMP_CAN_SA_DETAIL { Id = d.Id, @@ -291,8 +291,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s - join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 + join p in priceList on d.LU equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode==inv.Site && p.IsCancel==false//客户零件号 select new TEMP_CAN_SA_DETAIL { Id=d.Id, @@ -413,7 +413,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - var priceList = _priceRepository.ToList();//价格单 //var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); //if (errorList.Count() > 0) @@ -423,7 +422,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 select new TEMP_CAN_SA_DETAIL { Id = d.Id, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index 184cc433..41f633b9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -94,11 +94,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } var entitys = await _bbacMng.GetDetalListAsync(invbillNum);//可结算 + var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); var datetime = priceList.Select(p => p.Date).Max(); var prices = priceList.Where(p => p.Date == datetime).ToList(); ;//价格单 - var errorList = await CheckInvoiceGenerationRules(entitys, prices, main.BusinessType);//校验生成规则 + var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,prices, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); @@ -111,7 +112,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in prices on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode ==main.Site select new TEMP_CAN_SA_DETAIL { SettleBillNum = d.SettleBillNum, 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 696e6d0a..7fefdf26 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 @@ -248,7 +248,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel==false && p.ClientCode==inv.Site select new TEMP_CAN_SA_DETAIL { SettleBillNum = d.SettleBillNum, @@ -381,7 +381,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.PartCode equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 select new TEMP_CAN_SA_DETAIL { Id = d.Id, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs index 801b203c..9392f435 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs @@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } var entitys = await _hbpoMng.GetDetalListAsync(invbillnum); var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); //价格单 - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 + var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); @@ -103,7 +103,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == main.Site select new TEMP_CAN_SA_DETAIL { SettleBillNum = d.SettleBillNum, 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 063e18b4..010dbb70 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 @@ -2,6 +2,7 @@ using CodeArts.Db; using DocumentFormat.OpenXml.Bibliography; using DocumentFormat.OpenXml.Drawing.Diagrams; using DocumentFormat.OpenXml.Spreadsheet; +using DocumentFormat.OpenXml.Wordprocessing; using EFCore.BulkExtensions; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; @@ -32,6 +33,7 @@ using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; +using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; @@ -337,6 +339,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ ); return _fileName; } + + + + /// /// 导出发票组明细 /// @@ -354,6 +360,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + + var first=entities.FirstOrDefault(); + + + var dtoDetails = ObjectMapper.Map, List>(entities); var invdetail= await DetailQueryAsync(input); var m = invdetail.INVOICE_MAP_GROUP; 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 90d9c5b1..d5048155 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 @@ -152,7 +152,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site select new TEMP_CAN_SA_DETAIL { SettleBillNum = d.SettleBillNum, @@ -280,7 +280,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys join p in priceList on d.PartCode equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site select new TEMP_CAN_SA_DETAIL { SettleBillNum = d.SettleBillNum, @@ -413,7 +413,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.PartCode equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 select new TEMP_CAN_SA_DETAIL { Id = d.Id, 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 da1143dd..88edf6fd 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 @@ -91,19 +91,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 } - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 + var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); } - if (await _pubMng.SetForwardState(main, SettleBillState.已开票)) { var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == main.Site select new TEMP_CAN_SA_DETAIL { Id = d.Id, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs index 41d118bd..3a38ddd7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using SettleAccount.Bases; +using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; @@ -200,7 +201,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices return errorList; } - public async Task> CheckPriceList(List p_list,bool isBj=false) + public async Task> CheckPriceList(List p_list,string p_site,bool isBj=false) where TEntity : ISA_BASE,new() { List errorList = new List(); @@ -225,7 +226,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices } else { - var pricebjlist = _priceRepository.ToList(); + var pricebjlist = _priceRepository.Where(p=>p.ClientCode==p_site).ToList(); var inner = from d in p_list join p in pricebjlist on d.LU equals p.LU @@ -244,8 +245,8 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices return errorList; } - + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs index 86b2c895..eade44b7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs @@ -399,6 +399,10 @@ namespace SettleAccount.Bases /// 匹配类型 /// public EnumMappingType MappingType { get; set; } + + + + } public class SA_CAN_BASE : AuditedAggregateRoot, ISA_BASE @@ -461,6 +465,9 @@ namespace SettleAccount.Bases public string PartCode { get; set; } public string RealPartCode { get; set; } + + public string Site { get; set; } + //public SA_CAN_BASE(int version, decimal price, string billNum, DateTime settleDate, string invGroupNum, string lU, string pN, string keyCode, decimal qty, string groupNum) //{ // Version = version; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs index c5274dc2..210f8fd6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs @@ -88,8 +88,8 @@ public class BBAC_CAN_SA_DETAIL: SA_CAN_BASE /// /// 选择工厂导入 /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; + //[Display(Name = "工厂地点")] + //public string Site { get; set; } = null!; /// /// 对应字段Quantity diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs index 91631388..a0056364 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs @@ -90,8 +90,8 @@ public class HBPO_CAN_SA_DETAIL:SA_CAN_BASE /// /// 对应字段filename 区分 cn1、cn5 /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; + //[Display(Name = "工厂地点")] + //public string Site { get; set; } = null!; ///// ///// 对应字段Qty diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs index 9bc935fd..82806eb2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs @@ -56,6 +56,9 @@ public class INVOICE_GRP : FullAuditedAggregateRoot public decimal RealAmt { get; set; } + [Display(Name = "地点")] + public string Site { get; set; } + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs index 4c3f6279..ec715ff8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs @@ -47,9 +47,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers public virtual async Task> GenerateSettlementOrder(List p_list) { + var first = p_list.FirstOrDefault(); List errors = new List(); - var priceErrors = await _service.CheckPriceList(p_list); + var priceErrors = await _service.CheckPriceList(p_list,first.Site); if (priceErrors.Count > 0) { foreach (var itm in priceErrors) @@ -70,6 +71,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _entity.Version = int.Parse(DateTime.Now.ToString("yyyyMM")); _entity.State = SettleBillState.未结状态; _entity.SettleBillNum = string.Empty; + _entity.Site = first.Site; _entity.BusinessType = EnumBusinessType.JisBBAC; var _entityList = new List(); foreach (var itm in p_list) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs index 7caa22ab..ee2caaed 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs @@ -29,7 +29,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers private readonly INormalEfCoreRepository _detailRepository; private readonly INormalEfCoreRepository _notRepository; private readonly BaseDomainService _service; - public HBPO_NOT_SA_MNG() { } @@ -51,7 +50,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { var first=p_list.FirstOrDefault(); List errors = new List(); - var priceErrors = await _service.CheckPriceList(p_list); + var priceErrors = await _service.CheckPriceList(p_list,first.Site); if (priceErrors.Count > 0) { foreach (var itm in priceErrors) @@ -83,6 +82,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _entity.SettleBillNum = string.Empty; _entity.BusinessType = p_list.FirstOrDefault().BusinessType; _entity.SetId(Guid.NewGuid()); + _entity.Site = first.Site; var _entityList = new List(); foreach (var itm in p_list) { 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 2c0db594..baff71d6 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 @@ -1,6 +1,7 @@ using EFCore.BulkExtensions; using EmptyFiles; using Hangfire; +using Microsoft.AspNetCore.Razor.Language.Intermediate; using Microsoft.AspNetCore.SignalR; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.EntityFrameworkCore; @@ -40,6 +41,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _groupRepository; private readonly INormalEfCoreRepository _detailRepository; + + private readonly INormalEfCoreRepository _notRepository; private readonly INormalEfCoreRepository _adjRepository; protected readonly INormalEfCoreRepository _codesetRepository; @@ -369,7 +372,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers - + /// + /// 获得发票主表 + /// + /// + /// + /// @@ -1246,7 +1254,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers taxDiff: 0, clientCode: string.Empty, realAmt: readAmt + + + ); + invbill.Site = dtos.FirstOrDefault().Site; invlist.Add(invbill); } await _repository.DbContext.BulkInsertAsync(invlist); @@ -1478,6 +1490,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers clientCode: string.Empty, realAmt: realAmt ); + + invbill.Site= dtos.FirstOrDefault().Site; invbill.CreationTime = DateTime.Now; invlist.Add(invbill); } @@ -1747,6 +1761,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers realAmt:0 ); + invbill.Site = dtos.FirstOrDefault().Site; invbill.CreationTime = DateTime.Now; invlist.Add(invbill); } @@ -1973,6 +1988,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers clientCode: string.Empty, realAmt: realAmt ); + invbill.Site = dtos.FirstOrDefault().Site; invbill.CreationTime = DateTime.Now; invlist.Add(invbill); } @@ -2401,5 +2417,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } return false; } + + + + + + + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs index 5eca6fb5..b4186471 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs @@ -76,11 +76,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (first.BusinessType == EnumBusinessType.BeiJian) { name = "备件"; - priceErrors = await _service.CheckPriceList(notlist,true); + priceErrors = await _service.CheckPriceList(notlist,first.Site,true); } else { - priceErrors = await _service.CheckPriceList(notlist); + priceErrors = await _service.CheckPriceList(notlist,first.Site); } if (priceErrors.Count > 0) { @@ -102,6 +102,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _entity.State = SettleBillState.未结状态; _entity.SettleBillNum = string.Empty; _entity.BusinessType = first.BusinessType; + _entity.Site = first.Site; + var _entityList = new List(); foreach (var itm in notlist) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs index 1c3c7a7f..052de155 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs @@ -82,8 +82,8 @@ public class PUB_CAN_SA_DETAIL : SA_CAN_BASE /// /// 对应字段filename 区分 cn1、cn5 /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; + //[Display(Name = "工厂地点")] + //public string Site { get; set; } = null!; /// /// 对应字段Qty From 8a5c003d8898ffb2b085562612177c52f82de038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 9 Sep 2023 09:35:45 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 1 + .../20230909013408_202309090001.Designer.cs | 5793 +++++++++++++++++ .../Migrations/20230909013408_202309090001.cs | 178 + .../SettleAccountDbContextModelSnapshot.cs | 25 +- 4 files changed, 5986 insertions(+), 11 deletions(-) create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.Designer.cs create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.cs 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 88edf6fd..6941780c 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 @@ -6,6 +6,7 @@ using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Query.SqlExpressions; using SettleAccount.Domain.BQ; using Volo.Abp; using Volo.Abp.Data; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.Designer.cs new file mode 100644 index 00000000..6b2827d6 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.Designer.cs @@ -0,0 +1,5793 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Win.Sfs.SettleAccount; + +namespace Win.Sfs.SettleAccount.Migrations +{ + [DbContext(typeof(SettleAccountDbContext))] + [Migration("20230909013408_202309090001")] + partial class _202309090001 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.17") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_CAN_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractDocID") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + b.Property("IsReturn") + .HasMaxLength(50) + .HasColumnType("bit"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_CAN_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_NOT_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractDocID") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + b.Property("IsReturn") + .HasMaxLength(50) + .HasColumnType("bit"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_NOT_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_PD"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend2") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend3") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend4") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RELU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("REPN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_PD_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DNBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("Category") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractDocID") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPartCodeNoSpace") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsReturn") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MappingType") + .HasColumnType("int"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssembleData") + .HasColumnType("datetime2"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Batch") + .HasColumnType("nvarchar(max)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BillCharacter") + .HasColumnType("nvarchar(max)"); + + b.Property("BillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("BillType") + .HasColumnType("int"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerPartCodeNoSpace") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("FactoryPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHaveEdiData") + .HasColumnType("bit"); + + b.Property("JISNum") + .HasColumnType("nvarchar(max)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MESConfigCode") + .HasColumnType("nvarchar(max)"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Oper") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(max)"); + + b.Property("OrigiCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PartDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("ProType") + .HasColumnType("int"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RefBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("RefVinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("SubBillType") + .HasColumnType("int"); + + b.Property("ToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("TransType") + .HasColumnType("int"); + + b.Property("UID") + .HasColumnType("bigint"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SE_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_EDI", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPartCodeNoSpace") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend4") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHaveSeData") + .HasColumnType("bit"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineStationCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SE_EDI"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_REPORT", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EDIQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SE_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_SA_REPORT", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Category") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EDIQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WMSQty") + .HasColumnType("decimal(18,2)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SE_SA_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_ADJ_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OldInvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_ADJ_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_CAN_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_CAN_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_CAN_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_CAN_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_NOT_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_NOT_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_PD", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_PD"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_PD_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend2") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend3") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend4") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RELU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("REPN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_PD_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DNBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("RecordCount") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPartCodeNoSpace") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MappingType") + .HasColumnType("int"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SE_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssembleData") + .HasColumnType("datetime2"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Batch") + .HasColumnType("nvarchar(max)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BillCharacter") + .HasColumnType("nvarchar(max)"); + + b.Property("BillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("BillType") + .HasColumnType("int"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerPartCodeNoSpace") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("FactoryPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHaveEdiData") + .HasColumnType("bit"); + + b.Property("JISNum") + .HasColumnType("nvarchar(max)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MESConfigCode") + .HasColumnType("nvarchar(max)"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Oper") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(max)"); + + b.Property("OrigiCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PartDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("ProType") + .HasColumnType("int"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RefBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("RefVinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("SubBillType") + .HasColumnType("int"); + + b.Property("ToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("TransType") + .HasColumnType("int"); + + b.Property("UID") + .HasColumnType("bigint"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SE_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SE_EDI", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPartCodeNoSpace") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend4") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHaveSeData") + .HasColumnType("bit"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineStationCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SE_EDI"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SE_REPORT", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EDIQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SE_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SE_SA_REPORT", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Category") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EDIQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WMSQty") + .HasColumnType("decimal(18,2)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SE_SA_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_GRP", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvoiceState") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentInvbillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("PreTaxDiff") + .HasColumnType("decimal(18,2)"); + + b.Property("RealAmt") + .HasColumnType("decimal(18,2)"); + + b.Property("RealnvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Tax") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxAmt") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxDiff") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_GRP"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_MAP_GROUP", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_MAP_GROUP"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_NOT_SETTLE", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SettleGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_NOT_SETTLE"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_WAIT_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BussiessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PRICE") + .HasColumnType("decimal(18,2)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_WAIT_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.JIT_SE_SA_REPORT", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Category") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EDIQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WMSQty") + .HasColumnType("decimal(18,2)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_JIT_SE_SA_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_ADJ_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OldInvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_ADJ_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_CAN_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_CAN_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_CAN_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PoBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_CAN_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_NOT_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PoBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_NOT_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_PD", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_PD"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_PD_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend2") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend3") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend4") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RELU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("REPN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_PD_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Site") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPartCodeNoSpace") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MappingType") + .HasColumnType("int"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_SE_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssembleData") + .HasColumnType("datetime2"); + + b.Property("Batch") + .HasColumnType("nvarchar(max)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("BillType") + .HasColumnType("int"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustId") + .HasColumnType("nvarchar(max)"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerPartCodeNoSpace") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("DeliveryHose") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliveryIndex") + .HasColumnType("nvarchar(max)"); + + b.Property("DnBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("DnBillTime") + .HasColumnType("datetime2"); + + b.Property("DnOper") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FactoryPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromErpLocCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromHose") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocCode") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Oper") + .HasColumnType("nvarchar(max)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ProType") + .HasColumnType("int"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("SubBillType") + .HasColumnType("int"); + + b.Property("ToErpLocCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToHose") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TransType") + .HasColumnType("int"); + + b.Property("UID") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SE_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PURCHASE_PRICE", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Set_PURCHASE_PRICE"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.TB_RePartsRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("RepLU") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_TB_RePartsRelationship"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Boms.Bom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BomLevel") + .HasColumnType("int"); + + b.Property("BomType") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChildItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChildItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("ChildItemUom") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EffectiveTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExpireTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssuePosition") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OperateProcess") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ScrapPercent") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ParentItemCode", "ChildItemCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bom"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.BBAC_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.HBPO_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.PUB_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ErpLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Syncs.SyncPositionFlag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("TableName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_SyncPositionFlag"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Cron") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("HeartBeat") + .HasColumnType("datetime2"); + + b.Property("IsDisabled") + .HasColumnType("bit"); + + b.Property("IsRunning") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Service") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Set_JobItem"); + + b.HasData( + new + { + Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), + ConcurrencyStamp = "18add54a57684dd1818440f0d5005ebb", + Cron = "0 0 8 26 *", + IsDisabled = false, + IsRunning = false, + Name = "时点库存备份", + Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" + }, + new + { + Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), + ConcurrencyStamp = "dece69c1928241df9f38feccf47d0c0a", + Cron = "0 0/1 * * * ?", + IsDisabled = false, + IsRunning = false, + Name = "库存余额同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService" + }, + new + { + Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), + ConcurrencyStamp = "431db509a1f34bfe9fd1a4d7efcf1d4c", + Cron = "0 0/1 * * * ?", + IsDisabled = false, + IsRunning = false, + Name = "库存事务消息监控", + Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" + }, + new + { + Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), + ConcurrencyStamp = "de291b54ac7e487988bb2660050b0db4", + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "JisBBAC发运数据同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" + }, + new + { + Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), + ConcurrencyStamp = "06df83918cbc4543a2b44a83f739dc67", + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "JisHBPO发运数据同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" + }, + new + { + Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), + ConcurrencyStamp = "960ce38962e949558923f71d04f4e338", + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "买单件BBAC发运数据同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" + }, + new + { + Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), + ConcurrencyStamp = "9004a8ecf43a4fe1848f6802a6d4576f", + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "买单件HBPO发运数据同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanHBPOSeSyncAppService" + }, + new + { + Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), + ConcurrencyStamp = "03899f76c20043e896f38246ccb0d037", + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "直供件BBAC发运同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" + }, + new + { + Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), + ConcurrencyStamp = "f9c840d4749b410982c3288ce64a8691", + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "直供件HBPO发运同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" + }, + new + { + Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), + ConcurrencyStamp = "e5bf812fc44e445991f4a7b6ece063db", + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "备件发运同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" + }, + new + { + Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), + ConcurrencyStamp = "3ec6e8d3979a41088508d5ec64f5118a", + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "印度件发运同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" + }); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("End") + .HasColumnType("datetime2"); + + b.Property("Exception") + .HasColumnType("nvarchar(max)"); + + b.Property("Host") + .HasColumnType("nvarchar(max)"); + + b.Property("JobId") + .HasColumnType("uniqueidentifier"); + + b.Property("Start") + .HasColumnType("datetime2"); + + b.Property("Success") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.ToTable("Set_JobLog"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiBalance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssembleData") + .HasColumnType("datetime2"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("CodeType") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Configcode") + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedTime") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("getdate()"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(450)"); + + b.Property("IsReplenished") + .HasColumnType("bit"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(450)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("ReMark") + .HasColumnType("nvarchar(max)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RealPartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementVinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedTime") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime2") + .HasDefaultValueSql("getdate()"); + + b.Property("VinCode") + .HasColumnType("nvarchar(450)"); + + b.Property("factory") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("DeliverBillType", "CodeType", "RealPartCode", "VinCode", "ErpToLoc", "OrderNum", "factory", "Configcode") + .IsUnique() + .HasFilter("[DeliverBillType] IS NOT NULL AND [CodeType] IS NOT NULL AND [RealPartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL"); + + b.ToTable("Set_VmiBalance"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssembleData") + .HasColumnType("datetime2"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("ChangedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ChangedTime") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("getdate()"); + + b.Property("ChangedType") + .HasColumnType("int"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("Configcode") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedTime") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("getdate()"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("IsReplenished") + .HasColumnType("bit"); + + b.Property("LogType") + .HasColumnType("int"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(max)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("ReMark") + .HasColumnType("nvarchar(max)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RealPartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementVinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedTime") + .HasColumnType("datetime2"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("factory") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_VmiLog"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreatedTime") + .HasColumnType("datetime2"); + + b.Property("Message") + .HasColumnType("nvarchar(max)"); + + b.Property("Number") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("isConsumed") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("Set_VmiMessage"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiReplenished", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssembleData") + .HasColumnType("datetime2"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("ChangedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ChangedTime") + .HasColumnType("datetime2"); + + b.Property("ChangedType") + .HasColumnType("int"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("Configcode") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedTime") + .HasColumnType("datetime2"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("IsReplenished") + .HasColumnType("bit"); + + b.Property("LogType") + .HasColumnType("int"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(max)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("ReMark") + .HasColumnType("nvarchar(max)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RealPartCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementVinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedTime") + .HasColumnType("datetime2"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("factory") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_VmiReplenished"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiSnapshot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("End") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Start") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("Set_VmiSnapshot"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Boms.BomVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_bom_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.CodeSettings.CodeSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Project") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_CodeSetting"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Controls.CentralizedControl", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("bit"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Year", "Period") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_control"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Materials.Material", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimateType") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("EstimateTypeDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Unit") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_material"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractNo") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsCancel") + .HasColumnType("bit"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceList"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListBJ", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractNo") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsCancel") + .HasColumnType("bit"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListBJ"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersionBJ", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersionBJ"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.TaskJob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DownFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Email") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Error") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RealDownFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RealFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ServiceName") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("TaskId") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_TaskJob"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.MaterialRelationships.MaterialRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ErpMaterialCode", "BusinessType") + .IsUnique(); + + b.ToTable("Set_relationship"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobLog", b => + { + b.HasOne("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", "Job") + .WithMany() + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.cs new file mode 100644 index 00000000..aff6130b --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.cs @@ -0,0 +1,178 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Win.Sfs.SettleAccount.Migrations +{ + public partial class _202309090001 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Site", + table: "Set_INVOICE_GRP", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), + column: "ConcurrencyStamp", + value: "dece69c1928241df9f38feccf47d0c0a"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), + column: "ConcurrencyStamp", + value: "431db509a1f34bfe9fd1a4d7efcf1d4c"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), + column: "ConcurrencyStamp", + value: "06df83918cbc4543a2b44a83f739dc67"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), + column: "ConcurrencyStamp", + value: "9004a8ecf43a4fe1848f6802a6d4576f"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), + column: "ConcurrencyStamp", + value: "960ce38962e949558923f71d04f4e338"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), + column: "ConcurrencyStamp", + value: "f9c840d4749b410982c3288ce64a8691"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), + column: "ConcurrencyStamp", + value: "de291b54ac7e487988bb2660050b0db4"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), + column: "ConcurrencyStamp", + value: "3ec6e8d3979a41088508d5ec64f5118a"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), + column: "ConcurrencyStamp", + value: "e5bf812fc44e445991f4a7b6ece063db"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), + column: "ConcurrencyStamp", + value: "18add54a57684dd1818440f0d5005ebb"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), + column: "ConcurrencyStamp", + value: "03899f76c20043e896f38246ccb0d037"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Site", + table: "Set_INVOICE_GRP"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), + column: "ConcurrencyStamp", + value: "1aefd0b8d1ab49458c36e3932717ab35"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), + column: "ConcurrencyStamp", + value: "6b33d7dda3f645dcbe8b4a3f51a7399f"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), + column: "ConcurrencyStamp", + value: "22c0f3b78cf8410392dbaf098eecc973"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), + column: "ConcurrencyStamp", + value: "25d4d2fdf5e6403188ccd684459a6a47"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), + column: "ConcurrencyStamp", + value: "9475ae5b030a480b81c539f9eeabd7d5"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), + column: "ConcurrencyStamp", + value: "cdd7dba0132b488aa38becaebc9725eb"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), + column: "ConcurrencyStamp", + value: "f54dc633986d4eba9ce0793f450545c0"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), + column: "ConcurrencyStamp", + value: "d3521bfcefe94a38962bd1b7d72ed219"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), + column: "ConcurrencyStamp", + value: "c63da47e046c4d8cbe927a450388df2f"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), + column: "ConcurrencyStamp", + value: "024d5742d21c41e4b63052f4e03f15f8"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), + column: "ConcurrencyStamp", + value: "ff08e4cbf0c0461d8426470f9b84bf62"); + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs index 74fc2e96..cd573b41 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs @@ -2505,6 +2505,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(50) .HasColumnType("nvarchar(50)"); + b.Property("Site") + .HasColumnType("nvarchar(max)"); + b.Property("State") .HasColumnType("int"); @@ -4474,7 +4477,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), - ConcurrencyStamp = "024d5742d21c41e4b63052f4e03f15f8", + ConcurrencyStamp = "18add54a57684dd1818440f0d5005ebb", Cron = "0 0 8 26 *", IsDisabled = false, IsRunning = false, @@ -4484,7 +4487,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), - ConcurrencyStamp = "1aefd0b8d1ab49458c36e3932717ab35", + ConcurrencyStamp = "dece69c1928241df9f38feccf47d0c0a", Cron = "0 0/1 * * * ?", IsDisabled = false, IsRunning = false, @@ -4494,7 +4497,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), - ConcurrencyStamp = "6b33d7dda3f645dcbe8b4a3f51a7399f", + ConcurrencyStamp = "431db509a1f34bfe9fd1a4d7efcf1d4c", Cron = "0 0/1 * * * ?", IsDisabled = false, IsRunning = false, @@ -4504,7 +4507,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), - ConcurrencyStamp = "f54dc633986d4eba9ce0793f450545c0", + ConcurrencyStamp = "de291b54ac7e487988bb2660050b0db4", Cron = "0 0/30 * * * ? ", IsDisabled = false, IsRunning = false, @@ -4514,7 +4517,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), - ConcurrencyStamp = "22c0f3b78cf8410392dbaf098eecc973", + ConcurrencyStamp = "06df83918cbc4543a2b44a83f739dc67", Cron = "0 0/30 * * * ? ", IsDisabled = false, IsRunning = false, @@ -4524,7 +4527,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), - ConcurrencyStamp = "9475ae5b030a480b81c539f9eeabd7d5", + ConcurrencyStamp = "960ce38962e949558923f71d04f4e338", Cron = "0 0/30 * * * ? ", IsDisabled = false, IsRunning = false, @@ -4534,7 +4537,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), - ConcurrencyStamp = "25d4d2fdf5e6403188ccd684459a6a47", + ConcurrencyStamp = "9004a8ecf43a4fe1848f6802a6d4576f", Cron = "0 0/30 * * * ? ", IsDisabled = false, IsRunning = false, @@ -4544,7 +4547,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), - ConcurrencyStamp = "ff08e4cbf0c0461d8426470f9b84bf62", + ConcurrencyStamp = "03899f76c20043e896f38246ccb0d037", Cron = "0 0/30 * * * ? ", IsDisabled = false, IsRunning = false, @@ -4554,7 +4557,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), - ConcurrencyStamp = "cdd7dba0132b488aa38becaebc9725eb", + ConcurrencyStamp = "f9c840d4749b410982c3288ce64a8691", Cron = "0 0/30 * * * ? ", IsDisabled = false, IsRunning = false, @@ -4564,7 +4567,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), - ConcurrencyStamp = "c63da47e046c4d8cbe927a450388df2f", + ConcurrencyStamp = "e5bf812fc44e445991f4a7b6ece063db", Cron = "0 0/30 * * * ? ", IsDisabled = false, IsRunning = false, @@ -4574,7 +4577,7 @@ namespace Win.Sfs.SettleAccount.Migrations new { Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), - ConcurrencyStamp = "d3521bfcefe94a38962bd1b7d72ed219", + ConcurrencyStamp = "3ec6e8d3979a41088508d5ec64f5118a", Cron = "0 0/30 * * * ? ", IsDisabled = false, IsRunning = false, From f3e5abd3939b5d749af4e83008dea881429cd778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 9 Sep 2023 10:47:39 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 2 +- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs index 056ced23..134ca729 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs @@ -103,7 +103,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "业务类别")] public EnumBusinessType BusinessType { get; set; } - public List DETIAL { set; get; } + public List DETAIL { set; get; } } public class INVOICE_GRP_EXP_DTO diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index 41f633b9..10d7368f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -96,10 +96,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var entitys = await _bbacMng.GetDetalListAsync(invbillNum);//可结算 var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); - var datetime = priceList.Select(p => p.Date).Max(); - var prices = priceList.Where(p => p.Date == datetime).ToList(); + ;//价格单 - var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,prices, main.BusinessType);//校验生成规则 + var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "请下载错误信息", fileName = await ExportErrorReportAsync(errorList) }); @@ -111,7 +110,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var notQuery = _notRepository.Where(p => groupNumList.Contains(p.GroupNum)).ToList();//不能结算 var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s - join p in prices on d.LU equals p.LU + join p in priceList on d.LU equals p.LU where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode ==main.Site select new TEMP_CAN_SA_DETAIL { From 8e37a8b16ce8dba7a7793da7a3b3170fa03b095e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 9 Sep 2023 10:56:26 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs | 4 ++-- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 1 - .../SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs | 4 ++-- .../SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) 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 da51134d..5b26539f 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 @@ -469,7 +469,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invBill.TaxAmt = taxamt; invBill.Tax = tax; invBill.BusinessType = inv.BusinessType; - invBill.DETIAL =invls ; + invBill.DETAIL =invls ; invBill.RealAmt = realamt; invBilllist.Add(invBill); } @@ -494,7 +494,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invBill.TaxAmt = taxamt; invBill.Tax = tax; invBill.BusinessType = inv.BusinessType; - invBill.DETIAL = invls; + invBill.DETAIL = invls; invBill.RealAmt = realamt; invBilllist.Add(invBill); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index 10d7368f..51038c01 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -94,7 +94,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } var entitys = await _bbacMng.GetDetalListAsync(invbillNum);//可结算 - var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); ;//价格单 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 7fefdf26..b187badb 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 @@ -425,7 +425,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invBill.TaxAmt = taxamt; invBill.Tax = tax; invBill.BusinessType = inv.BusinessType; - invBill.DETIAL = invls; + invBill.DETAIL = invls; invBill.RealAmt = realamt; invBilllist.Add(invBill); } @@ -448,7 +448,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invBill.TaxAmt = taxamt; invBill.Tax = tax; invBill.BusinessType = inv.BusinessType; - invBill.DETIAL = invls; + invBill.DETAIL = invls; invBill.RealAmt = realamt; invBilllist.Add(invBill); } 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 d5048155..c78ee245 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 @@ -459,7 +459,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invBill.TaxAmt = taxamt; invBill.Tax = tax; invBill.BusinessType = inv.BusinessType; - invBill.DETIAL = invls; + invBill.DETAIL = invls; invBill.RealAmt = realamt; invBilllist.Add(invBill); } @@ -482,7 +482,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invBill.TaxAmt = taxamt; invBill.Tax = tax; invBill.BusinessType = inv.BusinessType; - invBill.DETIAL = invls; + invBill.DETAIL = invls; invBill.RealAmt = realamt; invBilllist.Add(invBill); } From 0304913e6678ecc35d89a9c8606f2436877fc2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 9 Sep 2023 11:57:58 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/ADJ_SERVICE.cs | 7 +- .../Entities/BQ/BBAC_BA_SERVICE.cs | 329 +++++++++++----- .../Entities/BQ/HBPO_BA_SERVICE.cs | 358 +++++++++++++++++- .../Entities/BQ/PUB_BA_SERVICE.cs | 200 +++++++++- 4 files changed, 783 insertions(+), 111 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs index 450d0719..21ff965b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs @@ -178,7 +178,7 @@ public class ADJ_SERVICE : BASE_SERVICE /// [HttpPost] [DisableRequestSizeLimit] - public async Task CheckImport(List p_list) + public async Task CheckImport(List p_list) { if (p_list.Count == 0) { @@ -283,8 +283,7 @@ public class ADJ_SERVICE : BASE_SERVICE } if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); - + return await ExportErrorReportAsync(errorList) ; } List ls = new List(); if (flag == 1) @@ -333,7 +332,7 @@ public class ADJ_SERVICE : BASE_SERVICE ls = inner.ToList(); } - return new JsonResult(new { Code = 200, data =ls }); ; + return "OK" ; } } 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 5b26539f..a0f52559 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 @@ -1,4 +1,5 @@ +using DocumentFormat.OpenXml.Drawing.Charts; using DocumentFormat.OpenXml.Spreadsheet; using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; @@ -41,7 +42,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly INormalEfCoreRepository _priceRepository; - + private readonly ADJ_SERVICE _adjservice; public BBAC_BA_SERVICE(IExcelImportAppService excelImportService, @@ -59,8 +60,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INV_MNG invMng, TaskJobService service, BaseDomainService baseservice, - INormalEfCoreRepository priceRepository - + INormalEfCoreRepository priceRepository, + ADJ_SERVICE adjservice + ) : base( excelImportService, @@ -79,6 +81,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ baseservice) { _priceRepository = priceRepository; + _adjservice = adjservice; } @@ -347,10 +350,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public virtual async Task> ReissueInvoiceList(List p_list) + public virtual async Task ReissueInvoiceList(List p_list) { - var invBilllist = new List(); + var result =await _adjservice.CheckImport(p_list); + if(result != "OK") + { + return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName =result }); + } + + var invBilllist = new List(); var adjlist=ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count==0) { @@ -372,82 +381,206 @@ namespace Win.Sfs.SettleAccount.Entities.BQ throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!"); } version = settle.Version; - if (inv != null) + if (inv != null) + { + if (inv.InvoiceState == InvoiceBillState.报废) { - if (inv.InvoiceState == InvoiceBillState.报废) + throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!"); + } + if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) + { + throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!"); + } + + var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count() > 0) + { + foreach (var itm in adjlist) { - throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!"); + bbaclist.Add(new BBAC_CAN_SA_DETAIL( + guid: itm.Id, + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + category: itm.BusinessType, + isReturn: itm.Qty > 0 ? false : true, + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + contactid: itm.Extend1,//生产号 + invbillnum: string.Empty, + partcode: itm.PartCode + )); } - if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) + } + var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + var priceList = _priceRepository.ToList();//价格单 + + var dto1s = ObjectMapper.Map, List>(entitys); + var q = from d in dto1s + join p in priceList on d.LU equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 + select new TEMP_CAN_SA_DETAIL + { + Id = d.Id, + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = d.ContractDocID, + BeginDate = p.BeginTime, + EndDate = p.EndTime, + PartCode = d.PartCode + + }; + var dtos = q.ToList(); + if (dtos != null && dtos.Count > 0) + { + if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!"); + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var ls = ObjectMapper.Map, List>(entities); + invBilllist.AddRange(ls); + } - - var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + else//二次开票 { - foreach (var itm in adjlist) - { - bbaclist.Add(new BBAC_CAN_SA_DETAIL( - guid: itm.Id, - keyCode: itm.KeyCode, - version: itm.Version, - billNum: itm.InvGroupNum, - settleBillNum: itm.SettleBillNum, - lU: itm.LU, - pN: itm.PN, - site: itm.Site, - qty: itm.Qty, - price: itm.Price, - category: itm.BusinessType, - isReturn: itm.Qty > 0 ? false : true, - settleDate: itm.SettleDate, - groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, - contactid: itm.Extend1,//生产号 - invbillnum: string.Empty, - partcode: itm.PartCode - )); - } + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var ls = ObjectMapper.Map, List>(entities); + invBilllist.AddRange(ls); + } - var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 - var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - var priceList = _priceRepository.ToList();//价格单 - //var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); - //if (errorList.Count() > 0) - //{ - // return await ExportErrorReportAsync(errorList); - //} - var dto1s = ObjectMapper.Map, List>(entitys); - var q = from d in dto1s - join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 - select new TEMP_CAN_SA_DETAIL - { - Id = d.Id, - SettleBillNum = d.SettleBillNum, - Site = d.Site, - Version = d.Version, - Price = p.Price, - BillNum = d.BillNum, - SettleDate = d.SettleDate, - InvGroupNum = d.InvGroupNum, - LU = d.LU, - MaterialDesc = d.MaterialDesc, - PN = d.PN, - Qty = d.Qty, - GroupNum = d.GroupNum, - Amt = Math.Round(d.Qty * p.Price, 2), - ContractDocID = d.ContractDocID, - BeginDate = p.BeginTime, - EndDate = p.EndTime, - PartCode = d.PartCode - }; - var dtos = q.ToList(); - if (dtos != null && dtos.Count > 0) + } + else + { + throw new UserFriendlyException($"不存发票号为:{invbillnum}发票"); + } + } + var invlist=invBilllist.OrderBy(p => p.PartCode).ToList(); + return new JsonResult(new { Code = 200, Data= invlist }); + + } + + [HttpPost] + [UnitOfWork(false)] + /// + /// 发票重开列表 + /// + /// + /// + public virtual async Task ReissueInvoiceListExt(List p_list) + { + + var invBilllist = new List(); + var adjlist = ObjectMapper.Map, List>(p_list); + if (adjlist == null && adjlist.Count == 0) + { + throw new UserFriendlyException($"调整表无数据!"); + } + var first = p_list.FirstOrDefault(); + var invbillnum = first.InvBillNum; + //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 + //if (mappingList != null && mappingList.Count() > 0) + //{ + var version = int.Parse(DateTime.Now.ToString("yyyymm")); + //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + + var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum); + + if (settle == null) + { + throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!"); + } + version = settle.Version; + if (inv != null) + { + if (inv.InvoiceState == InvoiceBillState.报废) + { + throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!"); + } + if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) + { + throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!"); + } + var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count() > 0) + { + foreach (var itm in adjlist) { + bbaclist.Add(new BBAC_CAN_SA_DETAIL( + guid: itm.Id, + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + category: itm.BusinessType, + isReturn: itm.Qty > 0 ? false : true, + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + contactid: itm.Extend1,//生产号 + invbillnum: string.Empty, + partcode: itm.PartCode + )); + } + } + var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + var priceList = _priceRepository.ToList();//价格单 + + var dto1s = ObjectMapper.Map, List>(entitys); + var q = from d in dto1s + join p in priceList on d.LU equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 + select new TEMP_CAN_SA_DETAIL + { + Id = d.Id, + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = d.ContractDocID, + BeginDate = p.BeginTime, + EndDate = p.EndTime, + PartCode = d.PartCode + + }; + var dtos = q.ToList(); + if (dtos != null && dtos.Count > 0) + { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); @@ -458,20 +591,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var invlist = ls.Select(p => p.InvbillNum).Distinct(); foreach (var itm in invlist) { - var invBill = new INVOICE_REPEAT_DTO(); - var invls= ls.Where(p => p.InvbillNum == itm).ToList(); - var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); - var tax = inv.Tax;//税率 - var amt = entitylist.Sum(p => p.Amt);//税前 - var taxamt = amt + Math.Round(amt * tax, 2);//税后 - var realamt = Math.Round(amt*tax,2);//税额 - invBill.Amt = amt; - invBill.TaxAmt = taxamt; - invBill.Tax = tax; - invBill.BusinessType = inv.BusinessType; - invBill.DETAIL =invls ; - invBill.RealAmt = realamt; - invBilllist.Add(invBill); + var invBill = new INVOICE_REPEAT_DTO(); + var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + var tax = inv.Tax;//税率 + var amt = entitylist.Sum(p => p.Amt);//税前 + var taxamt = amt + Math.Round(amt * tax, 2);//税后 + var realamt = Math.Round(amt * tax, 2);//税额 + invBill.Amt = amt; + invBill.TaxAmt = taxamt; + invBill.Tax = tax; + invBill.BusinessType = inv.BusinessType; + invBill.DETAIL = invls; + invBill.RealAmt = realamt; + invBilllist.Add(invBill); } } } @@ -499,22 +632,32 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invBilllist.Add(invBill); } } - } - } - else - { - throw new UserFriendlyException($"不存发票号为:{invbillnum}发票"); } + } + else + { + throw new UserFriendlyException($"不存发票号为:{invbillnum}发票"); + } //} //else //{ // throw new UserFriendlyException($"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return invBilllist; - + return new JsonResult(new { Code = 200, Data = invBilllist }); + + + } + + + + + + + + } } 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 b187badb..70bd41bb 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 @@ -10,6 +10,7 @@ using System.Text; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Services; +using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; @@ -29,20 +30,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [Route("api/settleaccount/[controller]/[action]")] public class HBPO_BA_SERVICE : BA_SERVICE { - + private readonly INormalEfCoreRepository _priceRepository; + private readonly ADJ_SERVICE _adjservice; public HBPO_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository pubRepository, INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, INormalEfCoreRepository adjRepository, BBAC_CAN_SA_MNG bbacMng, HBPO_CAN_SA_MNG hbpoMng, PUB_CAN_SA_MNG pubMng, INV_MNG invMng, TaskJobService service, BaseDomainService baseservice, - INormalEfCoreRepository priceRepository - + INormalEfCoreRepository priceRepository, + ADJ_SERVICE adjservice ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service,baseservice) { _priceRepository= priceRepository; + _adjservice = adjservice; } @@ -296,6 +299,150 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } + //[HttpPost] + //[UnitOfWork(false)] + ///// + ///// 发票重开列表 + ///// + ///// + ///// + //public virtual async Task ReissueInvoiceList(List p_list) + //{ + + // var result = await _adjservice.CheckImport(p_list); + // if (result != "OK") + // { + // return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); + // } + + // var invBilllist = new List(); + // var adjlist = ObjectMapper.Map, List>(p_list); + // if (adjlist == null && adjlist.Count == 0) + // { + // throw new UserFriendlyException($"调整表无数据!"); + // } + // var first = p_list.FirstOrDefault(); + // var invbillnum = first.InvBillNum; + // //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 + // //if (mappingList != null && mappingList.Count() > 0) + // //{ + // var version = int.Parse(DateTime.Now.ToString("yyyymm")); + // //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + // var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + + // var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum); + + // if (settle == null) + // { + // throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!"); + // } + // version = settle.Version; + // if (inv != null) + // { + // if (inv.InvoiceState == InvoiceBillState.报废) + // { + // throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!"); + // } + // if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) + // { + // throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!"); + // } + + // var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + // //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + // if (adjlist != null && adjlist.Count() > 0) + // { + // foreach (var itm in adjlist) + // { + // bbaclist.Add(new BBAC_CAN_SA_DETAIL( + // guid: itm.Id, + // keyCode: itm.KeyCode, + // version: itm.Version, + // billNum: itm.InvGroupNum, + // settleBillNum: itm.SettleBillNum, + // lU: itm.LU, + // pN: itm.PN, + // site: itm.Site, + // qty: itm.Qty, + // price: itm.Price, + // category: itm.BusinessType, + // isReturn: itm.Qty > 0 ? false : true, + // settleDate: itm.SettleDate, + // groupNum: itm.GroupNum, + // invGroupNum: itm.InvGroupNum, + // contactid: itm.Extend1,//生产号 + // invbillnum: string.Empty, + // partcode: itm.PartCode + // )); + // } + // } + // var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + // var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + // var priceList = _priceRepository.ToList();//价格单 + + // var dto1s = ObjectMapper.Map, List>(entitys); + // var q = from d in dto1s + // join p in priceList on d.LU equals p.LU + // where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 + // select new TEMP_CAN_SA_DETAIL + // { + // Id = d.Id, + // SettleBillNum = d.SettleBillNum, + // Site = d.Site, + // Version = d.Version, + // Price = p.Price, + // BillNum = d.BillNum, + // SettleDate = d.SettleDate, + // InvGroupNum = d.InvGroupNum, + // LU = d.LU, + // MaterialDesc = d.MaterialDesc, + // PN = d.PN, + // Qty = d.Qty, + // GroupNum = d.GroupNum, + // Amt = Math.Round(d.Qty * p.Price, 2), + // ContractDocID = d.ContractDocID, + // BeginDate = p.BeginTime, + // EndDate = p.EndTime, + // PartCode = d.PartCode + + // }; + // var dtos = q.ToList(); + // if (dtos != null && dtos.Count > 0) + // { + // if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 + // { + // var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + // var ls = ObjectMapper.Map, List>(entities); + // invBilllist.AddRange(ls); + + // } + // else//二次开票 + // { + // var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + // var ls = ObjectMapper.Map, List>(entities); + // invBilllist.AddRange(ls); + + // } + + // } + // else + // { + // throw new UserFriendlyException($"不存发票号为:{invbillnum}发票"); + // } + // } + // var invlist = invBilllist.OrderBy(p => p.PartCode); + // return new JsonResult(new { Code = 200, Data = invlist }); + + //} + + + + + + + + + @@ -304,8 +451,204 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public virtual async Task> ReissueInvoiceList(List p_list) + public virtual async Task ReissueInvoiceList(List p_list) { + + var result = await _adjservice.CheckImport(p_list); + if (result != "OK") + { + return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); + } + + + + var invBilllist = new List(); + + var adjlist = ObjectMapper.Map, List>(p_list); + if (adjlist == null && adjlist.Count == 0) + { + throw new UserFriendlyException($"调整表无数据!"); + } + var first = p_list.FirstOrDefault(); + var invbillnum = first.InvBillNum; + + //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 + //if (mappingList != null && mappingList.Count() > 0) + //{ + var version = int.Parse(DateTime.Now.ToString("yyyymm")); + //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + + var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum); + + if (settle == null) + { + throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); + } + version = settle.Version; + if (inv != null) + { + if (inv.InvoiceState == InvoiceBillState.报废) + { + throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!", "400"); + } + if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) + { + throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); + } + + var bbaclist = await _hbpoMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count() > 0) + { + foreach (var itm in adjlist) + { + bbaclist.Add(new HBPO_CAN_SA_DETAIL( + guid: itm.Id, + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + businessType: itm.BusinessType, + + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + + invbillnum: string.Empty, + partcode: itm.PartCode + )); + } + } + var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + + var priceList = _priceRepository.ToList();//价格单 + //var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); + //if (errorList.Count() > 0) + //{ + // return await ExportErrorReportAsync(errorList); + //} + var dto1s = ObjectMapper.Map, List>(entitys); + var q = from d in dto1s + join p in priceList on d.PartCode equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 + select new TEMP_CAN_SA_DETAIL + { + Id = d.Id, + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = "N", + BeginDate = p.BeginTime, + EndDate = p.EndTime, + PartCode = d.PartCode + + }; + var dtos = q.ToList(); + if (dtos != null && dtos.Count > 0) + { + if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 + { + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var ls = ObjectMapper.Map, List>(entities); + + invBilllist.AddRange(ls); + //var invlist = ls.Select(p => p.InvbillNum).Distinct(); + //foreach (var itm in invlist) + //{ + // var invBill = new INVOICE_REPEAT_DTO(); + // var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + // var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + // var tax = inv.Tax;//税率 + // var amt = entitylist.Sum(p => p.Amt);//税前 + // var taxamt = amt + Math.Round(amt * tax, 2);//税后 + // var realamt = Math.Round(amt * tax, 2);//税额 + // invBill.Amt = amt; + // invBill.TaxAmt = taxamt; + // invBill.Tax = tax; + // invBill.BusinessType = inv.BusinessType; + // invBill.DETAIL = invls; + // invBill.RealAmt = realamt; + // invBilllist.Add(invBill); + //} + } + else//二次开票 + { + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var ls = ObjectMapper.Map, List>(entities); + invBilllist.AddRange(ls); + + //var invlist = ls.Select(p => p.InvbillNum).Distinct(); + //foreach (var itm in invlist) + //{ + // var invBill = new INVOICE_REPEAT_DTO(); + // var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + // var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + // var tax = inv.Tax;//税率 + // var amt = entitylist.Sum(p => p.Amt);//税前 + // var taxamt = amt + Math.Round(amt * tax, 2);//税后 + // var realamt = Math.Round(amt * tax, 2);//税额 + // invBill.Amt = amt; + // invBill.TaxAmt = taxamt; + // invBill.Tax = tax; + // invBill.BusinessType = inv.BusinessType; + // invBill.DETAIL = invls; + // invBill.RealAmt = realamt; + // invBilllist.Add(invBill); + //} + + } + } + } + else + { + throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); + } + var invlist = invBilllist.OrderBy(p => p.PartCode).ToList(); + //} + //else + //{ + // throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号"); + //} + + return new JsonResult(new { Code = 200, Message = "生成成功", Data= invBilllist }); + + + } + + + [HttpPost] + /// 发票重开列表 + /// + /// + /// + public virtual async Task ReissueInvoiceListExt(List p_list) + { + + var result = await _adjservice.CheckImport(p_list); + if (result != "OK") + { + return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); + } + + + var invBilllist = new List(); var adjlist = ObjectMapper.Map, List>(p_list); @@ -465,7 +808,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号"); //} - return invBilllist; + + return new JsonResult(new { Code = 200, Message = "生成成功", Data = invBilllist }); + } @@ -474,6 +819,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ + + + } } 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 c78ee245..b2b84e85 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 @@ -33,19 +33,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly INormalEfCoreRepository _priceRepository; private readonly INormalEfCoreRepository _pricebjRepository; + private readonly ADJ_SERVICE _adjservice; public PUB_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository pubRepository, INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, INormalEfCoreRepository adjRepository, BBAC_CAN_SA_MNG bbacMng, HBPO_CAN_SA_MNG hbpoMng, PUB_CAN_SA_MNG pubMng, INV_MNG invMng, TaskJobService service, BaseDomainService baseservice, INormalEfCoreRepository priceRepository, - INormalEfCoreRepository pricebjRepository - + INormalEfCoreRepository pricebjRepository, + ADJ_SERVICE adjservice ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service,baseservice) { _priceRepository = priceRepository; _pricebjRepository = pricebjRepository; + _adjservice= adjservice; } @@ -331,15 +333,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public virtual async Task> ReissueInvoiceList(List p_list) + public virtual async Task ReissueInvoiceListExt(List p_list) { + + var result = await _adjservice.CheckImport(p_list); + if (result != "OK") + { + return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); + } + var first = p_list.FirstOrDefault(); var invbillnum = first.InvBillNum; - var invBilllist = new List(); - - List ls = new List(); var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) @@ -371,9 +377,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count() > 0) { foreach (var itm in adjlist) @@ -499,13 +504,190 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号"); //} - return invBilllist; + return new JsonResult(new { Code = 200, Message = "生成成功", Data = invBilllist }); } + [HttpPost] + public virtual async Task ReissueInvoiceList(List p_list) + { + + + var result = await _adjservice.CheckImport(p_list); + if (result != "OK") + { + return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); + } + + var first = p_list.FirstOrDefault(); + var invbillnum = first.InvBillNum; + var invBilllist = new List(); + List ls = new List(); + var adjlist = ObjectMapper.Map, List>(p_list); + if (adjlist == null && adjlist.Count == 0) + { + throw new UserFriendlyException($"调整表无数据!", "400"); + } + + //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 + //if (mappingList != null && mappingList.Count() > 0) + //{ + var version = int.Parse(DateTime.Now.ToString("yyyymm")); + //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + + var settle = await _pubMng.GetMainAsync(inv.InvGroupNum); + if (settle == null) + { + throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); + } + version = settle.Version; + if (inv != null) + { + if (inv.InvoiceState == InvoiceBillState.报废) + { + throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!", "400"); + } + if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) + { + throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); + } + var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count() > 0) + { + foreach (var itm in adjlist) + { + bbaclist.Add(new PUB_CAN_SA_DETAIL( + guid: itm.Id, + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + businessType: itm.BusinessType, + + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + invbillnum: string.Empty, + partcode: itm.PartCode, + pobillnum: string.Empty + )); + } + } + var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + + var priceList = _priceRepository.ToList();//价格单 + //var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); + //if (errorList.Count() > 0) + //{ + // return await ExportErrorReportAsync(errorList); + //} + var dto1s = ObjectMapper.Map, List>(entitys); + var q = from d in dto1s + join p in priceList on d.PartCode equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 + select new TEMP_CAN_SA_DETAIL + { + Id = d.Id, + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = "N", + BeginDate = p.BeginTime, + EndDate = p.EndTime, + PartCode = d.PartCode + + }; + var dtos = q.ToList(); + if (dtos != null && dtos.Count > 0) + { + if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 + { + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + + ls = ObjectMapper.Map, List>(entities); + + invBilllist.AddRange(ls.ToList()); + + + //var invlist = ls.Select(p => p.InvbillNum).Distinct(); + //foreach (var itm in invlist) + //{ + // var invBill = new INVOICE_REPEAT_DTO(); + // var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + // var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + // var tax = inv.Tax;//税率 + // var amt = entitylist.Sum(p => p.Amt);//税前 + // var taxamt = amt + Math.Round(amt * tax, 2);//税后 + // var realamt = Math.Round(amt * tax, 2);//税额 + // invBill.Amt = amt; + // invBill.TaxAmt = taxamt; + // invBill.Tax = tax; + // invBill.BusinessType = inv.BusinessType; + // invBill.DETAIL = invls; + // invBill.RealAmt = realamt; + // invBilllist.Add(invBill); + //} + } + else//二次开票 + { + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + ls = ObjectMapper.Map, List>(entities); + //var invlist = ls.Select(p => p.InvbillNum).Distinct(); + //foreach (var itm in invlist) + //{ + // var invBill = new INVOICE_REPEAT_DTO(); + // var invls = ls.Where(p => p.InvbillNum == itm).ToList(); + // var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); + // var tax = inv.Tax;//税率 + // var amt = entitylist.Sum(p => p.Amt);//税前 + // var taxamt = amt + Math.Round(amt * tax, 2);//税后 + // var realamt = Math.Round(amt * tax, 2);//税额 + // invBill.Amt = amt; + // invBill.TaxAmt = taxamt; + // invBill.Tax = tax; + // invBill.BusinessType = inv.BusinessType; + // invBill.DETAIL = invls; + // invBill.RealAmt = realamt; + // invBilllist.Add(invBill); + //} + invBilllist.AddRange(ls.ToList()); + + } + } + } + else + { + throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); + } + //} + //else + //{ + // throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号"); + //} + return new JsonResult(new { Code = 200, Message = "生成成功", Data = invBilllist }); + + } From 40fe8a5cc093b85e68ff8aebb8ebeb641de38764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 9 Sep 2023 11:58:08 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs | 1 + 1 file changed, 1 insertion(+) 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 b2b84e85..bd9b4761 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 @@ -680,6 +680,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); } + var invlist = invBilllist.OrderBy(p => p.PartCode).ToList(); //} //else //{ From 061a1a07ee10e798688a1cf20b14a7e5dcdab506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 9 Sep 2023 12:09:30 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/INVOICE_SERVICE.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 010dbb70..5f8e2709 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 @@ -184,7 +184,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BeginDate = itm.BeginDate, EndDate = itm.EndDate, }; - entity.INVOICE_WAIT_DETAIL_BBAC = wquery.ToList(); + entity.INVOICE_WAIT_DETAIL_BBAC = wquery.OrderBy(p => p.LU).ToList(); } else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) { @@ -214,7 +214,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BeginDate = itm.BeginDate, EndDate = itm.EndDate, }; - entity.INVOICE_WAIT_DETAIL_BJ = wquery.ToList(); + entity.INVOICE_WAIT_DETAIL_BJ = wquery.OrderBy(p => p.LU).ToList(); } else { @@ -246,7 +246,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ EndDate = itm.EndDate, }; - entity.INVOICE_WAIT_DETAIL= wquery.ToList(); + + + + entity.INVOICE_WAIT_DETAIL= wquery.OrderBy(p=>p.LU).ToList(); } var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); From a4e5388aade0c1aeca234dbbc92c5ed404e63c93 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Sat, 9 Sep 2023 13:00:56 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E9=87=8D=E5=BC=80?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4;=E9=AB=98=E7=BA=A7?= =?UTF-8?q?=E7=AD=9B=E9=80=89tabs=E8=BD=ACselect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/components/form/form-input.js | 12 +++---- .../wwwroot/components/list/index.js | 2 +- .../wwwroot/views/settle/_check.js | 31 ++++++++++--------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js index 99a4a65f..c6ed84ba 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js @@ -19,17 +19,17 @@ export default {