From 4357eea53454bc341288e38869e9d65a0e02bda5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 13 Jul 2023 08:45:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0DTO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs | 32 --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 197 ++++++++++++++++-- .../Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs | 4 +- .../Entities/BQ/IINVOICE_SERVICE.cs | 27 +++ .../Entities/BQ/IPUB_BA_SERVICE.cs | 1 + .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 49 +++++ .../Entities/Boms/BomAppService.cs | 82 ++++---- ...ttleAccountApplicationAutoMapperProfile.cs | 4 +- .../Entities/BQ/BBAC_CAN_SA.cs | 5 +- .../Entities/BQ/BBAC_SE_EDI.cs | 7 + .../Entities/BQ/HBPO_CAN_SA.cs | 5 +- .../Entities/BQ/HBPO_SE_EDI.cs | 7 + .../Entities/BQ/INVOICE_GRP.cs | 10 +- .../Entities/BQ/PUB_CAN_SA.cs | 5 +- .../src/SettleAccount.Domain/EnumBillState.cs | 37 ++++ ...AccountDbContextModelCreatingExtensions.cs | 11 + .../SettleAccountBQEfCoreRepository.cs | 6 +- 17 files changed, 388 insertions(+), 101 deletions(-) create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs 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 947b926c..53ec4d34 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 @@ -40,17 +40,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } public class HBPO_CAN_SA_DETAIL_DTO : EntityDto { - - - - - - - - - - - /// ///关联结算单号 /// @@ -97,27 +86,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string GroupNum { get; set; } - - - - - - - - - - - - - - - - - - - - - } public class HBPO_CAN_SA_DETAIL_EXP_DTO { 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 88450e5c..75e980c5 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 @@ -54,6 +54,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// [Display(Name = "业务类别")] public string BusinessType { get; set; } + /// + /// 发票状态 + /// + public int State { set; get; } } @@ -118,17 +122,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } - - - - - - - - - public class INVOICE_GRP_REQ_DTO : PagedAndSortedResultRequestDto - { [Display(Name = "实际纸质发票号")] @@ -137,17 +131,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal TaxAmt { get; set; } [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } - - public virtual List Filters { get; set; } = new List(); } - - namespace SettleAccount.Domain.BQ + public class INVOICE_GRP_DETAIL_DTO : EntityDto { - public class INVOICE_WAIT_DETAIL_DTO : EntityDto + public List INVOICE_WAIT_DETAIL { get; set; } + public List INVOICE_MAP_GROUP { get; set; } + public List INVOICE_NOT_SETTLE_DTO { get; set; } + + } + + public class INVOICE_WAIT_DETAIL_DTO : EntityDto { @@ -227,6 +224,172 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos + + + public class INVOICE_MAP_GROUP_DTO : EntityDto + + { + + /// + ///期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + /// + ///发票号 + /// + [Display(Name = "发票号")] + public string InvbillNum { get; set; } + /// + ///发票分组号 + /// + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } + /// + ///结算分组号 + /// + [Display(Name = "结算分组号")] + public string SettleGroupNum { get; set; } + /// + ///金额 + /// + [Display(Name = "金额")] + public decimal Amt { get; set; } + /// + ///扩展字段1 + /// + [Display(Name = "扩展字段1")] + public string Extend1 { get; set; } + /// + ///扩展字段2 + /// + [Display(Name = "扩展字段2")] + public string Extend2 { get; set; } + public bool IsDeleted { get; set; } + + } + + + + public class INVOICE_MAP_GROUP_EXP_DTO + + { + + /// + ///期间 + /// + [ExporterHeader(DisplayName = "期间")] + public int Version { get; set; } + /// + ///发票号 + /// + [ExporterHeader(DisplayName = "发票号")] + public string InvbillNum { get; set; } + /// + ///发票分组号 + /// + [ExporterHeader(DisplayName = "发票分组号")] + public string InvGroupNum { get; set; } + /// + ///结算分组号 + /// + [ExporterHeader(DisplayName = "结算分组号")] + public string SettleGroupNum { get; set; } + /// + ///金额 + /// + [ExporterHeader(DisplayName = "金额")] + public decimal Amt { get; set; } + /// + ///扩展字段1 + /// + [ExporterHeader(DisplayName = "扩展字段1")] + public string Extend1 { get; set; } + /// + ///扩展字段2 + /// + [ExporterHeader(DisplayName = "扩展字段2")] + public string Extend2 { get; set; } + + + } + + + public class INVOICE_MAP_GROUPRequestDto : PagedAndSortedResultRequestDto + { + public int Version { get; set; } + [Display(Name = "发票号")] + public string InvbillNum { get; set; } + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } + } + + public class INVOICE_NOT_SETTLE_DTO : EntityDto + { + + /// + ///期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + /// + ///发票分组号 + /// + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } + /// + ///结算分组号 + /// + [Display(Name = "结算分组号")] + public string SettleGroupNum { get; set; } + /// + ///可结算零件号 + /// + [Display(Name = "可结算零件号")] + public string LU { get; set; } + /// + ///不可结算零件号 + /// + [Display(Name = "不可结算零件号")] + public string LU1 { get; set; } + /// + ///扩展字段1 + /// + [Display(Name = "扩展字段1")] + public string Extend1 { get; set; } + /// + ///扩展字段2 + /// + [Display(Name = "扩展字段2")] + public string Extend2 { get; set; } + + } + + + + + + + + + + public class INVOICE_NOT_SETTLE_REQ_DTO : PagedAndSortedResultRequestDto + + { + + + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } + [Display(Name = "结算分组号")] + public string SettleGroupNum { get; set; } + + + public virtual List Filters { get; set; } = new List(); + } + + + + } @@ -247,7 +410,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos -} + + + 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 8ceb3ca7..520a20e2 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 @@ -46,7 +46,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } public class PUB_CAN_SA_REQ_DTO : PagedAndSortedResultRequestDto - { [Display(Name = "期间")] @@ -174,6 +173,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// [Display(Name = "业务类别")] public string BusinessType { get; set; } + /// + /// + /// [Display(Name = "发票分组号")] public string BillNum { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs new file mode 100644 index 00000000..96d96494 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Win.Sfs.SettleAccount.Entities.BQ.Dtos; + +namespace Win.Sfs.SettleAccount.Entities.BQ +{ + public interface IINVOICE_SERVICE + { +//Import +//ApprovalPassed +//Reject +//MainQuery +//DetailQuery +//Sync_QAD + Task ApprovalPassed(INVOICE_GRP_REQ_DTO input); + Task> MainQueryAsync(INVOICE_GRP_REQ_DTO input); + Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input); + Task ExportAsync(INVOICE_GRP_REQ_DTO input); + + + + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_BA_SERVICE.cs index 7698588f..d0d5d692 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_BA_SERVICE.cs @@ -8,5 +8,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IPUB_BA_SERVICE { + } } 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 2a0067ea..a910845a 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 @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using NPOI.SS.Formula.Functions; using System; using System.Collections.Generic; using System.Linq; @@ -34,7 +35,55 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [Route("generateinvoice")] public Task GenerateInvoice(BBAC_CAN_SA_REQ_DTO input) { + List _ls = new List(); + var _query= _ls.GroupBy(p => new { p.GroupNum }).Select(p =>new {GroupNum=p.Key.GroupNum, Qty=p.Sum(itm=>itm.Price)}); + Dictionary _dic = new Dictionary(); + Dictionary _dic1 = new Dictionary(); + foreach (var itm in _query.ToList()) + { + _dic.Add(itm.GroupNum, itm.Qty); + _dic1.Add(itm.GroupNum, itm.Qty); + } + Dictionary> _invoice=new Dictionary>(); + foreach (var _itm in _dic) + { + string invoiceBillNum = Guid.NewGuid().ToString(); + List invoiceGroupNumList = new List(); + List List = new List(); + + + decimal sum = _itm.Value;//初始价格 + List luList= _ls.Where(p => p.GroupNum == _itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类 + + + foreach (var _itm1 in _dic1) + { + if (_itm.Key == _itm1.Key) + { + continue; + } + var grouplist=_ls.Where(p => p.GroupNum == _itm1.Key).Select(p => p.LU).Distinct().ToList();//每项LU种类 + + luList.AddRange(grouplist); + luList = luList.Distinct().ToList(); + + if (luList.Count > 20)//累加零件不超过20种 + { + continue; + } + sum += _itm1.Value; + if (sum > 10000000) + { + continue; + } + invoiceGroupNumList.Add(_itm1.Key);//所有条件都满足添加发票和结算分组对应关系 + } + } + throw new NotImplementedException(); + + // return true; + } [HttpPost] [Route("mainquery")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs index 2901dbd5..8105950b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -48,7 +48,7 @@ namespace Win.Sfs.SettleAccount.Boms public class BomAppService : SettleAccountApplicationBase { /// - /// BOMִ + /// BOM�ִ� /// private readonly INormalEfCoreRepository _repository; @@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Boms private readonly ISettleAccountBranchEfCoreRepository _versionRepository; /// - /// 췽 + /// ���췽�� /// public BomAppService( INormalEfCoreRepository repository, @@ -91,9 +91,9 @@ namespace Win.Sfs.SettleAccount.Boms _importColumnMapRepository = importColumnMapRepository; } - #region 롢 + #region ���롢���� /// - /// + /// ���� /// [HttpPost] [Route("Export")] @@ -104,14 +104,14 @@ namespace Win.Sfs.SettleAccount.Boms 0, true); var dtoDetails = ObjectMapper.Map, List >(entities); - // + //������������ ExportImporter _exportImporter = new ExportImporter(); var result = await _exportImporter.ExcelExporter(dtoDetails); result.ShouldNotBeNull(); - //浼ļɶ + //���浼���ļ�����������ɶ����� await _excelImportService.SaveBlobAsync( new SaveExcelImportInputDto { @@ -125,7 +125,7 @@ namespace Win.Sfs.SettleAccount.Boms #region CURD /// - /// ȡб + /// ��ȡ�б� /// [HttpPost] [Route("list")] @@ -138,13 +138,13 @@ namespace Win.Sfs.SettleAccount.Boms } #endregion - #region ԭ - // #region 뵼 + #region ԭ������������ + // #region ���뵼������ // /// - // /// 빦 + // /// ���빦�� // /// - // /// ϴļ(ǰѾֻϴһ) + // /// �ϴ����ļ�(ǰ���Ѿ�����ֻ���ϴ�һ������) // /// // [HttpPost] // [Route("ExcelImport-Map")] @@ -169,7 +169,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // if (itm.Count > 1) // { - // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ܵ븸{0},ӱ{1}ظ", itm.ParentItmeCode, itm.ChildItemCode), string.Empty)); + // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("���ܵ��븸����{0},�ӱ���{1}���ظ�����", itm.ParentItmeCode, itm.ChildItemCode), string.Empty)); // } // } // var _id = GuidGenerator.Create(); @@ -179,7 +179,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode)) // { - // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("ݲϺ{0}", itm.ParentItemCode), string.Empty)); + // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("���������ݲ��������Ϻ�{0}��", itm.ParentItemCode), string.Empty)); // continue; // } // itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id, factory); @@ -198,9 +198,9 @@ namespace Win.Sfs.SettleAccount.Boms // /// - // /// 빦 + // /// ���빦�� // /// - // /// ϴļ(ǰѾֻϴһ) + // /// �ϴ����ļ�(ǰ���Ѿ�����ֻ���ϴ�һ������) // /// // [HttpPost] // [Route("ExcelImport")] @@ -224,7 +224,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // if (itm.Count > 1) // { - // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ܵ븸{0},ӱ{1}ظ", itm.ParentItmeCode, itm.ChildItemCode), string.Empty)); + // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("���ܵ��븸����{0},�ӱ���{1}���ظ�����", itm.ParentItmeCode, itm.ChildItemCode), string.Empty)); // } // } // var _id = GuidGenerator.Create(); @@ -234,7 +234,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode)) // { - // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("ݲϺ{0}", itm.ParentItemCode), string.Empty)); + // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("���������ݲ��������Ϻ�{0}��", itm.ParentItemCode), string.Empty)); // continue; // } // itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,_id,factory); @@ -249,7 +249,7 @@ namespace Win.Sfs.SettleAccount.Boms // return ApplicationConsts.SuccessStr; // } // /// - // /// ļ + // /// �����ļ� // /// // /// // /// @@ -260,7 +260,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // IExporter _csv = new CsvExporter(); // IExporter _excel = new ExcelExporter(); - // //ϰ汾ȫ + // //�������ϰ汾��������������ȫ���� // if (input.ParentId != Guid.Empty) // { // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); @@ -273,23 +273,23 @@ namespace Win.Sfs.SettleAccount.Boms // 0, true); // var dtoDetails = ObjectMapper.Map, List>(entities); // string _fileName = string.Empty; - // // + // //������������ // byte[] result = null; // switch (input.FileType) // { // case 0: - // _fileName = string.Format("Ʒṹ_{0}.csv", input.UserId.ToString()); + // _fileName = string.Format("��Ʒ�ṹ_{0}.csv", input.UserId.ToString()); // result = await _csv.ExportAsByteArray(dtoDetails); // break; // case 1: - // _fileName = string.Format("Ʒṹ_{0}.xlsx", input.UserId.ToString()); + // _fileName = string.Format("��Ʒ�ṹ_{0}.xlsx", input.UserId.ToString()); // result = await _excel.ExportAsByteArray(dtoDetails); // break; // } // result.ShouldNotBeNull(); - // //浼ļɶ + // //���浼���ļ�����������ɶ����� // await _excelImportService.SaveBlobAsync( // new SaveExcelImportInputDto // { @@ -302,13 +302,13 @@ namespace Win.Sfs.SettleAccount.Boms // #endregion // /// - // /// IDȡΨһʵ + // /// ��ID��ȡΨһʵ�� // /// // /// - // /// ʵȫ + // /// ����ʵ��ȫ������ // /// // /// ID - // /// ʵDTO + // /// ʵ��DTO // [HttpGet] // [Route("{id}")] //[Authorize(SettleAccountPermissions.Boms.Default)] @@ -339,9 +339,9 @@ namespace Win.Sfs.SettleAccount.Boms // } // /// - // /// ȡʵ + // /// ��ȡʵ������ // /// - // /// ʵ + // /// ʵ������ // [HttpGet] // [Route("count")] //[Authorize(SettleAccountPermissions.Boms.Default)] @@ -353,10 +353,10 @@ namespace Win.Sfs.SettleAccount.Boms // /// - // /// ɾʵ + // /// ɾ��ʵ�� // /// // /// ID - // /// + // /// �� // [HttpDelete] // [Route("{id}")] //[Authorize(SettleAccountPermissions.Boms.Delete)] @@ -368,10 +368,10 @@ namespace Win.Sfs.SettleAccount.Boms // } // /// - // /// IDsɾʵб + // /// ��IDsɾ��ʵ���б� // /// // /// IDs - // /// Ƿִгɹ + // /// �Ƿ�ִ�гɹ� // [HttpPost] // [Route("delete")] //[Authorize(SettleAccountPermissions.Boms.Delete)] @@ -390,13 +390,13 @@ namespace Win.Sfs.SettleAccount.Boms // ///// // /// - // /// ɸѡȡʵб + // /// ����ɸѡ������ȡʵ���б� // /// // /// - // /// :ɸѡб,,,ҳ + // /// ������������:ɸѡ�����б�,��������,��������,ҳ�� // /// - // /// - // /// ʵDTOб + // /// �������� + // /// ʵ��DTO�б� // [HttpPost] // [Route("list")] // [Authorize(SettleAccountPermissions.Boms.Default)] @@ -420,13 +420,13 @@ namespace Win.Sfs.SettleAccount.Boms // ///// // /// - // /// ɸѡȡʵб + // /// ����ɸѡ������ȡʵ���б� // /// // /// - // /// :ɸѡб,,,ҳ + // /// ������������:ɸѡ�����б�,��������,��������,ҳ�� // /// - // /// - // /// ʵDTOб + // /// �������� + // /// ʵ��DTO�б� // [HttpPost] // [Route("listVersion")] // [Authorize(SettleAccountPermissions.Boms.Default)] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index a511a92a..55f77c1b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -133,7 +133,9 @@ namespace Win.Sfs.SettleAccount #endregion } - #region 北汽 + #region BQ + + 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 46878084..5c893311 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 @@ -2,6 +2,7 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; +using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; [Display(Name = "BBAC可结算导入")] @@ -20,7 +21,7 @@ public class BBAC_CAN_SA:FullAuditedAggregateRoot /// 1、新建 2、已有出库3、已有扣减寄售库 /// [Display(Name = "状态")] - public string State { get; set; } = null!; + public SettleBillState State { get; set; } /// /// 明细记录行数 @@ -34,7 +35,7 @@ public class BBAC_CAN_SA:FullAuditedAggregateRoot - public BBAC_CAN_SA(Guid guid, int version, string billNum, string settleBillNum, string state, string invGroupNum) + public BBAC_CAN_SA(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum) { Id = guid; Version = version; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs index 61bfc315..d2aa822a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs @@ -36,6 +36,13 @@ public class BBAC_SE_EDI:FullAuditedAggregateRoot [Display(Name = "订货时间")] public DateTime BeginDate { get; set; } + public string Extend1 { set; get; } + + public string Extend2 { set; get; } + public string Extend3 { set; get; } + public string Extend4 { set; get; } + + public BBAC_SE_EDI() { } public BBAC_SE_EDI(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate) 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 e0eb2021..9d8c5647 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 @@ -2,6 +2,7 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; +using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; [Display(Name = "HBPO可结算导入")] @@ -19,7 +20,7 @@ public class HBPO_CAN_SA :FullAuditedAggregateRoot /// 1、新建 2、已有出库3、已有扣减寄售库 /// [Display(Name = "状态")] - public string State { get; set; } = null!; + public SettleBillState State { get; set; } /// /// 明细记录行数 @@ -27,7 +28,7 @@ public class HBPO_CAN_SA :FullAuditedAggregateRoot [Display(Name = "明细记录行数")] public string InvGroupNum { get; set; } = null!; - public HBPO_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, string state, string invGroupNum) + public HBPO_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, SettleBillState state, string invGroupNum) { Version = version; SettleBillNum = settleBillNum; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs index 568a92f0..b492396a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs @@ -36,6 +36,13 @@ public class HBPO_SE_EDI :FullAuditedAggregateRoot [Display(Name = "订货时间")] public DateTime BeginDate { get; set; } + public string Extend1 { set; get; } + + public string Extend2 { set; get; } + public string Extend3 { set; get; } + public string Extend4 { set; get; } + + public HBPO_SE_EDI(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate) { Id=guid; 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 543208a6..66113aa0 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 @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; +using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; [Display(Name = "发票分组")] @@ -30,7 +31,11 @@ public class INVOICE_GRP : FullAuditedAggregateRoot [Display(Name = "业务类别")] public string BusinessType { get; set; } = null!; - public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, string businessType) + + [Display(Name = "业务类别")] + public InvoiceBillState State { get; set; } + + public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, string businessType, InvoiceBillState state) { Id= guid; RealnvBillNum = realnvBillNum; @@ -40,8 +45,11 @@ public class INVOICE_GRP : FullAuditedAggregateRoot InvGroupNum = invGroupNum; FileName = fileName; BusinessType = businessType; + State = state; } + + public INVOICE_GRP() { } 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 a1972efc..e2f474cb 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 @@ -2,6 +2,7 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; +using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; [Display(Name = "PUB可结算导入")] @@ -20,7 +21,7 @@ public class PUB_CAN_SA :FullAuditedAggregateRoot /// 1、新建 2、已有出库3、已有扣减寄售库 /// [Display(Name = "状态")] - public int State { get; set; } + public SettleBillState State { get; set; } /// /// 1、JIT 2、买单件 3、备件 3、印度件 /// @@ -30,7 +31,7 @@ public class PUB_CAN_SA :FullAuditedAggregateRoot [Display(Name = "明细记录行数")] public string InvGroupNum { get; set; } = null!; - public PUB_CAN_SA(int version, string settleBillNum, string billNum, int state, string businessType, string invGroupNum) + public PUB_CAN_SA(int version, string settleBillNum, string billNum, SettleBillState state, string businessType, string invGroupNum) { Version = version; SettleBillNum = settleBillNum; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs index 85950c8e..d231bb14 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs @@ -16,4 +16,41 @@ namespace Win.Sfs.SettleAccount [Description("完成")] 完成 = 2, } + public enum SettleBillState + { + [Description("未结状态")] + 未结状态 = 0, + [Description("已开票")] + 已开票 = 1, + [Description("商务已审核")] + 商务已审核 = 2, + [Description("财务已审核")] + 财务已审核 = 3, + [Description("已扣减")] + 已扣减 = 4, + + } + + public enum InvoiceBillState + { + [Description("未结状态")] + 未结状态 = 0, + [Description("商务已审核")] + 商务已审核 = 2, + [Description("财务已审核")] + 财务已审核 = 3, + [Description("已扣减")] + 已扣减 = 4, + + } + + + + + + + + + + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 18d8073a..38de8a70 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -694,6 +694,11 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.AssemblyCode).HasMaxLength(50); b.Property(x => x.InjectionCode).HasMaxLength(50); b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); + b.Property(x => x.Extend1).HasMaxLength(50); + b.Property(x => x.Extend2).HasMaxLength(50); + b.Property(x => x.Extend3).HasMaxLength(50); + b.Property(x => x.Extend4).HasMaxLength(50); + }); } @@ -889,6 +894,12 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.AssemblyCode).HasMaxLength(50); b.Property(x => x.InjectionCode).HasMaxLength(50); b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); + b.Property(x => x.Extend1).HasMaxLength(50); + b.Property(x => x.Extend2).HasMaxLength(50); + b.Property(x => x.Extend3).HasMaxLength(50); + b.Property(x => x.Extend4).HasMaxLength(50); + + }); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBQEfCoreRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBQEfCoreRepository.cs index bae890c5..e25b6ad1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBQEfCoreRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBQEfCoreRepository.cs @@ -22,7 +22,7 @@ namespace Win.Sfs.SettleAccount.Repository SettleAccountEfCoreRepository, ISettleAccountBQEfCoreRepository, ITransientDependency - where TEntity : class, IBranch, IEntity + where TEntity : class, IEntity { private readonly IDbContextProvider _dbContextProvider; @@ -79,7 +79,7 @@ namespace Win.Sfs.SettleAccount.Repository public virtual async Task GetCountAsync(CancellationToken cancellationToken = default) { return await this.GetQueryable() - //.Where(p => p.BranchId.Equals(branchId)) + .LongCountAsync(GetCancellationToken(cancellationToken)); } @@ -88,7 +88,7 @@ namespace Win.Sfs.SettleAccount.Repository CancellationToken cancellationToken = default) { return await this.GetQueryable() - //.Where(p => p.BranchId.Equals(branchId)) + .WhereIf(filters?.Count != 0, filters.ToLambda()) .LongCountAsync(GetCancellationToken(cancellationToken)); }