...
|
...
|
@@ -55,20 +55,20 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop |
|
|
}
|
|
|
|
|
|
// 公司REST服务初始化
|
|
|
var companyService service.CompanyService
|
|
|
if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
companyService = value
|
|
|
}
|
|
|
//var companyService service.CompanyService
|
|
|
//if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//} else {
|
|
|
// companyService = value
|
|
|
//}
|
|
|
|
|
|
// 组织机构REST服务初始化
|
|
|
var organizationService service.OrgService
|
|
|
if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
organizationService = value
|
|
|
}
|
|
|
//var organizationService service.OrgService
|
|
|
//if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//} else {
|
|
|
// organizationService = value
|
|
|
//}
|
|
|
|
|
|
// 共创申请仓储初始化
|
|
|
var cooperationApplicationRepository domain.CooperationApplicationRepository
|
...
|
...
|
@@ -162,20 +162,20 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop |
|
|
}
|
|
|
|
|
|
// 获取公司信息
|
|
|
var company *domain.Company
|
|
|
if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败")
|
|
|
} else {
|
|
|
company = data
|
|
|
}
|
|
|
//var company *domain.Company
|
|
|
//if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败")
|
|
|
//} else {
|
|
|
// company = data
|
|
|
//}
|
|
|
|
|
|
// 获取组织机构信息
|
|
|
var organization *domain.Org
|
|
|
if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败")
|
|
|
} else {
|
|
|
organization = data
|
|
|
}
|
|
|
//var organization *domain.Org
|
|
|
//if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败")
|
|
|
//} else {
|
|
|
// organization = data
|
|
|
//}
|
|
|
|
|
|
// 校验:同一个用户,不能多次申请同一个项目
|
|
|
applicationExist, _ := cooperationApplicationDao.CheckApplicationExist(map[string]interface{}{
|
...
|
...
|
@@ -211,9 +211,9 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop |
|
|
CooperationApplicationVerifyTime: time.Time{},
|
|
|
CooperationApplyTime: time.Now(),
|
|
|
CooperationProject: cooperationProject,
|
|
|
Org: organization,
|
|
|
Org: cooperationProject.Org,
|
|
|
IsCanceled: 1,
|
|
|
Company: company,
|
|
|
Company: cooperationProject.Company,
|
|
|
CreatedAt: time.Now(),
|
|
|
DeletedAt: time.Time{},
|
|
|
UpdatedAt: time.Time{},
|
...
|
...
|
|