作者 tangxuhui

修正添加项目

@@ -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) {
@@ -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 {
@@ -350,7 +350,7 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu @@ -350,7 +350,7 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu
350 } 350 }
351 var deadline int64 351 var deadline int64
352 if !result.CooperationInfo.CooperationDeadline.IsZero() { 352 if !result.CooperationInfo.CooperationDeadline.IsZero() {
353 - deadline = result.CooperationInfo.CooperationDeadline.Unix() 353 + deadline = result.CooperationInfo.CooperationDeadline.UnixNano() / 1e6
354 } 354 }
355 userInfo := dto.CooperationUserInfo{ 355 userInfo := dto.CooperationUserInfo{
356 UserId: strconv.Itoa(result.UserId), 356 UserId: strconv.Itoa(result.UserId),
@@ -435,10 +435,15 @@ func (usersService *UsersService) CooperationUserResetPassword(cooperationUserRe @@ -435,10 +435,15 @@ func (usersService *UsersService) CooperationUserResetPassword(cooperationUserRe
435 func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCommand *command.CooperationUserUpdateCommand) (interface{}, error) { 435 func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCommand *command.CooperationUserUpdateCommand) (interface{}, error) {
436 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 436 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
437 cooperationUserUpdateCommand.Operator) 437 cooperationUserUpdateCommand.Operator)
  438 + var cooperationDeadline time.Time
  439 + if cooperationUserUpdateCommand.CooperationDeadline > 0 {
  440 + cooperationDeadline = time.Unix(cooperationUserUpdateCommand.CooperationDeadline, 0)
  441 + }
  442 +
438 _, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{ 443 _, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{
439 UserId: cooperationUserUpdateCommand.UserId, 444 UserId: cooperationUserUpdateCommand.UserId,
440 CooperationCompany: cooperationUserUpdateCommand.CooperationCompany, 445 CooperationCompany: cooperationUserUpdateCommand.CooperationCompany,
441 - CooperationDeadline: time.Unix(cooperationUserUpdateCommand.CooperationDeadline, 0), 446 + CooperationDeadline: cooperationDeadline,
442 Email: cooperationUserUpdateCommand.Email, 447 Email: cooperationUserUpdateCommand.Email,
443 EnableStatus: cooperationUserUpdateCommand.EnableStatus, 448 EnableStatus: cooperationUserUpdateCommand.EnableStatus,
444 UserCode: cooperationUserUpdateCommand.UserCode, 449 UserCode: cooperationUserUpdateCommand.UserCode,
@@ -550,7 +555,7 @@ func (usersService *UsersService) GetInitPassword(operator domain.Operator) (str @@ -550,7 +555,7 @@ func (usersService *UsersService) GetInitPassword(operator domain.Operator) (str
550 var password string 555 var password string
551 alliedCreationBasic := allied_creation_basic.NewHttplibAlliedCreationBasic(operator) 556 alliedCreationBasic := allied_creation_basic.NewHttplibAlliedCreationBasic(operator)
552 reqResult, err := alliedCreationBasic.SystemSettingGet(allied_creation_basic.ReqSystemSettingGet{ 557 reqResult, err := alliedCreationBasic.SystemSettingGet(allied_creation_basic.ReqSystemSettingGet{
553 - domain.InitPasswordSettingKey, 558 + SettingCode: domain.InitPasswordSettingKey,
554 }) 559 })
555 if err != nil { 560 if err != nil {
556 log.Logger.Error(err.Error()) 561 log.Logger.Error(err.Error())
@@ -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"`