|
@@ -60,6 +60,9 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
developButton, _ := this.GetBool("DevelopButton")
|
|
|
serverButton, _ := this.GetBool("ServerButton")
|
|
|
|
|
|
+ adminIdArr := strings.Split(adminId, ",")
|
|
|
+ serviceAdminIdArr := strings.Split(serviceAdminId, ",")
|
|
|
+
|
|
|
dataTypeArr := []string{}
|
|
|
if dataType == "季度" {
|
|
|
dataTypeArr = []string{"Q1", "Q2", "Q3", "Q4"}
|
|
@@ -185,19 +188,32 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
mapNewCustomerInvoicingMoney := make(map[string]float64) // 财务系统新客开票金额(金额)
|
|
|
mapNewCustomerPaymentsReceivedMoney := make(map[string]float64) // 财务系统新客到款金额(金额)
|
|
|
|
|
|
+ mapExpiredContractMoneyServer := make(map[string]float64) // 到期合同(金额)
|
|
|
+ mapExpiredContractNumServer := make(map[string]int) // 到期合同(数量)_服务组
|
|
|
+ mapExpiredContractCompanyNumServer := make(map[string]int) // 到期公司(数量)_服务组
|
|
|
+ mapRenewedContractMoneyServer := make(map[string]float64) // 续约合同(金额)_服务组
|
|
|
+ mapRenewedContractNumServer := make(map[string]int) // 续约合同(数量)_服务组
|
|
|
+ mapRenewedContractCompanyNumServer := make(map[string]int) // 续约公司(数量)_服务组
|
|
|
+ confirmedNoRenewalContractMoneyServer := make(map[string]float64) // 确认不续约合同(金额)_服务组
|
|
|
+ confirmedNoRenewalContractNumServer := make(map[string]int) // 确认不续约合同(数量)_服务组
|
|
|
+ confirmedNoRenewalContractCompanyNumServer := make(map[string]int) // 确认不续约公司(数量)_服务组
|
|
|
+ mapSignedClientNumServer := make(map[string]int) // 签约客户(数量)
|
|
|
+ mapSignedClientMoneyServer := make(map[string]float64) // 签约客户(金额)
|
|
|
+
|
|
|
var keyMap string
|
|
|
var keyMapTtoal string
|
|
|
var keyMapTtoalServer string
|
|
|
var keyMapCompany string
|
|
|
var keyMapCompanyNo string
|
|
|
+ //var keyMapCompanyNoServer string
|
|
|
var keySigned string
|
|
|
|
|
|
mapCompanyData := make(map[string]bool)
|
|
|
//新签部分的数据
|
|
|
for _, v := range listRaiData {
|
|
|
- if !mapsellerId[v.SellerIdInit] {
|
|
|
- continue
|
|
|
- }
|
|
|
+ //if !mapsellerId[v.SellerIdInit] {
|
|
|
+ // continue
|
|
|
+ //}
|
|
|
|
|
|
startDateTime := utils.StrDateToDate(v.StartDate)
|
|
|
monthNum := startDateTime.Month()
|
|
@@ -221,7 +237,7 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
}
|
|
|
|
|
|
keyMap = fmt.Sprint(yearStr, "_", v.SellerIdLast)
|
|
|
- keySigned = fmt.Sprint(yearStr, "_", "_CID_", v.CompanyId, "_SID_", v.SellerIdLast)
|
|
|
+ keySigned = fmt.Sprint(yearStr, "_CID_", v.CompanyId, "_SID_", v.SellerIdLast)
|
|
|
|
|
|
if sellerDevelopIds[v.SellerIdLast] == true {
|
|
|
keyMapTtoal = fmt.Sprint(yearStr, "_Develop")
|
|
@@ -246,10 +262,10 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //续约部分的数据
|
|
|
+ //续约部分的数据(开拓组)
|
|
|
mapKeyMapCompanyData := make(map[string]bool)
|
|
|
for _, v := range listInheritData {
|
|
|
- if !mapsellerId[v.SellerIdLast] {
|
|
|
+ if len(adminIdArr) > 0 && utils.InArrayByStr(adminIdArr, strconv.Itoa(v.SellerIdLast)) {
|
|
|
continue
|
|
|
}
|
|
|
startDateTime := utils.StrDateToDate(v.InheritEndDate)
|
|
@@ -275,44 +291,94 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
|
|
|
keyMap = fmt.Sprint(yearStr, "_", v.SellerIdLast)
|
|
|
keyMapCompany = fmt.Sprint(yearStr, "_", v.SellerIdLast, "_CID_", v.CompanyId)
|
|
|
- keySigned = fmt.Sprint(yearStr, "_", "_CID_", v.CompanyId, "_SID_", v.SellerIdLast)
|
|
|
- if sellerDevelopIds[v.SellerIdLast] == true {
|
|
|
- keyMapTtoal = fmt.Sprint(yearStr, "_Develop")
|
|
|
- } else {
|
|
|
- keyMapTtoal = fmt.Sprint(yearStr, "_Service")
|
|
|
- }
|
|
|
+ keySigned = fmt.Sprint(yearStr, "_CID_", v.CompanyId, "_SID_", v.SellerIdLast)
|
|
|
+ keyMapTtoal = fmt.Sprint(yearStr, "_Develop")
|
|
|
|
|
|
//续约合同 数据
|
|
|
mapRenewedContractMoney[keyMap] += v.Money
|
|
|
-
|
|
|
mapRenewedContractMoney[keyMapTtoal] += v.Money
|
|
|
-
|
|
|
- mapSignedClientMoney[keyMap] += v.Money
|
|
|
- mapSignedClientMoney[keyMapTtoal] += v.Money
|
|
|
-
|
|
|
- //一家公司同一个时间纬度,只统计一次
|
|
|
- //if !mapKeyMapCompanyData[keyMapCompany] {
|
|
|
mapRenewedContractNum[keyMap]++
|
|
|
mapRenewedContractNum[keyMapTtoal]++
|
|
|
- //mapKeyMapCompanyData[keyMapCompany] = true
|
|
|
- //}
|
|
|
+
|
|
|
+ //续约公司 数据
|
|
|
if !mapKeyMapCompanyData[keyMapCompany] {
|
|
|
mapRenewedContractCompanyNum[keyMap]++
|
|
|
mapRenewedContractCompanyNum[keyMapTtoal]++
|
|
|
mapKeyMapCompanyData[keyMapCompany] = true
|
|
|
}
|
|
|
- if !mapCompanyData[keySigned] && v.RaiContractType == "续约合同" {
|
|
|
+
|
|
|
+ //签约合同 数据
|
|
|
+ mapSignedClientMoney[keyMap] += v.Money
|
|
|
+ mapSignedClientMoney[keyMapTtoal] += v.Money
|
|
|
+
|
|
|
+ if !mapCompanyData[keySigned] {
|
|
|
mapSignedClientNum[keyMap]++
|
|
|
mapSignedClientNum[keyMapTtoal]++
|
|
|
mapCompanyData[keySigned] = true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //续约部分的数据(服务组)
|
|
|
+ for _, v := range listInheritData {
|
|
|
+ if len(serviceAdminIdArr) > 0 && utils.InArrayByStr(serviceAdminIdArr, strconv.Itoa(v.ShareSellerIdLast)) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ startDateTime := utils.StrDateToDate(v.InheritEndDate)
|
|
|
+ monthNum := startDateTime.Month()
|
|
|
+ yearStr := strconv.Itoa(startDateTime.Year())
|
|
|
+ if dataType == "季度" {
|
|
|
+ if monthNum < 4 {
|
|
|
+ yearStr += "Q1"
|
|
|
+ } else if monthNum > 3 && monthNum < 7 {
|
|
|
+ yearStr += "Q2"
|
|
|
+ } else if monthNum > 6 && monthNum < 10 {
|
|
|
+ yearStr += "Q3"
|
|
|
+ } else if monthNum > 9 {
|
|
|
+ yearStr += "Q4"
|
|
|
+ }
|
|
|
+ } else if dataType == "半年度" {
|
|
|
+ if monthNum < 7 {
|
|
|
+ yearStr += "H1"
|
|
|
+ } else {
|
|
|
+ yearStr += "H2"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ keyMap = fmt.Sprint(yearStr, "_Server_", v.ShareSellerIdLast)
|
|
|
+ keyMapCompany = fmt.Sprint(yearStr, "_Server_", v.ShareSellerIdLast, "_CID_", v.CompanyId)
|
|
|
+ keySigned = fmt.Sprint(yearStr, "_Server_", v.CompanyId, "_SID_", v.ShareSellerIdLast)
|
|
|
+ keyMapTtoal = fmt.Sprint(yearStr, "_Server_")
|
|
|
+
|
|
|
+ //续约合同 数据
|
|
|
+ mapRenewedContractMoneyServer[keyMap] += v.Money
|
|
|
+ mapRenewedContractMoneyServer[keyMapTtoal] += v.Money
|
|
|
+ mapRenewedContractNumServer[keyMap]++
|
|
|
+ mapRenewedContractNumServer[keyMapTtoal]++
|
|
|
+
|
|
|
+ //续约公司 数据
|
|
|
+ if !mapKeyMapCompanyData[keyMapCompany] {
|
|
|
+ mapRenewedContractCompanyNumServer[keyMap]++
|
|
|
+ mapRenewedContractCompanyNumServer[keyMapTtoal]++
|
|
|
+ mapKeyMapCompanyData[keyMapCompany] = true
|
|
|
+ }
|
|
|
+
|
|
|
+ ////签约合同 数据
|
|
|
+ mapSignedClientMoneyServer[keyMap] += v.Money
|
|
|
+ mapSignedClientMoneyServer[keyMapTtoal] += v.Money
|
|
|
+
|
|
|
+ //if !mapCompanyData[keySigned] {
|
|
|
+ // mapSignedClientNum[keyMap]++
|
|
|
+ // mapSignedClientNum[keyMapTtoal]++
|
|
|
+ // mapCompanyData[keySigned] = true
|
|
|
+ //}
|
|
|
+ }
|
|
|
+
|
|
|
//确认不续约、到期合同部分的数据
|
|
|
mapKeyMapCompanyEndData := make(map[string]bool)
|
|
|
mapKeyMapCompanyNoData := make(map[string]bool)
|
|
|
+ //开拓组数据
|
|
|
for _, v := range listEndData {
|
|
|
- if !mapsellerId[v.SellerIdLast] {
|
|
|
+ if len(adminIdArr) > 0 && utils.InArrayByStr(adminIdArr, strconv.Itoa(v.SellerIdLast)) {
|
|
|
continue
|
|
|
}
|
|
|
startDateTime := utils.StrDateToDate(v.EndDate)
|
|
@@ -339,22 +405,15 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
keyMap = fmt.Sprint(yearStr, "_", v.SellerIdLast)
|
|
|
keyMapCompany = fmt.Sprint(yearStr, "_", v.SellerIdLast, "_CID_", v.CompanyId)
|
|
|
keyMapCompanyNo = fmt.Sprint(yearStr, "_", v.SellerIdLast, "_CID_NO", v.CompanyId)
|
|
|
- if sellerDevelopIds[v.SellerIdLast] == true {
|
|
|
- keyMapTtoal = fmt.Sprint(yearStr, "_Develop")
|
|
|
- } else {
|
|
|
- keyMapTtoal = fmt.Sprint(yearStr, "_Service")
|
|
|
- }
|
|
|
+ keyMapTtoal = fmt.Sprint(yearStr, "_Develop")
|
|
|
|
|
|
//到期合同数据
|
|
|
mapExpiredContractMoney[keyMap] += v.Money
|
|
|
mapExpiredContractMoney[keyMapTtoal] += v.Money
|
|
|
|
|
|
//一家公司同一个时间纬度,只统计一次
|
|
|
- //if !mapKeyMapCompanyEndData[keyMapCompany] {
|
|
|
mapExpiredContractNum[keyMap]++
|
|
|
mapExpiredContractNum[keyMapTtoal]++
|
|
|
- //mapKeyMapCompanyEndData[keyMapCompany] = true
|
|
|
- //}
|
|
|
|
|
|
//一家公司同一个时间纬度,只统计一次
|
|
|
if !mapKeyMapCompanyEndData[keyMapCompany] {
|
|
@@ -365,22 +424,77 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
|
|
|
if mapNoRenewedcompanyContractIds[v.CompanyContractId] { // 确认不续约合同
|
|
|
confirmedNoRenewalContractMoney[keyMap] += v.Money
|
|
|
-
|
|
|
confirmedNoRenewalContractMoney[keyMapTtoal] += v.Money
|
|
|
|
|
|
//一家公司同一个时间纬度,只统计一次
|
|
|
- //if !mapKeyMapCompanyNoData[keyMapCompanyNo] {
|
|
|
confirmedNoRenewalContractNum[keyMap]++
|
|
|
confirmedNoRenewalContractNum[keyMapTtoal]++
|
|
|
- //mapKeyMapCompanyNoData[keyMapCompanyNo] = true
|
|
|
- //}
|
|
|
|
|
|
if !mapKeyMapCompanyNoData[keyMapCompanyNo] {
|
|
|
confirmedNoRenewalContractCompanyNum[keyMap]++
|
|
|
confirmedNoRenewalContractCompanyNum[keyMapTtoal]++
|
|
|
mapKeyMapCompanyNoData[keyMapCompanyNo] = true
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //服务组数据
|
|
|
+ for _, v := range listEndData {
|
|
|
+ if len(serviceAdminIdArr) > 0 && utils.InArrayByStr(serviceAdminIdArr, strconv.Itoa(v.ShareSellerIdLast)) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ startDateTime := utils.StrDateToDate(v.EndDate)
|
|
|
+ monthNum := startDateTime.Month()
|
|
|
+ yearStr := strconv.Itoa(startDateTime.Year())
|
|
|
+ if dataType == "季度" {
|
|
|
+ if monthNum < 4 {
|
|
|
+ yearStr += "Q1"
|
|
|
+ } else if monthNum > 3 && monthNum < 7 {
|
|
|
+ yearStr += "Q2"
|
|
|
+ } else if monthNum > 6 && monthNum < 10 {
|
|
|
+ yearStr += "Q3"
|
|
|
+ } else if monthNum > 9 {
|
|
|
+ yearStr += "Q4"
|
|
|
+ }
|
|
|
+ } else if dataType == "半年度" {
|
|
|
+ if monthNum < 7 {
|
|
|
+ yearStr += "H1"
|
|
|
+ } else {
|
|
|
+ yearStr += "H2"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ keyMap = fmt.Sprint(yearStr, "_Server_", v.ShareSellerIdLast)
|
|
|
+ keyMapCompany = fmt.Sprint(yearStr, "_Server_", v.ShareSellerIdLast, "_CID_", v.CompanyId)
|
|
|
+ keyMapCompanyNo = fmt.Sprint(yearStr, "_Server_", v.ShareSellerIdLast, "_CID_NO", v.CompanyId)
|
|
|
+ keyMapTtoal = fmt.Sprint(yearStr, "_Server_")
|
|
|
+
|
|
|
+ //到期合同数据
|
|
|
+ mapExpiredContractMoneyServer[keyMap] += v.Money
|
|
|
+ mapExpiredContractMoneyServer[keyMapTtoal] += v.Money
|
|
|
+ mapExpiredContractNumServer[keyMap]++
|
|
|
+ mapExpiredContractNumServer[keyMapTtoal]++
|
|
|
+
|
|
|
+ //一家公司同一个时间纬度,只统计一次
|
|
|
+ if !mapKeyMapCompanyEndData[keyMapCompany] {
|
|
|
+ mapExpiredContractCompanyNumServer[keyMap]++
|
|
|
+ mapExpiredContractCompanyNumServer[keyMapTtoal]++
|
|
|
+ mapKeyMapCompanyEndData[keyMapCompany] = true
|
|
|
+ }
|
|
|
+
|
|
|
+ if mapNoRenewedcompanyContractIds[v.CompanyContractId] { // 确认不续约合同
|
|
|
+ confirmedNoRenewalContractMoneyServer[keyMap] += v.Money
|
|
|
+ confirmedNoRenewalContractMoneyServer[keyMapTtoal] += v.Money
|
|
|
+
|
|
|
+ //一家公司同一个时间纬度,只统计一次
|
|
|
+ confirmedNoRenewalContractNumServer[keyMap]++
|
|
|
+ confirmedNoRenewalContractNumServer[keyMapTtoal]++
|
|
|
|
|
|
+ if !mapKeyMapCompanyNoData[keyMapCompanyNo] {
|
|
|
+ confirmedNoRenewalContractCompanyNumServer[keyMap]++
|
|
|
+ confirmedNoRenewalContractCompanyNumServer[keyMapTtoal]++
|
|
|
+ mapKeyMapCompanyNoData[keyMapCompanyNo] = true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -391,8 +505,9 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ //开拓组财务系统数据
|
|
|
for _, v := range listFmsData {
|
|
|
- if !mapsellerId[v.RaiSellerId] {
|
|
|
+ if len(adminIdArr) > 0 && utils.InArrayByStr(adminIdArr, strconv.Itoa(v.RaiSellerId)) {
|
|
|
continue
|
|
|
}
|
|
|
startDateTime := v.StartDate
|
|
@@ -417,12 +532,50 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
}
|
|
|
|
|
|
keyMap = fmt.Sprint(yearStr, "_", v.RaiSellerId)
|
|
|
+ keyMapTtoal = fmt.Sprint(yearStr, "_Develop")
|
|
|
|
|
|
- if sellerDevelopIds[v.RaiSellerId] == true {
|
|
|
- keyMapTtoal = fmt.Sprint(yearStr, "_Develop")
|
|
|
- } else {
|
|
|
- keyMapTtoal = fmt.Sprint(yearStr, "_Service")
|
|
|
+ mapInvoiceAmountMoney[keyMap] += v.InvoicedAmount
|
|
|
+ mapPaymentAmountMoney[keyMap] += v.PaymentAmount
|
|
|
+
|
|
|
+ mapInvoiceAmountMoney[keyMapTtoal] += v.InvoicedAmount
|
|
|
+ mapPaymentAmountMoney[keyMapTtoal] += v.PaymentAmount
|
|
|
+
|
|
|
+ if v.ContractType == 1 {
|
|
|
+ mapNewCustomerInvoicingMoney[keyMap] += v.InvoicedAmount
|
|
|
+ mapNewCustomerPaymentsReceivedMoney[keyMap] += v.PaymentAmount
|
|
|
+ mapNewCustomerInvoicingMoney[keyMapTtoal] += v.InvoicedAmount
|
|
|
+ mapNewCustomerPaymentsReceivedMoney[keyMapTtoal] += v.PaymentAmount
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ //服务组财务系统数据
|
|
|
+ for _, v := range listFmsData {
|
|
|
+ if len(serviceAdminIdArr) > 0 && utils.InArrayByStr(serviceAdminIdArr, strconv.Itoa(v.RaiSellerId)) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ startDateTime := v.StartDate
|
|
|
+ monthNum := startDateTime.Month()
|
|
|
+ yearStr := strconv.Itoa(startDateTime.Year())
|
|
|
+ if dataType == "季度" {
|
|
|
+ if monthNum < 4 {
|
|
|
+ yearStr += "Q1"
|
|
|
+ } else if monthNum > 3 && monthNum < 7 {
|
|
|
+ yearStr += "Q2"
|
|
|
+ } else if monthNum > 6 && monthNum < 10 {
|
|
|
+ yearStr += "Q3"
|
|
|
+ } else if monthNum > 9 {
|
|
|
+ yearStr += "Q4"
|
|
|
+ }
|
|
|
+ } else if dataType == "半年度" {
|
|
|
+ if monthNum < 7 {
|
|
|
+ yearStr += "H1"
|
|
|
+ } else {
|
|
|
+ yearStr += "H2"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ keyMap = fmt.Sprint(yearStr, "_", v.RaiSellerId)
|
|
|
+ keyMapTtoal = fmt.Sprint(yearStr, "_Server_")
|
|
|
|
|
|
mapInvoiceAmountMoney[keyMap] += v.InvoicedAmount
|
|
|
mapPaymentAmountMoney[keyMap] += v.PaymentAmount
|
|
@@ -477,20 +630,20 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
if sellerDevelopIds[sysUserId] == true {
|
|
|
keyMapTtoal = fmt.Sprint(yearStr, "_Develop")
|
|
|
} else {
|
|
|
- keyMapTtoal = fmt.Sprint(yearStr, "_Service")
|
|
|
+ keyMapTtoal = fmt.Sprint(yearStr, "_Server_")
|
|
|
}
|
|
|
mapAddTrialNum[keyMapTtoal]++
|
|
|
}
|
|
|
|
|
|
resp := new(statistic_report.RaiDataSummaryListResp)
|
|
|
var items []*statistic_report.RaiDataSummaryResp
|
|
|
+
|
|
|
for i := startYear; i <= endYear; i++ {
|
|
|
//if len(dataTypeArr) > 0 {
|
|
|
for _, Dv := range dataTypeArr {
|
|
|
item := new(statistic_report.RaiDataSummaryResp)
|
|
|
item.DataType = fmt.Sprint(i, Dv)
|
|
|
- keyMapTtoal = fmt.Sprint(item.DataType, "_Develop")
|
|
|
- keyMapTtoalServer = fmt.Sprint(item.DataType, "_Server")
|
|
|
+ keyMapTtoalServer = fmt.Sprint(item.DataType, "_Server_")
|
|
|
var sellerIds []string
|
|
|
var sellerServiceIds []string
|
|
|
for _, vS := range sellerDevelop {
|
|
@@ -610,48 +763,50 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
}
|
|
|
|
|
|
for _, vS := range sellerService {
|
|
|
+ keyMap = fmt.Sprint(item.DataType, "_Server_", vS.AdminId)
|
|
|
sellerItem := new(statistic_report.RaiDataSummaryDetail)
|
|
|
+ sellerItem.IsServerSeller = true
|
|
|
sellerItem.SellerId = strconv.Itoa(vS.AdminId)
|
|
|
sellerServiceIds = append(sellerServiceIds, sellerItem.SellerId)
|
|
|
sellerItem.SellerName = vS.RealName
|
|
|
sellerItem.AddTrialCount = fmt.Sprint(mapAddTrialNum[keyMap])
|
|
|
- sellerItem.NewContractData = fmt.Sprint(utils.SubFloatToString(mapNewContractMoney[keyMap], 2), " / ", mapNewContractNum[keyMap]) // 新签合同(金额/数量)-(数据)
|
|
|
- sellerItem.ExpiredContractData = fmt.Sprint(utils.SubFloatToString(mapExpiredContractMoney[keyMap], 2), " / ", mapExpiredContractNum[keyMap]) //"到期合同(金额/数量)-(数据)"
|
|
|
- sellerItem.RenewedContractData = fmt.Sprint(utils.SubFloatToString(mapRenewedContractMoney[keyMap], 2), " / ", mapRenewedContractNum[keyMap]) // "续约合同(金额/数量)-(数据)"
|
|
|
+ sellerItem.NewContractData = fmt.Sprint(utils.SubFloatToString(mapNewContractMoney[keyMap], 2), " / ", mapNewContractNum[keyMap]) // 新签合同(金额/数量)-(数据)
|
|
|
+ sellerItem.ExpiredContractData = fmt.Sprint(utils.SubFloatToString(mapExpiredContractMoneyServer[keyMap], 2), " / ", mapExpiredContractNumServer[keyMap]) //"到期合同(金额/数量)-(数据)"
|
|
|
+ sellerItem.RenewedContractData = fmt.Sprint(utils.SubFloatToString(mapRenewedContractMoneyServer[keyMap], 2), " / ", mapRenewedContractNumServer[keyMap]) // "续约合同(金额/数量)-(数据)"
|
|
|
var renewalRateMoey string
|
|
|
var renewalRateNum string
|
|
|
- if mapRenewedContractMoney[keyMap] == 0 || mapExpiredContractMoney[keyMap] == 0 {
|
|
|
+ if mapRenewedContractMoneyServer[keyMap] == 0 || mapExpiredContractMoneyServer[keyMap] == 0 {
|
|
|
renewalRateMoey = "0%"
|
|
|
} else {
|
|
|
- renewalRateMoey = utils.SubFloatToString(mapRenewedContractMoney[keyMap]/mapExpiredContractMoney[keyMap]*100, 2) + "%"
|
|
|
+ renewalRateMoey = utils.SubFloatToString(mapRenewedContractMoneyServer[keyMap]/mapExpiredContractMoneyServer[keyMap]*100, 2) + "%"
|
|
|
}
|
|
|
- if mapRenewedContractCompanyNum[keyMap] == 0 || mapExpiredContractCompanyNum[keyMap] == 0 {
|
|
|
+ if mapRenewedContractCompanyNumServer[keyMap] == 0 || mapExpiredContractCompanyNumServer[keyMap] == 0 {
|
|
|
renewalRateNum = "0%"
|
|
|
} else {
|
|
|
- renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractCompanyNum[keyMap])/float64(mapExpiredContractCompanyNum[keyMap])*100, 2) + "%"
|
|
|
+ renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractCompanyNumServer[keyMap])/float64(mapExpiredContractCompanyNumServer[keyMap])*100, 2) + "%"
|
|
|
}
|
|
|
- sellerItem.RenewalRateData = fmt.Sprint(renewalRateMoey, " / ", renewalRateNum) //"续约率(金额/数量)-(数据)"
|
|
|
- sellerItem.ConfirmedNoRenewalContractData = fmt.Sprint(utils.SubFloatToString(confirmedNoRenewalContractMoney[keyMap], 2), " / ", confirmedNoRenewalContractNum[keyMap]) //"确认不续约合同(金额/数量)-(数据)"
|
|
|
+ sellerItem.RenewalRateData = fmt.Sprint(renewalRateMoey, " / ", renewalRateNum) //"续约率(金额/数量)-(数据)"
|
|
|
+ sellerItem.ConfirmedNoRenewalContractData = fmt.Sprint(utils.SubFloatToString(confirmedNoRenewalContractMoneyServer[keyMap], 2), " / ", confirmedNoRenewalContractNumServer[keyMap]) //"确认不续约合同(金额/数量)-(数据)"
|
|
|
|
|
|
var confirmNonRenewalRateMoey string
|
|
|
var confirmNonRenewalRateNum string
|
|
|
- if confirmedNoRenewalContractMoney[keyMap] == 0 || mapExpiredContractMoney[keyMap] == 0 {
|
|
|
+ if confirmedNoRenewalContractMoneyServer[keyMap] == 0 || mapExpiredContractMoneyServer[keyMap] == 0 {
|
|
|
confirmNonRenewalRateMoey = "0%"
|
|
|
} else {
|
|
|
- confirmNonRenewalRateMoey = utils.SubFloatToString(confirmedNoRenewalContractMoney[keyMap]/mapExpiredContractMoney[keyMap]*100, 2) + "%"
|
|
|
+ confirmNonRenewalRateMoey = utils.SubFloatToString(confirmedNoRenewalContractMoneyServer[keyMap]/mapExpiredContractMoneyServer[keyMap]*100, 2) + "%"
|
|
|
}
|
|
|
- if confirmedNoRenewalContractCompanyNum[keyMap] == 0 || mapExpiredContractCompanyNum[keyMap] == 0 {
|
|
|
+ if confirmedNoRenewalContractCompanyNumServer[keyMap] == 0 || mapExpiredContractCompanyNumServer[keyMap] == 0 {
|
|
|
confirmNonRenewalRateNum = "0%"
|
|
|
} else {
|
|
|
- confirmNonRenewalRateNum = utils.SubFloatToString(float64(confirmedNoRenewalContractCompanyNum[keyMap])/float64(mapExpiredContractCompanyNum[keyMap])*100, 2) + "%"
|
|
|
+ confirmNonRenewalRateNum = utils.SubFloatToString(float64(confirmedNoRenewalContractCompanyNumServer[keyMap])/float64(mapExpiredContractCompanyNumServer[keyMap])*100, 2) + "%"
|
|
|
}
|
|
|
sellerItem.ConfirmNonRenewalRateData = fmt.Sprint(confirmNonRenewalRateMoey, " / ", confirmNonRenewalRateNum) //确认不续约率(金额/数量)-(数据)"
|
|
|
|
|
|
- sellerItem.SignedClientCount = fmt.Sprint(mapSignedClientNum[keyMap]) // 签约客户数量
|
|
|
- if mapSignedClientNum[keyMap] == 0 || mapSignedClientMoney[keyMap] == 0 {
|
|
|
+ sellerItem.SignedClientCount = fmt.Sprint(mapSignedClientNumServer[keyMap]) // 签约客户数量
|
|
|
+ if mapSignedClientNumServer[keyMap] == 0 || mapSignedClientMoneyServer[keyMap] == 0 {
|
|
|
sellerItem.AverageRevenueCount = "0"
|
|
|
} else {
|
|
|
- sellerItem.AverageRevenueCount = utils.SubFloatToString(mapSignedClientMoney[keyMap]/float64(mapSignedClientNum[keyMap]), 2) //客单价
|
|
|
+ sellerItem.AverageRevenueCount = utils.SubFloatToString(mapSignedClientMoneyServer[keyMap]/float64(mapSignedClientNumServer[keyMap]), 2) //客单价
|
|
|
}
|
|
|
|
|
|
sellerItem.InvoiceAmountCount = utils.SubFloatToString(mapInvoiceAmountMoney[keyMap], 2) //"开票金额-(数据)"
|
|
@@ -669,46 +824,47 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
|
|
|
}
|
|
|
if len(sellerService) > 0 {
|
|
|
sellerItem := new(statistic_report.RaiDataSummaryDetail)
|
|
|
+ sellerItem.IsServerSeller = true
|
|
|
sellerItem.SellerId = strings.Join(sellerServiceIds, ",")
|
|
|
sellerItem.SellerName = "服务组合计"
|
|
|
sellerItem.AddTrialCount = fmt.Sprint(mapAddTrialNum[keyMapTtoalServer])
|
|
|
- sellerItem.NewContractData = fmt.Sprint(utils.SubFloatToString(mapNewContractMoney[keyMapTtoalServer], 2), " / ", mapNewContractNum[keyMapTtoalServer]) // 新签合同(金额/数量)-(数据)
|
|
|
- sellerItem.ExpiredContractData = fmt.Sprint(utils.SubFloatToString(mapExpiredContractMoney[keyMapTtoalServer], 2), " / ", mapExpiredContractNum[keyMapTtoalServer]) //"到期合同(金额/数量)-(数据)"
|
|
|
- sellerItem.RenewedContractData = fmt.Sprint(utils.SubFloatToString(mapRenewedContractMoney[keyMapTtoalServer], 2), " / ", mapRenewedContractNum[keyMapTtoalServer]) // "续约合同(金额/数量)-(数据)"
|
|
|
+ sellerItem.NewContractData = fmt.Sprint(utils.SubFloatToString(mapNewContractMoney[keyMapTtoalServer], 2), " / ", mapNewContractNum[keyMapTtoalServer]) // 新签合同(金额/数量)-(数据)
|
|
|
+ sellerItem.ExpiredContractData = fmt.Sprint(utils.SubFloatToString(mapExpiredContractMoneyServer[keyMapTtoalServer], 2), " / ", mapExpiredContractNumServer[keyMapTtoalServer]) //"到期合同(金额/数量)-(数据)"
|
|
|
+ sellerItem.RenewedContractData = fmt.Sprint(utils.SubFloatToString(mapRenewedContractMoneyServer[keyMapTtoalServer], 2), " / ", mapRenewedContractNumServer[keyMapTtoalServer]) // "续约合同(金额/数量)-(数据)"
|
|
|
var renewalRateMoey string
|
|
|
var renewalRateNum string
|
|
|
- if mapRenewedContractMoney[keyMapTtoalServer] == 0 || mapExpiredContractMoney[keyMapTtoalServer] == 0 {
|
|
|
+ if mapRenewedContractMoneyServer[keyMapTtoalServer] == 0 || mapExpiredContractMoneyServer[keyMapTtoalServer] == 0 {
|
|
|
renewalRateMoey = "0%"
|
|
|
} else {
|
|
|
- renewalRateMoey = utils.SubFloatToString(mapRenewedContractMoney[keyMapTtoalServer]/mapExpiredContractMoney[keyMapTtoalServer]*100, 2) + "%"
|
|
|
+ renewalRateMoey = utils.SubFloatToString(mapRenewedContractMoneyServer[keyMapTtoalServer]/mapExpiredContractMoneyServer[keyMapTtoalServer]*100, 2) + "%"
|
|
|
}
|
|
|
- if mapRenewedContractCompanyNum[keyMapTtoalServer] == 0 || mapExpiredContractCompanyNum[keyMapTtoalServer] == 0 {
|
|
|
+ if mapRenewedContractCompanyNumServer[keyMapTtoalServer] == 0 || mapExpiredContractCompanyNumServer[keyMapTtoalServer] == 0 {
|
|
|
renewalRateNum = "0%"
|
|
|
} else {
|
|
|
- renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractCompanyNum[keyMapTtoalServer])/float64(mapExpiredContractCompanyNum[keyMapTtoalServer])*100, 2) + "%"
|
|
|
+ renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractCompanyNumServer[keyMapTtoalServer])/float64(mapExpiredContractCompanyNumServer[keyMapTtoalServer])*100, 2) + "%"
|
|
|
}
|
|
|
- sellerItem.RenewalRateData = fmt.Sprint(renewalRateMoey, " / ", renewalRateNum) //"续约率(金额/数量)-(数据)"
|
|
|
- sellerItem.ConfirmedNoRenewalContractData = fmt.Sprint(utils.SubFloatToString(confirmedNoRenewalContractMoney[keyMapTtoalServer], 2), " / ", confirmedNoRenewalContractNum[keyMapTtoalServer]) //"确认不续约合同(金额/数量)-(数据)"
|
|
|
+ sellerItem.RenewalRateData = fmt.Sprint(renewalRateMoey, " / ", renewalRateNum) //"续约率(金额/数量)-(数据)"
|
|
|
+ sellerItem.ConfirmedNoRenewalContractData = fmt.Sprint(utils.SubFloatToString(confirmedNoRenewalContractMoneyServer[keyMapTtoalServer], 2), " / ", confirmedNoRenewalContractNumServer[keyMapTtoalServer]) //"确认不续约合同(金额/数量)-(数据)"
|
|
|
|
|
|
var confirmNonRenewalRateMoey string
|
|
|
var confirmNonRenewalRateNum string
|
|
|
- if confirmedNoRenewalContractMoney[keyMapTtoalServer] == 0 || mapExpiredContractMoney[keyMapTtoalServer] == 0 {
|
|
|
+ if confirmedNoRenewalContractMoneyServer[keyMapTtoalServer] == 0 || mapExpiredContractMoneyServer[keyMapTtoalServer] == 0 {
|
|
|
confirmNonRenewalRateMoey = "0%"
|
|
|
} else {
|
|
|
- confirmNonRenewalRateMoey = utils.SubFloatToString(confirmedNoRenewalContractMoney[keyMapTtoalServer]/mapExpiredContractMoney[keyMapTtoalServer]*100, 2) + "%"
|
|
|
+ confirmNonRenewalRateMoey = utils.SubFloatToString(confirmedNoRenewalContractMoneyServer[keyMapTtoalServer]/mapExpiredContractMoneyServer[keyMapTtoalServer]*100, 2) + "%"
|
|
|
}
|
|
|
- if confirmedNoRenewalContractCompanyNum[keyMapTtoalServer] == 0 || mapExpiredContractCompanyNum[keyMapTtoalServer] == 0 {
|
|
|
+ if confirmedNoRenewalContractCompanyNumServer[keyMapTtoalServer] == 0 || mapExpiredContractCompanyNumServer[keyMapTtoalServer] == 0 {
|
|
|
confirmNonRenewalRateNum = "0%"
|
|
|
} else {
|
|
|
- confirmNonRenewalRateNum = utils.SubFloatToString(float64(confirmedNoRenewalContractCompanyNum[keyMapTtoalServer])/float64(mapExpiredContractCompanyNum[keyMapTtoalServer])*100, 2) + "%"
|
|
|
+ confirmNonRenewalRateNum = utils.SubFloatToString(float64(confirmedNoRenewalContractCompanyNumServer[keyMapTtoalServer])/float64(mapExpiredContractCompanyNumServer[keyMapTtoalServer])*100, 2) + "%"
|
|
|
}
|
|
|
sellerItem.ConfirmNonRenewalRateData = fmt.Sprint(confirmNonRenewalRateMoey, " / ", confirmNonRenewalRateNum) //确认不续约率(金额/数量)-(数据)"
|
|
|
|
|
|
- sellerItem.SignedClientCount = fmt.Sprint(mapSignedClientNum[keyMapTtoalServer]) // 签约客户数量
|
|
|
- if mapSignedClientNum[keyMapTtoalServer] == 0 || mapSignedClientMoney[keyMapTtoalServer] == 0 {
|
|
|
+ sellerItem.SignedClientCount = fmt.Sprint(mapSignedClientNumServer[keyMapTtoalServer]) // 签约客户数量
|
|
|
+ if mapSignedClientNumServer[keyMapTtoalServer] == 0 || mapSignedClientMoneyServer[keyMapTtoalServer] == 0 {
|
|
|
sellerItem.AverageRevenueCount = "0"
|
|
|
} else {
|
|
|
- sellerItem.AverageRevenueCount = utils.SubFloatToString(mapSignedClientMoney[keyMapTtoalServer]/float64(mapSignedClientNum[keyMapTtoalServer]), 2) //客单价
|
|
|
+ sellerItem.AverageRevenueCount = utils.SubFloatToString(mapSignedClientMoneyServer[keyMapTtoalServer]/float64(mapSignedClientNumServer[keyMapTtoalServer]), 2) //客单价
|
|
|
}
|
|
|
|
|
|
sellerItem.InvoiceAmountCount = utils.SubFloatToString(mapInvoiceAmountMoney[keyMapTtoalServer], 2) //"开票金额-(数据)"
|