Browse Source

no message

zhangchuanxing 4 weeks ago
parent
commit
f2b603dea9

+ 39 - 1
controllers/statistic/rai_data_summary.go

@@ -1,8 +1,10 @@
 package statistic
 
 import (
+	"fmt"
 	"hongze/hz_crm_api/controllers"
 	"hongze/hz_crm_api/models"
+	"hongze/hz_crm_api/models/statistic_report"
 )
 
 // 权益数据汇总
@@ -43,8 +45,44 @@ func (this *StatisticRaiDataSummaryController) MergeCompanyList() {
 	startYear, _ := this.GetInt("StartYear")
 	endYear, _ := this.GetInt("EndYear")
 
+	dataTypeArr := []string{}
+	if dataType == "季度" {
+		dataTypeArr = []string{"Q1", "Q2", "Q3", "Q4"}
+	} else if dataType == "半年度" {
+		dataTypeArr = []string{"H1", "H2"}
+	} else {
+		dataTypeArr = []string{""}
+	}
+
+	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)
+			sellerItem := new(statistic_report.RaiDataSummaryDetail)
+			sellerItem.SellerName = "梁春悦"
+			sellerItem.AddTrialCount = "新增试用-(数据)"
+			sellerItem.NewContractData = "新签合同(金额/数量)-(数据)"
+			sellerItem.ExpiredContractData = "到期合同(金额/数量)-(数据)"
+			sellerItem.RenewedContractData = "续约合同(金额/数量)-(数据)"
+			sellerItem.RenewalRateData = "续约率(金额/数量)-(数据)"
+			sellerItem.ConfirmedNoRenewalContractData = "确认不续约合同(金额/数量)-(数据)"
+			sellerItem.SignedClientCount = "签约客户数量-(数据)"
+			sellerItem.AverageRevenueCount = "客单价-(数据)"
+			sellerItem.InvoiceAmountCount = "开票金额-(数据)"
+			sellerItem.PaymentReceivedCount = "到款金额-(数据)"
+			sellerItem.UnpaidRatioCount = "未到款比例-(数据)"
+			sellerItem.NewCustomerInvoicingCount = "新客开票-(数据)"
+			sellerItem.NewCustomerPaymentsReceivedCount = "新客到款-(数据)"
+			item.DataList = append(item.DataList, sellerItem)
+			items = append(items, item)
+		}
+	}
+	resp.List = items
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"
-	//br.Data = resp
+	br.Data = resp
 }

+ 19 - 2
models/statistic_report/rai_data_summary.go

@@ -1,10 +1,27 @@
 package statistic_report
 
+type RaiDataSummaryListResp struct {
+	List []*RaiDataSummaryResp
+}
+
 type RaiDataSummaryResp struct {
-	DataType string `description:"时间类型"`
+	DataType string `description:"时间区间"`
 	DataList []*RaiDataSummaryDetail
 }
 
 type RaiDataSummaryDetail struct {
-	SelleName string `description:"时间类型"`
+	SellerName                       string `description:"销售名称"`
+	AddTrialCount                    string `description:"新增试用"`
+	NewContractData                  string `description:"新签合同(金额/数量)"`
+	ExpiredContractData              string `description:"到期合同(金额/数量)"`
+	RenewedContractData              string `description:"续约合同(金额/数量)"`
+	RenewalRateData                  string `description:"续约率(金额/数量)"`
+	ConfirmedNoRenewalContractData   string `description:"确认不续约合同(金额/数量)"`
+	SignedClientCount                string `description:"签约客户数量"`
+	AverageRevenueCount              string `description:"客单价"`
+	InvoiceAmountCount               string `description:"开票金额"`
+	PaymentReceivedCount             string `description:"到款金额"`
+	UnpaidRatioCount                 string `description:"未到款比例"`
+	NewCustomerInvoicingCount        string `description:"新客开票"`
+	NewCustomerPaymentsReceivedCount string `description:"新客到款"`
 }

+ 9 - 0
routers/commentsRouter.go

@@ -8053,6 +8053,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/statistic:StatisticRaiDataSummaryController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/statistic:StatisticRaiDataSummaryController"],
+        beego.ControllerComments{
+            Method: "MergeCompanyList",
+            Router: `/rai_data_summary/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/yb:ActivityController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/yb:ActivityController"],
         beego.ControllerComments{
             Method: "Add",

+ 2 - 0
routers/router.go

@@ -27,6 +27,7 @@ import (
 	"hongze/hz_crm_api/controllers/overseas_custom"
 	"hongze/hz_crm_api/controllers/roadshow"
 	"hongze/hz_crm_api/controllers/seal"
+	"hongze/hz_crm_api/controllers/statistic"
 	"hongze/hz_crm_api/controllers/yb"
 
 	"github.com/beego/beego/v2/server/web"
@@ -72,6 +73,7 @@ func init() {
 				&controllers.StatisticYbLogController{},
 				&controllers.StatisticReportCommonController{},
 				&controllers.StatisticCompanyMergerController{},
+				&statistic.StatisticRaiDataSummaryController{},
 			),
 		),
 		web.NSNamespace("/voice",