1
|
package service
|
1
|
package service
|
2
|
|
2
|
|
3
|
import (
|
3
|
import (
|
|
|
4
|
+ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
4
|
"strconv"
|
5
|
"strconv"
|
5
|
|
6
|
|
6
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
7
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
|
@@ -174,6 +175,43 @@ func (orgsService OrgsService) DepartmentsUsers(departmentsUsersQuery *query.Dep |
|
@@ -174,6 +175,43 @@ func (orgsService OrgsService) DepartmentsUsers(departmentsUsersQuery *query.Dep |
174
|
if err := departmentUsersDto.LoadDto(departmentsUsersQuery.Type, orgs, users); err != nil {
|
175
|
if err := departmentUsersDto.LoadDto(departmentsUsersQuery.Type, orgs, users); err != nil {
|
175
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
176
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
176
|
}
|
177
|
}
|
|
|
178
|
+
|
|
|
179
|
+ // 项目申请人
|
|
|
180
|
+ if departmentsUsersQuery.CooperationProjectId != 0 {
|
|
|
181
|
+ creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(departmentsUsersQuery.Operator)
|
|
|
182
|
+ resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
|
|
|
183
|
+ CooperationProjectId: departmentsUsersQuery.CooperationProjectId,
|
|
|
184
|
+ })
|
|
|
185
|
+ if err != nil {
|
|
|
186
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
187
|
+ }
|
|
|
188
|
+ resultApplication, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
|
|
|
189
|
+ CooperationProjectNumber: resultProject.CooperationProject.CooperationProjectNumber,
|
|
|
190
|
+ PageNumber: 0,
|
|
|
191
|
+ PageSize: 1000,
|
|
|
192
|
+ CompanyId: resultProject.Company.CompanyId,
|
|
|
193
|
+ OrgId: int64(resultProject.Org.OrgId),
|
|
|
194
|
+ })
|
|
|
195
|
+ if err != nil {
|
|
|
196
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
197
|
+ }
|
|
|
198
|
+ applications := make([]interface{}, 0)
|
|
|
199
|
+ for i := range resultApplication.Grid.List {
|
|
|
200
|
+ item := resultApplication.Grid.List[i]
|
|
|
201
|
+ user := dto.User{
|
|
|
202
|
+ UserID: item.CooperationApplicationApplicant.UserID,
|
|
|
203
|
+ UserCode: item.CooperationApplicationApplicant.UserInfo.UserCode,
|
|
|
204
|
+ UserInfo: map[string]interface{}{
|
|
|
205
|
+ "userName": item.CooperationApplicationApplicant.UserInfo.UserName,
|
|
|
206
|
+ "phone": item.CooperationApplicationApplicant.UserInfo.UserPhone,
|
|
|
207
|
+ },
|
|
|
208
|
+ Department: item.CooperationApplicationApplicant.Department,
|
|
|
209
|
+ }
|
|
|
210
|
+ applications = append(applications, user)
|
|
|
211
|
+ }
|
|
|
212
|
+ departmentUsersDto.Applicants = applications
|
|
|
213
|
+ }
|
|
|
214
|
+
|
177
|
return departmentUsersDto, nil
|
215
|
return departmentUsersDto, nil
|
178
|
}
|
216
|
}
|
179
|
|
217
|
|