作者 陈志颖

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

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