...
|
...
|
@@ -531,3 +531,42 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfoAttac |
|
|
|
|
|
return response, nil
|
|
|
}
|
|
|
|
|
|
// 个人 - 共创企业
|
|
|
func (ptr *CooperationStatisticsService) PersonCooperationCompany(queryOptions map[string]interface{}) (interface{}, error) {
|
|
|
// 参数验证
|
|
|
var request = struct {
|
|
|
UserBaseId int64 `json:"userBaseId"`
|
|
|
}{}
|
|
|
if err := LoadQueryObject(queryOptions, &request); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
var response = struct {
|
|
|
OrgIds []int64 `json:"orgIds"`
|
|
|
}{
|
|
|
OrgIds: make([]int64, 0),
|
|
|
}
|
|
|
undertakerDao, _ := dao.NewCooperationContractUndertakerDao(ptr.transactionContext)
|
|
|
_, undertakers, _ := undertakerDao.Find(map[string]interface{}{"userBaseId": request.UserBaseId, "offsetLimit": false})
|
|
|
contractIds := make([]int64, 0)
|
|
|
if len(undertakers) == 0 {
|
|
|
return response, nil
|
|
|
}
|
|
|
for i := range undertakers {
|
|
|
contractIds = append(contractIds, undertakers[i].CooperationContractId)
|
|
|
}
|
|
|
var mapOrg = make(map[int64]int64)
|
|
|
contractDao, _ := dao.NewCooperationContractDao(ptr.transactionContext)
|
|
|
_, contracts, err := contractDao.Find(map[string]interface{}{"cooperationContractIds": contractIds})
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
for i := range contracts {
|
|
|
orgId := contracts[i].Org.OrgId
|
|
|
if _, ok := mapOrg[orgId]; !ok {
|
|
|
response.OrgIds = append(response.OrgIds, orgId)
|
|
|
mapOrg[orgId] = orgId
|
|
|
}
|
|
|
}
|
|
|
return response, nil
|
|
|
} |
...
|
...
|
|