作者 yangfu

共创申请修改

@@ -12,7 +12,7 @@ type GetCooperationApplicationQuery struct { @@ -12,7 +12,7 @@ type GetCooperationApplicationQuery struct {
12 //操作人 12 //操作人
13 Operator domain.Operator `json:"-"` 13 Operator domain.Operator `json:"-"`
14 // 共创申请ID 14 // 共创申请ID
15 - CooperationApplicationId int `json:"cooperationApplicationId,string" valid:"Required"` 15 + CooperationApplicationId int64 `json:"cooperationApplicationId" valid:"Required"`
16 } 16 }
17 17
18 func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) { 18 func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) {
@@ -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 + Attachment []*domain.Attachment `json:"attachment"`
27 } 27 }
28 28
29 func (createCooperationProjectCommand *CreateCooperationProjectCommand) Valid(validation *validation.Validation) { 29 func (createCooperationProjectCommand *CreateCooperationProjectCommand) Valid(validation *validation.Validation) {
@@ -19,7 +19,7 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application @@ -19,7 +19,7 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application
19 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 19 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
20 applicationQuery.Operator) 20 applicationQuery.Operator)
21 resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{ 21 resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
22 - CooperationApplicationId: applicationQuery.CooperationApplicationId, 22 + CooperationApplicationId: int(applicationQuery.CooperationApplicationId),
23 }) 23 })
24 if err != nil { 24 if err != nil {
25 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 25 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -103,7 +103,7 @@ func (srv CooperationApplicationsService) PersonGetCooperationApplications(appli @@ -103,7 +103,7 @@ func (srv CooperationApplicationsService) PersonGetCooperationApplications(appli
103 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 103 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
104 applicationQuery.Operator) 104 applicationQuery.Operator)
105 resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{ 105 resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
106 - CooperationApplicationId: applicationQuery.CooperationApplicationId, 106 + CooperationApplicationId: int(applicationQuery.CooperationApplicationId),
107 }) 107 })
108 if err != nil { 108 if err != nil {
109 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 109 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -20,12 +20,12 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP @@ -20,12 +20,12 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
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 - var images []domain.Attachment  
24 - for _, v := range createCooperationProjectCommand.Images {  
25 - images = append(images, domain.Attachment{  
26 - Url: v,  
27 - })  
28 - } 23 + //var images []domain.Attachment
  24 + //for _, v := range createCooperationProjectCommand.Attachment {
  25 + // images = append(images, domain.Attachment{
  26 + // Url: v,
  27 + // })
  28 + //}
29 result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ 29 result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{
30 CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, 30 CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription,
31 CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber, 31 CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber,
@@ -33,7 +33,7 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP @@ -33,7 +33,7 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
33 PublisherUid: int(createCooperationProjectCommand.Operator.UserId), 33 PublisherUid: int(createCooperationProjectCommand.Operator.UserId),
34 SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, 34 SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor,
35 CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, 35 CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType,
36 - Attachment: images, 36 + Attachment: createCooperationProjectCommand.Attachment,
37 }) 37 })
38 38
39 if err != nil { 39 if err != nil {
@@ -22,9 +22,9 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro @@ -22,9 +22,9 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
22 } 22 }
23 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator) 23 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
24 24
25 - var images []domain.Attachment 25 + var images []*domain.Attachment
26 for _, v := range createCooperationProjectCommand.Images { 26 for _, v := range createCooperationProjectCommand.Images {
27 - images = append(images, domain.Attachment{ 27 + images = append(images, &domain.Attachment{
28 Url: v, 28 Url: v,
29 }) 29 })
30 } 30 }
@@ -38,6 +38,12 @@ type CooperationApplication struct { @@ -38,6 +38,12 @@ type CooperationApplication struct {
38 CooperationProjectNumber string `json:"cooperationProjectNumber"` 38 CooperationProjectNumber string `json:"cooperationProjectNumber"`
39 CooperationProjectDescription string `json:"cooperationProjectDescription"` 39 CooperationProjectDescription string `json:"cooperationProjectDescription"`
40 CooperationProjectName string `json:"cooperationProjectName"` 40 CooperationProjectName string `json:"cooperationProjectName"`
  41 + Attachment []struct {
  42 + FileType string `json:"fileType"`
  43 + Name string `json:"name"`
  44 + URL string `json:"url"`
  45 + FileSize string `json:"fileSize"`
  46 + } `json:"attachment"`
41 } `json:"cooperationProject"` 47 } `json:"cooperationProject"`
42 Org struct { 48 Org struct {
43 OrgID int `json:"orgId"` 49 OrgID int `json:"orgId"`
@@ -45,7 +51,7 @@ type CooperationApplication struct { @@ -45,7 +51,7 @@ type CooperationApplication struct {
45 } `json:"org"` 51 } `json:"org"`
46 IsCanceled bool `json:"isCanceled"` 52 IsCanceled bool `json:"isCanceled"`
47 Company struct { 53 Company struct {
48 - CompanyID string `json:"companyId"` 54 + CompanyID int `json:"companyId"`
49 CompanyLogo string `json:"companyLogo"` 55 CompanyLogo string `json:"companyLogo"`
50 CompanyName string `json:"companyName"` 56 CompanyName string `json:"companyName"`
51 } `json:"company"` 57 } `json:"company"`
@@ -64,14 +64,14 @@ type CooperationProject struct { @@ -64,14 +64,14 @@ type CooperationProject struct {
64 //创建共创项目 64 //创建共创项目
65 type ( 65 type (
66 ReqCooperationProjectAdd struct { 66 ReqCooperationProjectAdd struct {
67 - CooperationProjectDescription string `json:"cooperationProjectDescription"`  
68 - CooperationProjectName string `json:"cooperationProjectName"`  
69 - CooperationModeNumber string `json:"cooperationModeNumber"`  
70 - PublisherUid int `json:"publisherUid,string"`  
71 - SponsorUid int `json:"sponsorUid,string"`  
72 - DepartmentId int `json:"departmentId,string"`  
73 - CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"`  
74 - Attachment []domain.Attachment `json:"attachment"` 67 + CooperationProjectDescription string `json:"cooperationProjectDescription"`
  68 + CooperationProjectName string `json:"cooperationProjectName"`
  69 + CooperationModeNumber string `json:"cooperationModeNumber"`
  70 + PublisherUid int `json:"publisherUid,string"`
  71 + SponsorUid int `json:"sponsorUid,string"`
  72 + DepartmentId int `json:"departmentId,string"`
  73 + CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"`
  74 + Attachment []*domain.Attachment `json:"attachment"`
75 } 75 }
76 76
77 DataCooperationProjectAdd struct { 77 DataCooperationProjectAdd struct {
@@ -116,6 +116,7 @@ func (controller *CooperationController) PersonGetCooperationApplication() { @@ -116,6 +116,7 @@ func (controller *CooperationController) PersonGetCooperationApplication() {
116 return 116 return
117 } 117 }
118 cmd.Operator = controller.GetOperator() 118 cmd.Operator = controller.GetOperator()
  119 + cmd.CooperationApplicationId, _ = controller.GetInt64(":applicationId")
119 data, err := svr.PersonGetCooperationApplications(cmd) 120 data, err := svr.PersonGetCooperationApplications(cmd)
120 controller.Response(data, err) 121 controller.Response(data, err)
121 } 122 }