|
@ -23,6 +23,7 @@ using Volo.Abp.Domain.Entities; |
|
|
using Volo.Abp.Domain.Repositories; |
|
|
using Volo.Abp.Domain.Repositories; |
|
|
using Volo.Abp.Domain.Services; |
|
|
using Volo.Abp.Domain.Services; |
|
|
using Volo.Abp.Json; |
|
|
using Volo.Abp.Json; |
|
|
|
|
|
using Volo.Abp.Uow; |
|
|
using Win.Sfs.SettleAccount.Bases; |
|
|
using Win.Sfs.SettleAccount.Bases; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Temp; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Temp; |
|
|
using Win.Sfs.SettleAccount.Entities.CodeSettings; |
|
|
using Win.Sfs.SettleAccount.Entities.CodeSettings; |
|
@ -152,6 +153,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
/// <param name="p_State"></param>
|
|
|
/// <param name="p_State"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
/// <exception cref="BusinessException"></exception>
|
|
|
/// <exception cref="BusinessException"></exception>
|
|
|
|
|
|
[UnitOfWork(false)] |
|
|
public virtual async Task<bool> SetForwardState(List<string> p_invs, SettleBillState p_State) |
|
|
public virtual async Task<bool> SetForwardState(List<string> p_invs, SettleBillState p_State) |
|
|
{ |
|
|
{ |
|
|
List<string> errors = new List<string>(); |
|
|
List<string> errors = new List<string>(); |
|
@ -167,7 +169,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
if (nols.Count > 0) |
|
|
if (nols.Count > 0) |
|
|
{ |
|
|
{ |
|
|
var invs = nols.Select(p => p.InvbillNum); |
|
|
var invs = nols.Select(p => p.InvbillNum); |
|
|
throw new UserFriendlyException($"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作"); |
|
|
throw new BusinessException("8989",$"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作"); |
|
|
} |
|
|
} |
|
|
var state = p_State; |
|
|
var state = p_State; |
|
|
switch (p_State) |
|
|
switch (p_State) |
|
@ -230,7 +232,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await _repository.BatchUpdateAsync(appls); |
|
|
await _repository.DbContext.BulkUpdateAsync(appls); |
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
@ -263,7 +265,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
if (nols.Count > 0) |
|
|
if (nols.Count > 0) |
|
|
{ |
|
|
{ |
|
|
var invs = nols.Select(p => p.InvbillNum); |
|
|
var invs = nols.Select(p => p.InvbillNum); |
|
|
throw new UserFriendlyException($"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作"); |
|
|
throw new UserFriendlyException($"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作","400"); |
|
|
} |
|
|
} |
|
|
var state = p_State; |
|
|
var state = p_State; |
|
|
switch (p_State) |
|
|
switch (p_State) |
|
@ -388,11 +390,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
{ |
|
|
{ |
|
|
throw new UserFriendlyException($"发票不属于一个发票分组"); |
|
|
throw new UserFriendlyException($"发票不属于一个发票分组"); |
|
|
} |
|
|
} |
|
|
var lostlist = invList.Where(p => p.InvoiceState == InvoiceBillState.报废 || p.State ==SettleBillState.客户已收票).ToList(); |
|
|
var lostlist = invList.Where(p => p.InvoiceState == InvoiceBillState.报废 || p.State !=SettleBillState.财务已审核).ToList(); |
|
|
if (lostlist.Count > 0) |
|
|
if (lostlist.Count > 0) |
|
|
{ |
|
|
{ |
|
|
var invs=lostlist.Select(p => p.InvbillNum).ToList(); |
|
|
var invs=lostlist.Select(p => p.InvbillNum).ToList(); |
|
|
throw new UserFriendlyException($"发票{string.Join(",",invs)}已经报废或客户已收票!"); |
|
|
throw new UserFriendlyException($"发票{string.Join(",",invs)}已经报废或不是财务审核状态!","400"); |
|
|
} |
|
|
} |
|
|
var inv = invList.FirstOrDefault(); |
|
|
var inv = invList.FirstOrDefault(); |
|
|
if (inv.BusinessType == EnumBusinessType.JisBBAC) |
|
|
if (inv.BusinessType == EnumBusinessType.JisBBAC) |
|
@ -401,7 +403,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
if (pdlist != null && pdlist.Count > 0) |
|
|
if (pdlist != null && pdlist.Count > 0) |
|
|
{ |
|
|
{ |
|
|
var invs = pdlist.Select(p => p.BillNum).ToList(); |
|
|
var invs = pdlist.Select(p => p.BillNum).ToList(); |
|
|
throw new UserFriendlyException($"发票{string.Join(",", invs)}已经生成待扣减过不能再次提交"); |
|
|
throw new UserFriendlyException($"发票{string.Join(",", invs)}已经生成待扣减过不能再次提交","400"); |
|
|
} |
|
|
} |
|
|
var parentList = invList.Select(p => p.ParentInvbillNum).ToList();//所有发票存在父发票号
|
|
|
var parentList = invList.Select(p => p.ParentInvbillNum).ToList();//所有发票存在父发票号
|
|
|
List<string> oldinvs = new List<string>(); |
|
|
List<string> oldinvs = new List<string>(); |
|
|