|
@@ -951,7 +951,7 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
pars = append(pars, sellerId)
|
|
|
|
|
|
conditionEnd += ` AND a.seller_id_last = ? `
|
|
|
- parsEnd = append(pars, sellerId)
|
|
|
+ parsEnd = append(parsEnd, sellerId)
|
|
|
}
|
|
|
|
|
|
condition += ` AND a.status = 1 AND a.inherit_end_date >= ? AND a.inherit_end_date <= ? AND inherit_company_contract_id > 0 `
|
|
@@ -962,11 +962,12 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
br.ErrMsg = "获取数据信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ fmt.Println("listRaiData", len(listRaiData))
|
|
|
|
|
|
//到期合同数据
|
|
|
conditionEnd += ` AND a.status = 1 AND a.end_date >= ? AND a.end_date <= ? AND a.end_date < ? `
|
|
|
parsEnd = append(parsEnd, startDate, endDate, time.Now().Format(utils.FormatDate))
|
|
|
- listEndData, err := statistic_report.GetRaiDataSummaryList(condition, pars)
|
|
|
+ listEndData, err := statistic_report.GetRaiDataSummaryList(conditionEnd, parsEnd)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据信息失败"
|
|
|
br.ErrMsg = "获取数据信息失败,Err:" + err.Error()
|
|
@@ -975,18 +976,18 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
|
|
|
var renewedContractMoney float64 // 续约金额
|
|
|
var renewedContractCompany float64 // 续约客户数
|
|
|
- maprenewedContractCompany := make(map[int]bool)
|
|
|
+ //maprenewedContractCompany := make(map[int]bool)
|
|
|
|
|
|
var expiredContractMoney float64 //到期金额
|
|
|
var expiredContractCompany float64 // 到期客户数
|
|
|
- mapexpiredContractCompany := make(map[int]bool)
|
|
|
+ //mapexpiredContractCompany := make(map[int]bool)
|
|
|
|
|
|
for _, v := range listRaiData {
|
|
|
renewedContractMoney += v.Money
|
|
|
- if !maprenewedContractCompany[v.CompanyId] {
|
|
|
- renewedContractCompany++
|
|
|
- maprenewedContractCompany[v.CompanyId] = true
|
|
|
- }
|
|
|
+ //if !maprenewedContractCompany[v.CompanyId] {
|
|
|
+ renewedContractCompany++
|
|
|
+ //maprenewedContractCompany[v.CompanyId] = true
|
|
|
+ //}
|
|
|
//startDateTime := utils.StrDateToDate(v.StartDate)
|
|
|
//if startDateTime.Before(time.Now().AddDate(0, 0, -1)) { //到期合同数据
|
|
|
// expiredContractMoney += v.Money
|
|
@@ -999,10 +1000,10 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
|
|
|
for _, v := range listEndData {
|
|
|
expiredContractMoney += v.Money
|
|
|
- if !mapexpiredContractCompany[v.CompanyId] {
|
|
|
- expiredContractCompany++
|
|
|
- mapexpiredContractCompany[v.CompanyId] = true
|
|
|
- }
|
|
|
+ //if !mapexpiredContractCompany[v.CompanyId] {
|
|
|
+ expiredContractCompany++
|
|
|
+ //mapexpiredContractCompany[v.CompanyId] = true
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
item := new(statistic_report.RaiDataSummaryDetailResp)
|