作者 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 {
... ...
... ... @@ -16,6 +16,7 @@ type CooperationContract struct {
Department struct {
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,11 +164,7 @@ type (
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
}
DataCooperationProjectSearch struct {
//Total int64 `json:"total"`
//List []CooperationProject `json:"cooperationProjects"`
List []struct {
DataCooperationProjectSearchItem struct {
CooperationProjectID string `json:"cooperationProjectId"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectDescription string `json:"cooperationProjectDescription"`
... ... @@ -201,10 +197,6 @@ type (
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"`
... ... @@ -215,7 +207,6 @@ type (
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"`
... ... @@ -240,17 +231,12 @@ type (
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"`
}
DataCooperationProjectSearch struct {
List []DataCooperationProjectSearchItem `json:"list"`
Total int `json:"total"`
}
)
... ...