作者 tangxuhui

数据结构调整

... ... @@ -84,14 +84,21 @@ 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"`
UserInfo domain.UserInfo `json:"userInfo"`
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 {
CooperationContract CooperationContractItem `json:"cooperationContract"`
... ... @@ -159,26 +166,24 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
DepartmentId: int(v.Department.DepartmentId),
DepartmentName: v.Department.DepartmentName,
},
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,
},
HasReferrer: v.Referrer.UserId > 0,
HasSalesman: v.Salesman.UserId > 0,
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
... ...
... ... @@ -39,42 +39,31 @@ func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDivi
//金额激励列表
type DividendsEstimateMoneyItem struct {
CooperationContractName string `json:"cooperationContractName"` //合约名称
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编码
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //共创模式
CreatedAt int64 `json:"createdAt"` //合约建立时间
Department struct {
DepartmentId int `json:"departmentId"`
CooperationContractId int `json:"cooperationContractId,string"` // 共创合约ID
CooperationContractName string `json:"cooperationContractName"` //合约名称
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编码
CooperationModeName string `json:"cooperationModeName"`
CreatedAt int64 `json:"createdAt"` //合约建立时间
Department struct {
DepartmentId int `json:"departmentId,string"`
DepartmentName string `json:"departmentName"`
} `json:"department"` //发起部门
CooperationContractSponsor struct {
UserId int `json:"userId"`
UserBaseId int `json:"userBaseId"`
UsersName string `json:"userName"`
Phone string `json:"phone"`
} `json:"cooperationContractSponsor"` //合约发起人
CooperationContractSponsorName string `json:"cooperationContractSponsorName"`
}
func ToDividendsEstimateMoneyItem(param *allied_creation_cooperation.DataDividendsEstimateSearchMoney) []DividendsEstimateMoneyItem {
var listdata []DividendsEstimateMoneyItem
for _, v := range param.Grid.List {
item := DividendsEstimateMoneyItem{
CooperationContractId: v.CooperationContractId,
CooperationContractName: v.CooperationContractName,
CooperationContractNumber: v.CooperationContractNumber,
CreatedAt: v.CreatedAt.Unix(),
CreatedAt: v.CreatedAt.UnixNano() / 1e6,
CooperationModeName: v.CooperationContractName,
}
item.CooperationMode.CooperationModeId = v.CooperationMode.CooperationModeId
item.CooperationMode.CooperationModeName = v.CooperationMode.CooperationModeName
item.CooperationMode.CooperationModeNumber = v.CooperationMode.CooperationModeNumber
item.Department.DepartmentId = v.Department.DepartmentId
item.Department.DepartmentName = v.Department.DepartmentName
item.CooperationContractSponsor.UserId = v.CooperationContractSponsor.UserId
item.CooperationContractSponsor.Phone = v.CooperationContractSponsor.UserInfo.Phone
item.CooperationContractSponsor.UsersName = v.CooperationContractSponsor.UserInfo.UsersName
item.CooperationContractSponsorName = v.CooperationContractName
listdata = append(listdata, item)
}
return listdata
... ...
... ... @@ -96,29 +96,17 @@ type (
Grid struct {
Total int `json:"total"`
List []struct {
CooperationContractName string `json:"cooperationContractName"` //合约名称
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编码
DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` //订单编号
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //共创模式
CreatedAt time.Time `json:"createdAt"` //合约建立时间
Department struct {
DepartmentId int `json:"departmentId"`
CooperationContractId int `json:"cooperationContractId,string"` // 共创合约ID
CooperationContractName string `json:"cooperationContractName"` //合约名称
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编码
CooperationModeName string `json:"cooperationMode"`
CreatedAt time.Time `json:"createdAt"` //合约建立时间
Department struct {
DepartmentId int `json:"departmentId,string"`
DepartmentName string `json:"departmentName"`
} `json:"department"` //发起部门
CooperationContractSponsor struct {
UserId int `json:"userId"`
UserBaseId int `json:"userBaseId"`
UserInfo struct {
UsersName string `json:"userName"`
Phone string `json:"phone"`
UsersId int `json:"userId,string,"`
UserCode string `json:"userCode"`
} `json:"userInfo"`
} `json:"cooperationContractSponsor"` //合约发起人
// 共创合约发起人
CooperationContractSponsorName string `json:"cooperationContractSponsor"`
} `json:"list"`
} `json:"grid"`
}
... ...