...
|
...
|
@@ -106,7 +106,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
|
// 生成共创合约编号
|
|
|
contractNumber, err2 := cooperationContractDao.GenerateContractNumber()
|
|
|
if err2 != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err2.Error())
|
|
|
}
|
|
|
// 校验共创合约编号是否唯一
|
|
|
numberAvailable, _ := cooperationContractDao.CheckContractNumberAvailable(map[string]interface{}{
|
...
|
...
|
@@ -209,7 +209,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
|
ReferrerPercentage: dividendsIncentivesRule.ReferrerPercentage,
|
|
|
SalesmanPercentage: dividendsIncentivesRule.SalesmanPercentage,
|
|
|
DividendsIncentivesPercentage: dividendsIncentivesRule.DividendsIncentivesPercentage,
|
|
|
DividendsIncentivesStage: int64(dividendsIncentivesRule.DividendsIncentivesStage),
|
|
|
DividendsIncentivesStage: dividendsIncentivesRule.DividendsIncentivesStage,
|
|
|
DividendsIncentivesStageEnd: dividendsIncentivesRule.DividendsIncentivesStageEnd,
|
|
|
DividendsIncentivesStageStart: dividendsIncentivesRule.DividendsIncentivesStageStart,
|
|
|
Org: organization,
|
...
|
...
|
@@ -226,8 +226,8 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
|
moneyIncentivesRules = append(moneyIncentivesRules, &domain.MoneyIncentivesRule{
|
|
|
MoneyIncentivesRuleId: 0,
|
|
|
CooperationContractNumber: contractNumber,
|
|
|
MoneyIncentivesAmount: float64(moneyIncentivesRule.MoneyIncentivesAmount),
|
|
|
MoneyIncentivesStage: int64(moneyIncentivesRule.MoneyIncentivesStage),
|
|
|
MoneyIncentivesAmount: moneyIncentivesRule.MoneyIncentivesAmount,
|
|
|
MoneyIncentivesStage: moneyIncentivesRule.MoneyIncentivesStage,
|
|
|
MoneyIncentivesStageEnd: moneyIncentivesRule.MoneyIncentivesStageEnd,
|
|
|
MoneyIncentivesStageStart: moneyIncentivesRule.MoneyIncentivesStageStart,
|
|
|
MoneyIncentivesTime: time.Now(),
|
...
|
...
|
@@ -780,8 +780,12 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
}
|
|
|
}
|
|
|
|
|
|
undertakerId, err3 := strconv.ParseInt(undertaker.UndertakerId, 10, 64)
|
|
|
if err3 != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err3.Error())
|
|
|
}
|
|
|
undertakers = append(undertakers, &domain.Undertaker{
|
|
|
UndertakerId: undertaker.UndertakerId,
|
|
|
UndertakerId: undertakerId,
|
|
|
UserId: undertakerDomain.UserId,
|
|
|
CooperationContractNumber: cooperationContract.CooperationContractNumber,
|
|
|
UserBaseId: undertakerDomain.UserBaseId,
|
...
|
...
|
@@ -804,14 +808,17 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
// 获取分红规则列表
|
|
|
var dividendsIncentivesRules []*domain.DividendsIncentivesRule
|
|
|
for _, dividendsIncentivesRule := range updateCooperationContractCommand.DividendsIncentivesRules {
|
|
|
dividendsIncentivesRuleId, _ := strconv.ParseInt(dividendsIncentivesRule.DividendsIncentivesRuleId, 10, 64)
|
|
|
dividendsIncentivesRuleId, err2 := strconv.ParseInt(dividendsIncentivesRule.DividendsIncentivesRuleId, 10, 64)
|
|
|
if err2 != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err2.Error())
|
|
|
}
|
|
|
dividendsIncentivesRules = append(dividendsIncentivesRules, &domain.DividendsIncentivesRule{
|
|
|
DividendsIncentivesRuleId: dividendsIncentivesRuleId,
|
|
|
CooperationContractNumber: cooperationContract.CooperationContractNumber,
|
|
|
ReferrerPercentage: dividendsIncentivesRule.ReferrerPercentage,
|
|
|
SalesmanPercentage: dividendsIncentivesRule.SalesmanPercentage,
|
|
|
DividendsIncentivesPercentage: dividendsIncentivesRule.DividendsIncentivesPercentage,
|
|
|
DividendsIncentivesStage: int64(dividendsIncentivesRule.DividendsIncentivesStage),
|
|
|
DividendsIncentivesStage: dividendsIncentivesRule.DividendsIncentivesStage,
|
|
|
DividendsIncentivesStageEnd: dividendsIncentivesRule.DividendsIncentivesStageEnd,
|
|
|
DividendsIncentivesStageStart: dividendsIncentivesRule.DividendsIncentivesStageStart,
|
|
|
Org: organization,
|
...
|
...
|
@@ -827,12 +834,15 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
// 获取金额激励规则列表
|
|
|
var moneyIncentivesRules []*domain.MoneyIncentivesRule
|
|
|
for _, moneyIncentivesRule := range updateCooperationContractCommand.MoneyIncentivesRules {
|
|
|
moneyIncentivesRuleId, _ := strconv.ParseInt(moneyIncentivesRule.MoneyIncentivesRuleId, 10, 64)
|
|
|
moneyIncentivesRuleId, err4 := strconv.ParseInt(moneyIncentivesRule.MoneyIncentivesRuleId, 10, 64)
|
|
|
if err4 != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err4.Error())
|
|
|
}
|
|
|
moneyIncentivesRules = append(moneyIncentivesRules, &domain.MoneyIncentivesRule{
|
|
|
MoneyIncentivesRuleId: moneyIncentivesRuleId,
|
|
|
CooperationContractNumber: cooperationContract.CooperationContractNumber,
|
|
|
MoneyIncentivesAmount: float64(moneyIncentivesRule.MoneyIncentivesAmount),
|
|
|
MoneyIncentivesStage: int64(moneyIncentivesRule.MoneyIncentivesStage),
|
|
|
MoneyIncentivesAmount: moneyIncentivesRule.MoneyIncentivesAmount,
|
|
|
MoneyIncentivesStage: moneyIncentivesRule.MoneyIncentivesStage,
|
|
|
MoneyIncentivesStageEnd: moneyIncentivesRule.MoneyIncentivesStageEnd,
|
|
|
MoneyIncentivesStageStart: moneyIncentivesRule.MoneyIncentivesStageStart,
|
|
|
MoneyIncentivesTime: time.Now(),
|
...
|
...
|
|