...
|
...
|
@@ -61,7 +61,7 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do |
|
|
return nil, err
|
|
|
}
|
|
|
if undertakerEstimated {
|
|
|
return nil, fmt.Errorf("用户 " + undertaker.UserName + " 已分红")
|
|
|
return nil, fmt.Errorf("承接人 " + undertaker.UserName + " 已分红")
|
|
|
} else {
|
|
|
undertakerDividendsAmount, _ := decimal.NewFromFloat(moneyIncentivesRuleMatched.MoneyIncentivesAmount).Float64()
|
|
|
//Mul(decimal.NewFromFloat(1).Sub(decimal.NewFromFloat(moneyIncentivesRuleMatched.SalesmanPercentage).Add(decimal.NewFromFloat(moneyIncentivesRuleMatched.ReferrerPercentage)).Div(decimal.NewFromFloat(100)))).Float64()
|
...
|
...
|
@@ -80,7 +80,7 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do |
|
|
Status: undertaker.Status,
|
|
|
Company: undertaker.Company,
|
|
|
},
|
|
|
DividendsParticipateType: domain.MONEY_INCENTIVES,
|
|
|
DividendsParticipateType: 1,
|
|
|
DividendsStage: stage,
|
|
|
DividendsAmount: undertakerDividendsAmount,
|
|
|
})
|
...
|
...
|
@@ -114,7 +114,7 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do |
|
|
UserPhone: undertaker.Salesman.UserPhone,
|
|
|
Company: undertaker.Salesman.Company,
|
|
|
},
|
|
|
DividendsParticipateType: domain.MONEY_INCENTIVES,
|
|
|
DividendsParticipateType: 3,
|
|
|
DividendsStage: stage,
|
|
|
DividendsAmount: undertakerDividendsAmount,
|
|
|
})
|
...
|
...
|
@@ -122,7 +122,7 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do |
|
|
|
|
|
}
|
|
|
|
|
|
// 判断关联业务员在当前阶段是否已经分红
|
|
|
// 判断推荐人在当前阶段是否已经分红
|
|
|
if undertaker.Referrer != nil {
|
|
|
referrerEstimated, err := dividendsEstimateDao.UserEstimated(map[string]interface{}{
|
|
|
"undertakerUid": undertaker.Referrer.UserId,
|
...
|
...
|
@@ -133,7 +133,7 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do |
|
|
return nil, err
|
|
|
}
|
|
|
if referrerEstimated {
|
|
|
return nil, fmt.Errorf("推荐人 " + undertaker.Salesman.UserName + " 已分红")
|
|
|
return nil, fmt.Errorf("推荐人 " + undertaker.Referrer.UserName + " 已分红")
|
|
|
} else {
|
|
|
undertakerDividendsAmount, _ := decimal.NewFromFloat(moneyIncentivesRuleMatched.MoneyIncentivesAmount).Mul(decimal.NewFromFloat(moneyIncentivesRuleMatched.ReferrerPercentage).Div(decimal.NewFromFloat(100))).Float64()
|
|
|
dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
|
...
|
...
|
@@ -150,7 +150,7 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do |
|
|
UserPhone: undertaker.Referrer.UserPhone,
|
|
|
Company: undertaker.Referrer.Company,
|
|
|
},
|
|
|
DividendsParticipateType: domain.MONEY_INCENTIVES,
|
|
|
DividendsParticipateType: 2,
|
|
|
DividendsStage: stage,
|
|
|
DividendsAmount: undertakerDividendsAmount,
|
|
|
})
|
...
|
...
|
|