...
|
...
|
@@ -57,7 +57,7 @@ func ToCooperationContractItem(param *allied_creation_cooperation.CooperationCon |
|
|
}
|
|
|
|
|
|
type MoneyIncentivesRule struct {
|
|
|
MoneyIncentivesRuleId int `json:"moneyIncentivesRuleId"`
|
|
|
MoneyIncentivesRuleId int `json:"moneyIncentivesRuleId,string"`
|
|
|
CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的共创合约编号
|
|
|
MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"` // 激励金额
|
|
|
MoneyIncentivesStage int `json:"moneyIncentivesStage"` // 金额激励阶段
|
...
|
...
|
@@ -67,14 +67,14 @@ type MoneyIncentivesRule struct { |
|
|
}
|
|
|
|
|
|
type DividendsIncentivesRule struct {
|
|
|
DividendsIncentivesRuleId int `json:"dividendsIncentivesRuleId"`
|
|
|
DividendsIncentivesRuleId int `json:"dividendsIncentivesRuleId,string"`
|
|
|
CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的项目合约编号
|
|
|
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
|
|
|
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
|
|
|
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"` // 分红规则激励百分点
|
|
|
DividendsIncentivesStage int `json:"dividendsIncentivesStage,string"` // 分红规则激励阶段,
|
|
|
DividendsIncentivesStageEnd int64 `json:"dividendsIncentivesStageEnd"` // 分红规则激励阶段结束
|
|
|
DividendsIncentivesStageStart int64 `json:"dividendsIncentivesStageStart"` // 分红规则激励阶段开始
|
|
|
DividendsPercentage float64 `json:"dividendsPercentage"` // 分红规则激励百分点
|
|
|
DividendsStage int `json:"dividendsStage,string"` // 分红规则激励阶段,
|
|
|
DividendsStageEnd int64 `json:"dividendsStageEnd"` // 分红规则激励阶段结束
|
|
|
DividendsStageStart int64 `json:"dividendsStageStart"` // 分红规则激励阶段开始
|
|
|
}
|
|
|
|
|
|
type Relevant struct {
|
...
|
...
|
@@ -84,13 +84,20 @@ type Relevant struct { |
|
|
}
|
|
|
|
|
|
type ContractUndertaker struct {
|
|
|
UndertakerId int `json:"undertakerId,string"`
|
|
|
UndertakerId int `json:"undertakerId,string,"`
|
|
|
Attachment []domain.Attachment `json:"attachment"`
|
|
|
Department domain.Department `json:"department"`
|
|
|
HasReferrer bool `json:"hasReferrer"`
|
|
|
HasSalesman bool `json:"hasSalesman"`
|
|
|
ReferrerUser domain.UserInfo `json:"referrerUser"`
|
|
|
SalesmanUser domain.UserInfo `json:"salesmanUser"`
|
|
|
ReferrerUser struct {
|
|
|
UserId int `json:"userId,string"`
|
|
|
UserInfo domain.UserInfo `json:"userInfo"`
|
|
|
} `json:"referrerUser"`
|
|
|
SalesmanUser struct {
|
|
|
UserId int `json:"userId,string"`
|
|
|
UserInfo domain.UserInfo `json:"userInfo"`
|
|
|
}
|
|
|
UserId int `json:"userId,string"`
|
|
|
UserInfo domain.UserInfo `json:"userInfo"`
|
|
|
}
|
|
|
type CooperationContractInfo struct {
|
...
|
...
|
@@ -130,10 +137,10 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon |
|
|
CooperationContractNumber: v.CooperationContractNumber,
|
|
|
ReferrerPercentage: v.ReferrerPercentage,
|
|
|
SalesmanPercentage: v.SalesmanPercentage,
|
|
|
DividendsIncentivesPercentage: v.DividendsIncentivesPercentage,
|
|
|
DividendsIncentivesStage: v.DividendsIncentivesStage,
|
|
|
DividendsIncentivesStageEnd: v.DividendsIncentivesStageEnd.UnixNano() / 1e6,
|
|
|
DividendsIncentivesStageStart: v.DividendsIncentivesStageStart.UnixNano() / 1e6,
|
|
|
DividendsPercentage: v.DividendsIncentivesPercentage,
|
|
|
DividendsStage: v.DividendsIncentivesStage,
|
|
|
DividendsStageEnd: v.DividendsIncentivesStageEnd.UnixNano() / 1e6,
|
|
|
DividendsStageStart: v.DividendsIncentivesStageStart.UnixNano() / 1e6,
|
|
|
}
|
|
|
dividendsIncentivesRules = append(dividendsIncentivesRules, r)
|
|
|
}
|
...
|
...
|
@@ -152,8 +159,12 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon |
|
|
}
|
|
|
|
|
|
for _, v := range param.Undertakers {
|
|
|
attachment := v.ContractAttachment
|
|
|
if len(attachment) == 0 {
|
|
|
attachment = []domain.Attachment{}
|
|
|
}
|
|
|
u := ContractUndertaker{
|
|
|
Attachment: v.ContractAttachment,
|
|
|
Attachment: attachment,
|
|
|
Department: domain.Department{
|
|
|
DepartmentNumber: v.Department.DepartmentNumber,
|
|
|
DepartmentId: int(v.Department.DepartmentId),
|
...
|
...
|
@@ -161,24 +172,22 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon |
|
|
},
|
|
|
HasReferrer: v.Referrer.UserId > 0,
|
|
|
HasSalesman: v.Salesman.UserId > 0,
|
|
|
ReferrerUser: domain.UserInfo{
|
|
|
UsersName: v.Referrer.UserInfo.UserName,
|
|
|
Phone: v.Referrer.UserInfo.UserPhone,
|
|
|
UsersId: v.Referrer.UserId,
|
|
|
// UserCode :v.
|
|
|
},
|
|
|
SalesmanUser: domain.UserInfo{
|
|
|
UsersName: v.Salesman.UserInfo.UserName,
|
|
|
UsersId: v.Salesman.UserId,
|
|
|
Phone: v.Salesman.UserInfo.UserPhone,
|
|
|
},
|
|
|
UndertakerId: v.UndertakerId,
|
|
|
UserId: v.UserId,
|
|
|
UserInfo: domain.UserInfo{
|
|
|
UsersName: v.UserInfo.UserName,
|
|
|
UsersId: v.UserId,
|
|
|
Phone: v.UserInfo.UserPhone,
|
|
|
},
|
|
|
}
|
|
|
u.SalesmanUser.UserId = v.Salesman.UserId
|
|
|
u.SalesmanUser.UserInfo.UsersId = v.Salesman.UserId
|
|
|
u.SalesmanUser.UserInfo.UsersName = v.Salesman.UserInfo.UserName
|
|
|
u.SalesmanUser.UserInfo.Phone = v.Salesman.UserInfo.UserPhone
|
|
|
u.ReferrerUser.UserId = v.Referrer.UserId
|
|
|
u.ReferrerUser.UserInfo.UsersId = v.Referrer.UserId
|
|
|
u.ReferrerUser.UserInfo.UsersName = v.Referrer.UserInfo.UserName
|
|
|
u.ReferrerUser.UserInfo.Phone = v.Referrer.UserInfo.UserPhone
|
|
|
contractUndertaker = append(contractUndertaker, u)
|
|
|
}
|
|
|
undertakerTypesUncheckedAvailable := param.UndertakerTypesUncheckedAvailable
|
...
|
...
|
|