作者 yangfu

统计修改

@@ -167,7 +167,7 @@ func (dao *DividendsEstimateDao) DividendsEstimateStatistics(queryOptions map[st @@ -167,7 +167,7 @@ func (dao *DividendsEstimateDao) DividendsEstimateStatistics(queryOptions map[st
167 query.Where("cooperation_contract_number in (?)", pg.In(cooperationContractNumbers)) 167 query.Where("cooperation_contract_number in (?)", pg.In(cooperationContractNumbers))
168 } 168 }
169 //query.AllWithDeleted() 169 //query.AllWithDeleted()
170 - query.Where("is_canceled is null") 170 + query.Where("is_canceled =false")
171 if err := query.Select(v); err != nil { 171 if err := query.Select(v); err != nil {
172 return err 172 return err
173 } 173 }
@@ -416,7 +416,14 @@ func (ptr *CooperationStatisticsService) DividendsStatistics(queryOptions map[st @@ -416,7 +416,14 @@ func (ptr *CooperationStatisticsService) DividendsStatistics(queryOptions map[st
416 if err := dividendsEstimateDao.DividendsEstimateStatistics(queryOptions, annualDividendsEstimate); err != nil { 416 if err := dividendsEstimateDao.DividendsEstimateStatistics(queryOptions, annualDividendsEstimate); err != nil {
417 return nil, err 417 return nil, err
418 } 418 }
419 - if err := creditAccountDao.DividendsStatistics(queryOptions, annualDividends); err != nil { 419 + if err := creditAccountDao.DividendsStatistics(map[string]interface{}{
  420 + "companyId": request.CompanyId,
  421 + "orgId": request.OrgId,
  422 + "userId": request.UserId,
  423 + "userBaseId": request.UserBaseId,
  424 + "paymentBeginTime": queryOptions["beginTime"],
  425 + "paymentEndTime": queryOptions["endTime"],
  426 + }, annualDividends); err != nil {
420 return nil, err 427 return nil, err
421 } 428 }
422 annualDividendsEstimate.Paid = annualDividends.Paid 429 annualDividendsEstimate.Paid = annualDividends.Paid
@@ -425,7 +432,14 @@ func (ptr *CooperationStatisticsService) DividendsStatistics(queryOptions map[st @@ -425,7 +432,14 @@ func (ptr *CooperationStatisticsService) DividendsStatistics(queryOptions map[st
425 if err := dividendsEstimateDao.DividendsEstimateStatistics(queryOptions, quarterDividendsEstimate); err != nil { 432 if err := dividendsEstimateDao.DividendsEstimateStatistics(queryOptions, quarterDividendsEstimate); err != nil {
426 return nil, err 433 return nil, err
427 } 434 }
428 - if err := creditAccountDao.DividendsStatistics(queryOptions, quarterDividends); err != nil { 435 + if err := creditAccountDao.DividendsStatistics(map[string]interface{}{
  436 + "companyId": request.CompanyId,
  437 + "orgId": request.OrgId,
  438 + "userId": request.UserId,
  439 + "userBaseId": request.UserBaseId,
  440 + "paymentBeginTime": queryOptions["beginTime"],
  441 + "paymentEndTime": queryOptions["endTime"],
  442 + }, quarterDividends); err != nil {
429 return nil, err 443 return nil, err
430 } 444 }
431 quarterDividendsEstimate.Paid = quarterDividends.Paid 445 quarterDividendsEstimate.Paid = quarterDividends.Paid
@@ -526,6 +540,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m @@ -526,6 +540,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m
526 queryOptions["cooperationContractNumbers"] = contractNumbers 540 queryOptions["cooperationContractNumbers"] = contractNumbers
527 541
528 dividendsEstimateRepository, _ := repository.NewDividendsEstimateRepository(ptr.transactionContext) 542 dividendsEstimateRepository, _ := repository.NewDividendsEstimateRepository(ptr.transactionContext)
  543 + queryOptions["isCanceled"] = false
529 _, estimates, err := dividendsEstimateRepository.Find(queryOptions) 544 _, estimates, err := dividendsEstimateRepository.Find(queryOptions)
530 if err != nil { 545 if err != nil {
531 return nil, err 546 return nil, err