...
|
...
|
@@ -163,7 +163,7 @@ func (ptr *CooperationStatisticsService) getCompanyContracts(orgId, userId int64 |
|
|
if userId == 0 {
|
|
|
return contracts, nil
|
|
|
}
|
|
|
contractNumbers, err := ptr.getRelevantContracts(map[string]interface{}{"orgId": orgId, "userId": userId})
|
|
|
contractNumbers, err := ptr.getRelevantContracts1(map[string]interface{}{"orgId": orgId, "userId": userId})
|
|
|
if len(contractNumbers) == 0 {
|
|
|
return contracts, nil
|
|
|
}
|
...
|
...
|
@@ -190,6 +190,20 @@ func (ptr *CooperationStatisticsService) getRelevantContracts(queryOptions map[s |
|
|
return numbers, err
|
|
|
}
|
|
|
|
|
|
//getRelevantContracts 获取相关人的合约
|
|
|
func (ptr *CooperationStatisticsService) getRelevantContracts1(queryOptions map[string]interface{}) ([]string, error) {
|
|
|
undertakerRepository, _ := repository.NewCooperationContractRelevantRepository(ptr.transactionContext)
|
|
|
_, undertakers, err := undertakerRepository.Find(queryOptions)
|
|
|
var numbers []string
|
|
|
for i := range undertakers {
|
|
|
numbers = append(numbers, undertakers[i].CooperationContractNumber)
|
|
|
}
|
|
|
if len(numbers) == 0 {
|
|
|
return []string{}, nil
|
|
|
}
|
|
|
return numbers, err
|
|
|
}
|
|
|
|
|
|
// getContractsDividendsEstimate 合约分红预算
|
|
|
func (ptr *CooperationStatisticsService) getContractsDividendsEstimate(numbers []string) (map[string]*domain.DividendsEstimate, error) {
|
|
|
var estimates []*domain.DividendsEstimate
|
...
|
...
|
|