|
|
package service
|
|
|
|
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
|
|
"strconv"
|
|
|
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
...
|
...
|
@@ -174,6 +175,43 @@ func (orgsService OrgsService) DepartmentsUsers(departmentsUsersQuery *query.Dep |
|
|
if err := departmentUsersDto.LoadDto(departmentsUsersQuery.Type, orgs, users); err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
// 项目申请人
|
|
|
if departmentsUsersQuery.CooperationProjectId != 0 {
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(departmentsUsersQuery.Operator)
|
|
|
resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
|
|
|
CooperationProjectId: departmentsUsersQuery.CooperationProjectId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
resultApplication, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
|
|
|
CooperationProjectNumber: resultProject.CooperationProject.CooperationProjectNumber,
|
|
|
PageNumber: 0,
|
|
|
PageSize: 1000,
|
|
|
CompanyId: resultProject.Company.CompanyId,
|
|
|
OrgId: int64(resultProject.Org.OrgId),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
applications := make([]interface{}, 0)
|
|
|
for i := range resultApplication.Grid.List {
|
|
|
item := resultApplication.Grid.List[i]
|
|
|
user := dto.User{
|
|
|
UserID: item.CooperationApplicationApplicant.UserID,
|
|
|
UserCode: item.CooperationApplicationApplicant.UserInfo.UserCode,
|
|
|
UserInfo: map[string]interface{}{
|
|
|
"userName": item.CooperationApplicationApplicant.UserInfo.UserName,
|
|
|
"phone": item.CooperationApplicationApplicant.UserInfo.UserPhone,
|
|
|
},
|
|
|
Department: item.CooperationApplicationApplicant.Department,
|
|
|
}
|
|
|
applications = append(applications, user)
|
|
|
}
|
|
|
departmentUsersDto.Applicants = applications
|
|
|
}
|
|
|
|
|
|
return departmentUsersDto, nil
|
|
|
}
|
|
|
|
...
|
...
|
|