...
|
...
|
@@ -33,6 +33,8 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
// 共创项目仓储初始化
|
|
|
var cooperationProjectRepository domain.CooperationProjectRepository
|
|
|
if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
...
|
...
|
@@ -41,12 +43,14 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop |
|
|
} else {
|
|
|
cooperationProjectRepository = value
|
|
|
}
|
|
|
cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectNumber": applyForCooperationCommand.CooperationProjectNumber})
|
|
|
|
|
|
// 获取共创项目
|
|
|
cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectId": applyForCooperationCommand.CooperationProjectId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if cooperationProject == nil {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", applyForCooperationCommand.CooperationProjectNumber))
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(applyForCooperationCommand.CooperationProjectId, 10)))
|
|
|
}
|
|
|
|
|
|
// 用户REST服务初始化
|
...
|
...
|
@@ -156,12 +160,16 @@ func (cooperationApplicationService *CooperationApplicationService) ApprovalCoop |
|
|
} else {
|
|
|
cooperationApplicationRepository = value
|
|
|
}
|
|
|
cooperationApplicationId, err := strconv.ParseInt(approvalCooperationApplicationCommand.CooperationApplicationId, 10, 64)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请ID类型错误")
|
|
|
}
|
|
|
cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": approvalCooperationApplicationCommand.CooperationApplicationId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if cooperationApplication == nil {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(approvalCooperationApplicationCommand.CooperationApplicationId, 10)))
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10)))
|
|
|
}
|
|
|
if err := cooperationApplication.Update(tool_funs.SimpleStructToMap(approvalCooperationApplicationCommand)); err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
...
|
...
|
|