正在显示
5 个修改的文件
包含
47 行增加
和
0 行删除
@@ -20,6 +20,7 @@ type ListCooperationProjectQuery struct { | @@ -20,6 +20,7 @@ type ListCooperationProjectQuery struct { | ||
20 | DepartmentName string `json:"departmentName"` | 20 | DepartmentName string `json:"departmentName"` |
21 | //项目名称 | 21 | //项目名称 |
22 | CooperationProjectName string `json:"cooperationProjectName"` | 22 | CooperationProjectName string `json:"cooperationProjectName"` |
23 | + CooperationProjectNumberLike string `json:"cooperationProjectNumberLike"` | ||
23 | } | 24 | } |
24 | 25 | ||
25 | func (listCooperationProjectQuery *ListCooperationProjectQuery) Valid(validation *validation.Validation) { | 26 | func (listCooperationProjectQuery *ListCooperationProjectQuery) Valid(validation *validation.Validation) { |
@@ -160,6 +160,37 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | @@ -160,6 +160,37 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro | ||
160 | return updateCooperationProjectCommand, nil | 160 | return updateCooperationProjectCommand, nil |
161 | } | 161 | } |
162 | 162 | ||
163 | +// 返回共创项目管理列表 | ||
164 | +func (cooperationProjectService *CooperationProjectService) ListCooperationProjectSelector(listCooperationProjectQuery *query.ListCooperationProjectQuery) (int64, interface{}, error) { | ||
165 | + listCooperationProjectQuery.PageSize = 999 | ||
166 | + if err := listCooperationProjectQuery.ValidateQuery(); err != nil { | ||
167 | + return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
168 | + } | ||
169 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationProjectQuery.Operator) | ||
170 | + result, err := creationCooperationGateway.CooperationProjectsSearch(allied_creation_cooperation.ReqCooperationProjectSearch{ | ||
171 | + PageNumber: listCooperationProjectQuery.PageNumber, | ||
172 | + PageSize: listCooperationProjectQuery.PageSize, | ||
173 | + //发起部门名称 | ||
174 | + DepartmentName: listCooperationProjectQuery.DepartmentName, | ||
175 | + //项目名 | ||
176 | + CooperationProjectName: listCooperationProjectQuery.CooperationProjectName, | ||
177 | + CooperationProjectNumberLike: listCooperationProjectQuery.CooperationProjectNumberLike, | ||
178 | + }) | ||
179 | + if err != nil { | ||
180 | + return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
181 | + } | ||
182 | + var items []interface{} | ||
183 | + for i := range result.List { | ||
184 | + item := result.List[i] | ||
185 | + items = append(items, map[string]interface{}{ | ||
186 | + "cooperationProjectId": item.CooperationProjectID, | ||
187 | + "cooperationProjectNumber": item.CooperationProjectNumber, | ||
188 | + "cooperationProjectName": item.CooperationProjectName, | ||
189 | + }) | ||
190 | + } | ||
191 | + return int64(result.Total), items, nil | ||
192 | +} | ||
193 | + | ||
163 | func NewCooperationProjectService(options map[string]interface{}) *CooperationProjectService { | 194 | func NewCooperationProjectService(options map[string]interface{}) *CooperationProjectService { |
164 | newCooperationProjectService := &CooperationProjectService{} | 195 | newCooperationProjectService := &CooperationProjectService{} |
165 | return newCooperationProjectService | 196 | return newCooperationProjectService |
@@ -161,6 +161,8 @@ type ( | @@ -161,6 +161,8 @@ type ( | ||
161 | Status int `json:"status"` | 161 | Status int `json:"status"` |
162 | // | 162 | // |
163 | OrgIds []string `json:"orgIds"` | 163 | OrgIds []string `json:"orgIds"` |
164 | + CooperationProjectNumberLike string `json:"cooperationProjectNumberLike"` | ||
165 | + //OffsetLimitFlag bool `json:"offsetLimitFlag"` | ||
164 | } | 166 | } |
165 | 167 | ||
166 | DataCooperationProjectSearch struct { | 168 | DataCooperationProjectSearch struct { |
@@ -59,6 +59,18 @@ func (controller *CooperationProjectController) ListCooperationProject() { | @@ -59,6 +59,18 @@ func (controller *CooperationProjectController) ListCooperationProject() { | ||
59 | controller.ReturnPageListData(cnt, data, err, listCooperationProjectQuery.PageNumber) | 59 | controller.ReturnPageListData(cnt, data, err, listCooperationProjectQuery.PageNumber) |
60 | } | 60 | } |
61 | 61 | ||
62 | +func (controller *CooperationProjectController) SelectorCooperationProject() { | ||
63 | + cooperationProjectService := service.NewCooperationProjectService(nil) | ||
64 | + listCooperationProjectQuery := &query.ListCooperationProjectQuery{} | ||
65 | + err := controller.Unmarshal(listCooperationProjectQuery) | ||
66 | + if err != nil { | ||
67 | + log.Logger.Debug("json err:" + err.Error()) | ||
68 | + } | ||
69 | + listCooperationProjectQuery.Operator = controller.GetOperator() | ||
70 | + cnt, data, err := cooperationProjectService.ListCooperationProjectSelector(listCooperationProjectQuery) | ||
71 | + controller.ReturnListData(cnt, data, err) | ||
72 | +} | ||
73 | + | ||
62 | func (controller *CooperationProjectController) EndCooperationProject() { | 74 | func (controller *CooperationProjectController) EndCooperationProject() { |
63 | cooperationProjectService := service.NewCooperationProjectService(nil) | 75 | cooperationProjectService := service.NewCooperationProjectService(nil) |
64 | endCooperationProjectCommand := &command.EndCooperationProjectCommand{} | 76 | endCooperationProjectCommand := &command.EndCooperationProjectCommand{} |
@@ -11,6 +11,7 @@ func init() { | @@ -11,6 +11,7 @@ func init() { | ||
11 | web.Router("/v1/web/cooperation-projects/:projectId", &web_client.CooperationProjectController{}, "Get:GetCooperationProject") | 11 | web.Router("/v1/web/cooperation-projects/:projectId", &web_client.CooperationProjectController{}, "Get:GetCooperationProject") |
12 | web.Router("/v1/web/cooperation-projects/search", &web_client.CooperationProjectController{}, "Post:ListCooperationProject") | 12 | web.Router("/v1/web/cooperation-projects/search", &web_client.CooperationProjectController{}, "Post:ListCooperationProject") |
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 | + web.Router("/v1/web/cooperation-projects/selector", &web_client.CooperationProjectController{}, "Post:SelectorCooperationProject") | ||
14 | 15 | ||
15 | /***** 1.共创模式 *****/ | 16 | /***** 1.共创模式 *****/ |
16 | // web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Post:CreateCooperationMode") | 17 | // web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Post:CreateCooperationMode") |
-
请 注册 或 登录 后发表评论