作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev

# Conflicts:
#	pkg/application/web/users/service/users.go
@@ -23,7 +23,7 @@ type CreateCooperationProjectCommand struct { @@ -23,7 +23,7 @@ type CreateCooperationProjectCommand struct {
23 // 共创项目描述 23 // 共创项目描述
24 CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"` 24 CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"`
25 //图片 25 //图片
26 - Images []string `json:"images"` 26 + Images []*domain.Attachment `json:"images"`
27 } 27 }
28 28
29 func (createCooperationProjectCommand *CreateCooperationProjectCommand) Valid(validation *validation.Validation) { 29 func (createCooperationProjectCommand *CreateCooperationProjectCommand) Valid(validation *validation.Validation) {
@@ -25,7 +25,7 @@ type UpdateCooperationProjectCommand struct { @@ -25,7 +25,7 @@ type UpdateCooperationProjectCommand struct {
25 // 共创项目描述 25 // 共创项目描述
26 CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"` 26 CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"`
27 //图片 27 //图片
28 - Images []string `json:"images"` 28 + Images []domain.Attachment `json:"images"`
29 } 29 }
30 30
31 func (updateCooperationProjectCommand *UpdateCooperationProjectCommand) Valid(validation *validation.Validation) { 31 func (updateCooperationProjectCommand *UpdateCooperationProjectCommand) Valid(validation *validation.Validation) {
@@ -24,7 +24,7 @@ type CooperationProjectInfo struct { @@ -24,7 +24,7 @@ type CooperationProjectInfo struct {
24 CooperationModeNumber string `json:"cooperationModeNumber"` 24 CooperationModeNumber string `json:"cooperationModeNumber"`
25 } `json:"cooperationMode"` //项目模式 25 } `json:"cooperationMode"` //项目模式
26 CooperationProjectDescription string `json:"cooperationProjectDescription"` 26 CooperationProjectDescription string `json:"cooperationProjectDescription"`
27 - Attachment []domain.Attachment `json:"attachment"` //图片附件 27 + Images []domain.Attachment `json:"images"` //图片附件
28 CooperationProjectId int `json:"cooperationProjectId,string,"` 28 CooperationProjectId int `json:"cooperationProjectId,string,"`
29 CooperationProjectName string `json:"cooperationProjectName"` 29 CooperationProjectName string `json:"cooperationProjectName"`
30 CooperationProjectNumber string `json:"cooperationProjectNumber"` 30 CooperationProjectNumber string `json:"cooperationProjectNumber"`
@@ -64,7 +64,7 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj @@ -64,7 +64,7 @@ func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProj
64 CooperationProjectUndertakerType: param.CooperationProjectUndertakerType, 64 CooperationProjectUndertakerType: param.CooperationProjectUndertakerType,
65 Department: param.Department, 65 Department: param.Department,
66 Status: param.Status, 66 Status: param.Status,
67 - Attachment: param.Attachment, 67 + Images: param.Attachment,
68 } 68 }
69 69
70 data.CooperationProjectSponsor.UsersCode = param.CooperationProjectSponsor.UserInfo.UsersCode 70 data.CooperationProjectSponsor.UsersCode = param.CooperationProjectSponsor.UserInfo.UsersCode
@@ -7,7 +7,6 @@ import ( @@ -7,7 +7,6 @@ import (
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/command" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/command"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/dto" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/dto"
9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/query" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/query"
10 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"  
11 "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_cooperation"
12 ) 11 )
13 12
@@ -22,12 +21,6 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro @@ -22,12 +21,6 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
22 } 21 }
23 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator) 22 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
24 23
25 - var images []*domain.Attachment  
26 - for _, v := range createCooperationProjectCommand.Images {  
27 - images = append(images, &domain.Attachment{  
28 - Url: v,  
29 - })  
30 - }  
31 result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ 24 result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{
32 CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, 25 CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription,
33 CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, 26 CooperationProjectName: createCooperationProjectCommand.CooperationProjectName,
@@ -36,7 +29,7 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro @@ -36,7 +29,7 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
36 SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, 29 SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor,
37 DepartmentId: int(createCooperationProjectCommand.DepartmentId), 30 DepartmentId: int(createCooperationProjectCommand.DepartmentId),
38 CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, 31 CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType,
39 - Attachment: images, 32 + Attachment: createCooperationProjectCommand.Images,
40 }) 33 })
41 34
42 if err != nil { 35 if err != nil {
@@ -141,12 +134,6 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro @@ -141,12 +134,6 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
141 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 134 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
142 } 135 }
143 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator) 136 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
144 - var images []domain.Attachment  
145 - for _, v := range updateCooperationProjectCommand.Images {  
146 - images = append(images, domain.Attachment{  
147 - Url: v,  
148 - })  
149 - }  
150 _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{ 137 _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
151 CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId, 138 CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId,
152 CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName, 139 CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName,
@@ -155,7 +142,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro @@ -155,7 +142,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
155 SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor, 142 SponsorUid: updateCooperationProjectCommand.CooperationProjectSponsor,
156 PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)), 143 PublisherUid: strconv.Itoa(int(updateCooperationProjectCommand.Operator.UserId)),
157 CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription, 144 CooperationProjectDescription: updateCooperationProjectCommand.CooperationProjectDescription,
158 - Attachment: images, 145 + Attachment: updateCooperationProjectCommand.Images,
159 DepartmentId: updateCooperationProjectCommand.DepartmentId, 146 DepartmentId: updateCooperationProjectCommand.DepartmentId,
160 }) 147 })
161 if err != nil { 148 if err != nil {
@@ -165,7 +152,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro @@ -165,7 +152,7 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
165 return updateCooperationProjectCommand, nil 152 return updateCooperationProjectCommand, nil
166 } 153 }
167 154
168 -// 返回共创项目管理列表 155 +// 返回共创项目管理列表下拉选择框
169 func (cooperationProjectService *CooperationProjectService) ListCooperationProjectSelector(listCooperationProjectQuery *query.ListCooperationProjectQuery) (int64, interface{}, error) { 156 func (cooperationProjectService *CooperationProjectService) ListCooperationProjectSelector(listCooperationProjectQuery *query.ListCooperationProjectQuery) (int64, interface{}, error) {
170 listCooperationProjectQuery.PageSize = 999 157 listCooperationProjectQuery.PageSize = 999
171 if err := listCooperationProjectQuery.ValidateQuery(); err != nil { 158 if err := listCooperationProjectQuery.ValidateQuery(); err != nil {
@@ -17,7 +17,7 @@ type CooperationApplication struct { @@ -17,7 +17,7 @@ type CooperationApplication struct {
17 UserAccount string `json:"userAccount"` 17 UserAccount string `json:"userAccount"`
18 } `json:"userInfo"` 18 } `json:"userInfo"`
19 Department struct { 19 Department struct {
20 - // 部门ID,通过REST集成上下文获取 20 + // 部门ID,
21 DepartmentId int64 `json:"departmentId"` 21 DepartmentId int64 `json:"departmentId"`
22 // 部门名称 22 // 部门名称
23 DepartmentName string `json:"departmentName"` 23 DepartmentName string `json:"departmentName"`