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 8016a829..ea0386fb 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 @@ -99,6 +99,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public decimal Amt { get; set; } + + public string ContractDocID { set; get; } + } public class BBAC_CAN_SA_DETAIL_EXP_DTO { 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 fd9dfab7..da5af4ed 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 @@ -1,4 +1,4 @@ -using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -92,6 +92,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string GroupNum { get; set; } + public decimal Amt { get; set; } } public class HBPO_CAN_SA_DETAIL_EXP_DTO { 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 cf12964c..4109edaa 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 @@ -63,7 +63,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var groupNumList= entitys.Select(p=>p.GroupNum).Distinct().ToList(); - var notList =_notRepository.Where(p => groupNumList.Contains(p.InvGroupNum)).ToList();//不能结算 + //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); + + var notList =_notRepository.Where(p => groupNumList.Contains(p.GroupNum)).ToList();//不能结算 var dtos = ObjectMapper.Map, List>(entitys); @@ -72,6 +74,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ dto.Amt = Math.Round(dto.Price * dto.Qty, 2); }); + dtos = dtos.OrderBy(p => p.SettleDate).ToList(); + + var _query= dtos.GroupBy(p => new { p.GroupNum }).Select(p =>new {GroupNum=p.Key.GroupNum, Amt=p.Sum(itm=>itm.Amt)}); Dictionary dic = new Dictionary();//原本 @@ -90,8 +95,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ List invoiceGroupNumList = new List();//每个发票对应的结算分组号 List List = new List(); decimal sum = itm.Value;//初始分组合计金额 - List luList= dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类 - + List luList= dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU+p.ContractDocID ).Distinct().ToList(); //初始LU种类 if (copyDic.ContainsKey(itm.Key)==true)//是否存在分组 { foreach (var _itm1 in copyDic) @@ -101,7 +105,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invoiceGroupNumList.Add(itm.Key); continue; } - var grouplist = dtos.Where(p => p.GroupNum == _itm1.Key).Select(p => p.LU).Distinct().ToList();//每项LU种类 + var grouplist = dtos.Where(p => p.GroupNum == _itm1.Key).Select(p => p.LU + p.ContractDocID).Distinct().ToList();//每项LU种类 luList.AddRange(grouplist); luList = luList.Distinct().ToList(); if (luList.Count > 20)//累加零件不超过20种 @@ -125,100 +129,116 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } if(invoiceMap.Keys.Count > 0) { - var inv=new INVOICE_GRP(); var groupList = new List(); - var notDetialList=new List(); - var detailList= new List(); - - - - foreach (var itm in invoiceMap) + var notDetialList = new List(); + var detailList = new List(); + var invlist = new List(); + foreach (var itm in invoiceMap)//分组影响和 { var key = itm.Key;//发票票号 var ls = itm.Value;//结算分组号列表 - var detailDtos= dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p=>new {p.InvGroupNum, p.LU,p.Price }) - .Select(itm=>new { InvGroupNum=itm.Key.InvGroupNum, + var detailDtos= dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p=>new {p.InvGroupNum, p.LU,p.Price,p.ContractDocID }) + .Select(itm=>new { + InvGroupNum=itm.Key.InvGroupNum, LU=itm.Key.LU, - Price=itm.Key.Price,Amt=Math.Round(itm.Sum(k=>k.Qty)*itm.Key.Price,2) , - Qty= itm.Sum(k => k.Qty) }) + ContactDocID=itm.Key.ContractDocID, + Price=itm.Key.Price, + Amt=Math.Round(itm.Sum(k=>k.Qty)*itm.Key.Price,2) , + Qty= itm.Sum(k => k.Qty) + }) .ToList(); - var invbill=new INVOICE_GRP(); + decimal amt=detailDtos.Sum(k=>k.Amt); + decimal txtAmt=Math.Round(detailDtos.Sum(k => k.Amt),2); + + var mapList= new List(); - foreach (var obj in detailDtos) + foreach (var groupnum in ls) + { + amt=dtos.Where(p => p.GroupNum == groupnum).Sum(p => p.Amt); + mapList.Add(new INVOICE_MAP_GROUP( + guid: GuidGenerator.Create(), + version: main.Version, + invbillNum: key, + invGroupNum: main.InvGroupNum, + settleGroupNum:groupnum, + amt:amt, + extend1:string.Empty, + extend2:string.Empty + ) + ); + } + if(mapList.Count > 0) { + groupList.AddRange(mapList); + + } + List _entityDetailList = new List(); + foreach (var detail in detailDtos) + { + _entityDetailList.Add( new INVOICE_WAIT_DETAIL( guid: GuidGenerator.Create(), version:main.Version, invbillNum: key, - invGroupNum: obj.InvGroupNum, - lU: obj.LU, - qty: obj.Qty, + invGroupNum: main.InvGroupNum, + lU: detail.LU, + qty: detail.Qty, bussiessType: EnumBusinessType.BBAC, - amt: obj.Amt, - pRICE:obj.Price, - extend1: string.Empty, extend2: string.Empty, extend3: string.Empty, extend4: string.Empty - ); - + amt: detail.Amt, + pRICE:detail.Price, + extend1: detail.ContactDocID, + extend2: string.Empty, + extend3: string.Empty, + extend4: string.Empty + )); + } + if (_entityDetailList.Count > 0) + { + detailList.AddRange(_entityDetailList); } + var notls= notList.GroupBy(p => new { p.GroupNum, p.LU }).Select(p=>new {GroupNum= p.Key.GroupNum,LU=p.Key.LU,Qty= p.Sum(itm=>itm.Qty) }); - foreach (var groupnum in ls) + var innotls= new List(); + foreach (var nitm in notls) { - + innotls.Add(new INVOICE_NOT_SETTLE( + guid: GuidGenerator.Create(), + version: main.Version, + invGroupNum: main.InvGroupNum, + settleGroupNum: nitm.GroupNum, + lU: string.Empty, + lU1: nitm.LU, + extend1: string.Empty, + extend2: string.Empty, + qty: nitm.Qty + )); } - } + if (innotls.Count > 0) + { + notDetialList.AddRange(innotls); + } + var invbill = new INVOICE_GRP + (guid: GuidGenerator.Create(), + realnvBillNum: string.Empty, + invbillNum: key, + amt:amt, + taxAmt:txtAmt, + fileName: string.Empty, + businessType: EnumBusinessType.BBAC, + invGroupNum: main.InvGroupNum, + state: SettleBillState.已开票, + invoiceBillState: InvoiceBillState.正常 + + ); + invlist.Add( invbill ); + } } - - - - return ApplicationConsts.SuccessStr; } - //private Dictionary GenerateInvoice(Dictionary p_dic) - //{ - - // string invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV"); - // List invoiceGroupNumList = new List();//每个发票对应的结算分组号 - - // List List = new List(); - // decimal sum = p_dic.Value;//初始分组合计金额 - // List luList = dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类 - - - // foreach (var _itm1 in copyDic) - // { - // if (itm.Key == _itm1.Key)//相同结算分组项不计算 - // { - // invoiceGroupNumList.Add(itm.Key); - // continue; - // } - // var grouplist = dtos.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; - // } - - // if (sum > 10000000) - // { - // break; - // } - // sum += _itm1.Value; - // invoiceGroupNumList.Add(_itm1.Key);//所有条件都满足添加发票和结算分组对应关系 - // } - // foreach (var rem in invoiceGroupNumList)//移除 - // { - // copyDic.Remove(rem); - // } - - - - // return - //} - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs index f0a3162c..49e7c293 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs @@ -64,11 +64,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ , site: entity.Site , qty: entity.Qty , price: entity.Price - , category: entity.Category + , category: entity.BusinessType , isReturn: entity.IsReturn , settleDate: entity.SettleDate , groupNum: entity.GroupNum , invGroupNum: entity.InvGroupNum + ,contactid:entity.ContractDocID ); } 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 ed0465ff..0526b298 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 @@ -9,8 +9,10 @@ using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.ObjectMapping; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.Shared.RepositoryBase; @@ -34,8 +36,148 @@ namespace Win.Sfs.SettleAccount.Entities.BQ HBPO_CAN_SA_DETAIL_EXP_DTO > { - public HBPO_CAN_SA_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService, INormalEfCoreRepository detailRepository, INV_MNG invmng) : base(repository, excelImportService, detailRepository, invmng) + private INormalEfCoreRepository _notRepository; + public HBPO_CAN_SA_SERVICE(INormalEfCoreRepository repository, + IExcelImportAppService excelImportService, + INormalEfCoreRepository detailRepository, + INV_MNG invmng, + INormalEfCoreRepository notRepository + + + ) : base(repository, excelImportService, detailRepository, invmng) { + _notRepository = notRepository; } + /// + /// 生成发票 + /// + /// + /// + [HttpPost] + //[Route("generateinvoice")] + public async override Task GenerateInvoice(HBPO_CAN_SA_REQ_DTO input) + { + + var main = _repository.Where(p => p.InvGroupNum == input.Filters.Where(p => p.Column == "BillNum").FirstOrDefault().Value).FirstOrDefault(); + var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);//可结算 + + var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + + var notList = _notRepository.Where(p => groupNumList.Contains(p.InvGroupNum)).ToList();//不能结算 + + var dtos = ObjectMapper.Map, List>(entitys); + + dtos.ForEach(dto => + { + dto.Amt = Math.Round(dto.Price * dto.Qty, 2); + }); + + var _query = dtos.GroupBy(p => new { p.GroupNum }).Select(p => new { GroupNum = p.Key.GroupNum, Amt = p.Sum(itm => itm.Amt) }); + + Dictionary dic = new Dictionary();//原本 + + Dictionary copyDic = new Dictionary();//变换数组副本 + + foreach (var itm in _query.ToList()) + { + dic.Add(itm.GroupNum, itm.Amt); + copyDic.Add(itm.GroupNum, itm.Amt); + } + Dictionary> invoiceMap = new Dictionary>(); + foreach (var itm in dic) + { + string invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV"); + List invoiceGroupNumList = new List();//每个发票对应的结算分组号 + List List = new List(); + decimal sum = itm.Value;//初始分组合计金额 + List luList = dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类 + + if (copyDic.ContainsKey(itm.Key) == true)//是否存在分组 + { + foreach (var _itm1 in copyDic) + { + if (itm.Key == _itm1.Key)//相同结算分组项不计算,已初始化 + { + invoiceGroupNumList.Add(itm.Key); + continue; + } + var grouplist = dtos.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; + } + if (sum > 10000000) + { + break; + } + sum += _itm1.Value; + invoiceGroupNumList.Add(_itm1.Key);//所有条件都满足添加发票和结算分组对应关系 + } + + invoiceMap.Add(invoiceBillNum, invoiceGroupNumList);//记录发票对应关系 + foreach (var rem in invoiceGroupNumList)//移除 + { + copyDic.Remove(rem); + } + } + } + if (invoiceMap.Keys.Count > 0) + { + + var inv = new INVOICE_GRP(); + var groupList = new List(); + var notDetialList = new List(); + var detailList = new List(); + + foreach (var itm in invoiceMap) + { + var key = itm.Key;//发票票号 + var ls = itm.Value;//结算分组号列表 + var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.LU, p.Price }) + .Select(itm => new { + InvGroupNum = itm.Key.InvGroupNum, + LU = itm.Key.LU, + Price = itm.Key.Price, + Amt = Math.Round(itm.Sum(k => k.Qty) * itm.Key.Price, 2), + Qty = itm.Sum(k => k.Qty) + }) + .ToList(); + var invbill = new INVOICE_GRP(); + + + foreach (var obj in detailDtos) + { + new INVOICE_WAIT_DETAIL( + guid: GuidGenerator.Create(), + version: main.Version, + invbillNum: key, + invGroupNum: obj.InvGroupNum, + lU: obj.LU, + qty: obj.Qty, + bussiessType: EnumBusinessType.BBAC, + amt: obj.Amt, + pRICE: obj.Price, + extend1: string.Empty, extend2: string.Empty, extend3: string.Empty, extend4: string.Empty + ); + } + + + foreach (var groupnum in ls) + { + + } + } + + } + + + + + return ApplicationConsts.SuccessStr; + } + + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs index e973acd6..33001b34 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs @@ -65,6 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ , settleDate: entity.SettleDate , groupNum: entity.GroupNum , invGroupNum: entity.InvGroupNum + ,businessType: entity.BusinessType ); } 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 0b4b8e87..db7d3ffa 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 @@ -103,7 +103,7 @@ public class BBAC_CAN_SA_DETAIL: SA_CAN_BASE /// ExternalCallNumber包含(R0)为买单件 1为JIS 2.为买单件 /// [Display(Name = "业务类别")] - public string Category { get; set; } = null!; + public EnumBusinessType BusinessType { get; set; } /// /// 对应字段MovementType,996正常,997为退货 @@ -111,6 +111,11 @@ public class BBAC_CAN_SA_DETAIL: SA_CAN_BASE [Display(Name = "是否退货")] public string IsReturn { get; set; } = null!; + + + [Display(Name="合同号")] + public string ContractDocID { get; set; } + /// /// 对应字段PostingDate /// @@ -134,7 +139,10 @@ public class BBAC_CAN_SA_DETAIL: SA_CAN_BASE - public BBAC_CAN_SA_DETAIL(Guid guid,string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string category, string isReturn, DateTime settleDate, string groupNum, string invGroupNum) + public BBAC_CAN_SA_DETAIL(Guid guid,string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, string isReturn, + DateTime settleDate, string groupNum, string invGroupNum + ,string contactid + ) { Id = guid; KeyCode = keyCode; @@ -146,10 +154,11 @@ public class BBAC_CAN_SA_DETAIL: SA_CAN_BASE Site = site; Qty = qty; Price = price; - Category = category; + BusinessType = category; IsReturn = isReturn; SettleDate = settleDate; GroupNum = groupNum; InvGroupNum = invGroupNum; + ContractDocID = contactid; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs index a7b3fce1..61b66f5f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs @@ -1,7 +1,7 @@ -using SettleAccount.Bases; +using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; - +using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; @@ -61,7 +61,7 @@ public class BBAC_NOT_SA_DETAIL:SA_NOT_BASE /// ExternalCallNumber包含(R0)为买单件 1为JIS 2.为买单件 /// [Display(Name = "业务类别")] - public string Category { get; set; } = null!; + public EnumBusinessType BusinessType { get; set; } /// /// 对应字段MovementType,996正常,997为退货 @@ -84,13 +84,15 @@ public class BBAC_NOT_SA_DETAIL:SA_NOT_BASE //[Display(Name = "结算分组")] //public string GroupNum { get; set; } = null!; + [Display(Name = "合同号")] + public string ContractDocID { get; set; } public BBAC_NOT_SA_DETAIL() { } - public BBAC_NOT_SA_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string category, string isReturn, string invGroupNum, DateTime settleDate, string groupNum) + public BBAC_NOT_SA_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, string isReturn, string invGroupNum, DateTime settleDate, string groupNum,string contractDocID) { Id = guid; @@ -102,10 +104,11 @@ public class BBAC_NOT_SA_DETAIL:SA_NOT_BASE Site = site; Qty = qty; Price = price; - Category = category; + BusinessType = category; IsReturn = isReturn; InvGroupNum = invGroupNum; SettleDate = settleDate; GroupNum = groupNum; + ContractDocID = contractDocID; } } 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 7d28d814..ba0119bb 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 @@ -13,7 +13,7 @@ public class HBPO_CAN_SA : SA_CAN_BASE_MAIN //[Display(Name = "关联结算单号")] //public string SettleBillNum { get; set; } = null!; //[Display(Name = "结算单据")] - + //public string BillNum { get; set; } = null!; ///// @@ -33,6 +33,10 @@ public class HBPO_CAN_SA : SA_CAN_BASE_MAIN /// //[Display(Name = "工厂地点")] //public string Site { get; set; } = null!; + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } public HBPO_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, SettleBillState state, string invGroupNum,string site) { @@ -115,8 +119,12 @@ public class HBPO_CAN_SA_DETAIL:SA_CAN_BASE //[Display(Name = "发票分组号")] //public string InvGroupNum { get; set; } = null!; + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } - public HBPO_CAN_SA_DETAIL(Guid guid ,string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum) + public HBPO_CAN_SA_DETAIL(Guid guid ,string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType) { Id = guid; KeyCode = keyCode; @@ -131,6 +139,7 @@ public class HBPO_CAN_SA_DETAIL:SA_CAN_BASE SettleDate = settleDate; GroupNum = groupNum; InvGroupNum = invGroupNum; + BusinessType = businessType; } public HBPO_CAN_SA_DETAIL() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_NOT_SA_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_NOT_SA_DETAIL.cs index 2192899c..2baf05a2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_NOT_SA_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_NOT_SA_DETAIL.cs @@ -1,8 +1,7 @@ -using SettleAccount.Bases; +using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; - - +using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; // @@ -94,10 +93,13 @@ public class HBPO_NOT_SA_DETAIL :SA_NOT_BASE //[Display(Name = "发票分组号")] //public string InvGroupNum { get; set; } = null!; + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } - - public HBPO_NOT_SA_DETAIL(Guid guid ,string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum) + public HBPO_NOT_SA_DETAIL(Guid guid ,string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType) { Id = guid; KeyCode = keyCode; @@ -111,6 +113,7 @@ public class HBPO_NOT_SA_DETAIL :SA_NOT_BASE SettleDate = settleDate; GroupNum = groupNum; InvGroupNum = invGroupNum; + BusinessType = businessType; } public HBPO_NOT_SA_DETAIL() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SA.cs index 7ae1443f..d5ffda6c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SA.cs @@ -1,7 +1,8 @@ -using SettleAccount.Bases; +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结算导入")] @@ -35,6 +36,12 @@ public class HBPO_SA :FullAuditedAggregateRoot [Display(Name = "工厂地点")] public string Site { get; set; } = null!; + + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } + public HBPO_SA(Guid guid, int version, string billNum, string dNBillNum, string state, string recordCount) { this.Id= guid; @@ -114,12 +121,17 @@ public class HBPO_SA_DETAIL :SA_BASE ///// //[Display(Name = "结算分组")] //public string GroupNum { get; set; } = null!; + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } + [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } = null!; - public HBPO_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum) + public HBPO_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType) { this.Id= guid; KeyCode = keyCode; @@ -133,6 +145,7 @@ public class HBPO_SA_DETAIL :SA_BASE SettleDate = settleDate; GroupNum = groupNum; InvGroupNum = invGroupNum; + BusinessType= businessType; } public HBPO_SA_DETAIL() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs index 5d13ea46..e7df840f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; @@ -23,13 +23,19 @@ public class INVOICE_NOT_SETTLE : FullAuditedAggregateRoot [Display(Name = "不可结算零件号")] public string LU1 { get; set; } = null!; + [Display(Name = "数量")] + public decimal Qty { get; set; } + [Display(Name = "扩展字段1")] public string Extend1 { get; set; } = null!; [Display(Name = "扩展字段2")] public string Extend2 { get; set; } = null!; - public INVOICE_NOT_SETTLE(Guid guid, int version, string invGroupNum, string settleGroupNum, string lU, string lU1, string extend1, string extend2) + + + + public INVOICE_NOT_SETTLE(Guid guid, int version, string invGroupNum, string settleGroupNum, string lU, string lU1, string extend1, string extend2,decimal qty) { Id = guid; Version = version; @@ -39,6 +45,7 @@ public class INVOICE_NOT_SETTLE : FullAuditedAggregateRoot LU1 = lU1; Extend1 = extend1; Extend2 = extend2; + Qty = qty; } public INVOICE_NOT_SETTLE() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs index 46667bad..970ff8a9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs @@ -35,16 +35,13 @@ namespace Win.Sfs.SettleAccount public enum InvoiceBillState { - [Description("已开票")] - 已开票 = 1, - [Description("商务已审核")] - 商务已审核 = 2, - [Description("财务已审核")] - 财务已审核 = 3, - [Description("已扣减")] - 已扣减 = 5, - [Description("客户已收票")] - 客户已收票 = 4, + [Description("正常")] + 正常 = 1, + [Description("报废")] + 报废 = 2, + [Description("替换")] + 替换 = 3, + 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 cc22b56d..dd5dae6a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -515,7 +515,7 @@ namespace Win.Sfs.SettleAccount b.ConfigureByConvention(); b.Property(x => x.SettleBillNum).HasMaxLength(50); b.Property(x => x.Site).HasMaxLength(50); - b.Property(x => x.Category).HasMaxLength(50); + b.Property(x => x.IsReturn).HasMaxLength(50); b.Property(x => x.BillNum).HasMaxLength(50); b.Property(x => x.InvGroupNum).HasMaxLength(50); @@ -555,7 +555,7 @@ namespace Win.Sfs.SettleAccount b.ConfigureByConvention(); b.Property(x => x.Site).HasMaxLength(50); - b.Property(x => x.Category).HasMaxLength(50); + b.Property(x => x.IsReturn).HasMaxLength(50); b.Property(x => x.SettleBillNum).HasMaxLength(50); b.Property(x => x.InvGroupNum).HasMaxLength(50); diff --git a/repos.lnk b/repos.lnk new file mode 100644 index 00000000..e09a8aa6 Binary files /dev/null and b/repos.lnk differ