...
|
...
|
@@ -142,7 +142,7 @@ func (ptr *CooperationStatisticsService) getUserContracts(orgId, userBaseId int6 |
|
|
if userBaseId == 0 {
|
|
|
return contracts, nil
|
|
|
}
|
|
|
contractNumbers, err := ptr.getRelevantContracts(map[string]interface{}{"orgId": orgId, "userBaseId": userBaseId})
|
|
|
contractNumbers, err := ptr.getUnderTakerContracts(map[string]interface{}{"orgId": orgId, "userBaseId": userBaseId})
|
|
|
if len(contractNumbers) == 0 {
|
|
|
return contracts, nil
|
|
|
}
|
...
|
...
|
@@ -163,7 +163,7 @@ func (ptr *CooperationStatisticsService) getCompanyContracts(orgId, userId int64 |
|
|
if userId == 0 {
|
|
|
return contracts, nil
|
|
|
}
|
|
|
contractNumbers, err := ptr.getRelevantContracts1(map[string]interface{}{"orgId": orgId, "userId": userId})
|
|
|
contractNumbers, err := ptr.getRelevantContracts(map[string]interface{}{"orgId": orgId, "userId": userId})
|
|
|
if len(contractNumbers) == 0 {
|
|
|
return contracts, nil
|
|
|
}
|
...
|
...
|
@@ -176,8 +176,8 @@ func (ptr *CooperationStatisticsService) getCompanyContracts(orgId, userId int64 |
|
|
return contracts, err
|
|
|
}
|
|
|
|
|
|
//getRelevantContracts 获取相关人的合约
|
|
|
func (ptr *CooperationStatisticsService) getRelevantContracts(queryOptions map[string]interface{}) ([]string, error) {
|
|
|
// getUnderTakerContracts 获取承接人的合约
|
|
|
func (ptr *CooperationStatisticsService) getUnderTakerContracts(queryOptions map[string]interface{}) ([]string, error) {
|
|
|
undertakerRepository, _ := dao.NewCooperationContractUndertakerDao(ptr.transactionContext)
|
|
|
_, undertakers, err := undertakerRepository.Find(queryOptions)
|
|
|
var numbers []string
|
...
|
...
|
@@ -191,7 +191,7 @@ func (ptr *CooperationStatisticsService) getRelevantContracts(queryOptions map[s |
|
|
}
|
|
|
|
|
|
//getRelevantContracts 获取相关人的合约
|
|
|
func (ptr *CooperationStatisticsService) getRelevantContracts1(queryOptions map[string]interface{}) ([]string, error) {
|
|
|
func (ptr *CooperationStatisticsService) getRelevantContracts(queryOptions map[string]interface{}) ([]string, error) {
|
|
|
undertakerRepository, _ := repository.NewCooperationContractRelevantRepository(ptr.transactionContext)
|
|
|
_, undertakers, err := undertakerRepository.Find(queryOptions)
|
|
|
var numbers []string
|
...
|
...
|
@@ -401,7 +401,7 @@ func (ptr *CooperationStatisticsService) DividendsStatistics(queryOptions map[st |
|
|
return struct{}{}, err
|
|
|
}
|
|
|
} else if request.UserBaseId > 0 {
|
|
|
contractNumbers, err = ptr.getRelevantContracts(map[string]interface{}{"orgId": request.OrgId, "userBaseId": request.UserBaseId})
|
|
|
contractNumbers, err = ptr.getUnderTakerContracts(map[string]interface{}{"orgId": request.OrgId, "userBaseId": request.UserBaseId})
|
|
|
if err != nil {
|
|
|
return struct{}{}, err
|
|
|
}
|
...
|
...
|
@@ -524,7 +524,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m |
|
|
return struct{}{}, err
|
|
|
}
|
|
|
} else if request.UserBaseId > 0 {
|
|
|
contractNumbers, err = ptr.getRelevantContracts(map[string]interface{}{"orgId": request.OrgId, "userBaseId": request.UserBaseId})
|
|
|
contractNumbers, err = ptr.getUnderTakerContracts(map[string]interface{}{"orgId": request.OrgId, "userBaseId": request.UserBaseId})
|
|
|
if err != nil {
|
|
|
return struct{}{}, err
|
|
|
}
|
...
|
...
|
|