Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev
正在显示
15 个修改的文件
包含
186 行增加
和
58 行删除
| @@ -14,12 +14,8 @@ type ListCooperationApplicationQuery struct { | @@ -14,12 +14,8 @@ type ListCooperationApplicationQuery struct { | ||
| 14 | PageNumber int `json:"pageNumber" valid:"Required"` | 14 | PageNumber int `json:"pageNumber" valid:"Required"` |
| 15 | // 查询限制 | 15 | // 查询限制 |
| 16 | PageSize int `json:"pageSize" valid:"Required"` | 16 | PageSize int `json:"pageSize" valid:"Required"` |
| 17 | - //共创项目名称 | ||
| 18 | - ProjectName string `json:"projectName"` | ||
| 19 | - //申请人名称 | ||
| 20 | - ApplicantName string `json:"applicantName"` | ||
| 21 | //审核状态 | 17 | //审核状态 |
| 22 | - VerifyStatus int `json:"verifyStatus"` | 18 | + Status int `json:"status"` |
| 23 | } | 19 | } |
| 24 | 20 | ||
| 25 | func (listCooperationApplicationQuery *ListCooperationApplicationQuery) Valid(validation *validation.Validation) { | 21 | func (listCooperationApplicationQuery *ListCooperationApplicationQuery) Valid(validation *validation.Validation) { |
| @@ -17,7 +17,7 @@ type CreateCooperationProjectCommand struct { | @@ -17,7 +17,7 @@ type CreateCooperationProjectCommand struct { | ||
| 17 | // 共创项目名称 | 17 | // 共创项目名称 |
| 18 | CooperationProjectName string `json:"cooperationProjectName" valid:"Required"` | 18 | CooperationProjectName string `json:"cooperationProjectName" valid:"Required"` |
| 19 | // 共创发起人id | 19 | // 共创发起人id |
| 20 | - CooperationProjectSponsor string `json:"cooperationProjectSponsor,string,"` | 20 | + CooperationProjectSponsor int `json:"cooperationProjectSponsor,string,"` |
| 21 | // 项目承接对象 | 21 | // 项目承接对象 |
| 22 | CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` | 22 | CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` |
| 23 | // 共创项目描述 | 23 | // 共创项目描述 |
| @@ -11,7 +11,7 @@ type EndCooperationProjectCommand struct { | @@ -11,7 +11,7 @@ type EndCooperationProjectCommand struct { | ||
| 11 | //操作人 | 11 | //操作人 |
| 12 | Operator domain.Operator `json:"-"` | 12 | Operator domain.Operator `json:"-"` |
| 13 | // 共创项目id | 13 | // 共创项目id |
| 14 | - CooperationProjectId []int64 `json:"cooperationProjectId,omitempty"` | 14 | + CooperationProjectId []int `json:"cooperationProjectId,omitempty"` |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | func (endCooperationProjectCommand *EndCooperationProjectCommand) Valid(validation *validation.Validation) { | 17 | func (endCooperationProjectCommand *EndCooperationProjectCommand) Valid(validation *validation.Validation) { |
| @@ -39,3 +39,14 @@ func (listCooperationProjectQuery *ListCooperationProjectQuery) ValidateQuery() | @@ -39,3 +39,14 @@ func (listCooperationProjectQuery *ListCooperationProjectQuery) ValidateQuery() | ||
| 39 | } | 39 | } |
| 40 | return nil | 40 | return nil |
| 41 | } | 41 | } |
| 42 | + | ||
| 43 | +type PersonSearchCooperationProjectQuery struct { | ||
| 44 | + //操作人 | ||
| 45 | + Operator domain.Operator `json:"-"` | ||
| 46 | + // 查询偏离量 | ||
| 47 | + PageNumber int `json:"pageNumber"` | ||
| 48 | + // 查询限制 | ||
| 49 | + PageSize int `json:"pageSize" valid:"Required"` | ||
| 50 | + // | ||
| 51 | + OrgId int `json:"orgId"` | ||
| 52 | +} |
| @@ -3,6 +3,7 @@ package service | @@ -3,6 +3,7 @@ package service | ||
| 3 | import ( | 3 | import ( |
| 4 | "github.com/linmadan/egglib-go/core/application" | 4 | "github.com/linmadan/egglib-go/core/application" |
| 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" | 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" |
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" | ||
| 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" | 7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" |
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| @@ -43,18 +44,19 @@ func (srv CooperationApplicationsService) AuditCooperationApplications(userMenus | @@ -43,18 +44,19 @@ func (srv CooperationApplicationsService) AuditCooperationApplications(userMenus | ||
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | // GetCooperationApplications TODO:企业获取共创申请列表 | 46 | // GetCooperationApplications TODO:企业获取共创申请列表 |
| 46 | -func (srv CooperationApplicationsService) SearchCooperationApplications(userMenusCommand *command.ListCooperationApplicationQuery) (interface{}, error) { | ||
| 47 | - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( | ||
| 48 | - userMenusCommand.Operator) | ||
| 49 | - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{ | ||
| 50 | - UserId: int(userMenusCommand.Operator.UserId), | 47 | +func (srv CooperationApplicationsService) SearchCooperationApplications(applicationQuery *command.ListCooperationApplicationQuery) (interface{}, error) { |
| 48 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | ||
| 49 | + applicationQuery.Operator) | ||
| 50 | + resultMenu, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{ | ||
| 51 | + PageNumber: applicationQuery.PageNumber, | ||
| 52 | + PageSize: applicationQuery.PageSize, | ||
| 53 | + CompanyId: int(applicationQuery.Operator.CompanyId), | ||
| 54 | + CooperationApplicationStatus: applicationQuery.Status, | ||
| 51 | }) | 55 | }) |
| 52 | if err != nil { | 56 | if err != nil { |
| 53 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 57 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
| 54 | } | 58 | } |
| 55 | - return map[string]interface{}{ | ||
| 56 | - "accessMenus": resultMenu.Menus, | ||
| 57 | - }, nil | 59 | + return resultMenu, nil |
| 58 | } | 60 | } |
| 59 | 61 | ||
| 60 | /***** 共创用户端 *****/ | 62 | /***** 共创用户端 *****/ |
| @@ -7,7 +7,6 @@ import ( | @@ -7,7 +7,6 @@ import ( | ||
| 7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" | 7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" |
| 8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto" | 8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto" |
| 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" | 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" |
| 10 | - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" | ||
| 11 | ) | 10 | ) |
| 12 | 11 | ||
| 13 | // CooperationProjectService 共创项目服务 | 12 | // CooperationProjectService 共创项目服务 |
| @@ -20,13 +19,19 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP | @@ -20,13 +19,19 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP | ||
| 20 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 19 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 21 | } | 20 | } |
| 22 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator) | 21 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator) |
| 22 | + var images []allied_creation_cooperation.ProjectAttachment | ||
| 23 | + for _, v := range createCooperationProjectCommand.Images { | ||
| 24 | + images = append(images, allied_creation_cooperation.ProjectAttachment{ | ||
| 25 | + Url: v, | ||
| 26 | + }) | ||
| 27 | + } | ||
| 23 | result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ | 28 | result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ |
| 24 | CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, | 29 | CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, |
| 25 | CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, | 30 | CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, |
| 26 | - PublisherUid: strconv.Itoa(int(createCooperationProjectCommand.Operator.UserId)), | 31 | + PublisherUid: int(createCooperationProjectCommand.Operator.UserId), |
| 27 | SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, | 32 | SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, |
| 28 | CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, | 33 | CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, |
| 29 | - Images: createCooperationProjectCommand.Images, | 34 | + Attachment: images, |
| 30 | }) | 35 | }) |
| 31 | 36 | ||
| 32 | if err != nil { | 37 | if err != nil { |
| @@ -57,34 +62,45 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command | @@ -57,34 +62,45 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command | ||
| 57 | } | 62 | } |
| 58 | 63 | ||
| 59 | // UpdateCooperationProject | 64 | // UpdateCooperationProject |
| 60 | -//TODO 企业更新共创项目 | ||
| 61 | -func (srv CooperationProjectService) UpdateCooperationProject(userMenusCommand *command.UpdateCooperationProjectCommand) (interface{}, error) { | ||
| 62 | - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( | ||
| 63 | - userMenusCommand.Operator) | ||
| 64 | - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{ | ||
| 65 | - UserId: int(userMenusCommand.Operator.UserId), | 65 | +func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationProjectCommand *command.UpdateCooperationProjectCommand) (interface{}, error) { |
| 66 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator) | ||
| 67 | + var images []allied_creation_cooperation.ProjectAttachment | ||
| 68 | + for _, v := range updateCooperationProjectCommand.Images { | ||
| 69 | + images = append(images, allied_creation_cooperation.ProjectAttachment{ | ||
| 70 | + Url: v, | ||
| 71 | + }) | ||
| 72 | + } | ||
| 73 | + _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{ | ||
| 74 | + CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId, | ||
| 75 | + CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName, | ||
| 76 | + CooperationModeNumber: updateCooperationProjectCommand.CooperationModeNumber, | ||
| 77 | + CooperationProjectUndertakerType: updateCooperationProjectCommand.CooperationProjectUndertakerType, | ||
| 78 | + SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor, | ||
| 79 | + PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)), | ||
| 80 | + CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription, | ||
| 81 | + Attachment: images, | ||
| 66 | }) | 82 | }) |
| 67 | if err != nil { | 83 | if err != nil { |
| 68 | - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 84 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| 69 | } | 85 | } |
| 70 | - return map[string]interface{}{ | ||
| 71 | - "accessMenus": resultMenu.Menus, | ||
| 72 | - }, nil | 86 | + return updateCooperationProjectCommand, nil |
| 73 | } | 87 | } |
| 74 | 88 | ||
| 75 | -// EndCooperationProject TODO:企业结束共创项目 | ||
| 76 | -func (srv CooperationProjectService) EndCooperationProject(userMenusCommand *command.EndCooperationProjectCommand) (interface{}, error) { | ||
| 77 | - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( | ||
| 78 | - userMenusCommand.Operator) | ||
| 79 | - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{ | ||
| 80 | - UserId: int(userMenusCommand.Operator.UserId), | 89 | +// EndCooperationProject 企业结束共创项目 |
| 90 | +func (srv CooperationProjectService) EndCooperationProject(endCooperationProjectCommand *command.EndCooperationProjectCommand) (interface{}, error) { | ||
| 91 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(endCooperationProjectCommand.Operator) | ||
| 92 | + var projectIds []string | ||
| 93 | + for _, v := range endCooperationProjectCommand.CooperationProjectId { | ||
| 94 | + idStr := strconv.Itoa(v) | ||
| 95 | + projectIds = append(projectIds, idStr) | ||
| 96 | + } | ||
| 97 | + _, err := creationCooperationGateway.CooperationProjectBatchEnd(allied_creation_cooperation.ReqCooperationProjectBatchEnd{ | ||
| 98 | + CooperationProjectIds: projectIds, | ||
| 81 | }) | 99 | }) |
| 82 | if err != nil { | 100 | if err != nil { |
| 83 | - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 101 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| 84 | } | 102 | } |
| 85 | - return map[string]interface{}{ | ||
| 86 | - "accessMenus": resultMenu.Menus, | ||
| 87 | - }, nil | 103 | + return endCooperationProjectCommand, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| 88 | } | 104 | } |
| 89 | 105 | ||
| 90 | // SearchCooperationProject 企业获取共创项目列表 | 106 | // SearchCooperationProject 企业获取共创项目列表 |
| @@ -106,3 +122,24 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm | @@ -106,3 +122,24 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm | ||
| 106 | } | 122 | } |
| 107 | return int(result.Total), dataList, nil | 123 | return int(result.Total), dataList, nil |
| 108 | } | 124 | } |
| 125 | + | ||
| 126 | +// PersonSearchCooperationProject 共创用户获取共创项目列表 | ||
| 127 | +func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery *command.PersonSearchCooperationProjectQuery) (int, interface{}, error) { | ||
| 128 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | ||
| 129 | + projectQuery.Operator) | ||
| 130 | + orgidStr := strconv.Itoa(projectQuery.OrgId) | ||
| 131 | + result, err := creationCooperationGateway.CooperationProjectsSearch(allied_creation_cooperation.ReqCooperationProjectSearch{ | ||
| 132 | + PageNumber: projectQuery.PageNumber, | ||
| 133 | + PageSize: projectQuery.PageSize, | ||
| 134 | + OrgIds: []string{orgidStr}, | ||
| 135 | + }) | ||
| 136 | + if err != nil { | ||
| 137 | + return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 138 | + } | ||
| 139 | + var dataList []dto.CooperationProjectItem | ||
| 140 | + for i := range result.List { | ||
| 141 | + item := dto.ToCooperationProjectItem(&result.List[i]) | ||
| 142 | + dataList = append(dataList, *item) | ||
| 143 | + } | ||
| 144 | + return int(result.Total), dataList, nil | ||
| 145 | +} |
| @@ -17,7 +17,7 @@ type CreateCooperationProjectCommand struct { | @@ -17,7 +17,7 @@ type CreateCooperationProjectCommand struct { | ||
| 17 | // 共创项目名称 | 17 | // 共创项目名称 |
| 18 | CooperationProjectName string `json:"cooperationProjectName" valid:"Required"` | 18 | CooperationProjectName string `json:"cooperationProjectName" valid:"Required"` |
| 19 | // 共创发起人id | 19 | // 共创发起人id |
| 20 | - CooperationProjectSponsor string `json:"cooperationProjectSponsor,string,"` | 20 | + CooperationProjectSponsor int `json:"cooperationProjectSponsor,string,"` |
| 21 | // 项目承接对象 | 21 | // 项目承接对象 |
| 22 | CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` | 22 | CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` |
| 23 | // 共创项目描述 | 23 | // 共创项目描述 |
| @@ -11,7 +11,7 @@ type EndCooperationProjectCommand struct { | @@ -11,7 +11,7 @@ type EndCooperationProjectCommand struct { | ||
| 11 | //操作人 | 11 | //操作人 |
| 12 | Operator domain.Operator `json:"-"` | 12 | Operator domain.Operator `json:"-"` |
| 13 | // 共创项目id | 13 | // 共创项目id |
| 14 | - CooperationProjectId []int64 `json:"cooperationProjectId,omitempty"` | 14 | + CooperationProjectId []string `json:"cooperationProjectId,omitempty"` |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | func (endCooperationProjectCommand *EndCooperationProjectCommand) Valid(validation *validation.Validation) { | 17 | func (endCooperationProjectCommand *EndCooperationProjectCommand) Valid(validation *validation.Validation) { |
| @@ -20,13 +20,21 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro | @@ -20,13 +20,21 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro | ||
| 20 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 20 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 21 | } | 21 | } |
| 22 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator) | 22 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator) |
| 23 | + | ||
| 24 | + var images []allied_creation_cooperation.ProjectAttachment | ||
| 25 | + for _, v := range createCooperationProjectCommand.Images { | ||
| 26 | + images = append(images, allied_creation_cooperation.ProjectAttachment{ | ||
| 27 | + Url: v, | ||
| 28 | + }) | ||
| 29 | + } | ||
| 23 | result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ | 30 | result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ |
| 24 | CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, | 31 | CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, |
| 25 | CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, | 32 | CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, |
| 26 | - PublisherUid: strconv.Itoa(int(createCooperationProjectCommand.Operator.UserId)), | 33 | + CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber, |
| 34 | + PublisherUid: int(createCooperationProjectCommand.Operator.UserId), | ||
| 27 | SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, | 35 | SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, |
| 28 | CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, | 36 | CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, |
| 29 | - Images: createCooperationProjectCommand.Images, | 37 | + Attachment: images, |
| 30 | }) | 38 | }) |
| 31 | 39 | ||
| 32 | if err != nil { | 40 | if err != nil { |
| @@ -47,9 +55,14 @@ func (cooperationProjectService *CooperationProjectService) EndCooperationProjec | @@ -47,9 +55,14 @@ func (cooperationProjectService *CooperationProjectService) EndCooperationProjec | ||
| 47 | if err := endCooperationProjectCommand.ValidateCommand(); err != nil { | 55 | if err := endCooperationProjectCommand.ValidateCommand(); err != nil { |
| 48 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 56 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 49 | } | 57 | } |
| 50 | - //creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(endCooperationProjectCommand.Operator) | ||
| 51 | - //TODO 等待接口 | ||
| 52 | - return nil, nil | 58 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(endCooperationProjectCommand.Operator) |
| 59 | + _, err := creationCooperationGateway.CooperationProjectBatchEnd(allied_creation_cooperation.ReqCooperationProjectBatchEnd{ | ||
| 60 | + CooperationProjectIds: endCooperationProjectCommand.CooperationProjectId, | ||
| 61 | + }) | ||
| 62 | + if err != nil { | ||
| 63 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 64 | + } | ||
| 65 | + return endCooperationProjectCommand, nil | ||
| 53 | } | 66 | } |
| 54 | 67 | ||
| 55 | // 返回共创项目管理 | 68 | // 返回共创项目管理 |
| @@ -120,14 +133,21 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | @@ -120,14 +133,21 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | ||
| 120 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 133 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 121 | } | 134 | } |
| 122 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator) | 135 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator) |
| 136 | + var images []allied_creation_cooperation.ProjectAttachment | ||
| 137 | + for _, v := range updateCooperationProjectCommand.Images { | ||
| 138 | + images = append(images, allied_creation_cooperation.ProjectAttachment{ | ||
| 139 | + Url: v, | ||
| 140 | + }) | ||
| 141 | + } | ||
| 123 | _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{ | 142 | _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{ |
| 124 | CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId, | 143 | CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId, |
| 125 | CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName, | 144 | CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName, |
| 145 | + CooperationModeNumber: updateCooperationProjectCommand.CooperationModeNumber, | ||
| 126 | CooperationProjectUndertakerType: updateCooperationProjectCommand.CooperationProjectUndertakerType, | 146 | CooperationProjectUndertakerType: updateCooperationProjectCommand.CooperationProjectUndertakerType, |
| 127 | SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor, | 147 | SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor, |
| 128 | PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)), | 148 | PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)), |
| 129 | CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription, | 149 | CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription, |
| 130 | - Images: updateCooperationProjectCommand.Images, | 150 | + Attachment: images, |
| 131 | }) | 151 | }) |
| 132 | if err != nil { | 152 | if err != nil { |
| 133 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 153 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| @@ -256,3 +256,34 @@ func (gateway HttplibAlliedCreationCooperation) CooperationProjectsCheck(param R | @@ -256,3 +256,34 @@ func (gateway HttplibAlliedCreationCooperation) CooperationProjectsCheck(param R | ||
| 256 | err = gateway.GetResponseData(result, &data) | 256 | err = gateway.GetResponseData(result, &data) |
| 257 | return &data, err | 257 | return &data, err |
| 258 | } | 258 | } |
| 259 | + | ||
| 260 | +//CooperationProjectBatchEnd 批量结束共创项目 | ||
| 261 | +func (gateway HttplibAlliedCreationCooperation) CooperationProjectBatchEnd(param ReqCooperationProjectBatchEnd) (*DataCooperationProjectBatchEnd, error) { | ||
| 262 | + url := gateway.baseUrL + "/cooperation-projects/batch-end" | ||
| 263 | + method := "POST" | ||
| 264 | + req := gateway.CreateRequest(url, method) | ||
| 265 | + log.Logger.Debug("向业务模块请求数据:批量结束共创项目。", map[string]interface{}{ | ||
| 266 | + "api": method + ":" + url, | ||
| 267 | + "param": param, | ||
| 268 | + }) | ||
| 269 | + req, err := req.JSONBody(param) | ||
| 270 | + if err != nil { | ||
| 271 | + return nil, fmt.Errorf("请求批量结束共创项目失败:%w", err) | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + byteResult, err := req.Bytes() | ||
| 275 | + if err != nil { | ||
| 276 | + return nil, fmt.Errorf("批量结束共创项目失败:%w", err) | ||
| 277 | + } | ||
| 278 | + log.Logger.Debug("获取业务模块请求数据:批量结束共创项目。", map[string]interface{}{ | ||
| 279 | + "result": string(byteResult), | ||
| 280 | + }) | ||
| 281 | + var result service_gateway.GatewayResponse | ||
| 282 | + err = json.Unmarshal(byteResult, &result) | ||
| 283 | + if err != nil { | ||
| 284 | + return nil, fmt.Errorf("解析批量结束共创项目:%w", err) | ||
| 285 | + } | ||
| 286 | + var data DataCooperationProjectBatchEnd | ||
| 287 | + err = gateway.GetResponseData(result, &data) | ||
| 288 | + return &data, err | ||
| 289 | +} |
| @@ -228,6 +228,7 @@ type ( | @@ -228,6 +228,7 @@ type ( | ||
| 228 | CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创项目编号 | 228 | CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创项目编号 |
| 229 | PageNumber int `json:"pageNumber"` | 229 | PageNumber int `json:"pageNumber"` |
| 230 | PageSize int `json:"pageSize"` | 230 | PageSize int `json:"pageSize"` |
| 231 | + CompanyId int `json:"companyId"` | ||
| 231 | } | 232 | } |
| 232 | 233 | ||
| 233 | DataCooperationApplicationSearch struct { | 234 | DataCooperationApplicationSearch struct { |
| @@ -62,10 +62,12 @@ type ( | @@ -62,10 +62,12 @@ type ( | ||
| 62 | ReqCooperationProjectAdd struct { | 62 | ReqCooperationProjectAdd struct { |
| 63 | CooperationProjectDescription string `json:"cooperationProjectDescription"` | 63 | CooperationProjectDescription string `json:"cooperationProjectDescription"` |
| 64 | CooperationProjectName string `json:"cooperationProjectName"` | 64 | CooperationProjectName string `json:"cooperationProjectName"` |
| 65 | - PublisherUid string `json:"publisherUid"` | ||
| 66 | - SponsorUid string `json:"sponsorUid"` | 65 | + CooperationModeNumber string `json:"cooperationModeNumber"` |
| 66 | + PublisherUid int `json:"publisherUid,string"` | ||
| 67 | + SponsorUid int `json:"sponsorUid,string"` | ||
| 68 | + DepartmentId int `json:"departmentId,string"` | ||
| 67 | CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` | 69 | CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` |
| 68 | - Images []string `json:"images"` | 70 | + Attachment []ProjectAttachment `json:"attachment"` |
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | DataCooperationProjectAdd struct { | 73 | DataCooperationProjectAdd struct { |
| @@ -100,6 +102,7 @@ type ( | @@ -100,6 +102,7 @@ type ( | ||
| 100 | CooperationProjectId string `json:"cooperationProjectId" ` | 102 | CooperationProjectId string `json:"cooperationProjectId" ` |
| 101 | // 共创项目名称 | 103 | // 共创项目名称 |
| 102 | CooperationProjectName string `json:"cooperationProjectName"` | 104 | CooperationProjectName string `json:"cooperationProjectName"` |
| 105 | + CooperationModeNumber string `json:"cooperationModeNumber"` | ||
| 103 | // 承接对象,1员工,2共创用户,3公开,可以多选 | 106 | // 承接对象,1员工,2共创用户,3公开,可以多选 |
| 104 | CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerType"` | 107 | CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerType"` |
| 105 | // 共创项目发起人uid | 108 | // 共创项目发起人uid |
| @@ -108,7 +111,7 @@ type ( | @@ -108,7 +111,7 @@ type ( | ||
| 108 | PublisherUid string `json:"publisherUid"` | 111 | PublisherUid string `json:"publisherUid"` |
| 109 | // 共创项目描述 | 112 | // 共创项目描述 |
| 110 | CooperationProjectDescription string `json:"cooperationProjectDescription"` | 113 | CooperationProjectDescription string `json:"cooperationProjectDescription"` |
| 111 | - Images []string `json:"images"` | 114 | + Attachment []ProjectAttachment `json:"attachment"` |
| 112 | } | 115 | } |
| 113 | 116 | ||
| 114 | DataCooperationProjectUpdate struct { | 117 | DataCooperationProjectUpdate struct { |
| @@ -146,6 +149,8 @@ type ( | @@ -146,6 +149,8 @@ type ( | ||
| 146 | CooperationProjectName string `json:"cooperationProjectName"` | 149 | CooperationProjectName string `json:"cooperationProjectName"` |
| 147 | // 共创项目状态,1招标中,2结束 0 全部 | 150 | // 共创项目状态,1招标中,2结束 0 全部 |
| 148 | Status int `json:"status"` | 151 | Status int `json:"status"` |
| 152 | + // | ||
| 153 | + OrgIds []string `json:"orgIds"` | ||
| 149 | } | 154 | } |
| 150 | 155 | ||
| 151 | DataCooperationProjectSearch struct { | 156 | DataCooperationProjectSearch struct { |
| @@ -164,3 +169,13 @@ type ( | @@ -164,3 +169,13 @@ type ( | ||
| 164 | DataCooperationProjectsCheck struct { | 169 | DataCooperationProjectsCheck struct { |
| 165 | } | 170 | } |
| 166 | ) | 171 | ) |
| 172 | + | ||
| 173 | +// 批量结束项目 | ||
| 174 | +type ( | ||
| 175 | + ReqCooperationProjectBatchEnd struct { | ||
| 176 | + CooperationProjectIds []string `json:"cooperationProjectId"` | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + DataCooperationProjectBatchEnd struct { | ||
| 180 | + } | ||
| 181 | +) |
| @@ -198,6 +198,19 @@ func (controller *CooperationController) SearchCooperationProject() { | @@ -198,6 +198,19 @@ func (controller *CooperationController) SearchCooperationProject() { | ||
| 198 | controller.Response(data, err) | 198 | controller.Response(data, err) |
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | +func (controller *CooperationController) PersonSearchCooperationProject() { | ||
| 202 | + svr := service.CooperationProjectService{} | ||
| 203 | + cmd := &command.PersonSearchCooperationProjectQuery{} | ||
| 204 | + err := controller.Unmarshal(cmd) | ||
| 205 | + if err != nil { | ||
| 206 | + controller.Response(nil, err) | ||
| 207 | + return | ||
| 208 | + } | ||
| 209 | + cmd.Operator = controller.GetOperator() | ||
| 210 | + _, data, err := svr.PersonSearchCooperationProject(cmd) | ||
| 211 | + controller.Response(data, err) | ||
| 212 | +} | ||
| 213 | + | ||
| 201 | /***** CompanyCreditAccountService 企业端账期结算 *****/ | 214 | /***** CompanyCreditAccountService 企业端账期结算 *****/ |
| 202 | func (controller *CooperationController) CreditAccountSearch() { | 215 | func (controller *CooperationController) CreditAccountSearch() { |
| 203 | svr := service.CompanyCreditAccountService{} | 216 | svr := service.CompanyCreditAccountService{} |
| @@ -62,8 +62,10 @@ func (controller *CooperationProjectController) ListCooperationProject() { | @@ -62,8 +62,10 @@ func (controller *CooperationProjectController) ListCooperationProject() { | ||
| 62 | func (controller *CooperationProjectController) EndCooperationProject() { | 62 | func (controller *CooperationProjectController) EndCooperationProject() { |
| 63 | cooperationProjectService := service.NewCooperationProjectService(nil) | 63 | cooperationProjectService := service.NewCooperationProjectService(nil) |
| 64 | endCooperationProjectCommand := &command.EndCooperationProjectCommand{} | 64 | endCooperationProjectCommand := &command.EndCooperationProjectCommand{} |
| 65 | - controller.Unmarshal(endCooperationProjectCommand) | ||
| 66 | - //TODO | 65 | + err := controller.Unmarshal(endCooperationProjectCommand) |
| 66 | + if err != nil { | ||
| 67 | + log.Logger.Debug("json err:" + err.Error()) | ||
| 68 | + } | ||
| 67 | endCooperationProjectCommand.Operator = controller.GetOperator() | 69 | endCooperationProjectCommand.Operator = controller.GetOperator() |
| 68 | data, err := cooperationProjectService.EndCooperationProject(endCooperationProjectCommand) | 70 | data, err := cooperationProjectService.EndCooperationProject(endCooperationProjectCommand) |
| 69 | controller.Response(data, err) | 71 | controller.Response(data, err) |
| @@ -13,11 +13,11 @@ func init() { | @@ -13,11 +13,11 @@ func init() { | ||
| 13 | web.Router("/v1/web/cooperation-projects/end", &web_client.CooperationProjectController{}, "Put:EndCooperationProject") | 13 | web.Router("/v1/web/cooperation-projects/end", &web_client.CooperationProjectController{}, "Put:EndCooperationProject") |
| 14 | 14 | ||
| 15 | /***** 1.共创模式 *****/ | 15 | /***** 1.共创模式 *****/ |
| 16 | - web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Post:CreateCooperationMode") | ||
| 17 | - web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Put:UpdateCooperationMode") | ||
| 18 | - web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Get:GetCooperationMode") | ||
| 19 | - web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Delete:RemoveCooperationMode") | ||
| 20 | - web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:SearchCooperationMode") | ||
| 21 | - web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Get:ListCooperationMode") | 16 | + // web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Post:CreateCooperationMode") |
| 17 | + // web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Put:UpdateCooperationMode") | ||
| 18 | + // web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Get:GetCooperationMode") | ||
| 19 | + // web.Router("/v1/web/cooperation-modes/:cooperationModeId", &web_client.CooperationModeController{}, "Delete:RemoveCooperationMode") | ||
| 20 | + // web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:SearchCooperationMode") | ||
| 21 | + // web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Get:ListCooperationMode") | ||
| 22 | 22 | ||
| 23 | } | 23 | } |
-
请 注册 或 登录 后发表评论