作者 陈志颖

fix:金额激励分红承接人列表

... ... @@ -1420,6 +1420,10 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE
// 获取承接人
for _, undertaker := range cooperationContract.Undertakers {
// 将承接人填入不同分红阶段
for i, _ := range stageUndertakerMap {
stageUndertakerMap[i] = append(stageUndertakerMap[i], undertaker)
}
// 查询承接人分红预算单
if countDividendsEstimates, dividendsEstimates, err := dividendsEstimateRepository.Find(map[string]interface{}{
"cooperationContractNumber": cooperationContract.CooperationContractNumber,
... ... @@ -1435,15 +1439,22 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE
})
if countDividendsEstimates > 0 { // 已有分红预算
for _, dividendsEstimate := range dividendsEstimates {
if dividendsEstimate.IsCanceled { // 分红预算单状态为已取消
stageUndertakerMap[dividendsEstimate.DividendsStage] = append(stageUndertakerMap[dividendsEstimate.DividendsStage], undertaker)
if !dividendsEstimate.IsCanceled { // 分红预算单状态为非取消状态
//stageUndertakerMap[dividendsEstimate.DividendsStage] = append(stageUndertakerMap[dividendsEstimate.DividendsStage], undertaker)
for i, undertakerAppended := range stageUndertakerMap[dividendsEstimate.DividendsStage] {
if undertakerAppended.UndertakerId == undertaker.UndertakerId {
// 将删除点前后的元素连接起来
stageUndertakerMap[dividendsEstimate.DividendsStage] = append(stageUndertakerMap[dividendsEstimate.DividendsStage][:i], stageUndertakerMap[dividendsEstimate.DividendsStage][i+1:]...)
}
}
}
}
} else if countDividendsEstimates == 0 { // 未分红,可以加入任意阶段进行金额激励
for i, _ := range stageUndertakerMap {
stageUndertakerMap[i] = append(stageUndertakerMap[i], undertaker)
}
}
//else if countDividendsEstimates == 0 { // 未分红,可以加入任意阶段进行金额激励
// for i, _ := range stageUndertakerMap {
// stageUndertakerMap[i] = append(stageUndertakerMap[i], undertaker)
// }
//}
}
}
... ...