zhangchuanxing 2 долоо хоног өмнө
parent
commit
4193f27a0c

+ 16 - 10
controllers/statistic/rai_data_summary.go

@@ -169,6 +169,7 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
 	mapExpiredContractCompanyNum := make(map[string]int)            // 到期公司(数量)
 	mapRenewedContractMoney := make(map[string]float64)             // 续约合同(金额)
 	mapRenewedContractNum := make(map[string]int)                   // 续约合同(数量)
+	mapRenewedContractCompanyNum := make(map[string]int)            // 续约公司(数量)
 	confirmedNoRenewalContractMoney := make(map[string]float64)     // 确认不续约合同(金额)
 	confirmedNoRenewalContractNum := make(map[string]int)           // 确认不续约合同(数量)
 	mapSignedClientNum := make(map[string]int)                      // 签约客户(数量)
@@ -304,9 +305,14 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
 		mapRenewedContractMoney[keyMapTtoal] += v.Money
 
 		//一家公司同一个时间纬度,只统计一次
+		//if !mapKeyMapCompanyData[keyMapCompany] {
+		mapRenewedContractNum[keyMap]++
+		mapRenewedContractNum[keyMapTtoal]++
+		//mapKeyMapCompanyData[keyMapCompany] = true
+		//}
 		if !mapKeyMapCompanyData[keyMapCompany] {
-			mapRenewedContractNum[keyMap]++
-			mapRenewedContractNum[keyMapTtoal]++
+			mapRenewedContractCompanyNum[keyMap]++
+			mapRenewedContractCompanyNum[keyMapTtoal]++
 			mapKeyMapCompanyData[keyMapCompany] = true
 		}
 		if !mapCompanyData[keySigned] && v.RaiContractType == "续约合同" {
@@ -511,10 +517,10 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
 				} else {
 					renewalRateMoey = utils.SubFloatToString(mapRenewedContractMoney[keyMap]/mapExpiredContractMoney[keyMap]*100, 2) + "%"
 				}
-				if mapRenewedContractNum[keyMap] == 0 || mapExpiredContractCompanyNum[keyMap] == 0 {
+				if mapRenewedContractCompanyNum[keyMap] == 0 || mapExpiredContractCompanyNum[keyMap] == 0 {
 					renewalRateNum = "0%"
 				} else {
-					renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractNum[keyMap])/float64(mapExpiredContractCompanyNum[keyMap])*100, 2) + "%"
+					renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractCompanyNum[keyMap])/float64(mapExpiredContractCompanyNum[keyMap])*100, 2) + "%"
 				}
 				sellerItem.RenewalRateData = fmt.Sprint(renewalRateMoey, " / ", renewalRateNum)                                                                                          //"续约率(金额/数量)-(数据)"
 				sellerItem.ConfirmedNoRenewalContractData = fmt.Sprint(utils.SubFloatToString(confirmedNoRenewalContractMoney[keyMap], 2), " / ", confirmedNoRenewalContractNum[keyMap]) //"确认不续约合同(金额/数量)-(数据)"
@@ -569,10 +575,10 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
 				} else {
 					renewalRateMoey = utils.SubFloatToString(mapRenewedContractMoney[keyMapTtoal]/mapExpiredContractMoney[keyMapTtoal]*100, 2) + "%"
 				}
-				if mapRenewedContractNum[keyMapTtoal] == 0 || mapExpiredContractCompanyNum[keyMapTtoal] == 0 {
+				if mapRenewedContractCompanyNum[keyMapTtoal] == 0 || mapExpiredContractCompanyNum[keyMapTtoal] == 0 {
 					renewalRateNum = "0%"
 				} else {
-					renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractNum[keyMapTtoal])/float64(mapExpiredContractCompanyNum[keyMapTtoal])*100, 2) + "%"
+					renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractCompanyNum[keyMapTtoal])/float64(mapExpiredContractCompanyNum[keyMapTtoal])*100, 2) + "%"
 				}
 				sellerItem.RenewalRateData = fmt.Sprint(renewalRateMoey, " / ", renewalRateNum)                                                                                                    //"续约率(金额/数量)-(数据)"
 				sellerItem.ConfirmedNoRenewalContractData = fmt.Sprint(utils.SubFloatToString(confirmedNoRenewalContractMoney[keyMapTtoal], 2), " / ", confirmedNoRenewalContractNum[keyMapTtoal]) //"确认不续约合同(金额/数量)-(数据)"
@@ -626,10 +632,10 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
 				} else {
 					renewalRateMoey = utils.SubFloatToString(mapRenewedContractMoney[keyMap]/mapExpiredContractMoney[keyMap]*100, 2) + "%"
 				}
-				if mapRenewedContractNum[keyMap] == 0 || mapExpiredContractCompanyNum[keyMap] == 0 {
+				if mapRenewedContractCompanyNum[keyMap] == 0 || mapExpiredContractCompanyNum[keyMap] == 0 {
 					renewalRateNum = "0%"
 				} else {
-					renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractNum[keyMap])/float64(mapExpiredContractCompanyNum[keyMap])*100, 2) + "%"
+					renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractCompanyNum[keyMap])/float64(mapExpiredContractCompanyNum[keyMap])*100, 2) + "%"
 				}
 				sellerItem.RenewalRateData = fmt.Sprint(renewalRateMoey, " / ", renewalRateNum)                                                                                          //"续约率(金额/数量)-(数据)"
 				sellerItem.ConfirmedNoRenewalContractData = fmt.Sprint(utils.SubFloatToString(confirmedNoRenewalContractMoney[keyMap], 2), " / ", confirmedNoRenewalContractNum[keyMap]) //"确认不续约合同(金额/数量)-(数据)"
@@ -683,10 +689,10 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryList() {
 				} else {
 					renewalRateMoey = utils.SubFloatToString(mapRenewedContractMoney[keyMapTtoalServer]/mapExpiredContractMoney[keyMapTtoalServer]*100, 2) + "%"
 				}
-				if mapRenewedContractNum[keyMapTtoalServer] == 0 || mapExpiredContractCompanyNum[keyMapTtoalServer] == 0 {
+				if mapRenewedContractCompanyNum[keyMapTtoalServer] == 0 || mapExpiredContractCompanyNum[keyMapTtoalServer] == 0 {
 					renewalRateNum = "0%"
 				} else {
-					renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractNum[keyMapTtoalServer])/float64(mapExpiredContractCompanyNum[keyMapTtoalServer])*100, 2) + "%"
+					renewalRateNum = utils.SubFloatToString(float64(mapRenewedContractCompanyNum[keyMapTtoalServer])/float64(mapExpiredContractCompanyNum[keyMapTtoalServer])*100, 2) + "%"
 				}
 				sellerItem.RenewalRateData = fmt.Sprint(renewalRateMoey, " / ", renewalRateNum)                                                                                                                //"续约率(金额/数量)-(数据)"
 				sellerItem.ConfirmedNoRenewalContractData = fmt.Sprint(utils.SubFloatToString(confirmedNoRenewalContractMoney[keyMapTtoalServer], 2), " / ", confirmedNoRenewalContractNum[keyMapTtoalServer]) //"确认不续约合同(金额/数量)-(数据)"