From 3a21ada50841050ac5d1cfa397a9685248cd82db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 10 Aug 2023 15:01:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs | 12 ++++- .../Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs | 17 +++++- .../Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs | 15 ++++-- .../Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs | 19 +++++-- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 36 +++++++++---- .../Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs | 3 +- .../Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs | 15 +++++- .../Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs | 44 +++------------ .../Bases/BA_SERVICE.cs | 1 - .../Bases/CAN_SA_SERVICE.cs | 4 ++ .../Entities/BQ/BBAC_BA_SERVICE.cs | 15 +++--- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 7 ++- .../Entities/BQ/HBPO_BA_SERVICE.cs | 8 +-- .../Entities/BQ/HBPO_CAN_SA_SERVICE.cs | 8 ++- .../Entities/BQ/INVOICE_SERVICE.cs | 1 - .../Entities/BQ/PUB_BA_SERVICE.cs | 8 +-- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 4 +- .../SettleAccount.Domain/Bases/EntityBase.cs | 2 +- .../Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs | 4 +- .../Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs | 4 +- .../Entities/BQ/Managers/INV_MNG.cs | 53 ++++++++++++------- .../Entities/BQ/Managers/PUB_CAN_SA_MNG.cs | 4 +- .../Entities/BQ/Temp/TempClass.cs | 6 +++ 23 files changed, 182 insertions(+), 108 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs index c303a71a..5b0feba9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs @@ -103,7 +103,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public string ContractDocID { set; get; } - + /// + /// 客户零件号 + /// + + public string PartCode { get; set; } + @@ -156,6 +161,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal Qty { get; set; } [ExporterHeader(DisplayName = "结算分组号")] public string GroupNum { get; set; } + /// + /// 客户零件号 + /// + [ExporterHeader(DisplayName = "客户零件号")] + public string PartCode { get; set; } } //public class BBAC_CAN_SA_EXP_DTO diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs index ee84a141..02c44e17 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs @@ -1,4 +1,4 @@ -using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -60,6 +60,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string GroupNum { get; set; } + /// + /// 客户零件号 + /// + public string PartCode { get; set; } + + + + } public class BBAC_NOT_SA_DETAIL_EXP_DTO { @@ -110,7 +118,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal Qty { get; set; } [ExporterHeader(DisplayName = "结算分组号")] public string GroupNum { get; set; } - + /// + /// 客户零件号 + /// + [ExporterHeader(DisplayName = "何苦零件号")] + public string PartCode { get; set; } + } public class BBAC_NOT_SA_DETAIL_REQ_DTO : RequestInputBase { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs index 68beef4e..ed09fc50 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs @@ -94,7 +94,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string GroupNum { get; set; } - public decimal Amt { get; set; } + public decimal Amt { get; set; } + + + public string PartCode { get; set; } } public class HBPO_CAN_SA_DETAIL_EXP_DTO { @@ -129,13 +132,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public DateTime SettleDate { get; set; } [ExporterHeader(DisplayName = "发票分组号")] public string InvGroupNum { get; set; } - [ExporterHeader(DisplayName = "LU")] + [ExporterHeader(DisplayName = "零件号")] public string LU { get; set; } [ExporterHeader(DisplayName = "物料描述")] public string MaterialDesc { get; set; } - [ExporterHeader(DisplayName = "生产码")] public string PN { get; set; } public string KeyCode { get; set; } @@ -143,7 +145,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal Qty { get; set; } [ExporterHeader(DisplayName = "结算分组号")] public string GroupNum { get; set; } - + /// + /// 客户零件号 + /// + [ExporterHeader(DisplayName = "客户零件号")] + public string PartCode { get; set; } + } public class HBPO_CAN_SA_REQ_DTO : RequestInputBase diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs index 4f281843..48fda111 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs @@ -1,4 +1,4 @@ -using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -63,6 +63,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// 结算分组号 /// public string GroupNum { get; set; } + /// + /// 客户零件号 + /// + public string PartCode { get; set; } } public class HBPO_NOT_SA_DETAIL_EXP_DTO @@ -98,7 +102,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public DateTime SettleDate { get; set; } [ExporterHeader(DisplayName = "发票分组号")] public string InvGroupNum { get; set; } - [ExporterHeader(DisplayName = "LU")] + [ExporterHeader(DisplayName = "零件号(LU)")] public string LU { get; set; } [ExporterHeader(DisplayName = "物料描述")] @@ -111,7 +115,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal Qty { get; set; } [ExporterHeader(DisplayName = "结算分组号")] public string GroupNum { get; set; } - + + [ExporterHeader(DisplayName = "客户零件号")] + public string PartCode { get; set; } + + } public class HBPO_NOT_SA_DETAIL_REQ_DTO : RequestInputBase { @@ -147,7 +155,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "结算分组号")] public string GroupNum { get; set; } - + + + public string PartCode { get; set; } + } 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 f9bfa2e5..cbb6f8f7 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 @@ -18,16 +18,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { [Display(Name = "期间")] public int Version { set; get; } - /// ///实际纸质发票号 /// - [Display(Name = "实际纸质发票号")] + [Display(Name = "金税发票号")] public string RealnvBillNum { get; set; } /// ///系统生成发票号 /// - [Display(Name = "系统生成发票号")] + [Display(Name = "系统发票号")] public string InvbillNum { get; set; } /// ///未税金额 @@ -40,18 +39,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "税后金额")] public decimal TaxAmt { get; set; } - [Display(Name = "金税发票税后金额")] + [Display(Name = "金税发票金额")] public decimal RealAmt { get; set; } /// ///发票分组号 /// [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } - /// - ///开票Excel文件 - /// - [Display(Name = "开票Excel文件")] - public string FileName { get; set; } + /// ///业务类别 /// @@ -78,12 +73,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// ///实际纸质发票号 /// - [ExporterHeader(DisplayName = "实际纸质发票号")] + [ExporterHeader(DisplayName = "金税发票号")] public string RealnvBillNum { get; set; } /// ///系统生成发票号 /// - [ExporterHeader(DisplayName = "系统生成发票号")] + [ExporterHeader(DisplayName = "系统发票号")] public string InvbillNum { get; set; } /// ///未税金额 @@ -100,6 +95,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// [ExporterHeader(DisplayName = "税后金额")] public decimal TaxAmt { get; set; } + /// + ///业务类别 + /// + [ExporterHeader(DisplayName = "业务类别")] + public EnumBusinessType BusinessType { get; set; } + + [ExporterHeader(DisplayName = "状态")] + public SettleBillState State { get; set; } + + [ExporterHeader(DisplayName = "发票状态")] + public InvoiceBillState InvoiceState { get; set; } + + //[ExporterHeader(DisplayName ="发票税后尾差")] + //public decimal TaxDiff { get; set; } + [Display(Name = "客户代码")] + public string ClientCode { get; set; } + + + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs index 37218761..0fea4691 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs @@ -23,7 +23,6 @@ public class PUB_ADJ_DETAIL_DTO : EntityDto /// [Display(Name = "发票号")] public string InvBillNum { get; set; } - /// /// 下线日期 /// @@ -63,6 +62,8 @@ public class PUB_ADJ_DETAIL_EXP_DTO public decimal Qty { get; set; } [Display(Name = "结算分组号")] public string GroupNum { get; set; } + public string PartCode { get; set; } + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs index 258e2a82..87b111e9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs @@ -92,7 +92,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public DateTime SettleDate { get; set; } [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } - [Display(Name = "发票分组号")] + [Display(Name = "零件号")] public string LU { get; set; } [Display(Name = "")] public string PN { get; set; } @@ -105,8 +105,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "金额")] public decimal Amt { get; set; } - + [Display(Name = "物料描述")] public string MaterialDesc { set; get; } + [Display(Name = "客户零件号")] + public string PartCode { get; set; } } @@ -149,6 +151,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal Qty { get; set; } [ExporterHeader(DisplayName = "结算分组号")] public string GroupNum { get; set; } + + [ExporterHeader(DisplayName = "物料描述")] + public string MaterialDesc { set; get; } + [ExporterHeader(DisplayName= "客户零件号")] + public string PartCode { get; set; } + + + + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs index 28fabf13..6d2d323f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs @@ -1,4 +1,4 @@ -using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -50,24 +50,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "结算分组号")] public string GroupNum { get; set; } - /// - ///扩展1 - /// - [Display(Name = "扩展1")] - public string Extend1 { get; set; } - /// - ///扩展2 - /// - [Display(Name = "扩展2")] - public string Extend2 { get; set; } - /// - ///扩展3 - /// - [Display(Name = "扩展3")] - public string Extend3 { get; set; } - /// - ///业务分类 - /// + } @@ -112,23 +95,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal Qty { get; set; } [Display(Name = "结算分组号")] public string GroupNum { get; set; } - /// - ///扩展1 - /// - [ExporterHeader(DisplayName = "扩展1")] - public string Extend1 { get; set; } - /// - ///扩展2 - /// - [ExporterHeader(DisplayName = "扩展2")] - public string Extend2 { get; set; } - /// - ///扩展3 - /// - [ExporterHeader(DisplayName = "扩展3")] - public string Extend3 { get; set; } - - + [Display(Name = "物料描述")] + public string MaterialDesc { get; set; } + + [Display(Name = "客户零件号")] + public string PartCode { get; set; } + } 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 35d72cbb..2c495ed7 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 @@ -65,7 +65,6 @@ namespace Win.Sfs.SettleAccount.Bases protected BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, - INormalEfCoreRepository pubRepository, INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, 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 bd487df0..7f1fe7b8 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 @@ -83,6 +83,10 @@ namespace Win.Sfs.SettleAccount.Bases var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters); var dtos = ObjectMapper.Map, List>(entitys); + + + + return new PagedResultDto(totalCount, dtos); } /// 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 31aadfb8..f6057066 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 @@ -33,13 +33,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [Route("api/settleaccount/[controller]/[action]")] public class BBAC_BA_SERVICE : BA_SERVICE { - private readonly INormalEfCoreRepository _adjRepository; + private readonly INormalEfCoreRepository _priceRepository; public BBAC_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, - INormalEfCoreRepository pubRepository, + INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, @@ -53,7 +53,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INormalEfCoreRepository priceRepository - ) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service) + ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service) { _priceRepository = priceRepository; } @@ -109,7 +109,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ groupNum: itm.GroupNum, invGroupNum: itm.InvGroupNum, contactid: itm.Extend1,//生产号 - invbillnum:string.Empty, partcode:itm.PartCode )); @@ -128,8 +127,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.PartCode equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 select new TEMP_CAN_SA_DETAIL { SettleBillNum = d.SettleBillNum, @@ -147,7 +146,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Amt = Math.Round(d.Qty * p.Price, 2), ContractDocID = d.ContractDocID, BeginDate = p.BeginTime, - EndDate = p.EndTime + EndDate = p.EndTime, + PartCode= d.PartCode + }; var dtos = q.ToList(); if (dtos != null && dtos.Count > 0) 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 35c17389..d37068a0 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 @@ -120,7 +120,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Amt = Math.Round(d.Qty * p.Price, 2), ContractDocID = d.ContractDocID, BeginDate = p.BeginTime, - EndDate = p.EndTime + EndDate = p.EndTime, + PartCode = d.PartCode }; var dtos = q.ToList(); @@ -143,7 +144,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ InvGroupNum = p.InvGroupNum, SettleDate = p.SettleDate, GroupNum = p.GroupNum, - ContractDocID = string.Empty + ContractDocID = string.Empty, + PartCode=p.PartCode + }).ToList();//不能结算 await FirstInvoice(entitys,new List(),dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType); } 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 6484373c..95b97db3 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 @@ -38,7 +38,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INormalEfCoreRepository priceRepository ) - : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service) + : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service) { _priceRepository= priceRepository; } @@ -92,7 +92,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ qty: itm.Qty, price: itm.Price, businessType: itm.BusinessType, - settleDate: itm.SettleDate, groupNum: itm.GroupNum, invGroupNum: itm.InvGroupNum, @@ -113,7 +112,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 + 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 { @@ -132,7 +131,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Amt = Math.Round(d.Qty * p.Price, 2), ContractDocID = "n", BeginDate = p.BeginTime, - EndDate = p.EndTime + EndDate = p.EndTime, + PartCode=d.PartCode }; var dtos = q.ToList(); if (dtos != null && dtos.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 96fb2797..65004ab2 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 @@ -1,3 +1,4 @@ +using CodeArts; using DocumentFormat.OpenXml.Bibliography; using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; @@ -112,7 +113,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Amt = Math.Round(d.Qty * p.Price, 2), ContractDocID="no", BeginDate = p.BeginTime, - EndDate = p.EndTime + EndDate = p.EndTime, + PartCode=d.PartCode + }; var dtos = q.ToList(); if (dtos != null && dtos.Count > 0) @@ -134,7 +137,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ InvGroupNum = p.InvGroupNum, SettleDate = p.SettleDate, GroupNum = p.GroupNum, - ContractDocID = string.Empty + ContractDocID = string.Empty, + PartCode=p.PartCode }).ToList();//不能结算 var falg= await FirstInvoice(entitys,new List(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty,main.BusinessType); 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 5998e51d..aa956a9e 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 @@ -82,7 +82,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] public virtual async Task ApprovalPassed(List p_invs) { - await _invMng.SetForwardState(p_invs, SettleBillState.财务已审核); return ApplicationConsts.SuccessStr; } 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 03c79a7f..62c492dc 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 @@ -37,7 +37,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ - ) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service) + ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service) { _priceRepository = priceRepository; @@ -116,7 +116,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 + 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 { @@ -135,7 +135,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Amt = Math.Round(d.Qty * p.Price, 2), ContractDocID = "n", BeginDate = p.BeginTime, - EndDate = p.EndTime + EndDate = p.EndTime, + PartCode= d.PartCode + }; var dtos = q.ToList(); if (dtos != null && dtos.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 0f6bd683..d60e2180 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 @@ -112,7 +112,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Amt = Math.Round(d.Qty * p.Price, 2), ContractDocID = "no", BeginDate = p.BeginTime, - EndDate = p.EndTime + EndDate = p.EndTime, + PartCode=d.PartCode//客户零件号 + }; var dtos = q.ToList(); if (dtos != null && dtos.Count > 0) 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 33f21a64..7e06ed5c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs @@ -431,7 +431,7 @@ namespace SettleAccount.Bases public string InvbillNum { get; set; } - [Display(Name = "厂内零件号")] + public string PartCode { 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) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs index d23afa17..2647e5d8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs @@ -248,9 +248,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// - public virtual async Task> GetContainsAsync(string p_canSettleBillNum, List p_list) + public virtual async Task> GetContainsAsync(string p_invbillnum, List p_list) { - return await _detailRepository.Where(p =>p.InvGroupNum==p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync(); + return await _detailRepository.Where(p =>p.InvbillNum== p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs index 846fe5dc..44735d1a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs @@ -258,9 +258,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// - public virtual async Task> GetContainsAsync(string p_canSettleBillNum, List p_list) + public virtual async Task> GetContainsAsync(string p_invbillnum, List p_list) { - return await _detailRepository.Where(p => p.InvGroupNum == p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync(); + return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync(); } 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 8a925cc7..b61d082d 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 @@ -959,8 +959,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { List _invls = new List(); - var groups1 = dtos.GroupBy(p => new { p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV + var groups1 = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV { + PartCode=p.Key.PartCode, LU = p.Key.LU, Amt = p.Sum(itm => itm.Amt), Qty = p.Sum(itm => itm.Qty), @@ -969,8 +970,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers BeginDate = p.Key.BeginDate, EndDate = p.Key.EndDate }).ToList();//汇总记录不出现重复值 - var groups = dtos.GroupBy(p => new { p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV + var groups = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV { + PartCode = p.Key.PartCode, LU = p.Key.LU, Amt = p.Sum(itm => itm.Amt), Qty = p.Sum(itm => itm.Qty), @@ -983,6 +985,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var group in groups) { int i = groups1.Count(p => p.LU == group.LU + && p.PartCode==group.PartCode && p.BeginDate == group.BeginDate && p.EndDate == group.EndDate && p.ContractDocID == group.ContractDocID @@ -996,6 +999,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var group1 in groups1) { if (group.LU == group1.LU + && group.PartCode == group1.PartCode && group.BeginDate == group1.BeginDate && group.EndDate == group1.EndDate && group1.ContractDocID == group.ContractDocID @@ -1020,12 +1024,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invoiceMap.Add(invoiceBillNum, tempList); var query = from itm in groups1 //更新分组 join itm1 in tempList - on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID } - equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID } into temp + on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID ,itm.PartCode} + equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID,itm1.PartCode } into temp from tm in temp where tm == null select new TMEP_INV { + LU = itm.LU, Amt = itm.Amt, Qty = itm.Qty, @@ -1050,11 +1055,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var key = group.Key;//发票票号 var ls = group.Value;//发票明细 - + //反向查找结算数据 var query = from itm in dtos join itm1 in ls - on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } - join itm2 in p_list on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } + on new { itm.LU,itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate } + join itm2 in p_list on new { itm.PartCode, itm.SettleDate } equals new { itm2.PartCode, itm2.SettleDate } select itm2; foreach (var itm in query) { @@ -1063,10 +1068,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } if (!string.IsNullOrEmpty(p_parentInvBillNum)) { + //反向查找调整数据 var query1 = from itm in dtos join itm1 in ls - on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } - join itm2 in p_ajdlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } + on new { itm.LU,itm.PartCode ,itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate } + join itm2 in p_ajdlist on new { itm.PartCode, itm.SettleDate } equals new { itm2.PartCode, itm2.SettleDate } select itm2; foreach (var itm in query1) @@ -1183,8 +1189,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers public async Task> MakeInvoice(List details,List p_adjlist, List dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType, bool p_first) where TDetail : SA_CAN_BASE { List _invls = new List(); - var groups1 = dtos.GroupBy(p => new { p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV + var groups1 = dtos.GroupBy(p => new { p.PartCode,p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV { + PartCode=p.Key.PartCode, LU = p.Key.LU, Amt = p.Sum(itm => itm.Amt), Qty = p.Sum(itm => itm.Qty), @@ -1193,8 +1200,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers BeginDate = p.Key.BeginDate, EndDate = p.Key.EndDate }).ToList();//汇总记录不出现重复值 - var groups = dtos.GroupBy(p => new { p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV + var groups = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV { + PartCode=p.Key.PartCode, LU = p.Key.LU, Amt = p.Sum(itm => itm.Amt), Qty = p.Sum(itm => itm.Qty), @@ -1207,6 +1215,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var group in groups) { int i = groups1.Count(p => p.LU == group.LU + && p.PartCode==group.PartCode && p.BeginDate == group.BeginDate && p.EndDate == group.EndDate && p.ContractDocID == group.ContractDocID @@ -1231,6 +1240,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers && group.BeginDate == group1.BeginDate && group.EndDate == group1.EndDate && group1.ContractDocID == group.ContractDocID + && group1.PartCode== group1.PartCode ) { tempList.Add(group1); @@ -1249,15 +1259,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers sum += group1.Amt; tempList.Add(group1); } - invoiceMap.Add(invoiceBillNum, tempList); + invoiceMap.Add(invoiceBillNum, tempList);//每张发票的明细记录 var query = from itm in groups1 join itm1 in tempList - on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID } - equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID } into temp + on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID ,itm.PartCode} + equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID,itm1.PartCode } into temp from tm in temp where tm == null select new TMEP_INV { + PartCode= itm.PartCode, LU = itm.LU, Amt = itm.Amt, Qty = itm.Qty, @@ -1284,8 +1295,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers //更新结算记录更新 var query = from itm in dtos join itm1 in ls - on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } - join itm2 in details on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } + on new { LU=itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } + join itm2 in details on new { itm.LU,itm.PartCode, itm.SettleDate } equals new { itm2.LU,itm2.PartCode,itm2.SettleDate } select itm2; foreach (var itm in query) { @@ -1296,7 +1307,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { var query1 = from itm in dtos join itm1 in ls - on new { itm.LU, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } + on new {LU= itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } join itm2 in p_adjlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } select itm2; @@ -1477,6 +1488,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { var key = itm.Key;//发票票号 var ls = itm.Value;//结算分组号列表 + //反向查找结算数据 var invdetails = p_list.Where(p => ls.Contains(p.GroupNum)).ToList(); foreach (var detail in invdetails) { @@ -1485,6 +1497,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } if (!string.IsNullOrEmpty(p_parentInvBillNum)) { + //反向查找调整数据 var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList(); foreach (var detail in adjdetails) { @@ -1493,11 +1506,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } } - var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) + 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 { + InvGroupNum = itm.Key.InvGroupNum, - LU = itm.Key.LU, + LU = itm.Key.PartCode, ContactDocID = itm.Key.ContractDocID, Price = itm.Key.Price, Amt = Math.Round(itm.Sum(k => k.Qty) * itm.Key.Price, 2), @@ -1537,6 +1551,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invbillNum: key, invGroupNum: p_InvGroupNum, lU: detail.LU, + qty: detail.Qty, bussiessType: businessType, amt: detail.Amt, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs index fe31baeb..3ee1cd84 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs @@ -249,9 +249,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// - public virtual async Task> GetContainsAsync(string p_canSettleBillNum, List p_list) + public virtual async Task> GetContainsAsync(string p_invbillnum, List p_list) { - return await _detailRepository.Where(p => p.InvGroupNum == p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync(); + return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs index 36531c54..6438edb3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs @@ -9,6 +9,7 @@ using SettleAccount.Bases; namespace Win.Sfs.SettleAccount.Entities.BQ.Temp; public class TMEP_INV { + public string PartCode { set; get; } public string LU { set; get; } /// /// 合同号 @@ -100,6 +101,11 @@ public class TEMP_CAN_SA_DETAIL /// public DateTime EndDate { get; set; } + /// + /// 客户零件号 + /// + public string PartCode { get; set; } + } public class TEMP_NOT_SA_DETAIL : SA_NOT_BASE