|
|
@ -474,7 +474,12 @@ namespace BBWYB.Server.Business |
|
|
|
HYBDId = psReq.HYBDId, |
|
|
|
HYSchemeId = psReq.HYSchemeId, |
|
|
|
SchemeGroupId = psReq.SchemeGroupId ?? 0, |
|
|
|
Version = 1 |
|
|
|
Version = 1, |
|
|
|
BelongBargainTeamId = uInfo.isBargainTeam ? uInfo.department.Id : string.Empty, |
|
|
|
BelongBargainTeamName = uInfo.isBargainTeam ? uInfo.department.DepartmentName : string.Empty, |
|
|
|
UpdateTeamId = uInfo.department.Id, |
|
|
|
UpdateUserId = userId, |
|
|
|
IsBargainTeamUpdate = uInfo.isBargainTeam |
|
|
|
}; |
|
|
|
addPurchaseSchemeList.Add(ps); |
|
|
|
foreach (var pspReq in psReq.PurchaseSchemeProductList) |
|
|
@ -609,13 +614,21 @@ namespace BBWYB.Server.Business |
|
|
|
insertHistoryPSPList.Add(historyPsp); |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
var belongBargainTeamId = uInfo.isBargainTeam ? uInfo.department.Id : string.Empty; |
|
|
|
var belongBargainTeamName = uInfo.isBargainTeam ? uInfo.department.DepartmentName : string.Empty; |
|
|
|
|
|
|
|
var psupdate = fsql.Update<PurchaseScheme>(schemeId) |
|
|
|
.Set(ps => ps.DefaultCost, defaultCost) |
|
|
|
.Set(ps => ps.BargainingCost, bargainingCost) |
|
|
|
.SetIf(bargainingCost != null && bargainingCost != dbps.BargainingCost, ps => ps.LastBargainingTime, DateTime.Now) |
|
|
|
.Set(ps => ps.HYSchemeId, psReq.HYSchemeId) |
|
|
|
.Set(ps => ps.HYBDId, psReq.HYBDId) |
|
|
|
.Set(ps => ps.Version, newVersion); |
|
|
|
.Set(ps => ps.Version, newVersion) |
|
|
|
.Set(ps => ps.BelongBargainTeamId, belongBargainTeamId) |
|
|
|
.Set(ps => ps.BelongBargainTeamName, belongBargainTeamName) |
|
|
|
.Set(ps => ps.UpdateUserId, userId) |
|
|
|
.Set(ps => ps.UpdateTeamId, uInfo.department.Id) |
|
|
|
.Set(ps => ps.IsBargainTeamUpdate, uInfo.isBargainTeam); |
|
|
|
updatePurchaseSchemeList.Add(psupdate); |
|
|
|
|
|
|
|
#region 处理历史版本
|
|
|
@ -641,6 +654,20 @@ namespace BBWYB.Server.Business |
|
|
|
purchaseProductSku.PurchaseRatio = 1; |
|
|
|
} |
|
|
|
|
|
|
|
if (uInfo.isBargainTeam) |
|
|
|
{ |
|
|
|
if (newPurchaserList.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var p in newPurchaserList) |
|
|
|
{ |
|
|
|
p.BelongBargainTeamId = uInfo.department.Id; |
|
|
|
p.BelongBargainTeamName = uInfo.department.DepartmentName; |
|
|
|
p.BelongType = Enums.PurchaserBelongType.临时; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fsql.Transaction(() => |
|
|
|
{ |
|
|
|
if (newPurchaserList.Count > 0) |
|
|
|