作者 陈志颖

fix:增加金额激励预算校验

... ... @@ -379,14 +379,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
// 用户REST服务初始化
//var userService service.UserService
//if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
//} else {
// userService = value
//}
// 公司REST服务初始化
var companyService service.CompanyService
if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
... ...
... ... @@ -89,7 +89,9 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do
DividendsAmount: undertakerDividendsAmount,
})
}
// 判断业务员在当前阶段是否已经分红
if undertaker.Salesman.UserId != 0 {
salesmanEstimated, err := dividendsEstimateDao.UserEstimated(map[string]interface{}{
"undertakerUid": undertaker.Salesman.UserId,
"companyId": contract.Company.CompanyId,
... ... @@ -121,7 +123,11 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do
DividendsAmount: undertakerDividendsAmount,
})
}
}
// 判断关联业务员在当前阶段是否已经分红
if undertaker.Referrer.UserId != 0 {
referrerEstimated, err := dividendsEstimateDao.UserEstimated(map[string]interface{}{
"undertakerUid": undertaker.Referrer.UserId,
"companyId": contract.Company.CompanyId,
... ... @@ -154,6 +160,7 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do
})
}
}
}
return dividendsEstimateDetails, nil
}
... ...