|
|
@ -366,6 +366,7 @@ namespace BBWYB.Server.Business |
|
|
|
#region DBOperation
|
|
|
|
List<SpuOptimizationCompetitiveTenderTask> insertSpuOptimizationCompetitiveTenderTaskList = new List<SpuOptimizationCompetitiveTenderTask>(); |
|
|
|
List<long> updateCompetitiveTenderTaskIdList = new List<long>(); |
|
|
|
List<SpuOptimizationProductSkuUpdateQuotedPriceRecord> insertUpdatePriceList = new List<SpuOptimizationProductSkuUpdateQuotedPriceRecord>(); |
|
|
|
#endregion
|
|
|
|
|
|
|
|
//var skuList = request.ItemList.Select(x => x.SkuId).Distinct().ToList();
|
|
|
@ -393,6 +394,11 @@ namespace BBWYB.Server.Business |
|
|
|
IncludePurchaseSkuBasicInfo = 0 |
|
|
|
}); |
|
|
|
|
|
|
|
//查询配件级报价任务
|
|
|
|
var updatePriceRecordList = fsql.Select<SpuOptimizationProductSkuUpdateQuotedPriceRecord>() |
|
|
|
.Where(x => x.SpuOptimizationTaskId == request.SpuOptimizationTaskId && |
|
|
|
x.BargainTeamId == uInfo.bargainTeam.Id) |
|
|
|
.ToList(); |
|
|
|
|
|
|
|
//筛选出不在竞标任务中的采购方案
|
|
|
|
var noJoinCompetitiveTenderPurchaseSchemeList = relationPurchaseSchemeList.Where(ps => !competitiveTenderTaskList.Any(ct => ct.SchemeId == ps.Id)).ToList(); |
|
|
@ -404,6 +410,15 @@ namespace BBWYB.Server.Business |
|
|
|
purchaseSchemeBusiness.BatchEditPurchaseSkuActualPrice(batchEditPurchaseSkuActualPriceRequest, uInfo); |
|
|
|
} |
|
|
|
|
|
|
|
insertUpdatePriceList.AddRange(request.ItemList.Where(x => !updatePriceRecordList.Any(r => r.PurchaseSkuId == x.PurchaseSkuId)).Select(x => new SpuOptimizationProductSkuUpdateQuotedPriceRecord() |
|
|
|
{ |
|
|
|
Id = idGenerator.NewLong(), |
|
|
|
BargainTeamId = uInfo.bargainTeam.Id, |
|
|
|
CreateTime = DateTime.Now, |
|
|
|
PurchaseSkuId = x.PurchaseSkuId, |
|
|
|
SpuOptimizationTaskId = request.SpuOptimizationTaskId, |
|
|
|
UserId = uInfo.user.Id |
|
|
|
})); |
|
|
|
|
|
|
|
if (noJoinCompetitiveTenderPurchaseSchemeList.Count() > 0) |
|
|
|
{ |
|
|
@ -421,6 +436,7 @@ namespace BBWYB.Server.Business |
|
|
|
UpdateTime = DateTime.Now |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
if (competitiveTenderTaskList.Count() > 0) |
|
|
|
{ |
|
|
|
//updateCompetitiveTenderTaskIdList.AddRange(competitiveTenderTaskList.Select(ct => ct.Id).ToList());
|
|
|
@ -450,6 +466,8 @@ namespace BBWYB.Server.Business |
|
|
|
.Set(ct => ct.IsUpdateQuotedPrice, true) |
|
|
|
.Set(ct => ct.UpdateTime, DateTime.Now) |
|
|
|
.ExecuteAffrows(); |
|
|
|
if (insertUpdatePriceList.Count() > 0) |
|
|
|
fsql.Insert(insertUpdatePriceList).ExecuteAffrows(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@ -790,7 +808,7 @@ namespace BBWYB.Server.Business |
|
|
|
var winGroupKey = psGroups.Select(g => new { SchemeGroupId = g.Key, Cost = g.Sum(ps => ps.BargainingCost ?? ps.DefaultCost) }) |
|
|
|
.OrderByDescending(x => x.Cost) |
|
|
|
.FirstOrDefault(); |
|
|
|
victoryList.AddRange(competitiveTenderTaskList.Where(ct=>ct.SchemeGroupId == winGroupKey.SchemeGroupId)); |
|
|
|
victoryList.AddRange(competitiveTenderTaskList.Where(ct => ct.SchemeGroupId == winGroupKey.SchemeGroupId)); |
|
|
|
|
|
|
|
//foreach (var psGroup in psGroups)
|
|
|
|
//{
|
|
|
|