|
|
@ -29,6 +29,7 @@ using Win.Sfs.SettleAccount.Constant; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Managers; |
|
|
|
using Win.Sfs.SettleAccount.ExcelImporter; |
|
|
|
using Win.Sfs.SettleAccount.ExportReports; |
|
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
|
|
|
|
|
namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
@ -83,10 +84,35 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
[UnitOfWork(false)] |
|
|
|
public virtual async Task<string> ApprovalPassed(List<string> p_invs) |
|
|
|
public virtual async Task<IActionResult> ApprovalPassed(List<string> p_invs) |
|
|
|
{ |
|
|
|
List<ERR_EXP_DTO> errors = new List<ERR_EXP_DTO>(); |
|
|
|
var invs = await _invMng.GetInvoiceListAsync(p_invs); |
|
|
|
if (invs.Count > 0) |
|
|
|
{ |
|
|
|
var ls = invs.Where(p => p.State != SettleBillState.商务已审核).Distinct(); |
|
|
|
if (ls.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in ls) |
|
|
|
{ |
|
|
|
errors.Add(new ERR_EXP_DTO() { Message = $"{itm.InvbillNum}发票号状态不是商务审核!" }); |
|
|
|
} |
|
|
|
} |
|
|
|
var ls1 = invs.Where(p => p.InvoiceState == InvoiceBillState.报废).Distinct(); |
|
|
|
if (ls1.Count() > 1) |
|
|
|
{ |
|
|
|
foreach (var itm in ls1) |
|
|
|
{ |
|
|
|
errors.Add(new ERR_EXP_DTO() { Message = $"{itm.InvbillNum}发票号状态不是商务审核!" }); |
|
|
|
} |
|
|
|
} |
|
|
|
if (errors.Count() > 0) |
|
|
|
{ |
|
|
|
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errors) }); |
|
|
|
} |
|
|
|
} |
|
|
|
await _invMng.SetForwardState(p_invs, SettleBillState.财务已审核); |
|
|
|
return ApplicationConsts.SuccessStr; |
|
|
|
return new JsonResult(new { Code = "200", Message = "审核成功" }); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -193,8 +219,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
_excel.Append(adj, "发票调整数据" + itm.InvbillNum).SeparateBySheet(); |
|
|
|
} |
|
|
|
_excel.Append(not, "发票分组未结对应结算分组"); |
|
|
|
|
|
|
|
|
|
|
|
var result = _excel.ExportAppendDataAsByteArray(); |
|
|
|
result.ShouldNotBeNull(); |
|
|
|
//保存导出文件到服务器存成二进制
|
|
|
|