正在显示
12 个修改的文件
包含
159 行增加
和
103 行删除
@@ -8,7 +8,9 @@ import ( | @@ -8,7 +8,9 @@ import ( | ||
8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationApplication/query" | 8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationApplication/query" |
9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/factory" | 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/factory" |
10 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | 10 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" |
11 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service" | ||
11 | "strconv" | 12 | "strconv" |
13 | + "time" | ||
12 | ) | 14 | ) |
13 | 15 | ||
14 | // CooperationApplicationService 共创申请服务 | 16 | // CooperationApplicationService 共创申请服务 |
@@ -93,15 +95,92 @@ func (cooperationApplicationService *CooperationApplicationService) CreateCooper | @@ -93,15 +95,92 @@ func (cooperationApplicationService *CooperationApplicationService) CreateCooper | ||
93 | defer func() { | 95 | defer func() { |
94 | _ = transactionContext.RollbackTransaction() | 96 | _ = transactionContext.RollbackTransaction() |
95 | }() | 97 | }() |
98 | + | ||
99 | + var cooperationProjectRepository domain.CooperationProjectRepository | ||
100 | + if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{ | ||
101 | + "transactionContext": transactionContext, | ||
102 | + }); err != nil { | ||
103 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
104 | + } else { | ||
105 | + cooperationProjectRepository = value | ||
106 | + } | ||
107 | + cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectNumber": createCooperationApplicationCommand.CooperationProjectNumber}) | ||
108 | + if err != nil { | ||
109 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
110 | + } | ||
111 | + if cooperationProject == nil { | ||
112 | + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createCooperationApplicationCommand.CooperationProjectNumber)) | ||
113 | + } else { | ||
114 | + | ||
115 | + } | ||
116 | + | ||
117 | + //TODO 获取申请人 | ||
118 | + // 用户REST服务初始化 | ||
119 | + var userService service.UserService | ||
120 | + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { | ||
121 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
122 | + } else { | ||
123 | + userService = value | ||
124 | + } | ||
125 | + | ||
126 | + // 获取申请人 | ||
127 | + var applicant *domain.User | ||
128 | + if data, err := userService.UserFrom(createCooperationApplicationCommand.CompanyId, createCooperationApplicationCommand.OrgId, createCooperationApplicationCommand.UserId); err != nil { | ||
129 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
130 | + } else { | ||
131 | + applicant = data | ||
132 | + } | ||
133 | + | ||
134 | + // 公司REST服务初始化 | ||
135 | + var companyService service.CompanyService | ||
136 | + if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil { | ||
137 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
138 | + } else { | ||
139 | + companyService = value | ||
140 | + } | ||
141 | + | ||
142 | + // 获取公司信息 | ||
143 | + var company *domain.Company | ||
144 | + if data, err := companyService.CompanyFrom(createCooperationApplicationCommand.CompanyId); err != nil { | ||
145 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
146 | + } else { | ||
147 | + company = data | ||
148 | + } | ||
149 | + | ||
150 | + // 组织机构REST服务初始化 | ||
151 | + var organizationService service.OrgService | ||
152 | + if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil { | ||
153 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
154 | + } else { | ||
155 | + organizationService = value | ||
156 | + } | ||
157 | + | ||
158 | + // 获取组织机构信息 | ||
159 | + var organization *domain.Org | ||
160 | + if data, err := organizationService.OrgFrom(createCooperationApplicationCommand.CompanyId, createCooperationApplicationCommand.OrgId); err != nil { | ||
161 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
162 | + } else { | ||
163 | + organization = data | ||
164 | + } | ||
165 | + | ||
96 | newCooperationApplication := &domain.CooperationApplication{ | 166 | newCooperationApplication := &domain.CooperationApplication{ |
97 | - //ApplicantUid: createCooperationApplicationCommand.ApplicantUid, | ||
98 | - CooperationApplicationDescription: createCooperationApplicationCommand.CooperationApplicationDescription, | ||
99 | - CooperationApplicationAttachment: createCooperationApplicationCommand.CooperationApplicationAttachment, | ||
100 | - //CooperationProjectNumber: createCooperationApplicationCommand.CooperationProjectNumber, | ||
101 | - //CompanyId: createCooperationApplicationCommand.CompanyId, | ||
102 | - //OrgId: createCooperationApplicationCommand.OrgId, | ||
103 | - //UserId: createCooperationApplicationCommand.UserId, | 167 | + CooperationApplicationApplicant: applicant, |
168 | + CooperationApplicationAttachment: createCooperationApplicationCommand.CooperationApplicationAttachment, | ||
169 | + CooperationApplicationDescription: createCooperationApplicationCommand.CooperationApplicationDescription, | ||
170 | + CooperationApplicationStatus: 1, | ||
171 | + CooperationApplicationVerifier: nil, | ||
172 | + CooperationApplicationVerifyDescription: "", | ||
173 | + CooperationApplicationVerifyTime: time.Time{}, | ||
174 | + CooperationApplyTime: time.Now(), | ||
175 | + CooperationProject: cooperationProject, | ||
176 | + Org: organization, | ||
177 | + IsCanceled: false, | ||
178 | + Company: company, | ||
179 | + CreatedAt: time.Now(), | ||
180 | + DeletedAt: time.Time{}, | ||
181 | + UpdatedAt: time.Time{}, | ||
104 | } | 182 | } |
183 | + | ||
105 | var cooperationApplicationRepository domain.CooperationApplicationRepository | 184 | var cooperationApplicationRepository domain.CooperationApplicationRepository |
106 | if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ | 185 | if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{ |
107 | "transactionContext": transactionContext, | 186 | "transactionContext": transactionContext, |
@@ -16,25 +16,25 @@ type UpdateCooperationContractCommand struct { | @@ -16,25 +16,25 @@ type UpdateCooperationContractCommand struct { | ||
16 | // 共创合约编号 | 16 | // 共创合约编号 |
17 | CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"` | 17 | CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"` |
18 | // 共创项目编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001 | 18 | // 共创项目编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001 |
19 | - CooperationProjectNumber string `cname:"共创项目编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001" json:"cooperationProjectNumber" valid:"Required"` | 19 | + CooperationProjectNumber string `cname:"共创项目编号" json:"cooperationProjectNumber" valid:"Required"` |
20 | // 部门编码 | 20 | // 部门编码 |
21 | - DepartmentNumber string `cname:"部门编码" json:"departmentNumber" valid:"Required"` | 21 | + DepartmentId string `cname:"部门ID" json:"departmentId" valid:"Required"` |
22 | // 共创合约承接对象,1员工,2共创用户,3公开 | 22 | // 共创合约承接对象,1员工,2共创用户,3公开 |
23 | - CooperationContractUndertakerType []int32 `cname:"共创合约承接对象,1员工,2共创用户,3公开" json:"cooperationContractUndertakerType" valid:"Required"` | 23 | + CooperationContractUndertakerTypes []int32 `cname:"共创合约承接对象" json:"cooperationContractUndertakerTypes" valid:"Required"` |
24 | // 共创合约名称 | 24 | // 共创合约名称 |
25 | CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName" valid:"Required"` | 25 | CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName" valid:"Required"` |
26 | // 共创模式编码,手动输入,唯一确定 | 26 | // 共创模式编码,手动输入,唯一确定 |
27 | - CooperationModeNumber string `cname:"共创模式编码,手动输入,唯一确定" json:"cooperationModeNumber" valid:"Required"` | 27 | + CooperationModeNumber string `cname:"共创模式编码" json:"cooperationModeNumber" valid:"Required"` |
28 | // 共创合约发起人uid | 28 | // 共创合约发起人uid |
29 | SponsorUid string `cname:"共创合约发起人uid" json:"sponsorUid,omitempty"` | 29 | SponsorUid string `cname:"共创合约发起人uid" json:"sponsorUid,omitempty"` |
30 | // 公司ID,通过集成REST上下文获取 | 30 | // 公司ID,通过集成REST上下文获取 |
31 | - CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"` | 31 | + CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"` |
32 | // 组织机构ID | 32 | // 组织机构ID |
33 | OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"` | 33 | OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"` |
34 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 34 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
35 | - UserId int64 `cname:"用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员" json:"userId,string" valid:"Required"` | 35 | + UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"` |
36 | // 用户基础数据id | 36 | // 用户基础数据id |
37 | - UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId,string" valid:"Required"` | 37 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"` |
38 | } | 38 | } |
39 | 39 | ||
40 | func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) { | 40 | func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) { |
@@ -12,11 +12,11 @@ type CreateCooperationProjectCommand struct { | @@ -12,11 +12,11 @@ type CreateCooperationProjectCommand struct { | ||
12 | // 共创项目名称 | 12 | // 共创项目名称 |
13 | CooperationProjectName string `cname:"共创项目名称" json:"cooperationProjectName" valid:"Required"` | 13 | CooperationProjectName string `cname:"共创项目名称" json:"cooperationProjectName" valid:"Required"` |
14 | // 承接对象,1员工,2共创用户,3公开,可以多选 | 14 | // 承接对象,1员工,2共创用户,3公开,可以多选 |
15 | - CooperationProjectUndertakerType []int32 `cname:"承接对象,1员工,2共创用户,3公开,可以多选" json:"cooperationProjectUndertakerType" valid:"Required"` | 15 | + CooperationProjectUndertakerTypes []int32 `cname:"承接对象" json:"cooperationProjectUndertakerTypes" valid:"Required"` |
16 | // 共创项目发起人uid | 16 | // 共创项目发起人uid |
17 | - SponsorUid string `cname:"共创项目发起人uid" json:"sponsorUid" valid:"Required"` | 17 | + SponsorUid string `cname:"共创项目发起人UID" json:"sponsorUid" valid:"Required"` |
18 | // 共创项目发布人uid | 18 | // 共创项目发布人uid |
19 | - PublisherUid string `cname:"共创项目发布人uid" json:"publisherUid" valid:"Required"` | 19 | + PublisherUid string `cname:"共创项目发布人UID" json:"publisherUid" valid:"Required"` |
20 | // 共创项目描述 | 20 | // 共创项目描述 |
21 | CooperationProjectDescription string `cname:"共创项目描述" json:"cooperationProjectDescription,omitempty"` | 21 | CooperationProjectDescription string `cname:"共创项目描述" json:"cooperationProjectDescription,omitempty"` |
22 | // 公司ID,通过集成REST上下文获取 | 22 | // 公司ID,通过集成REST上下文获取 |
@@ -119,20 +119,20 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro | @@ -119,20 +119,20 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro | ||
119 | } | 119 | } |
120 | 120 | ||
121 | newCooperationProject := &domain.CooperationProject{ | 121 | newCooperationProject := &domain.CooperationProject{ |
122 | - CooperationProjectNumber: "", | ||
123 | - CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, | ||
124 | - CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, | ||
125 | - CooperationProjectSponsor: sponsor, | ||
126 | - CooperationProjectPublisher: publisher, | ||
127 | - CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, | ||
128 | - Company: company, | ||
129 | - Org: organization, | ||
130 | - Operator: operator, | ||
131 | - OperateTime: time.Now(), | ||
132 | - Status: 0, | ||
133 | - UpdatedAt: time.Time{}, | ||
134 | - DeletedAt: time.Time{}, | ||
135 | - CreatedAt: time.Now(), | 122 | + CooperationProjectNumber: "", |
123 | + CooperationProjectName: createCooperationProjectCommand.CooperationProjectName, | ||
124 | + CooperationProjectUndertakerTypes: createCooperationProjectCommand.CooperationProjectUndertakerTypes, | ||
125 | + CooperationProjectSponsor: sponsor, | ||
126 | + CooperationProjectPublisher: publisher, | ||
127 | + CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, | ||
128 | + Company: company, | ||
129 | + Org: organization, | ||
130 | + Operator: operator, | ||
131 | + OperateTime: time.Now(), | ||
132 | + Status: 0, | ||
133 | + UpdatedAt: time.Time{}, | ||
134 | + DeletedAt: time.Time{}, | ||
135 | + CreatedAt: time.Now(), | ||
136 | } | 136 | } |
137 | var cooperationProjectRepository domain.CooperationProjectRepository | 137 | var cooperationProjectRepository domain.CooperationProjectRepository |
138 | if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{ | 138 | if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{ |
@@ -22,7 +22,7 @@ type CooperationApplication struct { | @@ -22,7 +22,7 @@ type CooperationApplication struct { | ||
22 | CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` | 22 | CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` |
23 | // 共创申请时间 | 23 | // 共创申请时间 |
24 | CooperationApplyTime time.Time `json:"cooperationApplyTime"` | 24 | CooperationApplyTime time.Time `json:"cooperationApplyTime"` |
25 | - // 共创项目编号 | 25 | + // 共创项目 |
26 | CooperationProject *CooperationProject `json:"cooperationProject"` | 26 | CooperationProject *CooperationProject `json:"cooperationProject"` |
27 | // 数据所属组织机构 | 27 | // 数据所属组织机构 |
28 | Org *Org `json:"org"` | 28 | Org *Org `json:"org"` |
@@ -83,26 +83,5 @@ func (cooperationApplication *CooperationApplication) Update(data map[string]int | @@ -83,26 +83,5 @@ func (cooperationApplication *CooperationApplication) Update(data map[string]int | ||
83 | if cooperationApplyTime, ok := data["cooperationApplyTime"]; ok { | 83 | if cooperationApplyTime, ok := data["cooperationApplyTime"]; ok { |
84 | cooperationApplication.CooperationApplyTime = cooperationApplyTime.(time.Time) | 84 | cooperationApplication.CooperationApplyTime = cooperationApplyTime.(time.Time) |
85 | } | 85 | } |
86 | - if cooperationProjectId, ok := data["cooperationProjectId"]; ok { | ||
87 | - cooperationApplication.CooperationProject.CooperationProjectId = cooperationProjectId.(int64) | ||
88 | - } | ||
89 | - if cooperationProjectNumber, ok := data["cooperationProjectNumber"]; ok { | ||
90 | - cooperationApplication.CooperationProject.CooperationProjectNumber = cooperationProjectNumber.(string) | ||
91 | - } | ||
92 | - if cooperationProjectDescription, ok := data["cooperationProjectDescription"]; ok { | ||
93 | - cooperationApplication.CooperationProject.CooperationProjectDescription = cooperationProjectDescription.(string) | ||
94 | - } | ||
95 | - if cooperationProjectName, ok := data["cooperationProjectName"]; ok { | ||
96 | - cooperationApplication.CooperationProject.CooperationProjectName = cooperationProjectName.(string) | ||
97 | - } | ||
98 | - if cooperationProjectPublishTime, ok := data["cooperationProjectPublishTime"]; ok { | ||
99 | - cooperationApplication.CooperationProject.CooperationProjectPublishTime = cooperationProjectPublishTime.(time.Time) | ||
100 | - } | ||
101 | - if operateTime, ok := data["operateTime"]; ok { | ||
102 | - cooperationApplication.CooperationProject.OperateTime = operateTime.(time.Time) | ||
103 | - } | ||
104 | - if status, ok := data["status"]; ok { | ||
105 | - cooperationApplication.CooperationProject.Status = status.(int32) | ||
106 | - } | ||
107 | return nil | 86 | return nil |
108 | } | 87 | } |
@@ -21,11 +21,11 @@ type CooperationProject struct { | @@ -21,11 +21,11 @@ type CooperationProject struct { | ||
21 | // 共创项目发起部门 | 21 | // 共创项目发起部门 |
22 | Department *Department `json:"department"` | 22 | Department *Department `json:"department"` |
23 | // 共创项目承接对象,1员工,2共创用户,3公开,可以多选 | 23 | // 共创项目承接对象,1员工,2共创用户,3公开,可以多选 |
24 | - CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerType"` | 24 | + CooperationProjectUndertakerTypes []int32 `json:"cooperationProjectUndertakerTypes"` |
25 | // 数据所属组织机构 | 25 | // 数据所属组织机构 |
26 | Org *Org `json:"org"` | 26 | Org *Org `json:"org"` |
27 | // 图片附件 | 27 | // 图片附件 |
28 | - Attachment *Attachment `json:"attachment"` | 28 | + Attachment []*Attachment `json:"attachment"` |
29 | // 公司 | 29 | // 公司 |
30 | Company *Company `json:"company"` | 30 | Company *Company `json:"company"` |
31 | // 操作人 | 31 | // 操作人 |
@@ -151,7 +151,7 @@ func (cooperationProject *CooperationProject) Update(data map[string]interface{} | @@ -151,7 +151,7 @@ func (cooperationProject *CooperationProject) Update(data map[string]interface{} | ||
151 | cooperationProject.CooperationProjectSponsor.Company.CompanyId = companyId.(int64) | 151 | cooperationProject.CooperationProjectSponsor.Company.CompanyId = companyId.(int64) |
152 | } | 152 | } |
153 | if cooperationProjectUndertakerType, ok := data["cooperationProjectUndertakerType"]; ok { | 153 | if cooperationProjectUndertakerType, ok := data["cooperationProjectUndertakerType"]; ok { |
154 | - cooperationProject.CooperationProjectUndertakerType = cooperationProjectUndertakerType.([]int32) | 154 | + cooperationProject.CooperationProjectUndertakerTypes = cooperationProjectUndertakerType.([]int32) |
155 | } | 155 | } |
156 | if operateTime, ok := data["operateTime"]; ok { | 156 | if operateTime, ok := data["operateTime"]; ok { |
157 | cooperationProject.OperateTime = operateTime.(time.Time) | 157 | cooperationProject.OperateTime = operateTime.(time.Time) |
@@ -24,7 +24,9 @@ type CooperationProject struct { | @@ -24,7 +24,9 @@ type CooperationProject struct { | ||
24 | // 共创项目发起部门 | 24 | // 共创项目发起部门 |
25 | Department *domain.Department `comment:"共创项目发起部门"` | 25 | Department *domain.Department `comment:"共创项目发起部门"` |
26 | // 共创项目承接对象,1员工,2共创用户,3公开,可以多选 | 26 | // 共创项目承接对象,1员工,2共创用户,3公开,可以多选 |
27 | - CooperationProjectUndertakerType []int32 `comment:"共创项目承接对象,1员工,2共创用户,3公开,可以多选" pg:",array"` | 27 | + CooperationProjectUndertakerTypes []int32 `comment:"共创项目承接对象,1员工,2共创用户,3公开,可以多选" pg:",array"` |
28 | + // 附件 | ||
29 | + Attachment []*domain.Attachment `comment:"附件"` | ||
28 | // 数据所属组织机构 | 30 | // 数据所属组织机构 |
29 | Org *domain.Org `comment:"数据所属组织机构"` | 31 | Org *domain.Org `comment:"数据所属组织机构"` |
30 | // 公司 | 32 | // 公司 |
@@ -19,22 +19,23 @@ func TransformToCooperationApplicationDomainModelFromPgModels( | @@ -19,22 +19,23 @@ func TransformToCooperationApplicationDomainModelFromPgModels( | ||
19 | CooperationApplicationVerifyTime: cooperationApplicationModel.CooperationApplicationVerifyTime, | 19 | CooperationApplicationVerifyTime: cooperationApplicationModel.CooperationApplicationVerifyTime, |
20 | CooperationApplyTime: cooperationApplicationModel.CooperationApplyTime, | 20 | CooperationApplyTime: cooperationApplicationModel.CooperationApplyTime, |
21 | CooperationProject: &domain.CooperationProject{ | 21 | CooperationProject: &domain.CooperationProject{ |
22 | - CooperationProjectId: cooperationProject.CooperationProjectId, | ||
23 | - CooperationProjectNumber: cooperationProject.CooperationProjectNumber, | ||
24 | - CooperationProjectDescription: cooperationProject.CooperationProjectDescription, | ||
25 | - CooperationProjectName: cooperationProject.CooperationProjectName, | ||
26 | - CooperationProjectPublishTime: cooperationProject.CooperationProjectPublishTime, | ||
27 | - CooperationProjectPublisher: cooperationProject.CooperationProjectPublisher, | ||
28 | - CooperationProjectSponsor: cooperationProject.CooperationProjectSponsor, | ||
29 | - CooperationProjectUndertakerType: cooperationProject.CooperationProjectUndertakerType, | ||
30 | - Org: cooperationProject.Org, | ||
31 | - Company: cooperationProject.Company, | ||
32 | - Operator: cooperationProject.Operator, | ||
33 | - OperateTime: cooperationProject.OperateTime, | ||
34 | - Status: cooperationProject.Status, | ||
35 | - UpdatedAt: cooperationProject.UpdatedAt, | ||
36 | - DeletedAt: cooperationProject.DeletedAt, | ||
37 | - CreatedAt: cooperationProject.CreatedAt, | 22 | + CooperationProjectNumber: cooperationProject.CooperationProjectNumber, |
23 | + CooperationProjectDescription: cooperationProject.CooperationProjectDescription, | ||
24 | + CooperationProjectName: cooperationProject.CooperationProjectName, | ||
25 | + CooperationProjectPublishTime: cooperationProject.CooperationProjectPublishTime, | ||
26 | + CooperationProjectPublisher: cooperationProject.CooperationProjectPublisher, | ||
27 | + CooperationProjectSponsor: cooperationProject.CooperationProjectSponsor, | ||
28 | + Department: cooperationProject.Department, | ||
29 | + CooperationProjectUndertakerTypes: cooperationProject.CooperationProjectUndertakerTypes, | ||
30 | + Org: cooperationProject.Org, | ||
31 | + Attachment: cooperationProject.Attachment, | ||
32 | + Company: cooperationProject.Company, | ||
33 | + Operator: cooperationProject.Operator, | ||
34 | + OperateTime: cooperationProject.OperateTime, | ||
35 | + Status: cooperationProject.Status, | ||
36 | + UpdatedAt: cooperationProject.UpdatedAt, | ||
37 | + DeletedAt: cooperationProject.DeletedAt, | ||
38 | + CreatedAt: cooperationProject.CreatedAt, | ||
38 | }, | 39 | }, |
39 | Org: cooperationApplicationModel.Org, | 40 | Org: cooperationApplicationModel.Org, |
40 | IsCanceled: cooperationApplicationModel.IsCanceled, | 41 | IsCanceled: cooperationApplicationModel.IsCanceled, |
@@ -7,22 +7,22 @@ import ( | @@ -7,22 +7,22 @@ import ( | ||
7 | 7 | ||
8 | func TransformToCooperationProjectDomainModelFromPgModels(cooperationProjectModel *models.CooperationProject) (*domain.CooperationProject, error) { | 8 | func TransformToCooperationProjectDomainModelFromPgModels(cooperationProjectModel *models.CooperationProject) (*domain.CooperationProject, error) { |
9 | return &domain.CooperationProject{ | 9 | return &domain.CooperationProject{ |
10 | - CooperationProjectId: cooperationProjectModel.CooperationProjectId, | ||
11 | - CooperationProjectNumber: cooperationProjectModel.CooperationProjectNumber, | ||
12 | - CooperationProjectDescription: cooperationProjectModel.CooperationProjectDescription, | ||
13 | - CooperationProjectName: cooperationProjectModel.CooperationProjectName, | ||
14 | - CooperationProjectPublishTime: cooperationProjectModel.CooperationProjectPublishTime, | ||
15 | - CooperationProjectPublisher: cooperationProjectModel.CooperationProjectPublisher, | ||
16 | - CooperationProjectSponsor: cooperationProjectModel.CooperationProjectSponsor, | ||
17 | - Department: cooperationProjectModel.Department, | ||
18 | - CooperationProjectUndertakerType: cooperationProjectModel.CooperationProjectUndertakerType, | ||
19 | - Org: cooperationProjectModel.Org, | ||
20 | - Company: cooperationProjectModel.Company, | ||
21 | - Operator: cooperationProjectModel.Operator, | ||
22 | - OperateTime: cooperationProjectModel.OperateTime, | ||
23 | - Status: cooperationProjectModel.Status, | ||
24 | - UpdatedAt: cooperationProjectModel.UpdatedAt, | ||
25 | - DeletedAt: cooperationProjectModel.DeletedAt, | ||
26 | - CreatedAt: cooperationProjectModel.CreatedAt, | 10 | + CooperationProjectId: cooperationProjectModel.CooperationProjectId, |
11 | + CooperationProjectNumber: cooperationProjectModel.CooperationProjectNumber, | ||
12 | + CooperationProjectDescription: cooperationProjectModel.CooperationProjectDescription, | ||
13 | + CooperationProjectName: cooperationProjectModel.CooperationProjectName, | ||
14 | + CooperationProjectPublishTime: cooperationProjectModel.CooperationProjectPublishTime, | ||
15 | + CooperationProjectPublisher: cooperationProjectModel.CooperationProjectPublisher, | ||
16 | + CooperationProjectSponsor: cooperationProjectModel.CooperationProjectSponsor, | ||
17 | + Department: cooperationProjectModel.Department, | ||
18 | + CooperationProjectUndertakerTypes: cooperationProjectModel.CooperationProjectUndertakerTypes, | ||
19 | + Org: cooperationProjectModel.Org, | ||
20 | + Company: cooperationProjectModel.Company, | ||
21 | + Operator: cooperationProjectModel.Operator, | ||
22 | + OperateTime: cooperationProjectModel.OperateTime, | ||
23 | + Status: cooperationProjectModel.Status, | ||
24 | + UpdatedAt: cooperationProjectModel.UpdatedAt, | ||
25 | + DeletedAt: cooperationProjectModel.DeletedAt, | ||
26 | + CreatedAt: cooperationProjectModel.CreatedAt, | ||
27 | }, nil | 27 | }, nil |
28 | } | 28 | } |
@@ -35,9 +35,9 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication | @@ -35,9 +35,9 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication | ||
35 | "cooperation_application_verify_description", | 35 | "cooperation_application_verify_description", |
36 | "cooperation_application_verify_time", | 36 | "cooperation_application_verify_time", |
37 | "cooperation_apply_time", | 37 | "cooperation_apply_time", |
38 | - "cooperation_project", | 38 | + "cooperation_project_number", |
39 | "org", | 39 | "org", |
40 | - "isCanceled", | 40 | + "is_canceled", |
41 | "company", | 41 | "company", |
42 | "created_at", | 42 | "created_at", |
43 | "deleted_at", | 43 | "deleted_at", |
@@ -60,7 +60,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication | @@ -60,7 +60,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication | ||
60 | pg.Scan( | 60 | pg.Scan( |
61 | &cooperationApplication.CooperationApplicationId, | 61 | &cooperationApplication.CooperationApplicationId, |
62 | &cooperationApplication.CooperationApplicationApplicant, | 62 | &cooperationApplication.CooperationApplicationApplicant, |
63 | - pg.Array(&cooperationApplication.CooperationApplicationAttachment), | 63 | + &cooperationApplication.CooperationApplicationAttachment, |
64 | &cooperationApplication.CooperationApplicationDescription, | 64 | &cooperationApplication.CooperationApplicationDescription, |
65 | &cooperationApplication.CooperationApplicationStatus, | 65 | &cooperationApplication.CooperationApplicationStatus, |
66 | &cooperationApplication.CooperationApplicationVerifier, | 66 | &cooperationApplication.CooperationApplicationVerifier, |
@@ -35,7 +35,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | @@ -35,7 +35,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | ||
35 | "cooperation_project_publisher", | 35 | "cooperation_project_publisher", |
36 | "cooperation_project_sponsor", | 36 | "cooperation_project_sponsor", |
37 | "department", | 37 | "department", |
38 | - "cooperation_project_undertaker_type", | 38 | + "cooperation_project_undertaker_types", |
39 | "org", | 39 | "org", |
40 | "company", | 40 | "company", |
41 | "operator", | 41 | "operator", |
@@ -68,7 +68,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | @@ -68,7 +68,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | ||
68 | &cooperationProject.CooperationProjectPublisher, | 68 | &cooperationProject.CooperationProjectPublisher, |
69 | &cooperationProject.CooperationProjectSponsor, | 69 | &cooperationProject.CooperationProjectSponsor, |
70 | &cooperationProject.Department, | 70 | &cooperationProject.Department, |
71 | - pg.Array(&cooperationProject.CooperationProjectUndertakerType), | 71 | + pg.Array(&cooperationProject.CooperationProjectUndertakerTypes), |
72 | &cooperationProject.Org, | 72 | &cooperationProject.Org, |
73 | &cooperationProject.Company, | 73 | &cooperationProject.Company, |
74 | &cooperationProject.Operator, | 74 | &cooperationProject.Operator, |
@@ -87,7 +87,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | @@ -87,7 +87,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | ||
87 | cooperationProject.CooperationProjectPublisher, | 87 | cooperationProject.CooperationProjectPublisher, |
88 | cooperationProject.CooperationProjectSponsor, | 88 | cooperationProject.CooperationProjectSponsor, |
89 | cooperationProject.Department, | 89 | cooperationProject.Department, |
90 | - pg.Array(cooperationProject.CooperationProjectUndertakerType), | 90 | + pg.Array(cooperationProject.CooperationProjectUndertakerTypes), |
91 | cooperationProject.Org, | 91 | cooperationProject.Org, |
92 | cooperationProject.Company, | 92 | cooperationProject.Company, |
93 | cooperationProject.Operator, | 93 | cooperationProject.Operator, |
@@ -110,7 +110,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | @@ -110,7 +110,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | ||
110 | &cooperationProject.CooperationProjectPublisher, | 110 | &cooperationProject.CooperationProjectPublisher, |
111 | &cooperationProject.CooperationProjectSponsor, | 111 | &cooperationProject.CooperationProjectSponsor, |
112 | &cooperationProject.Department, | 112 | &cooperationProject.Department, |
113 | - pg.Array(&cooperationProject.CooperationProjectUndertakerType), | 113 | + pg.Array(&cooperationProject.CooperationProjectUndertakerTypes), |
114 | &cooperationProject.Org, | 114 | &cooperationProject.Org, |
115 | &cooperationProject.Company, | 115 | &cooperationProject.Company, |
116 | &cooperationProject.Operator, | 116 | &cooperationProject.Operator, |
@@ -129,7 +129,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | @@ -129,7 +129,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. | ||
129 | cooperationProject.CooperationProjectPublisher, | 129 | cooperationProject.CooperationProjectPublisher, |
130 | cooperationProject.CooperationProjectSponsor, | 130 | cooperationProject.CooperationProjectSponsor, |
131 | cooperationProject.Department, | 131 | cooperationProject.Department, |
132 | - pg.Array(cooperationProject.CooperationProjectUndertakerType), | 132 | + pg.Array(cooperationProject.CooperationProjectUndertakerTypes), |
133 | cooperationProject.Org, | 133 | cooperationProject.Org, |
134 | cooperationProject.Company, | 134 | cooperationProject.Company, |
135 | cooperationProject.Operator, | 135 | cooperationProject.Operator, |
@@ -14,7 +14,6 @@ func (controller *CooperationContractController) CreateCooperationContract() { | @@ -14,7 +14,6 @@ func (controller *CooperationContractController) CreateCooperationContract() { | ||
14 | cooperationContractService := service.NewCooperationContractService(nil) | 14 | cooperationContractService := service.NewCooperationContractService(nil) |
15 | createCooperationContractCommand := &command.CreateCooperationContractCommand{} | 15 | createCooperationContractCommand := &command.CreateCooperationContractCommand{} |
16 | _ = controller.Unmarshal(createCooperationContractCommand) | 16 | _ = controller.Unmarshal(createCooperationContractCommand) |
17 | - // 解析头部信息 | ||
18 | header := controller.GetRequestHeader(controller.Ctx) | 17 | header := controller.GetRequestHeader(controller.Ctx) |
19 | createCooperationContractCommand.CompanyId = header.CompanyId | 18 | createCooperationContractCommand.CompanyId = header.CompanyId |
20 | createCooperationContractCommand.OrgId = header.OrgId | 19 | createCooperationContractCommand.OrgId = header.OrgId |
@@ -28,7 +27,6 @@ func (controller *CooperationContractController) UpdateCooperationContract() { | @@ -28,7 +27,6 @@ func (controller *CooperationContractController) UpdateCooperationContract() { | ||
28 | cooperationContractService := service.NewCooperationContractService(nil) | 27 | cooperationContractService := service.NewCooperationContractService(nil) |
29 | updateCooperationContractCommand := &command.UpdateCooperationContractCommand{} | 28 | updateCooperationContractCommand := &command.UpdateCooperationContractCommand{} |
30 | _ = controller.Unmarshal(updateCooperationContractCommand) | 29 | _ = controller.Unmarshal(updateCooperationContractCommand) |
31 | - // 解析头部信息 | ||
32 | header := controller.GetRequestHeader(controller.Ctx) | 30 | header := controller.GetRequestHeader(controller.Ctx) |
33 | updateCooperationContractCommand.CompanyId = header.CompanyId | 31 | updateCooperationContractCommand.CompanyId = header.CompanyId |
34 | updateCooperationContractCommand.OrgId = header.OrgId | 32 | updateCooperationContractCommand.OrgId = header.OrgId |
@@ -43,7 +41,6 @@ func (controller *CooperationContractController) UpdateCooperationContract() { | @@ -43,7 +41,6 @@ func (controller *CooperationContractController) UpdateCooperationContract() { | ||
43 | func (controller *CooperationContractController) GetCooperationContract() { | 41 | func (controller *CooperationContractController) GetCooperationContract() { |
44 | cooperationContractService := service.NewCooperationContractService(nil) | 42 | cooperationContractService := service.NewCooperationContractService(nil) |
45 | getCooperationContractQuery := &query.GetCooperationContractQuery{} | 43 | getCooperationContractQuery := &query.GetCooperationContractQuery{} |
46 | - // 解析头部信息 | ||
47 | header := controller.GetRequestHeader(controller.Ctx) | 44 | header := controller.GetRequestHeader(controller.Ctx) |
48 | getCooperationContractQuery.CompanyId = header.CompanyId | 45 | getCooperationContractQuery.CompanyId = header.CompanyId |
49 | getCooperationContractQuery.OrgId = header.OrgId | 46 | getCooperationContractQuery.OrgId = header.OrgId |
@@ -86,7 +83,6 @@ func (controller *CooperationContractController) SearchCooperationContract() { | @@ -86,7 +83,6 @@ func (controller *CooperationContractController) SearchCooperationContract() { | ||
86 | func (controller *CooperationContractController) SearchCooperationContractByUndertaker() { | 83 | func (controller *CooperationContractController) SearchCooperationContractByUndertaker() { |
87 | cooperationContractService := service.NewCooperationContractService(nil) | 84 | cooperationContractService := service.NewCooperationContractService(nil) |
88 | searchCooperationContractByUndertakerQuery := &query.SearchCooperationContractByUndertakerQuery{} | 85 | searchCooperationContractByUndertakerQuery := &query.SearchCooperationContractByUndertakerQuery{} |
89 | - // 解析头部信息 | ||
90 | header := controller.GetRequestHeader(controller.Ctx) | 86 | header := controller.GetRequestHeader(controller.Ctx) |
91 | searchCooperationContractByUndertakerQuery.CompanyId = header.CompanyId | 87 | searchCooperationContractByUndertakerQuery.CompanyId = header.CompanyId |
92 | searchCooperationContractByUndertakerQuery.OrgId = header.OrgId | 88 | searchCooperationContractByUndertakerQuery.OrgId = header.OrgId |
@@ -103,7 +99,6 @@ func (controller *CooperationContractController) SearchCooperationContractByUnde | @@ -103,7 +99,6 @@ func (controller *CooperationContractController) SearchCooperationContractByUnde | ||
103 | func (controller *CooperationContractController) ListCooperationContract() { | 99 | func (controller *CooperationContractController) ListCooperationContract() { |
104 | cooperationContractService := service.NewCooperationContractService(nil) | 100 | cooperationContractService := service.NewCooperationContractService(nil) |
105 | listCooperationContractQuery := &query.ListCooperationContractQuery{} | 101 | listCooperationContractQuery := &query.ListCooperationContractQuery{} |
106 | - // 解析头部信息 | ||
107 | header := controller.GetRequestHeader(controller.Ctx) | 102 | header := controller.GetRequestHeader(controller.Ctx) |
108 | listCooperationContractQuery.CompanyId = header.CompanyId | 103 | listCooperationContractQuery.CompanyId = header.CompanyId |
109 | listCooperationContractQuery.OrgId = header.OrgId | 104 | listCooperationContractQuery.OrgId = header.OrgId |
-
请 注册 或 登录 后发表评论