...
|
...
|
@@ -3,6 +3,7 @@ package service |
|
|
import (
|
|
|
"crypto/sha1"
|
|
|
"fmt"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
|
|
"strconv"
|
|
|
"time"
|
|
|
|
...
|
...
|
@@ -570,3 +571,46 @@ func (usersService *UsersService) GetInitPassword(operator domain.Operator) (str |
|
|
password = fmt.Sprintf("%x", sha1.Sum([]byte(reqResult.Value)))
|
|
|
return password, reqResult.Value, err
|
|
|
}
|
|
|
|
|
|
// SelectorCooperationProjectUsers 共创项目用户下拉列表
|
|
|
func (usersService *UsersService) SelectorCooperationProjectUsers(q *query.CooperationProjectUsersQuery) (interface{}, error) {
|
|
|
applications := make([]interface{}, 0)
|
|
|
// 项目申请人
|
|
|
if q.CooperationProjectId != 0 {
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(q.Operator)
|
|
|
resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
|
|
|
CooperationProjectId: q.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),
|
|
|
CooperationApplicationStatus: 2, //审核通过的
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
for i := range resultApplication.Grid.List {
|
|
|
item := resultApplication.Grid.List[i]
|
|
|
user := map[string]interface{}{
|
|
|
"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)
|
|
|
}
|
|
|
}
|
|
|
return map[string]interface{}{
|
|
|
"applicants": applications,
|
|
|
}, nil
|
|
|
} |
...
|
...
|
|