From ffb693b6f32756ccc03fa4796bef11c3c01f5764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 17 Aug 2023 15:54:41 +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 --- .../Bases/ADJ_SERVICE.cs | 9 +++-- .../Bases/BA_SERVICE.cs | 39 +++++++++++++------ .../Bases/CAN_SA_SERVICE.cs | 4 +- .../Bases/NOT_SA_SERVICE.cs | 4 +- .../Entities/BQ/BBAC_BA_SERVICE.cs | 20 ++++++---- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 6 +-- .../Entities/BQ/BBAC_NOT_SA_SERVICE.cs | 29 +++++++++----- .../Entities/BQ/HBPO_BA_SERVICE.cs | 15 ++++--- .../Entities/BQ/HBPO_CAN_SA_SERVICE.cs | 6 +-- .../Entities/BQ/HBPO_NOT_SA_SERVICE.cs | 23 +++++++---- .../Entities/BQ/PUB_BA_SERVICE.cs | 14 +++---- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 6 +-- .../Entities/BQ/PUB_NOT_SA_SERVICE.cs | 30 ++++++++------ .../Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs | 24 ++++++------ .../Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs | 24 ++++++------ .../Entities/BQ/Managers/PUB_CAN_SA_MNG.cs | 24 ++++++------ 16 files changed, 161 insertions(+), 116 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs index 292da981..a98f2ca9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs @@ -182,7 +182,7 @@ public class ADJ_SERVICE : BASE_SERVICE /// [HttpPost] [DisableRequestSizeLimit] - public async Task CheckImport(List p_list) + public async Task CheckImport(List p_list) { if (p_list.Count == 0) { @@ -299,7 +299,8 @@ public class ADJ_SERVICE : BASE_SERVICE } if (errorList.Count > 0) { - return await ExportErrorReportAsync(errorList); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + } //var query = from itm in entityList // join itm1 in invlist @@ -323,11 +324,11 @@ public class ADJ_SERVICE : BASE_SERVICE // inv: string.Empty, // partcode:itm.PartCode - + // ); //await _repository.DbContext.BulkDeleteAsync(deletels);//删除发票下所有调整明细 //await _repository.DbContext.BulkInsertAsync(query.ToList()); - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "校验成功" }); ; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index de562560..1195a69c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -98,12 +98,15 @@ namespace Win.Sfs.SettleAccount.Bases /// /// [HttpPost] - public virtual async Task GenerateInvoice(List p_invs) + public virtual async Task GenerateInvoice(List p_invs) { - await _invMng.SetForwardState(p_invs, SettleBillState.商务已审核); - - return ApplicationConsts.SuccessStr; + var issucess=await _invMng.SetForwardState(p_invs, SettleBillState.商务已审核); + if (issucess == true) + { + return new JsonResult(new { Code = 200, Message = "审核成功" }); + } + return new JsonResult(new { Code = 400, Message = "审核失败" }); } /// @@ -112,12 +115,12 @@ namespace Win.Sfs.SettleAccount.Bases /// /// [HttpPost] - public virtual async Task ReissueInvoice(string input) + public virtual async Task ReissueInvoice(string input) { // await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核); - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "重开成功" }); } /// @@ -201,19 +204,31 @@ namespace Win.Sfs.SettleAccount.Bases /// 主表查询条件 /// [HttpPost] - public virtual async Task RejectAsync(string p_invGroupNum) + public virtual async Task RejectAsync(string p_invGroupNum) { - await _invMng.Reject(p_invGroupNum); - return ApplicationConsts.SuccessStr; + bool issuc= await _invMng.Reject(p_invGroupNum); + if (issuc == true) + { + + return new JsonResult(new { Code = 200, Message = "退回成功" }); + } + + return new JsonResult(new { Code = 400, Message = "退回失败" }); } [HttpPost] - public virtual async Task ReceivedAsync(List p_ins) + public virtual async Task ReceivedAsync(List p_ins) { - await _invMng.ReceivedAsync(p_ins); - return ApplicationConsts.SuccessStr; + bool issuc = await _invMng.ReceivedAsync(p_ins); + if (issuc == true) + { + return new JsonResult(new { Code = 200, Message = "收票成功" }); + + } + + return new JsonResult(new { Code = 200, Message = "收票成功" }); } protected virtual async Task> GetMapGroupAsync(INVOICE_GRP_REQ_DTO input) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index 13f5b9a4..033b0b4b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -133,10 +133,10 @@ namespace Win.Sfs.SettleAccount.Bases /// [HttpPost] //[Route("generateinvoice")] - public virtual async Task GenerateInvoice(string input) + public virtual async Task GenerateInvoice(string input) { - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "创建成功" }); ; } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs index 163a407f..6e15b771 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs @@ -103,9 +103,9 @@ namespace Win.Sfs.SettleAccount.Bases /// /// [HttpPost] - public virtual async Task GenerateSettlementOrder(TRequestDetailInput input) + public virtual async Task GenerateSettlementOrder(TRequestDetailInput input) { - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "生成成功" }); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index 81c63175..f7346834 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -4,6 +4,7 @@ using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using NPOI.HPSF; using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; @@ -65,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public override async Task ReissueInvoice(string p_invbillnum) + public override async Task ReissueInvoice(string p_invbillnum) { //var mappingList= await GetMapGroupAsync(p_invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) @@ -134,7 +135,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { - return await ExportErrorReportAsync(errorList); + + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + } var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s @@ -184,7 +187,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException( $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "重开成功" }); } [HttpPost] @@ -193,7 +196,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public virtual async Task ReissueInvoiceExtend(List p_list) + public virtual async Task ReissueInvoiceExtend(List p_list) { var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) @@ -261,9 +264,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList =await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { - return await ExportErrorReportAsync(errorList); - } - var dto1s = ObjectMapper.Map, List>(entitys); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + + } + var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 @@ -311,7 +315,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException( $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "重开成功" }); ; } [HttpPost] 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 d93df0af..ea44fe78 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 @@ -82,7 +82,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// [HttpPost] - public async override Task GenerateInvoice(string invbillNum) + public async override Task GenerateInvoice(string invbillNum) { var main =await _bbacMng.GetMainAsync(invbillNum); if (main != null) @@ -97,7 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList,main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { - return await ExportErrorReportAsync(errorList); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); } var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s @@ -161,7 +161,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException(string.Format("{0}不存在该可结算单号", invbillNum)); } - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "生成成功" }); } } } 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 0c8cc7ee..e4843967 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 @@ -47,24 +47,33 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } [HttpPost] - public override async Task GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input) + 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); - var errors=await _bbacNotMng.GenerateSettlementOrder(entitys); - if (errors.Count > 0) + + if (entitys == null ) + { + errorlist.Add(new ERR_EXP_DTO() { Message = "查询条件无记录" }); + } + else { - List errorlist = new List(); - foreach (var itm in errors) + var errors = await _bbacNotMng.GenerateSettlementOrder(entitys); + if (errors.Count > 0) { - errorlist.Add(new ERR_EXP_DTO() { Message = itm }); - } - return await ExportErrorReportAsync(errorlist); + 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 ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "生成成功" }); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs index 60a9700e..c829b40e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs @@ -54,7 +54,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public override async Task ReissueInvoice(string p_invbillnum) + public override async Task ReissueInvoice(string p_invbillnum) { //var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) @@ -112,7 +112,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { - return await ExportErrorReportAsync(errorList); + + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + + ; } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -161,7 +164,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException( $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "发票重开成功" }); } [HttpPost] @@ -170,7 +173,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public virtual async Task ReissueInvoiceExtend(List p_list) + public virtual async Task ReissueInvoiceExtend(List p_list) { var adjlist = ObjectMapper.Map, List>(p_list); @@ -238,7 +241,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count() > 0) { - return await ExportErrorReportAsync(errorList); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -287,7 +290,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException( $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "发票重开成功" }); } 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 0700a97b..9a3ff640 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 @@ -74,7 +74,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// [HttpPost] //[Route("generateinvoice")] - public async override Task GenerateInvoice(string invbillnum) + public async override Task GenerateInvoice(string invbillnum) { var main =await _hbpoMng.GetMainAsync(invbillnum); @@ -90,7 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList=await CheckInvoiceGenerationRules(entitys, priceList,main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { - return await ExportErrorReportAsync(errorList); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); } var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s @@ -151,7 +151,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } } } - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "生成成功" }); } 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 df27c98d..11422a08 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 @@ -48,20 +48,27 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _hbpoNotMng = hbpoNotMng; } - public override async Task GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input) + public override async Task GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input) { var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); - var errors = await _hbpoNotMng.GenerateSettlementOrder(entitys); - if (errors.Count > 0) + List errorlist = new List(); + if (entitys == null) { - List errorlist = new List(); - foreach (var itm in errors) + errorlist.Add(new ERR_EXP_DTO() { Message = "查询条件无记录" }); + } + else + { + var errors = await _hbpoNotMng.GenerateSettlementOrder(entitys); + if (errors.Count > 0) { - errorlist.Add(new ERR_EXP_DTO() { Message = itm }); + 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 await ExportErrorReportAsync(errorlist); } - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "生成成功" }); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs index edfd8586..3a6b24f9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs @@ -52,7 +52,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// [HttpPost] - public virtual async Task ReissueInvoiceExtend(List p_list) + public virtual async Task ReissueInvoiceExtend(List p_list) { var first = p_list.FirstOrDefault(); var invbillnum = first.InvBillNum; @@ -124,7 +124,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count > 0) { - return await ExportErrorReportAsync(errorList); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -173,7 +173,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new BusinessException("8989", $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "发票重开成功" }); } @@ -186,7 +186,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// - public override async Task ReissueInvoice(string p_invbillnum) + public override async Task ReissueInvoice(string p_invbillnum) { //var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) @@ -249,8 +249,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (errorList.Count > 0) { - return await ExportErrorReportAsync(errorList); - } + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); + } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys join p in priceList on d.PartCode equals p.LU @@ -298,7 +298,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new BusinessException("8989", $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "发票重开成功" }); ; } [HttpPost] /// 发票重开列表 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 9f101843..3cbfc5f9 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 @@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] - public async override Task GenerateInvoice(string billnum) + public async override Task GenerateInvoice(string billnum) { var main = await _pubMng.GetMainAsync(billnum); if (main != null) @@ -90,7 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则 if (errorList.Count() > 0) { - return await ExportErrorReportAsync(errorList); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); } var dto1s = ObjectMapper.Map, List>(entitys); @@ -135,7 +135,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } } - return ApplicationConsts.SuccessStr; + return new JsonResult(new { Code = 200, Message = "生成成功" }); } } } 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 6296b015..cfadb072 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 @@ -44,24 +44,30 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _pubNotMng = pubNotMng; } - public override async Task GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input) + 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); - var errors=await _pubNotMng.GenerateSettlementOrder(entitys); - if (errors.Count > 0) + + List errorlist = new List(); + if (entitys == null) { - - List errorlist= new List(); - foreach (var itm in errors) + errorlist.Add(new ERR_EXP_DTO() { Message = "查询条件无记录" }); + } + else + { + var errors = await _pubNotMng.GenerateSettlementOrder(entitys); + if (errors.Count > 0) { - errorlist.Add(new ERR_EXP_DTO() { Message = itm }); + 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 await ExportErrorReportAsync(errorlist); - - } - return ApplicationConsts.SuccessStr; - + + return new JsonResult(new { Code = 200, Message = "生成成功" }); + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs index 8087e393..ad6e5805 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs @@ -64,7 +64,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count ==0) { - throw new BusinessException("8989", string.Format("不存在编号为{0}",p_billNum)); + throw new UserFriendlyException(string.Format("不存在编号为{0}",p_billNum)); } foreach (BBAC_CAN_SA p_entiy in ls) { @@ -77,7 +77,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); + throw new UserFriendlyException("当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); } break; case SettleBillState.商务已审核: @@ -87,7 +87,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); + throw new UserFriendlyException("当前状态不是【已开票】状态,无法设置成【商务已审核】"); } break; case SettleBillState.已开票: @@ -97,7 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【未结状态】状态,无法设置成【已开票】"); + throw new UserFriendlyException("当前状态不是【未结状态】状态,无法设置成【已开票】"); } break; case SettleBillState.已扣减: @@ -107,7 +107,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[客户收票],无法设置成【财务已审核】状态"); + throw new UserFriendlyException("当前状态不是[客户收票],无法设置成【财务已审核】状态"); } break; case SettleBillState.客户已收票: @@ -117,7 +117,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[财务已审核],无法设置成【客户已收票】状态"); + throw new UserFriendlyException("当前状态不是[财务已审核],无法设置成【客户已收票】状态"); } break; } @@ -139,7 +139,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count == 0) { - throw new BusinessException("8989", string.Format("不存在发票分组号为{0}的可结算单", p_billNum)); + throw new UserFriendlyException(string.Format("不存在发票分组号为{0}的可结算单", p_billNum)); } foreach (BBAC_CAN_SA p_entiy in ls) { @@ -153,7 +153,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【财务已审核】,无法设置成【商务已审核】状态"); + throw new UserFriendlyException("当前状态不是【财务已审核】,无法设置成【商务已审核】状态"); } break; case SettleBillState.已开票: @@ -163,7 +163,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【商务已审核】状态,无法设置成【已开票】"); + throw new UserFriendlyException("当前状态不是【商务已审核】状态,无法设置成【已开票】"); } break; case SettleBillState.未结状态: @@ -173,7 +173,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【未结状态】"); + throw new UserFriendlyException("当前状态不是【已开票】状态,无法设置成【未结状态】"); } break; case SettleBillState.客户已收票: @@ -183,7 +183,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态"); + throw new UserFriendlyException("当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态"); } break; case SettleBillState.财务已审核: @@ -193,7 +193,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[客户已收票],无法设置成【财务已审核】状态"); + throw new UserFriendlyException("当前状态不是[客户已收票],无法设置成【财务已审核】状态"); } break; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs index a907f7fa..4dd957be 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs @@ -72,7 +72,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count ==0) { - throw new BusinessException("8989", string.Format("不存在编号为{0}",p_billNum)); + throw new UserFriendlyException(string.Format("不存在编号为{0}",p_billNum)); } foreach (HBPO_CAN_SA p_entiy in ls) { @@ -85,7 +85,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); + throw new UserFriendlyException("当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); } break; case SettleBillState.商务已审核: @@ -95,7 +95,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); + throw new UserFriendlyException("当前状态不是【已开票】状态,无法设置成【商务已审核】"); } break; case SettleBillState.已开票: @@ -105,7 +105,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【未结状态】状态,无法设置成【已开票】"); + throw new UserFriendlyException("当前状态不是【未结状态】状态,无法设置成【已开票】"); } break; case SettleBillState.已扣减: @@ -115,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[客户收票],无法设置成【财务已审核】状态"); + throw new UserFriendlyException("当前状态不是[客户收票],无法设置成【财务已审核】状态"); } break; case SettleBillState.客户已收票: @@ -125,7 +125,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[财务已审核],无法设置成【客户已收票】状态"); + throw new UserFriendlyException("当前状态不是[财务已审核],无法设置成【客户已收票】状态"); } break; } @@ -147,7 +147,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count == 0) { - throw new BusinessException("8989", string.Format("不存在发票分组号为{0}的可结算单", p_billNum)); + throw new UserFriendlyException(string.Format("不存在发票分组号为{0}的可结算单", p_billNum)); } foreach (HBPO_CAN_SA p_entiy in ls) { @@ -161,7 +161,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【财务已审核】,无法设置成【商务已审核】状态"); + throw new UserFriendlyException("当前状态不是【财务已审核】,无法设置成【商务已审核】状态"); } break; case SettleBillState.已开票: @@ -171,7 +171,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【商务已审核】状态,无法设置成【已开票】"); + throw new UserFriendlyException("当前状态不是【商务已审核】状态,无法设置成【已开票】"); } break; case SettleBillState.未结状态: @@ -181,7 +181,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【未结状态】"); + throw new UserFriendlyException("当前状态不是【已开票】状态,无法设置成【未结状态】"); } break; case SettleBillState.客户已收票: @@ -191,7 +191,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态"); + throw new UserFriendlyException("当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态"); } break; case SettleBillState.财务已审核: @@ -201,7 +201,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[客户已收票],无法设置成【财务已审核】状态"); + throw new UserFriendlyException("当前状态不是[客户已收票],无法设置成【财务已审核】状态"); } break; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs index 3708c69e..94d25e1a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs @@ -67,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count ==0) { - throw new BusinessException("8989", string.Format("不存在编号为{0}",p_billNum)); + throw new UserFriendlyException( string.Format("不存在编号为{0}",p_billNum)); } foreach (PUB_CAN_SA p_entiy in ls) { @@ -80,7 +80,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); + throw new UserFriendlyException( "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); } break; case SettleBillState.商务已审核: @@ -90,7 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); + throw new UserFriendlyException( "当前状态不是【已开票】状态,无法设置成【商务已审核】"); } break; case SettleBillState.已开票: @@ -100,7 +100,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【未结状态】状态,无法设置成【已开票】"); + throw new UserFriendlyException( "当前状态不是【未结状态】状态,无法设置成【已开票】"); } break; case SettleBillState.已扣减: @@ -110,7 +110,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[客户收票],无法设置成【财务已审核】状态"); + throw new UserFriendlyException( "当前状态不是[客户收票],无法设置成【财务已审核】状态"); } break; case SettleBillState.客户已收票: @@ -120,7 +120,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[财务已审核],无法设置成【客户已收票】状态"); + throw new UserFriendlyException( "当前状态不是[财务已审核],无法设置成【客户已收票】状态"); } break; } @@ -142,7 +142,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count == 0) { - throw new BusinessException("8989", string.Format("不存在发票分组号为{0}的可结算单", p_billNum)); + throw new UserFriendlyException( string.Format("不存在发票分组号为{0}的可结算单", p_billNum)); } foreach (PUB_CAN_SA p_entiy in ls) { @@ -156,7 +156,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【财务已审核】,无法设置成【商务已审核】状态"); + throw new UserFriendlyException( "当前状态不是【财务已审核】,无法设置成【商务已审核】状态"); } break; case SettleBillState.已开票: @@ -166,7 +166,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【商务已审核】状态,无法设置成【已开票】"); + throw new UserFriendlyException( "当前状态不是【商务已审核】状态,无法设置成【已开票】"); } break; case SettleBillState.未结状态: @@ -176,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【未结状态】"); + throw new UserFriendlyException( "当前状态不是【已开票】状态,无法设置成【未结状态】"); } break; case SettleBillState.客户已收票: @@ -186,7 +186,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态"); + throw new UserFriendlyException( "当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态"); } break; case SettleBillState.财务已审核: @@ -196,7 +196,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new BusinessException("8989", "当前状态不是[客户已收票],无法设置成【财务已审核】状态"); + throw new UserFriendlyException( "当前状态不是[客户已收票],无法设置成【财务已审核】状态"); } break; }