作者 陈志颖

fix:金额激励重复预算校验

@@ -1430,7 +1430,10 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE @@ -1430,7 +1430,10 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE
1430 }); err != nil { 1430 }); err != nil {
1431 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1431 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
1432 } else { 1432 } else {
1433 - if countDividendsEstimates > 0 { // 已有分红 1433 + log.Logger.Info("获取承接人相关的金额激励预算信息", map[string]interface{}{
  1434 + "dividendsEstimates": dividendsEstimates,
  1435 + })
  1436 + if countDividendsEstimates > 0 { // 已有分红预算
1434 for _, dividendsEstimate := range dividendsEstimates { 1437 for _, dividendsEstimate := range dividendsEstimates {
1435 if dividendsEstimate.IsCanceled { // 分红预算单状态为已取消 1438 if dividendsEstimate.IsCanceled { // 分红预算单状态为已取消
1436 stageUndertakerMap[dividendsEstimate.DividendsStage] = append(stageUndertakerMap[dividendsEstimate.DividendsStage], undertaker) 1439 stageUndertakerMap[dividendsEstimate.DividendsStage] = append(stageUndertakerMap[dividendsEstimate.DividendsStage], undertaker)
@@ -312,7 +312,7 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte @@ -312,7 +312,7 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte
312 query.Where("cooperation_contract_number = ?", cooperationContractNumber) 312 query.Where("cooperation_contract_number = ?", cooperationContractNumber)
313 } 313 }
314 if dividendsUserId, ok := queryOptions["dividendsUserId"]; ok && dividendsUserId.(int64) != 0 { 314 if dividendsUserId, ok := queryOptions["dividendsUserId"]; ok && dividendsUserId.(int64) != 0 {
315 - query.Where(`dividends_user @> '{"uid":"?"}'`, dividendsUserId) 315 + query.Where(`dividends_user @> '{"userId":"?"}'`, dividendsUserId)
316 } 316 }
317 if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 { 317 if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 {
318 query.Where("company->>'companyId' = '?'", companyId) 318 query.Where("company->>'companyId' = '?'", companyId)