作者 yangfu

统计修改

... ... @@ -167,7 +167,7 @@ func (dao *DividendsEstimateDao) DividendsEstimateStatistics(queryOptions map[st
query.Where("cooperation_contract_number in (?)", pg.In(cooperationContractNumbers))
}
//query.AllWithDeleted()
query.Where("is_canceled is null")
query.Where("is_canceled =false")
if err := query.Select(v); err != nil {
return err
}
... ...
... ... @@ -416,7 +416,14 @@ func (ptr *CooperationStatisticsService) DividendsStatistics(queryOptions map[st
if err := dividendsEstimateDao.DividendsEstimateStatistics(queryOptions, annualDividendsEstimate); err != nil {
return nil, err
}
if err := creditAccountDao.DividendsStatistics(queryOptions, annualDividends); err != nil {
if err := creditAccountDao.DividendsStatistics(map[string]interface{}{
"companyId": request.CompanyId,
"orgId": request.OrgId,
"userId": request.UserId,
"userBaseId": request.UserBaseId,
"paymentBeginTime": queryOptions["beginTime"],
"paymentEndTime": queryOptions["endTime"],
}, annualDividends); err != nil {
return nil, err
}
annualDividendsEstimate.Paid = annualDividends.Paid
... ... @@ -425,7 +432,14 @@ func (ptr *CooperationStatisticsService) DividendsStatistics(queryOptions map[st
if err := dividendsEstimateDao.DividendsEstimateStatistics(queryOptions, quarterDividendsEstimate); err != nil {
return nil, err
}
if err := creditAccountDao.DividendsStatistics(queryOptions, quarterDividends); err != nil {
if err := creditAccountDao.DividendsStatistics(map[string]interface{}{
"companyId": request.CompanyId,
"orgId": request.OrgId,
"userId": request.UserId,
"userBaseId": request.UserBaseId,
"paymentBeginTime": queryOptions["beginTime"],
"paymentEndTime": queryOptions["endTime"],
}, quarterDividends); err != nil {
return nil, err
}
quarterDividendsEstimate.Paid = quarterDividends.Paid
... ... @@ -526,6 +540,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m
queryOptions["cooperationContractNumbers"] = contractNumbers
dividendsEstimateRepository, _ := repository.NewDividendsEstimateRepository(ptr.transactionContext)
queryOptions["isCanceled"] = false
_, estimates, err := dividendsEstimateRepository.Find(queryOptions)
if err != nil {
return nil, err
... ...