作者 tangxuhui

数据结构调整

... ... @@ -18,18 +18,22 @@ type CooperationContractItem 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 {
data := CooperationContractItem{
CooperationContractId: param.CooperationContractId,
CooperationProjectNumber: param.CooperationContractNumber,
CooperationContractName: param.CooperationContractName,
CooperationContractNumber: param.CooperationContractNumber,
Status: param.Status,
CreateTime: int(param.CreatedAt.UnixNano() / 1e6),
CooperationContractUndertakerType: param.CooperationContractUndertakerTypes,
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
... ... @@ -86,11 +90,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 {
... ... @@ -172,12 +177,17 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
}
contractUndertaker = append(contractUndertaker, u)
}
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: param.UndertakerTypesUncheckedAvailable,
}
if len(param.UndertakerTypesUncheckedAvailable) == 0 {
data.UndertakerTypesUncheckedAvailable = []int{}
}
return &data
... ...
... ... @@ -41,7 +41,7 @@ type CooperationProjectInfo struct {
UsersId int `json:"userId,string"`
} `json:"userInfo"`
} `json:"cooperationProjectSponsor"` //项目发起人
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"` //共创合约承接对象,1员工,2共创用户,3公开
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //共创合约承接对象,1员工,2共创用户,3公开
Department struct {
DepartmentNumber string `json:"departmentNumber"`
DepartmentId int `json:"departmentId,string,"`
... ... @@ -79,16 +79,17 @@ type CooperationApplicationItem struct {
Company domain.CompanyData `json:"company"`
Department domain.Department `json:"department"`
Org domain.Org `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserBaseID int `json:"userBaseId,string"`
UserID int `json:"userId,string"`
UserInfo domain.UserInfo `json:"userInfo"`
UserType int `json:"userType"`
} `json:"cooperationApplicationApplicant"` //申请人
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //申请id
CooperationApplicationID int `json:"cooperationApplicationId,string"` //申请id
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //状态
CooperationApplyTime int `json:"cooperationApplyTime"` //申请时间
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationVerifyTime int `json:"cooperationApplicationVerifyTime"`
}
func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
... ... @@ -97,8 +98,9 @@ func ToCooperationApplicationItem(param *allied_creation_cooperation.Cooperation
CooperationApplicationDescription: param.CooperationApplicationDescription,
CooperationApplicationID: applicationID,
CooperationApplicationStatus: param.CooperationApplicationStatus,
CooperationApplyTime: int(param.CooperationApplyTime),
CooperationApplyTime: param.CooperationApplyTime,
CooperationApplicationAttachment: param.CooperationApplicationAttachment,
CooperationApplicationVerifyTime: param.CooperationApplicationVerifyTime,
}
data.CooperationApplicationApplicant.Company.CompanyID = param.Company.CompanyID
data.CooperationApplicationApplicant.Company.CompanyName = param.Company.CompanyName
... ...
... ... @@ -31,8 +31,8 @@ type CooperationApplication struct {
Department interface{} `json:"department"`
} `json:"cooperationApplicationVerifier"`
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
CooperationApplicationVerifyTime int64 `json:"cooperationApplicationVerifyTime"`
CooperationApplyTime int64 `json:"cooperationApplyTime"`
CooperationApplicationVerifyTime int `json:"cooperationApplicationVerifyTime"`
CooperationApplyTime int `json:"cooperationApplyTime"`
CooperationProject struct {
CooperationProjectID int `json:"cooperationProjectId"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
... ...
... ... @@ -112,9 +112,10 @@ type CooperationContract struct {
DepartmentNumber string `json:"departmentNumber"` // 部门编码
} `json:"department"` //申请人部门
} `json:"relevantPeople"` // 共创合约相关人列表
OperateTime time.Time `json:"operateTime"` // 操作时间
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
OperateTime time.Time `json:"operateTime"` // 操作时间
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
UndertakerTypesUncheckedAvailable []int `json:"undertakerTypesUncheckedAvailable"`
}
//创建共创合约
... ...