...
|
...
|
@@ -49,14 +49,15 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
|
underTakers := []allied_creation_cooperation.Undertaker{}
|
|
|
for _, v := range createCooperationContractCommand.Undertakers {
|
|
|
u := allied_creation_cooperation.Undertaker{
|
|
|
UserId: v.UndertakerId,
|
|
|
RerferrerId: v.RerferrerId,
|
|
|
SalesmanId: v.SalesmanId,
|
|
|
Attachment: v.Attachment,
|
|
|
RelevantId: v.UndertakerId,
|
|
|
UserId: v.UserId,
|
|
|
ReferrerId: v.RerferrerId,
|
|
|
SalesmanId: v.SalesmanId,
|
|
|
Attachment: v.Attachment,
|
|
|
}
|
|
|
underTakers = append(underTakers, u)
|
|
|
}
|
|
|
_, err := creationCooperationGateway.CooperationContractAdd(allied_creation_cooperation.ReqCooperationContractAdd{
|
|
|
result, err := creationCooperationGateway.CooperationContractAdd(allied_creation_cooperation.ReqCooperationContractAdd{
|
|
|
MoneyIncentivesRules: rules2,
|
|
|
DividendsIncentivesRules: rules1,
|
|
|
Undertakers: underTakers,
|
...
|
...
|
@@ -76,7 +77,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return createCooperationContractCommand, err
|
|
|
return dto.ToCooperationContractInfo(&result.CooperationContract), err
|
|
|
}
|
|
|
|
|
|
// 暂停恢复共创合约
|
...
|
...
|
@@ -164,14 +165,15 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
underTakers := []allied_creation_cooperation.Undertaker{}
|
|
|
for _, v := range updateCooperationContractCommand.Undertakers {
|
|
|
u := allied_creation_cooperation.Undertaker{
|
|
|
UserId: v.UndertakerId,
|
|
|
RerferrerId: v.RerferrerId,
|
|
|
SalesmanId: v.SalesmanId,
|
|
|
Attachment: v.Attachment,
|
|
|
RelevantId: v.UndertakerId,
|
|
|
UserId: v.UserId,
|
|
|
ReferrerId: v.RerferrerId,
|
|
|
SalesmanId: v.SalesmanId,
|
|
|
Attachment: v.Attachment,
|
|
|
}
|
|
|
underTakers = append(underTakers, u)
|
|
|
}
|
|
|
_, err := creationCooperationGateway.CooperationContractUpdate(allied_creation_cooperation.ReqCooperationContractUpdate{
|
|
|
result, err := creationCooperationGateway.CooperationContractUpdate(allied_creation_cooperation.ReqCooperationContractUpdate{
|
|
|
CooperationContractId: updateCooperationContractCommand.CooperationContract.CooperationContractId,
|
|
|
MoneyIncentivesRules: rules2,
|
|
|
DividendsIncentivesRules: rules1,
|
...
|
...
|
@@ -193,7 +195,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return nil, nil
|
|
|
return dto.ToCooperationContractInfo(&result.CooperationContract), nil
|
|
|
}
|
|
|
|
|
|
func NewCooperationContractService(options map[string]interface{}) *CooperationContractService {
|
...
|
...
|
|