...
|
...
|
@@ -281,6 +281,16 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec |
|
|
cooperationApplicationRepository = value
|
|
|
}
|
|
|
|
|
|
// 共创合约仓储初始化
|
|
|
var cooperationContractRepository domain.CooperationContractRepository
|
|
|
if value, err := factory.CreateCooperationContractRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
cooperationContractRepository = value
|
|
|
}
|
|
|
|
|
|
var getCooperationProjectQuerySpecific *query.GetCooperationProjectQuery
|
|
|
if getCooperationProjectQuery.CooperationProjectId != 0 { // 根据ID查询
|
|
|
getCooperationProjectQuerySpecific = &query.GetCooperationProjectQuery{
|
...
|
...
|
@@ -349,6 +359,37 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec |
|
|
undertakerTypesUncheckedAvailable = append(undertakerTypesUncheckedAvailable, 3)
|
|
|
}
|
|
|
|
|
|
// TODO 判断项目关联的合约承接人类型
|
|
|
undertakers := make([]*domain.Undertaker, 0)
|
|
|
if countContracts, cooperationContracts, err := cooperationContractRepository.Find(map[string]interface{}{
|
|
|
"offsetLimit": false,
|
|
|
}); err != nil {
|
|
|
|
|
|
} else {
|
|
|
if countContracts > 0 {
|
|
|
for _, cooperationContract := range cooperationContracts {
|
|
|
undertakers = append(undertakers, cooperationContract.Undertakers...)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var undertakerUserTypes []int32
|
|
|
for _, undertaker := range undertakers {
|
|
|
undertakerUserTypes = append(undertakerUserTypes, undertaker.UserType)
|
|
|
}
|
|
|
|
|
|
undertakerUserTypes = utils.RemoveDuplicationInt32(undertakerUserTypes)
|
|
|
|
|
|
for i, userType := range undertakerUserTypes {
|
|
|
if userType == 1025 {
|
|
|
undertakerUserTypes[i] = 2
|
|
|
}
|
|
|
}
|
|
|
|
|
|
log.Logger.Info("承接人类型", map[string]interface{}{
|
|
|
"undertakerUserTypes": undertakerUserTypes,
|
|
|
})
|
|
|
|
|
|
// 返回所有员工类型的申请通过人
|
|
|
applicants := make([]*domain.User, 0)
|
|
|
|
...
|
...
|
@@ -357,6 +398,7 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec |
|
|
"cooperationProjectNumberExact": cooperationProject.CooperationProjectNumber,
|
|
|
"companyId": cooperationProject.Company.CompanyId,
|
|
|
"orgId": cooperationProject.Org.OrgId,
|
|
|
"offsetLimit": false,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
...
|
...
|
|