...
|
...
|
@@ -175,11 +175,20 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro |
|
|
"orgId": createCooperationProjectCommand.OrgId,
|
|
|
"cooperationProjectNumber": projectNumber,
|
|
|
})
|
|
|
// TODO 校验共创项目名称是否唯一
|
|
|
|
|
|
if !numberAvailable {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "新增共创项目异常")
|
|
|
}
|
|
|
|
|
|
// 校验共创项目名称是否唯一
|
|
|
nameAvailable, _ := cooperationProjectDao.CheckProjectNameAvailable(map[string]interface{}{
|
|
|
"companyId": createCooperationProjectCommand.CompanyId,
|
|
|
"orgId": createCooperationProjectCommand.OrgId,
|
|
|
"cooperationProjectName": createCooperationProjectCommand.CooperationProjectName,
|
|
|
})
|
|
|
if !nameAvailable {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "共创项目名称重复")
|
|
|
}
|
|
|
|
|
|
newCooperationProject := &domain.CooperationProject{
|
|
|
CooperationProjectNumber: projectNumber,
|
|
|
CooperationProjectName: createCooperationProjectCommand.CooperationProjectName,
|
...
|
...
|
@@ -489,6 +498,16 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro |
|
|
operator = data
|
|
|
}
|
|
|
|
|
|
// 共创项目DAO初始化
|
|
|
var cooperationProjectDao *dao.CooperationProjectDao
|
|
|
if value, err := factory.CreateCooperationProjectDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
} else {
|
|
|
cooperationProjectDao = value
|
|
|
}
|
|
|
|
|
|
// 获取发起人
|
|
|
var sponsor *domain.User
|
|
|
// sponsorUid类型转换
|
...
|
...
|
@@ -520,6 +539,18 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro |
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateCooperationProjectCommand.CooperationProjectId)))
|
|
|
}
|
|
|
|
|
|
// 校验共创项目名称是否唯一
|
|
|
if cooperationProject.CooperationProjectName != updateCooperationProjectCommand.CooperationProjectName {
|
|
|
nameAvailable, _ := cooperationProjectDao.CheckProjectNameAvailable(map[string]interface{}{
|
|
|
"companyId": updateCooperationProjectCommand.CompanyId,
|
|
|
"orgId": updateCooperationProjectCommand.OrgId,
|
|
|
"cooperationProjectName": updateCooperationProjectCommand.CooperationProjectName,
|
|
|
})
|
|
|
if !nameAvailable {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "共创项目名称重复")
|
|
|
}
|
|
|
}
|
|
|
|
|
|
applicantTypes := make(map[int32]interface{})
|
|
|
|
|
|
// 获取所有申请人
|
...
|
...
|
|