mahao 1 year ago
parent
commit
ea816e7362
  1. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs
  2. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  3. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  4. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs
  5. 20
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  6. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  7. 29
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs
  8. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  9. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  10. 23
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs
  11. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  12. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  13. 30
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs
  14. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs
  15. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs
  16. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs

9
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs

@ -182,7 +182,7 @@ public class ADJ_SERVICE : BASE_SERVICE
/// <exception cref="BusinessException"></exception>
[HttpPost]
[DisableRequestSizeLimit]
public async Task<string> CheckImport(List<PUB_ADJ_DETAIL_DTO> p_list)
public async Task<IActionResult> CheckImport(List<PUB_ADJ_DETAIL_DTO> 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 = "校验成功" }); ;
}
}

39
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs

@ -98,12 +98,15 @@ namespace Win.Sfs.SettleAccount.Bases
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> GenerateInvoice(List<string> p_invs)
public virtual async Task<IActionResult> GenerateInvoice(List<string> 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 = "审核失败" });
}
/// <summary>
@ -112,12 +115,12 @@ namespace Win.Sfs.SettleAccount.Bases
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> ReissueInvoice(string input)
public virtual async Task<IActionResult> ReissueInvoice(string input)
{
// await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核);
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "重开成功" });
}
/// <summary>
@ -201,19 +204,31 @@ namespace Win.Sfs.SettleAccount.Bases
/// <param name="input">主表查询条件</param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> RejectAsync(string p_invGroupNum)
public virtual async Task<IActionResult> 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<string> ReceivedAsync(List<string> p_ins)
public virtual async Task<IActionResult> ReceivedAsync(List<string> 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<List<INVOICE_MAP_GROUP_DTO>> GetMapGroupAsync(INVOICE_GRP_REQ_DTO input)
{

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs

@ -133,10 +133,10 @@ namespace Win.Sfs.SettleAccount.Bases
/// <returns></returns>
[HttpPost]
//[Route("generateinvoice")]
public virtual async Task<string> GenerateInvoice(string input)
public virtual async Task<IActionResult> GenerateInvoice(string input)
{
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "创建成功" }); ;
}
/// <summary>

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs

@ -103,9 +103,9 @@ namespace Win.Sfs.SettleAccount.Bases
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<string> GenerateSettlementOrder(TRequestDetailInput input)
public virtual async Task<IActionResult> GenerateSettlementOrder(TRequestDetailInput input)
{
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "生成成功" });
}
}

20
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
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<string> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> 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<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(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
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> ReissueInvoiceExtend(List<PUB_ADJ_DETAIL_DTO> p_list)
public virtual async Task<IActionResult> ReissueInvoiceExtend(List<PUB_ADJ_DETAIL_DTO> p_list)
{
var adjlist = ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(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<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) });
}
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(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]

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs

@ -82,7 +82,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <returns></returns>
[HttpPost]
public async override Task<string> GenerateInvoice(string invbillNum)
public async override Task<IActionResult> 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<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(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 = "生成成功" });
}
}
}

29
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<string> GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input)
public override async Task<IActionResult> GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input)
{
List<ERR_EXP_DTO> errorlist = new List<ERR_EXP_DTO>();
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<ERR_EXP_DTO> errorlist = new List<ERR_EXP_DTO>();
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 = "生成成功" });
}

15
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs

@ -54,7 +54,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<string> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> 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<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(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
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> ReissueInvoiceExtend(List<PUB_ADJ_DETAIL_DTO> p_list)
public virtual async Task<IActionResult> ReissueInvoiceExtend(List<PUB_ADJ_DETAIL_DTO> p_list)
{
var adjlist = ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(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<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(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 = "发票重开成功" });
}

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs

@ -74,7 +74,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <returns></returns>
[HttpPost]
//[Route("generateinvoice")]
public async override Task<string> GenerateInvoice(string invbillnum)
public async override Task<IActionResult> 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<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(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 = "生成成功" });
}

23
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<string> GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input)
public override async Task<IActionResult> 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<ERR_EXP_DTO> errorlist = new List<ERR_EXP_DTO>();
if (entitys == null)
{
List<ERR_EXP_DTO> errorlist = new List<ERR_EXP_DTO>();
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 = "生成成功" });
}
}

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -52,7 +52,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <exception cref="UserFriendlyException"></exception>
/// <exception cref="BusinessException"></exception>
[HttpPost]
public virtual async Task<string> ReissueInvoiceExtend(List<PUB_ADJ_DETAIL_DTO> p_list)
public virtual async Task<IActionResult> ReissueInvoiceExtend(List<PUB_ADJ_DETAIL_DTO> 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<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(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
/// <param name="input"></param>
/// <returns></returns>
public override async Task<string> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> 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<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(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]
/// 发票重开列表

6
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<string> GenerateInvoice(string billnum)
public async override Task<IActionResult> 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<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys);
@ -135,7 +135,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
}
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "生成成功" });
}
}
}

30
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<string> GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input)
public override async Task<IActionResult> 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<ERR_EXP_DTO> errorlist = new List<ERR_EXP_DTO>();
if (entitys == null)
{
List<ERR_EXP_DTO> errorlist= new List<ERR_EXP_DTO>();
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 = "生成成功" });
}

24
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;
}

24
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;
}

24
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;
}

Loading…
Cancel
Save