...
|
...
|
@@ -9,27 +9,35 @@ type CooperationContractItem struct { |
|
|
CooperationContractId int `json:"cooperationContractId,string,"`
|
|
|
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
|
|
|
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
|
|
|
CooperationContractName string `json:"CooperationContractName"` //合约名称
|
|
|
CooperationContractName string `json:"cooperationContractName"` //合约名称
|
|
|
Status int `json:"status"` //合约状态
|
|
|
CreateTtime int `json:"createTtime"`
|
|
|
CreateTime int `json:"createTime"`
|
|
|
Department domain.Department `json:"department"`
|
|
|
IncentivesType string `json:"incentivesType"` //Incentives激励方式
|
|
|
CooperationContractSponsor struct {
|
|
|
UserId int `json:"userId,string,"`
|
|
|
UserName string `json:"userName"`
|
|
|
} `json:"cooperationContractSponsor"` //共创发起人
|
|
|
CooperationMode domain.CooperationMode `json:"cooperationMode"` //共创模式
|
|
|
Org domain.Org `json:"org"` //组织结构
|
|
|
CooperationMode domain.CooperationMode `json:"cooperationMode"` //共创模式
|
|
|
Org domain.Org `json:"org"` //组织结构
|
|
|
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"` //共创合约承接对象,1员工,2共创用户,3公开
|
|
|
CooperationContractDescription string `json:"cooperationContractDescription"` //合约描述
|
|
|
}
|
|
|
|
|
|
func ToCooperationContractItem(param *allied_creation_cooperation.CooperationContract) *CooperationContractItem {
|
|
|
cooperationContractUndertakerType := param.CooperationContractUndertakerTypes
|
|
|
if len(cooperationContractUndertakerType) == 0 {
|
|
|
cooperationContractUndertakerType = []int{}
|
|
|
}
|
|
|
data := CooperationContractItem{
|
|
|
CooperationContractId: param.CooperationContractId,
|
|
|
CooperationProjectNumber: param.CooperationContractNumber,
|
|
|
CooperationContractName: param.CooperationContractName,
|
|
|
CooperationContractNumber: param.CooperationContractNumber,
|
|
|
Status: param.Status,
|
|
|
CreateTtime: int(param.CreatedAt.Unix()),
|
|
|
CooperationContractUndertakerType: cooperationContractUndertakerType,
|
|
|
CooperationContractDescription: param.CooperationContractDescription,
|
|
|
CooperationContractId: param.CooperationContractId,
|
|
|
CooperationProjectNumber: param.CooperationContractNumber,
|
|
|
CooperationContractName: param.CooperationContractName,
|
|
|
CooperationContractNumber: param.CooperationContractNumber,
|
|
|
Status: param.Status,
|
|
|
CreateTime: int(param.CreatedAt.UnixNano() / 1e6),
|
|
|
}
|
|
|
data.CooperationContractSponsor.UserId = param.CooperationContractSponsor.UserId
|
|
|
data.CooperationContractSponsor.UserName = param.CooperationContractSponsor.UserInfo.UserName
|
...
|
...
|
@@ -76,6 +84,7 @@ type Relevant struct { |
|
|
}
|
|
|
|
|
|
type ContractUndertaker struct {
|
|
|
UndertakerId int `json:"undertakerId,string"`
|
|
|
Attachment []domain.Attachment `json:"attachment"`
|
|
|
Department domain.Department `json:"department"`
|
|
|
HasReferrer bool `json:"hasReferrer"`
|
...
|
...
|
@@ -85,11 +94,12 @@ type ContractUndertaker struct { |
|
|
UserInfo domain.UserInfo `json:"userInfo"`
|
|
|
}
|
|
|
type CooperationContractInfo struct {
|
|
|
CooperationContract CooperationContractItem `json:"cooperationContract"`
|
|
|
Relevant []Relevant `json:"relevant"`
|
|
|
DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"`
|
|
|
MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"`
|
|
|
ContractUndertaker []ContractUndertaker `json:"contractUndertaker"`
|
|
|
CooperationContract CooperationContractItem `json:"cooperationContract"`
|
|
|
Relevant []Relevant `json:"relevant"`
|
|
|
DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"`
|
|
|
MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"`
|
|
|
ContractUndertaker []ContractUndertaker `json:"contractUndertaker"`
|
|
|
UndertakerTypesUncheckedAvailable []int `json:"undertakerTypesUncheckedAvailable"` // 可以去除勾选的共创项目承接对象列表
|
|
|
}
|
|
|
|
|
|
func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationContract) *CooperationContractInfo {
|
...
|
...
|
@@ -122,8 +132,8 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon |
|
|
SalesmanPercentage: v.SalesmanPercentage,
|
|
|
DividendsIncentivesPercentage: v.DividendsIncentivesPercentage,
|
|
|
DividendsIncentivesStage: v.DividendsIncentivesStage,
|
|
|
DividendsIncentivesStageEnd: v.DividendsIncentivesStageEnd.Unix(),
|
|
|
DividendsIncentivesStageStart: v.DividendsIncentivesStageStart.Unix(),
|
|
|
DividendsIncentivesStageEnd: v.DividendsIncentivesStageEnd.UnixNano() / 1e6,
|
|
|
DividendsIncentivesStageStart: v.DividendsIncentivesStageStart.UnixNano() / 1e6,
|
|
|
}
|
|
|
dividendsIncentivesRules = append(dividendsIncentivesRules, r)
|
|
|
}
|
...
|
...
|
@@ -134,7 +144,7 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon |
|
|
CooperationContractNumber: v.CooperationContractNumber,
|
|
|
MoneyIncentivesAmount: v.MoneyIncentivesAmount,
|
|
|
MoneyIncentivesStage: v.MoneyIncentivesStage,
|
|
|
MoneyIncentivesTime: v.MoneyIncentivesTime.Unix(),
|
|
|
MoneyIncentivesTime: v.MoneyIncentivesTime.UnixNano() / 1e6,
|
|
|
ReferrerPercentage: v.ReferrerPercentage,
|
|
|
SalesmanPercentage: v.SalesmanPercentage,
|
|
|
}
|
...
|
...
|
@@ -162,6 +172,7 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon |
|
|
UsersId: v.Salesman.UserId,
|
|
|
Phone: v.Salesman.UserInfo.UserPhone,
|
|
|
},
|
|
|
UndertakerId: v.UndertakerId,
|
|
|
UserInfo: domain.UserInfo{
|
|
|
UsersName: v.UserInfo.UserName,
|
|
|
UsersId: v.UserId,
|
...
|
...
|
@@ -170,12 +181,17 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon |
|
|
}
|
|
|
contractUndertaker = append(contractUndertaker, u)
|
|
|
}
|
|
|
undertakerTypesUncheckedAvailable := param.UndertakerTypesUncheckedAvailable
|
|
|
if len(undertakerTypesUncheckedAvailable) == 0 {
|
|
|
undertakerTypesUncheckedAvailable = []int{}
|
|
|
}
|
|
|
data := CooperationContractInfo{
|
|
|
CooperationContract: *ToCooperationContractItem(param),
|
|
|
Relevant: relevants,
|
|
|
DividendsIncentivesRules: dividendsIncentivesRules,
|
|
|
MoneyIncentivesRules: moneyIncentivesRules,
|
|
|
ContractUndertaker: contractUndertaker,
|
|
|
CooperationContract: *ToCooperationContractItem(param),
|
|
|
Relevant: relevants,
|
|
|
DividendsIncentivesRules: dividendsIncentivesRules,
|
|
|
MoneyIncentivesRules: moneyIncentivesRules,
|
|
|
ContractUndertaker: contractUndertaker,
|
|
|
UndertakerTypesUncheckedAvailable: undertakerTypesUncheckedAvailable,
|
|
|
}
|
|
|
return &data
|
|
|
|
...
|
...
|
|