From c10996efca33914126098e0b93b8dcbab1a5c974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 17 Jul 2023 16:17:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0DomainService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 8 +- .../Entities/BQ/INVOICE_SERVICE.cs | 43 +++++- .../SettleAccount.Domain/Bases/EntityBase.cs | 72 +++++++++- .../Entities/BQ/BBAC_PD.cs | 46 ++++++ .../Entities/BQ/BBAC_PD_DETAIL.cs | 11 +- .../Entities/BQ/HBPO_PD.cs | 46 ++++++ .../Entities/BQ/INVOICE_GRP.cs | 2 +- .../Entities/BQ/Managers/CAN_SA_MNG.cs | 134 ++++++++++++------ .../Entities/BQ/Managers/INV_MNG.cs | 114 ++++++++------- .../Entities/BQ/Managers/NOT_SA_MNG.cs | 5 +- .../Entities/BQ/PUB_PD.cs | 46 ++++++ .../src/SettleAccount.Domain/EnumBillState.cs | 16 +++ .../SettleAccount.Domain/EnumBusinessType.cs | 17 ++- 13 files changed, 443 insertions(+), 117 deletions(-) create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD.cs create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD.cs create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD.cs 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 a6996a89..922f5de9 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 @@ -129,7 +129,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "实际纸质发票号")] public string RealnvBillNum { get; set; } - [Display(Name = "系统生成发票号")] + + [Display(Name = "未税金额")] + public decimal Amt { get; set; } + [Display(Name = "税后金额")] public decimal TaxAmt { get; set; } [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } @@ -137,6 +140,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public string InvbillNum { get; set; } [Display(Name = "发票分组状态")] public int State { set; get; } + [Display(Name = "业务类别")] + public EnumBusinessType BusinessType { get; set; } + } 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 c3e12303..9e3ef810 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 Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; +using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ @@ -28,6 +29,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly INormalEfCoreRepository _wRepository; private readonly INormalEfCoreRepository _sRepository; private readonly INormalEfCoreRepository _mRepository; + private readonly CAN_SA_MNG _pubMng; + private readonly CAN_SA_MNG _bbacMng; + private readonly CAN_SA_MNG _hbpoMng; + private readonly INV_MNG _invMng; //private readonly INormalEfCoreRepository _detailRepository; private readonly IExcelImportAppService _excelImportService; @@ -36,9 +41,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, - IExcelImportAppService excelImportService - //INormalEfCoreRepository detailRepository - + IExcelImportAppService excelImportService, + CAN_SA_MNG pubMng, + CAN_SA_MNG bbacMng, + CAN_SA_MNG hbpoMng, + INV_MNG invMng ) { _excelImportService = excelImportService; @@ -46,6 +53,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _wRepository = wRepository; _mRepository = mRepository; _sRepository = sRepository; + _pubMng = pubMng; + _bbacMng = bbacMng; + _hbpoMng = hbpoMng; + _invMng = invMng; + + + } [HttpPost] public virtual async Task ApprovalPassed(INVOICE_GRP_REQ_DTO input) @@ -118,8 +132,29 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] public virtual async Task RejectAsync(INVOICE_GRP_REQ_DTO input) { + bool state = await _invMng.Reject(input.InvGroupNum); + if (state==true) + { + switch (input.BusinessType) + { + case EnumBusinessType.BeiJian: + await _pubMng.SetNewState(input.InvGroupNum); + break; + case EnumBusinessType.ZhiGongJian: + await _pubMng.SetNewState(input.InvGroupNum); + break; + case EnumBusinessType.YingDuJian: + await _pubMng.SetNewState(input.InvGroupNum); + break; + case EnumBusinessType.BBAC: + await _bbacMng.SetNewState(input.InvGroupNum); + break; + case EnumBusinessType.HBPO: + await _hbpoMng.SetNewState(input.InvGroupNum); + break; + } + } return string.Empty; - } [HttpPost] public virtual async Task Sync_QAD(INVOICE_GRP_REQ_DTO input) 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 f79d9083..37c2c1c5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs @@ -42,30 +42,70 @@ namespace SettleAccount.Bases { [Display(Name = "期间")] - public int Version { get; set; } + public virtual int Version { get; set; } [Display(Name = "结算单据")] - public string BillNum { get; set; } = null!; + public virtual string BillNum { get; set; } = null!; [Display(Name = "关联结算单号")] - public string SettleBillNum { get; set; } = null!; + public virtual string SettleBillNum { get; set; } = null!; /// /// 可结算单状态 /// [Display(Name = "状态")] - public SettleBillState State { get; set; } + public virtual SettleBillState State { get; set; } /// /// 明细记录行数 /// [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } = null!; + public virtual string InvGroupNum { get; set; } = null!; } + public class PD_BASE_MAIN : FullAuditedAggregateRoot + { + + [Display(Name = "期间")] + public virtual int Version { get; set; } + + [Display(Name = "结算单据")] + public virtual string BillNum { get; set; } = null!; + [Display(Name = "关联结算单号")] + public virtual string SettleBillNum { get; set; } = null!; + + + /// + /// 可结算单状态 + /// + [Display(Name = "状态")] + public virtual SettleBillState State { get; set; } + + /// + /// 明细记录行数 + /// + [Display(Name = "发票分组号")] + public virtual string InvGroupNum { get; set; } = null!; + /// + /// 地点 + /// + [Display(Name = "地点")] + public virtual string Site { get; set; } + + } + - public interface ISA_BASE : ISBASE + + + + + + + + + + public interface ISA_BASE : ISBASE { /// /// 期间 @@ -527,7 +567,25 @@ namespace SettleAccount.Bases /// public string KeyCode { get; set; } - + /// + ///扩展字段1 + /// + public string Extend1 { get; set; } + /// + ///扩展字段2 + /// + public string Extend2 { get; set; } + /// + /// 键值字段3 + /// + public string Extend3 { get; set; } + /// + /// 键值字段4 + /// + public string Extend4 { get; set; } + + + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD.cs new file mode 100644 index 00000000..0053f055 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD.cs @@ -0,0 +1,46 @@ +using SettleAccount.Bases; +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win.Sfs.SettleAccount; + +namespace SettleAccount.Domain.BQ; +[Display(Name = "BBAC待扣减")] +public class BBAC_PD : PD_BASE_MAIN +{ + + //[Display(Name = "期间")] + //public int Version { get; set; } + + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + public BBAC_PD() + { + + } + public BBAC_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum,string site) + { + Id = guid; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + State = state; + InvGroupNum = invGroupNum; + Site = site; + } +} + + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs index 7084d90e..a2475713 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs @@ -46,7 +46,12 @@ public class BBAC_PD_DETAIL:PD_BASE //[Display(Name = "结算分组")] //public string GroupNum { get; set; } = null!; - public BBAC_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum) + + + public BBAC_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum + ,string extend1,string extend2,string extend3,string extend4 + + ) { Id = guid; KeyCode = keyCode; @@ -62,6 +67,10 @@ public class BBAC_PD_DETAIL:PD_BASE InvGroupNum = invGroupNum; SettleDate = settleDate; GroupNum = groupNum; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + Extend4 = extend4; } public BBAC_PD_DETAIL() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD.cs new file mode 100644 index 00000000..7e9cc1fc --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD.cs @@ -0,0 +1,46 @@ +using SettleAccount.Bases; +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win.Sfs.SettleAccount; + +namespace SettleAccount.Domain.BQ; +[Display(Name = "HBPO待扣减")] +public class HBPO_PD : PD_BASE_MAIN +{ + + //[Display(Name = "期间")] + //public int Version { get; set; } + + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + public HBPO_PD() + { + + } + public HBPO_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum,string site) + { + Id = guid; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + State = state; + InvGroupNum = invGroupNum; + Site = site; + } +} + + + 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 ae79fb06..a35f3b82 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 @@ -32,7 +32,7 @@ public class INVOICE_GRP : FullAuditedAggregateRoot public EnumBusinessType BusinessType { get; set; } - [Display(Name = "业务类别")] + [Display(Name = "状态")] public InvoiceBillState State { get; set; } public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, EnumBusinessType businessType, InvoiceBillState state) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs index 62780fd0..72e4e8b0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs @@ -1,4 +1,5 @@ -using Hangfire.Annotations; +using EFCore.BulkExtensions; +using Hangfire.Annotations; using SettleAccount.Bases; using System; using System.Collections.Generic; @@ -33,58 +34,104 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _repository = repository; _detailRepository = detailRepository; } - public virtual async Task SetState(TEntity p_entiy, SettleBillState state) + public virtual async Task SetForwardState(TEntity p_entiy, SettleBillState state) { - switch (p_entiy.State) + if (await SetForwardState(p_entiy.InvGroupNum, state) == true) { - case SettleBillState.财务已审核: - if (state == SettleBillState.商务已审核) - { - p_entiy.State = state; - } - else - { - throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); - } - break; - case SettleBillState.商务已审核: - if (state == SettleBillState.已开票) - { - p_entiy.State = state; - } - else - { - throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); - } - break; - case SettleBillState.已开票: - if (state == SettleBillState.未结状态) - { - p_entiy.State = state; - } - else - { - throw new BusinessException("8989", "当前状态不是【未结状态】状态,无法设置成【已开票】"); - } - break; - case SettleBillState.已扣减: - if (state == SettleBillState.财务已审核) - { - p_entiy.State = state; - } - else - { - throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); - } - break; + return true; } + else + { + return false; + } + } + + + public virtual async Task SetForwardState(string p_billNum, SettleBillState state) + { + + var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); + + foreach(TEntity p_entiy in ls) + { + + switch (p_entiy.State) + { + case SettleBillState.财务已审核: + if (state == SettleBillState.商务已审核) + { + p_entiy.State = state; + } + else + { + throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); + } + break; + case SettleBillState.商务已审核: + if (state == SettleBillState.已开票) + { + p_entiy.State = state; + } + else + { + throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); + } + break; + case SettleBillState.已开票: + if (state == SettleBillState.未结状态) + { + p_entiy.State = state; + } + else + { + throw new BusinessException("8989", "当前状态不是【未结状态】状态,无法设置成【已开票】"); + } + break; + case SettleBillState.已扣减: + if (state == SettleBillState.财务已审核) + { + p_entiy.State = state; + } + else + { + throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); + } + break; + } + await _repository.UpdateAsync(p_entiy); + + } + + + return true; + } + + + public virtual async Task SetNewState(TEntity p_entiy) + { + p_entiy.State = SettleBillState.未结状态; await _repository.UpdateAsync(p_entiy); return true; } + public virtual async Task SetNewState(string billNUm) + { + + var ls=_repository.Where(p => p.InvGroupNum == billNUm).ToList(); + foreach (var l in ls) + { + l.State = SettleBillState.未结状态; + } + + await _repository.DbContext.BulkReadAsync(ls); + return true; + } } +} + + @@ -94,4 +141,3 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers -} 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 6fc3d034..19ae1fd2 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,5 +1,7 @@ using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using NPOI.SS.Formula.Functions; +using SettleAccount.Bases; using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; @@ -12,17 +14,16 @@ using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { - public class INV_MNG : DomainService + public class INV_MNG:DomainService { + //private readonly INormalEfCoreRepository _canRepository; private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _groupRepository; private readonly INormalEfCoreRepository _detailRepository; private readonly INormalEfCoreRepository _notRepository; - - public INV_MNG ( - + //INormalEfCoreRepository canRepository, INormalEfCoreRepository repository, INormalEfCoreRepository groupRepository, INormalEfCoreRepository detailRepository, @@ -30,6 +31,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers ) { + //_canRepository = canRepository; _repository = repository; _detailRepository = detailRepository; _groupRepository = groupRepository; @@ -75,70 +77,74 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers return true; } + public virtual async Task GetEntityByBillNum(string p_billNum) + { + return await _repository.Where(p => p.InvGroupNum == p_billNum).FirstOrDefaultAsync(); + } + + public virtual async Task Reject(INVOICE_GRP p_entity) { - if (p_entity.State == InvoiceBillState.财务已审核 - || p_entity.State == InvoiceBillState.已开票 || p_entity.State == InvoiceBillState.商务已审核) + if (await Reject(p_entity.InvGroupNum)) + + return true; + else + return false; + + + } + + public virtual async Task Reject(string billNum) + { + + var _ls=await _repository.Where(p => p.InvGroupNum == billNum).ToListAsync(); + + if (_ls != null && _ls.Count > 0) { - var entList = _repository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); - var groupList = _groupRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); - var notList = _notRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); - var detailList = _detailRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); - await _repository.DbContext.BulkDeleteAsync(entList); - await _repository.DbContext.BulkDeleteAsync(groupList); - await _repository.DbContext.BulkDeleteAsync(notList); - await _repository.DbContext.BulkDeleteAsync(detailList); + foreach (var p_entity in _ls) + { + if (p_entity.State == InvoiceBillState.财务已审核 + || p_entity.State == InvoiceBillState.已开票 || p_entity.State == InvoiceBillState.商务已审核) + { + var entList = _repository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); + var groupList = _groupRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); + var notList = _notRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); + var detailList = _detailRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); + //var canList = _canRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); + //foreach (var itm in canList) + //{ + // itm.State = SettleBillState.未结状态; + //} + await _repository.DbContext.BulkDeleteAsync(entList); + await _repository.DbContext.BulkDeleteAsync(groupList); + await _repository.DbContext.BulkDeleteAsync(notList); + await _repository.DbContext.BulkDeleteAsync(detailList); + //await _repository.DbContext.BulkUpdateAsync(canList); + + + + } + if (p_entity.State == InvoiceBillState.已扣减) + { + } + } + } + else + { } - return true; - //switch (p_entiy.State) - //{ - // case InvoiceBillState.财务已审核 || InvoiceBillState.已开票: - - // _repository.re - - - - // //if (state == InvoiceBillState.商务已审核) - // //{ - // // p_entiy.State = state; - // //} - // //else - // //{ - // // throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); - // //} - // break; - // case InvoiceBillState.商务已审核: - // if (state == InvoiceBillState.已开票) - // { - // p_entiy.State = state; - // } - // else - // { - // throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); - // } - // break; - // case InvoiceBillState.已扣减: - // if (state == InvoiceBillState.财务已审核) - // { - // p_entiy.State = state; - // } - // else - // { - // throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); - // } - // break; - //} + - } + return true; + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/NOT_SA_MNG.cs index 82e78356..83a6b7b7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/NOT_SA_MNG.cs @@ -39,6 +39,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } public virtual async Task GenerateSettlementOrder(List p_list, Action> p_action = null) { + var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var _entity = new TEntity(); _entity.BillNum = billNumber; @@ -69,13 +70,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } await _notRepository.DbContext.BulkDeleteAsync(p_list); await _repository.DbContext.BulkInsertAsync(new List() { _entity }); - await _repository.DbContext.BulkInsertAsync(_entityList); - - - return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD.cs new file mode 100644 index 00000000..b6b9478d --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD.cs @@ -0,0 +1,46 @@ +using SettleAccount.Bases; +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win.Sfs.SettleAccount; + +namespace SettleAccount.Domain.BQ; +[Display(Name = "PUB待扣减")] +public class PUB_PD : PD_BASE_MAIN +{ + + //[Display(Name = "期间")] + //public int Version { get; set; } + + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + public PUB_PD() + { + + } + public PUB_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum,string site) + { + Id = guid; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + State = state; + InvGroupNum = invGroupNum; + Site = site; + } +} + + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs index d9ea9fc7..a0527952 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs @@ -44,6 +44,22 @@ namespace Win.Sfs.SettleAccount } + public enum BusinessType + { + [Description("HBPO-JIS")] + HBPOJIS =1, + [Description("BBAC-JIS")] + BBACJIS =2, + [Description("JIT")] + JIT =3, + [Description("备件")] + 备件 =4, + [Description("印度件")] + 印度件 =5 + } + + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs index f7115879..80143dd5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs @@ -35,6 +35,21 @@ namespace Win.Sfs.SettleAccount ///印度件 /// [Display(Name = "印度件")] - YingDuJian = 4 + YingDuJian = 4, + + /// + /// + /// + [Display(Name = "HBPO-JIS")] + HBPO = 5, + + /// + ///印度件 + /// + [Display(Name = "BBAC-JIS")] + BBAC = 6 + + + } }