|
|
@ -773,7 +773,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
var involdList = invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList(); |
|
|
|
var involdname = involdList.Select(p => p.InvbillNum); |
|
|
|
var adjlist = _adjRepository.Where(p => involdname.Contains(p.InvBillNum)); |
|
|
|
|
|
|
|
if (adjlist != null && adjlist.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in adjlist) |
|
|
@ -799,7 +798,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
); |
|
|
|
detail.RealPartCode = itm.RealPartCode;//厂内替换零件号
|
|
|
|
detail.ErpLoc = itm.ErpLoc;//ERP库位
|
|
|
|
|
|
|
|
entityList.Add(detail); |
|
|
|
} |
|
|
|
} |
|
|
@ -878,7 +876,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
extend3: string.Empty, |
|
|
|
extend4: itm.PartCode |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
entity.RELU =string.IsNullOrEmpty(itm.RealPartCode)?itm.PartCode:itm.RealPartCode;//厂内替换零件号
|
|
|
|
entity.Extend2 = itm.ErpLoc;//ERP库位
|
|
|
@ -1353,8 +1350,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
var invlist = new List<INVOICE_GRP>(); |
|
|
|
var salist = new List<TDetail>(); |
|
|
|
var adjlist = new List<PUB_ADJ_DETAIL>(); |
|
|
|
|
|
|
|
|
|
|
|
List<string> lsby = new List<string>(); |
|
|
|
var grouplist = p_list.Select(p => p.GroupNum).Distinct().ToList();//可结分组
|
|
|
|
lsby.AddRange(grouplist); |
|
|
@ -1721,7 +1716,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
adjlist.Add(itm); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>(); |
|
|
|
foreach (var detail in ls) |
|
|
|
{ |
|
|
@ -1741,7 +1735,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
beginDate: detail.BeginDate, |
|
|
|
endDate: detail.EndDate, |
|
|
|
partcode: detail.PartCode |
|
|
|
|
|
|
|
)); |
|
|
|
} |
|
|
|
if (_entityDetailList.Count > 0) |
|
|
@ -1954,10 +1947,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
{ |
|
|
|
detailList.AddRange(_entityDetailList); |
|
|
|
} |
|
|
|
|
|
|
|
string site = dtos.FirstOrDefault().Site; |
|
|
|
string clientCode = string.Empty; |
|
|
|
|
|
|
|
switch (site) |
|
|
|
{ |
|
|
|
case "1040": |
|
|
@ -1993,11 +1984,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
invbill.CreationTime = DateTime.Now; |
|
|
|
invlist.Add(invbill); |
|
|
|
} |
|
|
|
|
|
|
|
await _repository.DbContext.BulkInsertAsync(invlist); |
|
|
|
await _repository.DbContext.BulkInsertAsync(groupList); |
|
|
|
await _repository.DbContext.BulkInsertAsync(detailList); |
|
|
|
|
|
|
|
if(salist.Count>0) |
|
|
|
{ |
|
|
|
await _repository.DbContext.BulkUpdateAsync(salist); |
|
|
@ -2008,17 +1997,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
} |
|
|
|
if(p_notlist.Count > 0) |
|
|
|
{ |
|
|
|
|
|
|
|
var innotls = new List<INVOICE_NOT_SETTLE>(); |
|
|
|
var notls = p_notlist.GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); |
|
|
|
foreach (var nitm in notls) |
|
|
|
{ |
|
|
|
innotls.Add(new INVOICE_NOT_SETTLE( |
|
|
|
guid: GuidGenerator.Create(), |
|
|
|
|
|
|
|
version: p_version, |
|
|
|
invGroupNum: p_InvGroupNum, |
|
|
|
settleGroupNum: nitm.GroupNum, |
|
|
|
lU: string.Empty, |
|
|
|
lU: nitm.LU, |
|
|
|
lU1: nitm.LU, |
|
|
|
extend1: string.Empty, |
|
|
|
extend2: string.Empty, |
|
|
@ -2031,7 +2020,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
} |
|
|
|
_invls = invlist.Select(p => p.InvbillNum).ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
return _invls; |
|
|
|
} |
|
|
|
|
|
|
@ -2099,9 +2087,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_repository.DbContext.BulkUpdate(new List<INVOICE_GRP> { inv }); |
|
|
|
return true; |
|
|
|
} |
|
|
@ -2198,7 +2183,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
adjdetails.Add(detail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) |
|
|
|
.Select(itm => new |
|
|
|
{ |
|
|
@ -2213,7 +2197,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
EndDate = itm.Key.EndDate |
|
|
|
}) |
|
|
|
.ToList(); |
|
|
|
|
|
|
|
var query = from inv1 in invdetails |
|
|
|
join dto1 in dtos on |
|
|
|
new { inv1.LU,inv1.PartCode, inv1.PN,inv1.Id } equals new { dto1.LU,dto1.PartCode, dto1.PN ,dto1.Id |
|
|
|