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 242a1530..c272e5a5 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 @@ -38,6 +38,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.CodeSettings; using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.EntityFrameworkCore; @@ -319,6 +320,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private async Task CreatePubTaskAsync(List invoiceGrps) { + var codelist = _settleAccountDbContext.Set().Where(p => p.Project == "库位").ToList(); + var zg1 = codelist.Where(p => p.Value == "ZhiGongJianBBAC").FirstOrDefault().Description; + var zg2 = codelist.Where(p => p.Value == "ZhiGongJianBBAC顺义").FirstOrDefault().Description; + + var bj = codelist.Where(p => p.Value == "BeiJian").FirstOrDefault().Description; + var yindu = codelist.Where(p => p.Value == "YinDuJian").FirstOrDefault().Description; + var zgh = codelist.Where(p => p.Value == "ZhiGongJianHBPO").FirstOrDefault().Description; + + // 对发票组进行处理 foreach (var itm in invoiceGrps) { @@ -350,23 +360,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { case EnumBusinessType.YinDuJian: - itm1.ErpLoc = $"CC001"; + itm1.ErpLoc = yindu; break; case EnumBusinessType.BeiJian: - itm1.ErpLoc = $"CC005"; + itm1.ErpLoc = bj; break; case EnumBusinessType.ZhiGongJianBBAC: if (site == "1046") { - itm1.ErpLoc = "CC171"; + itm1.ErpLoc = zg2; } if (site == "1040") { - itm1.ErpLoc = "CC001"; + itm1.ErpLoc = zg1; } break; case EnumBusinessType.ZhiGongJianHBPO: - itm1.ErpLoc = $"CC004"; + itm1.ErpLoc = zgh; break; default: itm1.ErpLoc = $"C{invoice.ClientCode}";