作者 tangxuhui

数据结构调整

... ... @@ -83,6 +83,9 @@ func (cooperationApplicationService *CooperationApplicationService) ListCooperat
// item := dto.ToCooperationApplicationItem(&result.Grid.List[i])
// dataList = append(dataList, *item)
//}
if len(result.Grid.List) == 0 {
result.Grid.List = []allied_creation_cooperation.CooperationApplication{}
}
return int64(result.Grid.Total), result.Grid.List, nil
}
... ...
... ... @@ -45,6 +45,7 @@ func ToCooperationContractItem(param *allied_creation_cooperation.CooperationCon
data.CooperationContractSponsor.UserName = param.CooperationContractSponsor.UserInfo.UserName
data.Department.DepartmentId = param.Department.DepartmentId
data.Department.DepartmentName = param.Department.DepartmentName
data.Department.DepartmentNumber = param.Department.DepartmentNumber
data.Org.OrgID = int(param.Org.OrgId)
data.Org.OrgName = param.Org.OrgName
data.CooperationMode.CooperationModeId = param.CooperationMode.CooperationModeId
... ...
... ... @@ -128,6 +128,9 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
// item := dto.ToCooperationProjectInfo(&result.List[i])
// dataList = append(dataList, *item)
//}
if len(result.List) == 0 {
result.List = []allied_creation_cooperation.DataCooperationProjectSearchItem{}
}
return int64(result.Total), result.List, nil
}
... ...
... ... @@ -22,11 +22,12 @@ func (srv *CreditAccountService) ListCreditAccount(listQuery *query.ListCreditAc
PageSize: int64(listQuery.PageSize),
CreditAccountOrderNum: listQuery.CreditAccountOrderNum,
ParticipatorName: listQuery.Participator,
CompanyId: listQuery.Operator.CompanyId,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
var listData []dto.CreditAccountItem
listData := []dto.CreditAccountItem{}
for i := range result.Grid.List {
item := dto.ToCreditAccountItem(&result.Grid.List[i])
listData = append(listData, *item)
... ...
... ... @@ -18,7 +18,7 @@ type DividendsEstimateDividendItem struct {
}
func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDividendsEstimateSearchDividend) []DividendsEstimateDividendItem {
var listdata []DividendsEstimateDividendItem
listdata := []DividendsEstimateDividendItem{}
for _, v := range param.List {
item := DividendsEstimateDividendItem{
OrderGoodId: v.OrderGoodId,
... ... @@ -52,7 +52,7 @@ type DividendsEstimateMoneyItem struct {
}
func ToDividendsEstimateMoneyItem(param *allied_creation_cooperation.DataDividendsEstimateSearchMoney) []DividendsEstimateMoneyItem {
var listdata []DividendsEstimateMoneyItem
listdata := []DividendsEstimateMoneyItem{}
for _, v := range param.Grid.List {
item := DividendsEstimateMoneyItem{
CooperationContractId: v.CooperationContractId,
... ...
... ... @@ -97,7 +97,7 @@ func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchD
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
var dataList []dto.DividendsOrder
dataList := []dto.DividendsOrder{}
for i := range result.Grid.List {
item := dto.ToDividendsOrder(&result.Grid.List[i])
dataList = append(dataList, *item)
... ...
... ... @@ -95,7 +95,7 @@ func (orgsService *OrgsService) OrgList(orgListQuery *query.OrgListQuery) (inter
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
var (
dataList []dto.OrgItem
dataList = []dto.OrgItem{}
item dto.OrgItem
)
for _, v := range result.Orgs {
... ...
... ... @@ -14,8 +14,9 @@ type CooperationContract struct {
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationContractUndertakerTypes []int `json:"cooperationContractUndertakerTypes"` // 共创合约承接对象,1员工,2共创用户,3公开
Department struct {
DepartmentId int `json:"departmentId,string"`
DepartmentName string `json:"departmentName"`
DepartmentId int `json:"departmentId,string"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
} `jsopn:"department" json:"department"` //发起部门
CooperationContractSponsor struct {
UserId int `json:"userId,string"` //id
... ...
... ... @@ -164,94 +164,80 @@ type (
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
DataCooperationProjectSearchItem struct {
CooperationProjectID string `json:"cooperationProjectId"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectDescription string `json:"cooperationProjectDescription"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectPublishTime jtime.TimeToUnixMsec `json:"cooperationProjectPublishTime"`
CooperationProjectPublisher struct {
UserID string `json:"userId"`
UserBaseID string `json:"userBaseId"`
Department interface{} `json:"department"`
UserInfo struct {
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
//UserType int `json:"userType"`
//UserName string `json:"userName"`
//UserPhone string `json:"userPhone"`
//Status int `json:"status"`
} `json:"cooperationProjectPublisher"`
CooperationProjectSponsor struct {
UserID string `json:"userId"`
UserBaseID string `json:"userBaseId"`
Department interface{} `json:"department"`
UserInfo struct {
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
} `json:"cooperationProjectSponsor"`
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
Department struct {
DepartmentID string `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
} `json:"department"`
CooperationProjectUndertakerTypes []int `json:"cooperationProjectUndertakerTypes"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"`
Org struct {
OrgID string `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
Attachment interface{} `json:"attachment"`
Company struct {
CompanyID string `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
Operator struct {
UserID string `json:"userId"`
UserBaseID string `json:"userBaseId"`
Department interface{} `json:"department"`
UserInfo struct {
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
} `json:"operator"`
//OperateTime time.Time `json:"operateTime"`
Status int `json:"status"`
}
DataCooperationProjectSearch struct {
//Total int64 `json:"total"`
//List []CooperationProject `json:"cooperationProjects"`
List []struct {
CooperationProjectID string `json:"cooperationProjectId"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectDescription string `json:"cooperationProjectDescription"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectPublishTime jtime.TimeToUnixMsec `json:"cooperationProjectPublishTime"`
CooperationProjectPublisher struct {
UserID string `json:"userId"`
UserBaseID string `json:"userBaseId"`
Department interface{} `json:"department"`
UserInfo struct {
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
//UserType int `json:"userType"`
//UserName string `json:"userName"`
//UserPhone string `json:"userPhone"`
//Status int `json:"status"`
} `json:"cooperationProjectPublisher"`
CooperationProjectSponsor struct {
UserID string `json:"userId"`
UserBaseID string `json:"userBaseId"`
Department interface{} `json:"department"`
UserInfo struct {
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
//UserType int `json:"userType"`
//UserName string `json:"userName"`
//UserPhone string `json:"userPhone"`
//Status int `json:"status"`
} `json:"cooperationProjectSponsor"`
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
Department struct {
DepartmentID string `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
//IsOrganization bool `json:"isOrganization"`
} `json:"department"`
CooperationProjectUndertakerTypes []int `json:"cooperationProjectUndertakerTypes"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"`
Org struct {
OrgID string `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
Attachment interface{} `json:"attachment"`
Company struct {
CompanyID string `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
Operator struct {
UserID string `json:"userId"`
UserBaseID string `json:"userBaseId"`
Department interface{} `json:"department"`
UserInfo struct {
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
//UserType int `json:"userType"`
//UserName string `json:"userName"`
//UserPhone string `json:"userPhone"`
//Status int `json:"status"`
} `json:"operator"`
//OperateTime time.Time `json:"operateTime"`
Status int `json:"status"`
//UpdatedAt time.Time `json:"updatedAt"`
//DeletedAt time.Time `json:"deletedAt"`
//CreatedAt time.Time `json:"createdAt"`
} `json:"list"`
Total int `json:"total"`
List []DataCooperationProjectSearchItem `json:"list"`
Total int `json:"total"`
}
)
... ...