From 236239507424e9faed83ae0bc629ae32c6045dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sun, 8 Oct 2023 10:14:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=92=A4=E9=94=80=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=95=B0=E6=8D=AE=E7=8A=B6=E6=80=81=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/BBAC_PD_DTO.cs | 59 ++++++++++++++++- .../Entities/BQ/Dtos/HBPO_PD_DTO.cs | 59 ++++++++--------- .../Entities/BQ/Dtos/PUB_PD_DTO.cs | 63 ++++++++++--------- .../Bases/PD_SERVICE.cs | 15 ++++- .../BQ/Syncs/PendingDeductionService.cs | 19 +++--- 5 files changed, 145 insertions(+), 70 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs index 6075dff5..ad982c2c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs @@ -8,7 +8,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { namespace SettleAccount.Domain.BQ { - public class BBAC_PD_DTO : EntityDto + public class PD_DTO : EntityDto { /// @@ -37,8 +37,61 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "地点")] public string Site { get; set; } - [Display(Name = "状态")] - public EnumBillState State { set; get; } + [Display(Name = "扣减单状态")] + public SettleBillState State { set; get; } + + [Display(Name = "发票状态")] + public SettleBillState InvState { set; get; } + + + + } + + + + + //public interface IPD_DTO + //{ + // public EnumBillState InvState { set; get; } + //} + + + public class BBAC_PD_DTO :PD_DTO + { + + ///// + /////期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + ///// + /////结算单据 + ///// + //[Display(Name = "发票号")] + //public string BillNum { get; set; } + ///// + /////关联结算单号 + ///// + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } + ///// + /////发票分组号 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } + ///// + /////地点 + ///// + //[Display(Name = "地点")] + //public string Site { get; set; } + + //[Display(Name = "扣减单状态")] + //public EnumBillState State { set; get; } + + //[Display(Name = "发票状态")] + //public EnumBillState InvState { set; get; } + + } public class BBAC_PD_EXP_DTO diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs index f34d9e22..508c6377 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs @@ -3,41 +3,44 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { - public class HBPO_PD_DTO : EntityDto + public class HBPO_PD_DTO : PD_DTO { - /// - ///期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } - /// - ///结算单据 - /// - [Display(Name = "发票分组号")] - public string BillNum { get; set; } - /// - ///关联结算单号 - /// - [Display(Name = "关联结算单号")] - public string SettleBillNum { get; set; } - /// - ///发票分组号 - /// - [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } - /// - ///地点 - /// - [Display(Name = "地点")] - public string Site { get; set; } + ///// + /////期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + ///// + /////结算单据 + ///// + //[Display(Name = "发票分组号")] + //public string BillNum { get; set; } + ///// + /////关联结算单号 + ///// + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } + ///// + /////发票分组号 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } + ///// + /////地点 + ///// + //[Display(Name = "地点")] + //public string Site { get; set; } - [Display(Name = "状态")] - public EnumBillState State { set; get; } + //[Display(Name = "扣减单状态")] + //public SettleBillState State { set; get; } + //[Display(Name = "发票状态")] + //public SettleBillState InvState { set; get; } } public class HBPO_PD_EXPORT { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs index 21a54602..238fd893 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs @@ -3,42 +3,45 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { - public class PUB_PD_DTO : EntityDto + public class PUB_PD_DTO : PD_DTO { - /// - ///期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } - /// - ///结算单据 - /// - [Display(Name = "发票分组号")] - public string BillNum { get; set; } - /// - ///关联结算单号 - /// - [Display(Name = "关联结算单号")] - public string SettleBillNum { get; set; } - /// - ///发票分组号 - /// - [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } - /// - ///地点 - /// - [Display(Name = "地点")] - public string Site { get; set; } - [Display(Name = "业务类型")] - public EnumBusinessType BusinessType { get; set; } + ///// + /////期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + ///// + /////结算单据 + ///// + //[Display(Name = "发票分组号")] + //public string BillNum { get; set; } + ///// + /////关联结算单号 + ///// + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } + ///// + /////发票分组号 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } + ///// + /////地点 + ///// + //[Display(Name = "地点")] + //public string Site { get; set; } + //[Display(Name = "业务类型")] + //public EnumBusinessType BusinessType { get; set; } - [Display(Name = "状态")] - public EnumBillState State { set; get; } + //[Display(Name = "状态")] + //public EnumBillState State { set; get; } + //[Display(Name = "发票状态")] + //public EnumBillState InvState { set; get; } } public class PUB_PD_EXPORT diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs index e57fc15f..46c617a4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -30,6 +30,7 @@ using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; +using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.TaskJobs; @@ -43,7 +44,7 @@ namespace Win.Sfs.SettleAccount.Bases public class PD_SERVICE : BASE_SERVICE where TEntity : PD_BASE_MAIN where TEntityDetail : PD_BASE - where TEntityDto : class, IEntityDto, new() + where TEntityDto : PD_DTO, new() where TEntityDetailDto : class, IEntityDto, new() where TRequestMainInput : RequestInputBase where TRequestDetailInput : RequestInputBase @@ -290,6 +291,18 @@ namespace Win.Sfs.SettleAccount.Bases var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); + + var entity= entitys.FirstOrDefault(); + var invoices =entitys.Select(p => p.BillNum); + var entities=_invRepository.Where(p => invoices.Contains(p.InvbillNum)).ToList(); + foreach (var itm in dtos) + { + var pd = entities.FirstOrDefault(p => p.InvbillNum == itm.BillNum); + if (pd != null) + { + itm.InvState = pd.State; + } + } return new PagedResultDto(totalCount, dtos); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index 0d52c478..1958b150 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -236,6 +236,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { if (flag == true) { + + + foreach (var item in pdList) { item.State = SettleBillState.已扣减; @@ -288,10 +291,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs } foreach (var item in bbacinvList) { - //if (item.State != SettleBillState.已提交QAD) - //{ - item.State = SettleBillState.客户已收票; - //} + if (item.State != SettleBillState.已提交QAD) + { + item.State = SettleBillState.红冲发票; + } } _dbcontext.BulkUpdate(bbacList); _dbcontext.BulkUpdate(bbacinvList); @@ -322,10 +325,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs } foreach (var item in hbpoinvList) { - // if (item.State != SettleBillState.已提交QAD) - // { - item.State = SettleBillState.客户已收票; - // } + if (item.State != SettleBillState.已提交QAD) + { + item.State = SettleBillState.红冲发票; + } } _dbcontext.BulkUpdate(hbpoList); _dbcontext.BulkUpdate(hbpoinvList);