正在显示
13 个修改的文件
包含
181 行增加
和
53 行删除
@@ -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) { |
@@ -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 | /***** 共创用户端 *****/ |
1 | package service | 1 | package service |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "strconv" | ||
5 | + | ||
4 | "github.com/linmadan/egglib-go/core/application" | 6 | "github.com/linmadan/egglib-go/core/application" |
5 | "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" |
6 | "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" |
7 | "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" |
8 | - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" | ||
9 | ) | 10 | ) |
10 | 11 | ||
11 | // CooperationProjectService 共创项目服务 | 12 | // CooperationProjectService 共创项目服务 |
@@ -18,13 +19,19 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP | @@ -18,13 +19,19 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP | ||
18 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 19 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
19 | } | 20 | } |
20 | 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 | + } | ||
21 | result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ | 28 | result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ |
22 | CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, | 29 | CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, |
23 | CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, | 30 | CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, |
24 | PublisherUid: int(createCooperationProjectCommand.Operator.UserId), | 31 | PublisherUid: int(createCooperationProjectCommand.Operator.UserId), |
25 | SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, | 32 | SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, |
26 | CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, | 33 | CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, |
27 | - // Images: createCooperationProjectCommand.Images, | 34 | + Attachment: images, |
28 | }) | 35 | }) |
29 | 36 | ||
30 | if err != nil { | 37 | if err != nil { |
@@ -55,34 +62,45 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command | @@ -55,34 +62,45 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command | ||
55 | } | 62 | } |
56 | 63 | ||
57 | // UpdateCooperationProject | 64 | // UpdateCooperationProject |
58 | -//TODO 企业更新共创项目 | ||
59 | -func (srv CooperationProjectService) UpdateCooperationProject(userMenusCommand *command.UpdateCooperationProjectCommand) (interface{}, error) { | ||
60 | - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( | ||
61 | - userMenusCommand.Operator) | ||
62 | - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{ | ||
63 | - 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, | ||
64 | }) | 82 | }) |
65 | if err != nil { | 83 | if err != nil { |
66 | - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 84 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
67 | } | 85 | } |
68 | - return map[string]interface{}{ | ||
69 | - "accessMenus": resultMenu.Menus, | ||
70 | - }, nil | 86 | + return updateCooperationProjectCommand, nil |
71 | } | 87 | } |
72 | 88 | ||
73 | -// EndCooperationProject TODO:企业结束共创项目 | ||
74 | -func (srv CooperationProjectService) EndCooperationProject(userMenusCommand *command.EndCooperationProjectCommand) (interface{}, error) { | ||
75 | - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( | ||
76 | - userMenusCommand.Operator) | ||
77 | - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{ | ||
78 | - 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, | ||
79 | }) | 99 | }) |
80 | if err != nil { | 100 | if err != nil { |
81 | - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 101 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
82 | } | 102 | } |
83 | - return map[string]interface{}{ | ||
84 | - "accessMenus": resultMenu.Menus, | ||
85 | - }, nil | 103 | + return endCooperationProjectCommand, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
86 | } | 104 | } |
87 | 105 | ||
88 | // SearchCooperationProject 企业获取共创项目列表 | 106 | // SearchCooperationProject 企业获取共创项目列表 |
@@ -104,3 +122,24 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm | @@ -104,3 +122,24 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm | ||
104 | } | 122 | } |
105 | return int(result.Total), dataList, nil | 123 | return int(result.Total), dataList, nil |
106 | } | 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 | +} |
@@ -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,14 +20,21 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro | @@ -20,14 +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, |
33 | + CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber, | ||
26 | PublisherUid: int(createCooperationProjectCommand.Operator.UserId), | 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, | ||
30 | - //TODO | 37 | + Attachment: images, |
31 | }) | 38 | }) |
32 | 39 | ||
33 | if err != nil { | 40 | if err != nil { |
@@ -48,9 +55,14 @@ func (cooperationProjectService *CooperationProjectService) EndCooperationProjec | @@ -48,9 +55,14 @@ func (cooperationProjectService *CooperationProjectService) EndCooperationProjec | ||
48 | if err := endCooperationProjectCommand.ValidateCommand(); err != nil { | 55 | if err := endCooperationProjectCommand.ValidateCommand(); err != nil { |
49 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 56 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
50 | } | 57 | } |
51 | - //creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(endCooperationProjectCommand.Operator) | ||
52 | - //TODO 等待接口 | ||
53 | - 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 | ||
54 | } | 66 | } |
55 | 67 | ||
56 | // 返回共创项目管理 | 68 | // 返回共创项目管理 |
@@ -121,14 +133,21 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | @@ -121,14 +133,21 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | ||
121 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 133 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
122 | } | 134 | } |
123 | 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 | + } | ||
124 | _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{ | 142 | _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{ |
125 | CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId, | 143 | CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId, |
126 | CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName, | 144 | CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName, |
145 | + CooperationModeNumber: updateCooperationProjectCommand.CooperationModeNumber, | ||
127 | CooperationProjectUndertakerType: updateCooperationProjectCommand.CooperationProjectUndertakerType, | 146 | CooperationProjectUndertakerType: updateCooperationProjectCommand.CooperationProjectUndertakerType, |
128 | SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor, | 147 | SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor, |
129 | PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)), | 148 | PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)), |
130 | CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription, | 149 | CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription, |
131 | - Images: updateCooperationProjectCommand.Images, | 150 | + Attachment: images, |
132 | }) | 151 | }) |
133 | if err != nil { | 152 | if err != nil { |
134 | 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,6 +62,7 @@ type ( | @@ -62,6 +62,7 @@ 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 | + CooperationModeNumber string `json:"cooperationModeNumber"` | ||
65 | PublisherUid int `json:"publisherUid,string"` | 66 | PublisherUid int `json:"publisherUid,string"` |
66 | SponsorUid int `json:"sponsorUid,string"` | 67 | SponsorUid int `json:"sponsorUid,string"` |
67 | DepartmentId int `json:"departmentId,string"` | 68 | DepartmentId int `json:"departmentId,string"` |
@@ -101,6 +102,7 @@ type ( | @@ -101,6 +102,7 @@ type ( | ||
101 | CooperationProjectId string `json:"cooperationProjectId" ` | 102 | CooperationProjectId string `json:"cooperationProjectId" ` |
102 | // 共创项目名称 | 103 | // 共创项目名称 |
103 | CooperationProjectName string `json:"cooperationProjectName"` | 104 | CooperationProjectName string `json:"cooperationProjectName"` |
105 | + CooperationModeNumber string `json:"cooperationModeNumber"` | ||
104 | // 承接对象,1员工,2共创用户,3公开,可以多选 | 106 | // 承接对象,1员工,2共创用户,3公开,可以多选 |
105 | CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerType"` | 107 | CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerType"` |
106 | // 共创项目发起人uid | 108 | // 共创项目发起人uid |
@@ -108,8 +110,8 @@ type ( | @@ -108,8 +110,8 @@ type ( | ||
108 | // 共创项目发布人uid | 110 | // 共创项目发布人uid |
109 | PublisherUid string `json:"publisherUid"` | 111 | PublisherUid string `json:"publisherUid"` |
110 | // 共创项目描述 | 112 | // 共创项目描述 |
111 | - CooperationProjectDescription string `json:"cooperationProjectDescription"` | ||
112 | - Images []string `json:"images"` | 113 | + CooperationProjectDescription string `json:"cooperationProjectDescription"` |
114 | + Attachment []ProjectAttachment `json:"attachment"` | ||
113 | } | 115 | } |
114 | 116 | ||
115 | DataCooperationProjectUpdate struct { | 117 | DataCooperationProjectUpdate struct { |
@@ -147,6 +149,8 @@ type ( | @@ -147,6 +149,8 @@ type ( | ||
147 | CooperationProjectName string `json:"cooperationProjectName"` | 149 | CooperationProjectName string `json:"cooperationProjectName"` |
148 | // 共创项目状态,1招标中,2结束 0 全部 | 150 | // 共创项目状态,1招标中,2结束 0 全部 |
149 | Status int `json:"status"` | 151 | Status int `json:"status"` |
152 | + // | ||
153 | + OrgIds []string `json:"orgIds"` | ||
150 | } | 154 | } |
151 | 155 | ||
152 | DataCooperationProjectSearch struct { | 156 | DataCooperationProjectSearch struct { |
@@ -165,3 +169,13 @@ type ( | @@ -165,3 +169,13 @@ type ( | ||
165 | DataCooperationProjectsCheck struct { | 169 | DataCooperationProjectsCheck struct { |
166 | } | 170 | } |
167 | ) | 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 | } |
-
请 注册 或 登录 后发表评论