From 8d575016273ff562f567abdc14f194f5c34d152f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 1 Sep 2023 16:43:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs | 8 +++--- .../Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs | 4 +-- .../Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs | 4 +-- .../Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs | 4 +-- .../Entities/BQ/BBAC_NOT_SA_SERVICE.cs | 9 ------- .../Entities/BQ/BBAC_PD_SERVICE.cs | 1 - .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 3 --- .../Entities/BQ/PUB_NOT_SA_SERVICE.cs | 1 - .../BQ/Syncs/PendingDeductionService.cs | 2 ++ .../Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs | 27 ++++++++++++------- .../Entities/BQ/Managers/PUB_NOT_SA_MNG.cs | 2 +- 11 files changed, 31 insertions(+), 34 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 98460a8c..a90939a4 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 @@ -52,9 +52,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public DateTime SettleDate { get; set; } [ExporterHeader(DisplayName = "发票号")] //全部业务都显示 public string InvBillNum { get; set; } - [ExporterHeader(DisplayName = "厂内零件号")] //全部业务都显示 + [ExporterHeader(DisplayName = "客户零件号")] //全部业务都显示 public string LU { get; set; } - [ExporterHeader(DisplayName = "客户零件号")] //全部业务都显示 (查询条件) + [ExporterHeader(DisplayName = "厂内零件号")] //全部业务都显示 (查询条件) public string PartCode { get; set; } [ExporterHeader(DisplayName = "零件描述")] //全部业务都显示 public string MaterialDesc { get; set; } @@ -106,9 +106,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public DateTime SettleDate { get; set; } [ExporterHeader(DisplayName = "发票号")] //全部业务都显示 public string InvBillNum { get; set; } - [ExporterHeader(DisplayName = "厂内零件号")] //全部业务都显示 + [ExporterHeader(DisplayName = "客户零件号")] //全部业务都显示 public string LU { get; set; } - [ExporterHeader(DisplayName = "客户零件号")] //全部业务都显示 (查询条件) + [ExporterHeader(DisplayName = "厂内零件号")] //全部业务都显示 (查询条件) public string PartCode { get; set; } [ExporterHeader(DisplayName = "零件描述")] //全部业务都显示 public string MaterialDesc { get; set; } 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 c8a271eb..2894400f 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 @@ -105,7 +105,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 = "客户零件")] public string LU { get; set; } [ExporterHeader(DisplayName = "物料描述")] public string MaterialDesc { get; set; } @@ -121,7 +121,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// /// 客户零件号 /// - [ExporterHeader(DisplayName = "何苦零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] public string PartCode { get; set; } } 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 9dd09781..9e167ee0 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 @@ -144,7 +144,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public DateTime SettleDate { get; set; } [ExporterHeader(DisplayName = "发票分组号")] public string InvGroupNum { get; set; } - [ExporterHeader(DisplayName = "零件号")] + [ExporterHeader(DisplayName = "客户零件号")] public string LU { get; set; } [ExporterHeader(DisplayName = "物料描述")] @@ -160,7 +160,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// /// 客户零件号 /// - [ExporterHeader(DisplayName = "客户零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] public string PartCode { get; set; } } 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 c5c0c9d4..ee72c745 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 @@ -102,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 = "客户零件号")] public string LU { get; set; } [ExporterHeader(DisplayName = "物料描述")] @@ -116,7 +116,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "结算分组号")] public string GroupNum { get; set; } - [ExporterHeader(DisplayName = "客户零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] public string PartCode { get; set; } 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 e4843967..0061cfa3 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 @@ -35,9 +35,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BBAC_NOT_SA_DETAIL_REQ_DTO, BBAC_NOT_SA_DETAIL_EXP_DTO> { - private readonly BBAC_NOT_SA_MNG _bbacNotMng; - public BBAC_NOT_SA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository detailRepository, BBAC_NOT_SA_MNG bbacNotMng) : @@ -45,32 +43,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { _bbacNotMng = bbacNotMng; } - [HttpPost] public override async Task GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input) { List errorlist = new List(); var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); - if (entitys == null ) { errorlist.Add(new ERR_EXP_DTO() { Message = "查询条件无记录" }); } else { - var errors = await _bbacNotMng.GenerateSettlementOrder(entitys); if (errors.Count > 0) { - - foreach (var itm in errors) { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorlist) }); - - } } return new JsonResult(new { Code = 200, Message = "生成成功" }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs index cbb2456a..08ceebf3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs @@ -49,7 +49,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [UnitOfWork(false)] public override async Task ApprovalPassed(List p_list) { - var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList(); List customConditionList = new List(); customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value =string.Join(",",p_list) }); 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 c9f803a0..4a424a05 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 @@ -71,15 +71,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task GenerateInvoice( [FromBody] string billnum) { var main = await _pubMng.GetMainAsync(billnum); - if (main != null) { if (main.State != SettleBillState.未结状态) { return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } - - if (await _pubMng.SetForwardState(main, SettleBillState.已开票)) { var entitys = await _pubMng.GetDetalListAsync(billnum); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs index cfadb072..a383ab95 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs @@ -47,7 +47,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public override async Task GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input) { var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); - List errorlist = new List(); if (entitys == null) { 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 6394c208..ee51b03c 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 @@ -102,6 +102,8 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, public void Sync(List p_ls, EnumDeliverBjBmpBillType bussinessType, bool flag=true) where T : PD_BASE,new() { + + var query = from itm in p_ls select new VmiLog() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs index 626bf387..7caa22ab 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs @@ -49,6 +49,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } public virtual async Task> GenerateSettlementOrder(List p_list) { + var first=p_list.FirstOrDefault(); List errors = new List(); var priceErrors = await _service.CheckPriceList(p_list); if (priceErrors.Count > 0) @@ -58,16 +59,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers errors.Add($"生产号{itm.PN}零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据"); } } - var ls=p_list.Select(p => p.Site.Substring(0, 3)).Distinct().ToList(); - if(ls.Count>1) + if (first.BusinessType == EnumBusinessType.JisHBPO) { - errors.Add($"生成结算数据有多个地点数据{string.Join(",",ls)}"); - } - if (errors.Count > 0) - { - return errors; - } + var ls = p_list.Select(p => p.Site.Substring(0, 3)).Distinct().ToList(); + if (ls.Count > 1) + { + errors.Add($"生成结算数据有多个地点数据{string.Join(",", ls)}"); + } + if (errors.Count > 0) + { + return errors; + } + + + } var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var _entity = new HBPO_CAN_SA(); _entity.BillNum = billNumber; @@ -96,7 +102,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers settleDate: itm.SettleDate, site: itm.Site, invbillnum: string.Empty, - partcode:itm.PartCode + partcode: itm.PartCode ); _detailEntity.RealPartCode = itm.RealPartCode; _entityList.Add(_detailEntity); @@ -104,6 +110,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 errors; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs index b65a42f5..5eca6fb5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs @@ -86,7 +86,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { foreach (var itm in priceErrors) { - errors.Add($"{name}零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据"); + errors.Add($"{name}{itm.GroupNum}零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据"); } } if (errors.Count > 0)