作者 yangfu

共创申请修改

@@ -3,7 +3,6 @@ package service @@ -3,7 +3,6 @@ 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/web/cooperationApplication/command" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/command"
6 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/dto"  
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/query" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/query"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
9 ) 8 )
@@ -42,16 +41,17 @@ func (cooperationApplicationService *CooperationApplicationService) GetCooperati @@ -42,16 +41,17 @@ func (cooperationApplicationService *CooperationApplicationService) GetCooperati
42 applicationResult, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{ 41 applicationResult, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
43 CooperationApplicationId: getCooperationApplicationQuery.CooperationApplicationId, 42 CooperationApplicationId: getCooperationApplicationQuery.CooperationApplicationId,
44 }) 43 })
  44 + //if err != nil {
  45 + // return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  46 + //}
  47 + //objectResult, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
  48 + // CooperationProjectId: applicationResult.CooperationProject.CooperationProjectID,
  49 + //})
45 if err != nil { 50 if err != nil {
46 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 51 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
47 } 52 }
48 - objectResult, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{  
49 - CooperationProjectId: applicationResult.CooperationProject.CooperationProjectID,  
50 - })  
51 - if err != nil {  
52 - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
53 - }  
54 - return dto.ToCooperationApplicationInfo(&applicationResult.CooperationApplication, &objectResult.CooperationProject), nil 53 + //return dto.ToCooperationApplicationInfo(&applicationResult.CooperationApplication, &objectResult.CooperationProject), nil
  54 + return applicationResult, nil
55 } 55 }
56 56
57 // 返回共创申请管理列表 57 // 返回共创申请管理列表
1 package dto 1 package dto
2 2
3 import ( 3 import (
  4 + "strconv"
4 "time" 5 "time"
5 6
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
@@ -91,25 +92,26 @@ type CooperationApplicationItem struct { @@ -91,25 +92,26 @@ type CooperationApplicationItem struct {
91 } 92 }
92 93
93 func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem { 94 func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
94 - //data := CooperationApplicationItem{  
95 - // CooperationApplicationDescription: param.CooperationApplicationDescription,  
96 - // CooperationApplicationID: param.CooperationApplicationID,  
97 - // CooperationApplicationStatus: param.CooperationApplicationStatus,  
98 - // CooperationApplyTime: int(param.CooperationApplyTime.Unix()),  
99 - // CooperationApplicationAttachment: param.CooperationApplicationAttachment,  
100 - //}  
101 - //data.CooperationApplicationApplicant.Company.CompanyID = param.CooperationApplicationApplicant.Company.CompanyID  
102 - //data.CooperationApplicationApplicant.Company.CompanyName = param.CooperationApplicationApplicant.Company.CompanyName  
103 - //data.CooperationApplicationApplicant.Department.DepartmentId = param.CooperationApplicationApplicant.Department.DepartmentID  
104 - //data.CooperationApplicationApplicant.Department.DepartmentName = param.CooperationApplicationApplicant.Department.DepartmentName 95 + applicationID, _ := strconv.Atoi(param.CooperationApplicationID)
  96 + data := CooperationApplicationItem{
  97 + CooperationApplicationDescription: param.CooperationApplicationDescription,
  98 + CooperationApplicationID: applicationID,
  99 + CooperationApplicationStatus: param.CooperationApplicationStatus,
  100 + CooperationApplyTime: int(param.CooperationApplyTime),
  101 + CooperationApplicationAttachment: param.CooperationApplicationAttachment,
  102 + }
  103 + data.CooperationApplicationApplicant.Company.CompanyID = param.Company.CompanyID
  104 + data.CooperationApplicationApplicant.Company.CompanyName = param.Company.CompanyName
  105 + data.CooperationApplicationApplicant.Department.DepartmentId = int(param.CooperationApplicationApplicant.Department.DepartmentId)
  106 + data.CooperationApplicationApplicant.Department.DepartmentName = param.CooperationApplicationApplicant.Department.DepartmentName
105 //data.CooperationApplicationApplicant.Department.DepartmentNumber = param.CooperationApplicationApplicant.Department.DepartmentNumber 107 //data.CooperationApplicationApplicant.Department.DepartmentNumber = param.CooperationApplicationApplicant.Department.DepartmentNumber
106 - //data.CooperationApplicationApplicant.Org.OrgID = param.CooperationApplicationApplicant.Org.OrgID  
107 - //data.CooperationApplicationApplicant.Org.OrgName = param.CooperationApplicationApplicant.Org.OrgName  
108 - //data.CooperationApplicationApplicant.UserID = param.CooperationApplicationApplicant.UserID  
109 - //data.CooperationApplicationApplicant.UserType = param.CooperationApplicationApplicant.UserType  
110 - //data.CooperationApplicationApplicant.UserInfo.Phone = param.CooperationApplicationApplicant.UserInfo.UserPhone  
111 - //data.CooperationApplicationApplicant.UserInfo.UsersName = param.CooperationApplicationApplicant.UserInfo.UserName  
112 - //data.CooperationApplicationApplicant.UserInfo.UsersId = param.CooperationApplicationApplicant.UserID  
113 - //return &data  
114 - return nil 108 + data.CooperationApplicationApplicant.Org.OrgID = param.Org.OrgID
  109 + data.CooperationApplicationApplicant.Org.OrgName = param.Org.OrgName
  110 + data.CooperationApplicationApplicant.UserID = param.CooperationApplicationApplicant.UserID
  111 + //data.CooperationApplicationApplicant.UserType = param.CooperationApplicationApplicant.
  112 + data.CooperationApplicationApplicant.UserInfo.Phone = param.CooperationApplicationApplicant.UserInfo.UserPhone
  113 + data.CooperationApplicationApplicant.UserInfo.UsersName = param.CooperationApplicationApplicant.UserInfo.UserName
  114 + data.CooperationApplicationApplicant.UserInfo.UsersId = param.CooperationApplicationApplicant.UserID
  115 + return &data
  116 + //return nil
115 } 117 }
@@ -16,16 +16,16 @@ type CooperationApplication struct { @@ -16,16 +16,16 @@ type CooperationApplication struct {
16 UserPhone string `json:"userPhone"` 16 UserPhone string `json:"userPhone"`
17 UserAccount string `json:"userAccount"` 17 UserAccount string `json:"userAccount"`
18 } `json:"userInfo"` 18 } `json:"userInfo"`
19 - Department interface{} `json:"department"` 19 + Department struct {
  20 + // 部门ID,通过REST集成上下文获取
  21 + DepartmentId int64 `json:"departmentId"`
  22 + // 部门名称
  23 + DepartmentName string `json:"departmentName"`
  24 + } `json:"department"`
20 } `json:"cooperationApplicationApplicant"` 25 } `json:"cooperationApplicationApplicant"`
21 - CooperationApplicationAttachment []struct {  
22 - FileType string `json:"fileType"`  
23 - Name string `json:"name"`  
24 - URL string `json:"url"`  
25 - FileSize string `json:"fileSize"`  
26 - } `json:"cooperationApplicationAttachment"`  
27 - CooperationApplicationDescription string `json:"cooperationApplicationDescription"`  
28 - CooperationApplicationStatus int `json:"cooperationApplicationStatus"` 26 + CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"`
  27 + CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
  28 + CooperationApplicationStatus int `json:"cooperationApplicationStatus"`
29 CooperationApplicationVerifier struct { 29 CooperationApplicationVerifier struct {
30 UserID int `json:"userId"` 30 UserID int `json:"userId"`
31 Department interface{} `json:"department"` 31 Department interface{} `json:"department"`