作者 yangfu

共创统计修改

@@ -229,6 +229,12 @@ func (ptr *CooperationStatisticsService) CompanyCooperationUsersStatistics(query @@ -229,6 +229,12 @@ func (ptr *CooperationStatisticsService) CompanyCooperationUsersStatistics(query
229 } 229 }
230 if user, e := userService.UserFrom(0, 0, responses[i].UserId); e == nil && user != nil { 230 if user, e := userService.UserFrom(0, 0, responses[i].UserId); e == nil && user != nil {
231 item["cooperationTime"] = user.CreatedAt.Unix() * 1000 231 item["cooperationTime"] = user.CreatedAt.Unix() * 1000
  232 + item["participator"] = map[string]interface{}{
  233 + "userId": user.UserId,
  234 + "userInfo": map[string]interface{}{
  235 + "userName": user.UserName,
  236 + },
  237 + }
232 } 238 }
233 retMap = append(retMap, item) 239 retMap = append(retMap, item)
234 } 240 }
@@ -515,6 +515,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m @@ -515,6 +515,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m
515 if item.DividendsType == 1 { 515 if item.DividendsType == 1 {
516 order, err := dividendsOrderRepository.FindOne(map[string]interface{}{ 516 order, err := dividendsOrderRepository.FindOne(map[string]interface{}{
517 "dividendsOrderNumber": item.OrderOrReturnedOrderNum, 517 "dividendsOrderNumber": item.OrderOrReturnedOrderNum,
  518 + "orgId": request.OrgId,
518 }) 519 })
519 if err != nil { 520 if err != nil {
520 return nil, err 521 return nil, err
@@ -522,7 +523,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m @@ -522,7 +523,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m
522 result.DividendsOrderAmount = order.DividendsOrderAmount 523 result.DividendsOrderAmount = order.DividendsOrderAmount
523 result.CustomerName = order.CustomerName 524 result.CustomerName = order.CustomerName
524 } else if item.DividendsType == 2 { 525 } else if item.DividendsType == 2 {
525 - order, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{"dividendsReturnedOrderNumber": item.OrderOrReturnedOrderNum}) 526 + order, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{"dividendsReturnedOrderNumber": item.OrderOrReturnedOrderNum, "orgId": request.OrgId})
526 if err != nil { 527 if err != nil {
527 return nil, err 528 return nil, err
528 } 529 }
@@ -584,7 +585,7 @@ func (ptr *CooperationStatisticsService) RelevantCooperationContractNumbers(quer @@ -584,7 +585,7 @@ func (ptr *CooperationStatisticsService) RelevantCooperationContractNumbers(quer
584 return nil, err 585 return nil, err
585 } 586 }
586 queryOptions = tool_funs.SimpleStructToMap(&request) 587 queryOptions = tool_funs.SimpleStructToMap(&request)
587 - 588 + queryOptions["limit"] = 999
588 contractNumbers, err := ptr.getRelevantContracts(queryOptions) 589 contractNumbers, err := ptr.getRelevantContracts(queryOptions)
589 return contractNumbers, err 590 return contractNumbers, err
590 } 591 }
@@ -208,6 +208,9 @@ func (repository *CreditAccountRepository) Find(queryOptions map[string]interfac @@ -208,6 +208,9 @@ func (repository *CreditAccountRepository) Find(queryOptions map[string]interfac
208 if cooperationContractNumber, ok := queryOptions["cooperationContractNumber"]; ok && cooperationContractNumber != "" { 208 if cooperationContractNumber, ok := queryOptions["cooperationContractNumber"]; ok && cooperationContractNumber != "" {
209 query.Where(`cooperation_contract_number = ?`, fmt.Sprintf("%s", cooperationContractNumber)) 209 query.Where(`cooperation_contract_number = ?`, fmt.Sprintf("%s", cooperationContractNumber))
210 } 210 }
  211 + if v, ok := queryOptions["cooperationContractNumbers"]; ok && len(v.([]string)) > 0 {
  212 + query.Where("cooperation_contract_number in (?)", pg.In(v))
  213 + }
211 if paymentStatus, ok := queryOptions["paymentStatus"]; ok && paymentStatus.(int32) != 0 { 214 if paymentStatus, ok := queryOptions["paymentStatus"]; ok && paymentStatus.(int32) != 0 {
212 query.Where("payment_status = ?", paymentStatus) 215 query.Where("payment_status = ?", paymentStatus)
213 } 216 }