...
|
...
|
@@ -19,13 +19,22 @@ type CooperationApplicationsService struct { |
|
|
func (srv CooperationApplicationsService) GetCooperationApplications(applicationQuery *command.GetCooperationApplicationQuery) (interface{}, error) {
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
applicationQuery.Operator)
|
|
|
result, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
|
|
|
resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
|
|
|
CooperationApplicationId: applicationQuery.CooperationApplicationId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
data := dto.ToCooperationApplication(&result.CooperationApplication)
|
|
|
resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
|
|
|
CooperationProjectId: resultApplication.CooperationProject.CooperationProjectID,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
data := map[string]interface{}{
|
|
|
"cooperationApplication": dto.ToCooperationApplication(&resultApplication.CooperationApplication),
|
|
|
"cooperationProject": dto.ToCooperationProjectInfo(&resultProject.CooperationProject),
|
|
|
}
|
|
|
return data, nil
|
|
|
}
|
|
|
|
...
|
...
|
@@ -91,8 +100,26 @@ func (srv CooperationApplicationsService) CreateCooperationApplications(createAp |
|
|
}
|
|
|
|
|
|
//PersonGetCooperationApplications 共创用户获取共创申请详情
|
|
|
func (srv CooperationApplicationsService) PersonGetCooperationApplications(userMenusCommand *command.GetCooperationApplicationQuery) (interface{}, error) {
|
|
|
return nil, nil
|
|
|
func (srv CooperationApplicationsService) PersonGetCooperationApplications(applicationQuery *command.GetCooperationApplicationQuery) (interface{}, error) {
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
applicationQuery.Operator)
|
|
|
resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
|
|
|
CooperationApplicationId: applicationQuery.CooperationApplicationId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
|
|
|
CooperationProjectId: resultApplication.CooperationProject.CooperationProjectID,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
data := map[string]interface{}{
|
|
|
"cooperationApplication": dto.ToCooperationApplication(&resultApplication.CooperationApplication),
|
|
|
"cooperationProject": dto.ToCooperationProjectInfo(&resultProject.CooperationProject),
|
|
|
}
|
|
|
return data, nil
|
|
|
}
|
|
|
|
|
|
// PersonCancelCooperationApplications 共创用户取消共创申请
|
...
|
...
|
@@ -101,6 +128,23 @@ func (srv CooperationApplicationsService) PersonCancelCooperationApplications(us |
|
|
}
|
|
|
|
|
|
// PersonSearchCooperationApplications 共创用户获取共创申请列表
|
|
|
func (srv CooperationApplicationsService) PersonSearchCooperationApplications(userMenusCommand *command.ListCooperationApplicationQuery) (interface{}, error) {
|
|
|
return nil, nil
|
|
|
func (srv CooperationApplicationsService) PersonSearchCooperationApplications(applicationQuery *command.ListCooperationApplicationQuery) (interface{}, error) {
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
applicationQuery.Operator)
|
|
|
resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
|
|
|
PageNumber: applicationQuery.PageNumber,
|
|
|
PageSize: applicationQuery.PageSize,
|
|
|
CompanyId: int(applicationQuery.Operator.CompanyId),
|
|
|
CooperationApplicationStatus: applicationQuery.Status,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
// var dataList []dto.CooperationApplication
|
|
|
|
|
|
// for i := range resultApplications.Gride.List {
|
|
|
// item := dto.ToCooperationApplication(&resultApplications.Gride.List[i])
|
|
|
// dataList = append(dataList, *item)
|
|
|
// }
|
|
|
return resultApplications, nil
|
|
|
} |
...
|
...
|
|