作者 yangfu

共创统计修改

... ... @@ -229,6 +229,12 @@ func (ptr *CooperationStatisticsService) CompanyCooperationUsersStatistics(query
}
if user, e := userService.UserFrom(0, 0, responses[i].UserId); e == nil && user != nil {
item["cooperationTime"] = user.CreatedAt.Unix() * 1000
item["participator"] = map[string]interface{}{
"userId": user.UserId,
"userInfo": map[string]interface{}{
"userName": user.UserName,
},
}
}
retMap = append(retMap, item)
}
... ...
... ... @@ -515,6 +515,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m
if item.DividendsType == 1 {
order, err := dividendsOrderRepository.FindOne(map[string]interface{}{
"dividendsOrderNumber": item.OrderOrReturnedOrderNum,
"orgId": request.OrgId,
})
if err != nil {
return nil, err
... ... @@ -522,7 +523,7 @@ func (ptr *CooperationStatisticsService) SearchDividendsEstimates(queryOptions m
result.DividendsOrderAmount = order.DividendsOrderAmount
result.CustomerName = order.CustomerName
} else if item.DividendsType == 2 {
order, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{"dividendsReturnedOrderNumber": item.OrderOrReturnedOrderNum})
order, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{"dividendsReturnedOrderNumber": item.OrderOrReturnedOrderNum, "orgId": request.OrgId})
if err != nil {
return nil, err
}
... ... @@ -584,7 +585,7 @@ func (ptr *CooperationStatisticsService) RelevantCooperationContractNumbers(quer
return nil, err
}
queryOptions = tool_funs.SimpleStructToMap(&request)
queryOptions["limit"] = 999
contractNumbers, err := ptr.getRelevantContracts(queryOptions)
return contractNumbers, err
}
... ...
... ... @@ -208,6 +208,9 @@ func (repository *CreditAccountRepository) Find(queryOptions map[string]interfac
if cooperationContractNumber, ok := queryOptions["cooperationContractNumber"]; ok && cooperationContractNumber != "" {
query.Where(`cooperation_contract_number = ?`, fmt.Sprintf("%s", cooperationContractNumber))
}
if v, ok := queryOptions["cooperationContractNumbers"]; ok && len(v.([]string)) > 0 {
query.Where("cooperation_contract_number in (?)", pg.In(v))
}
if paymentStatus, ok := queryOptions["paymentStatus"]; ok && paymentStatus.(int32) != 0 {
query.Where("payment_status = ?", paymentStatus)
}
... ...