|
@ -140,6 +140,15 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
|
|
|
|
|
|
importBBACSaDetails.ForEach(importBBACSaDetail => |
|
|
importBBACSaDetails.ForEach(importBBACSaDetail => |
|
|
{ |
|
|
{ |
|
|
|
|
|
List<string> lus = importBBACSaDetail.LU.Split(" ").ToList(); |
|
|
|
|
|
importBBACSaDetail.LU = lus[0].Replace(" ", ""); |
|
|
|
|
|
if (lus.Count > 1) |
|
|
|
|
|
{ |
|
|
|
|
|
lus.RemoveAt(0); |
|
|
|
|
|
var luAssemble = lus.Select(t => t.Replace(" ", "")); |
|
|
|
|
|
importBBACSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
importBBACSaDetail.Version = bbacSaImportRequestDto.Version; |
|
|
importBBACSaDetail.Version = bbacSaImportRequestDto.Version; |
|
|
importBBACSaDetail.Site = Site; |
|
|
importBBACSaDetail.Site = Site; |
|
|
}); |
|
|
}); |
|
@ -331,7 +340,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
var bbacSa = new BBAC_SA() |
|
|
var bbacSa = new BBAC_SA() |
|
|
{ |
|
|
{ |
|
|
BillNum = bbacSaBillNum, |
|
|
BillNum = bbacSaBillNum, |
|
|
State = "1", |
|
|
State = "0", |
|
|
BusinessType = _businessType, |
|
|
BusinessType = _businessType, |
|
|
Site = Site |
|
|
Site = Site |
|
|
}; |
|
|
}; |
|
@ -399,8 +408,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
#region 添加入库
|
|
|
#region 添加入库
|
|
|
await _bbacSaRepository.InsertAsync(bbacSa); |
|
|
await _bbacSaRepository.InsertAsync(bbacSa).ConfigureAwait(false); |
|
|
await _bbacSaDetailRepository.DbContext.BulkInsertAsync(bbacSaDetails); |
|
|
await _bbacSaDetailRepository.DbContext.BulkInsertAsync(bbacSaDetails).ConfigureAwait(false); |
|
|
if (bbacCanSaDetails.Count > 0) |
|
|
if (bbacCanSaDetails.Count > 0) |
|
|
{ |
|
|
{ |
|
|
bbacCanSaDetails.ForEach(bbacCanSaDetail => |
|
|
bbacCanSaDetails.ForEach(bbacCanSaDetail => |
|
@ -409,8 +418,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
bbacCanSaDetail.BusinessType = _businessType; |
|
|
bbacCanSaDetail.BusinessType = _businessType; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
await _bbacCanSaRepository.InsertAsync(bbacCanSa); |
|
|
await _bbacCanSaRepository.InsertAsync(bbacCanSa).ConfigureAwait(false); |
|
|
await _bbacCanSaDetailRepository.DbContext.BulkInsertAsync(bbacCanSaDetails); |
|
|
await _bbacCanSaDetailRepository.DbContext.BulkInsertAsync(bbacCanSaDetails).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
if (bbacNotSaDetails.Count > 0) |
|
|
if (bbacNotSaDetails.Count > 0) |
|
|
{ |
|
|
{ |
|
@ -419,7 +428,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
bbacNotSaDetail.BusinessType = _businessType; |
|
|
bbacNotSaDetail.BusinessType = _businessType; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
await _bbacNotSaDetailRepository.InsertManyAsync(bbacNotSaDetails); |
|
|
await _bbacNotSaDetailRepository.DbContext.BulkInsertAsync(bbacNotSaDetails).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
if (materialRelationships.Count > 0) |
|
|
if (materialRelationships.Count > 0) |
|
|
{ |
|
|
{ |
|
@ -443,8 +452,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> |
|
|
List<BBAC_CAN_SA_DETAIL> bbacCanSaDetails = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
List<BBAC_CAN_SA_DETAIL> bbacCanSaDetails = new List<BBAC_CAN_SA_DETAIL>(); |
|
|
//不可结算
|
|
|
//不可结算
|
|
|
List<BBAC_NOT_SA_DETAIL> bbacNotSaDetails = new List<BBAC_NOT_SA_DETAIL>(); |
|
|
List<BBAC_NOT_SA_DETAIL> bbacNotSaDetails = new List<BBAC_NOT_SA_DETAIL>(); |
|
|
var bbacSaEntity = await _bbacSaRepository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false); |
|
|
var bbacSaEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false); |
|
|
//var bbacSaEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false);
|
|
|
|
|
|
if (bbacSaEntity != null) |
|
|
if (bbacSaEntity != null) |
|
|
{ |
|
|
{ |
|
|
//结算单据
|
|
|
//结算单据
|
|
|