|
|
@@ -11,6 +11,7 @@ import (
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/oilcatalog"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/oilcatalogsub"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/qualchange"
|
|
|
+ "dashoo.cn/backend/api/business/oilsupplier/supplierStatistics"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
|
|
|
@@ -4330,8 +4331,9 @@ func (this *OilSupplierController) RecoverCertSub() {
|
|
|
// @Success 200 {object}
|
|
|
// @router /statisticalNum [get]
|
|
|
func (this *OilSupplierController) StatisticalNum() {
|
|
|
+ log.Println("开始统计")
|
|
|
certService := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
- var statisticalNum supplier.StatisticalNum
|
|
|
+ var statisticalNum supplierStatistics.OilSupplierStatistics
|
|
|
var supplierGoods []suppliercert.OilSupplierCert
|
|
|
certService.GetEntitysByWhere(OilSupplierCertName, "SupplierTypeCode = '01'", &supplierGoods)
|
|
|
statisticalNum.GoodsNum = len(supplierGoods)
|
|
|
@@ -4388,6 +4390,40 @@ func (this *OilSupplierController) StatisticalNum() {
|
|
|
var RegCapitalBig []supplier.OilSupplier
|
|
|
certService.GetEntitysByWhere(OilSupplierName, "RegCapital >= 5000", &RegCapitalBig)
|
|
|
statisticalNum.RegCapitalBig = len(RegCapitalBig)
|
|
|
+ log.Println("结束统计")
|
|
|
+ cols := []string{
|
|
|
+ "GoodsNum",
|
|
|
+ "TecNum",
|
|
|
+ "BasNum",
|
|
|
+ "ReviewNum",
|
|
|
+ "TenderNum",
|
|
|
+ "StrategicNum",
|
|
|
+ "OneLevelGoodsNum",
|
|
|
+ "TwoLevelMakeNum",
|
|
|
+ "TwoLevelNotMakeNum",
|
|
|
+ "RegCapitalSmall",
|
|
|
+ "RegCapital2",
|
|
|
+ "RegCapital3",
|
|
|
+ "RegCapital4",
|
|
|
+ "RegCapitalBig",
|
|
|
+ }
|
|
|
+ statisticService := supplierStatistics.GetSupplierStatisticsService(utils.DBE)
|
|
|
+ whereStatistic := "Id = 1"
|
|
|
+ err := statisticService.UpdateEntityBywheretbl("OilSupplierStatistics", &statisticalNum, cols, whereStatistic)
|
|
|
+ if err != nil {
|
|
|
+ log.Println("统计更新首页数据失败")
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 首页统计饼图
|
|
|
+// @Description 首页统计饼图
|
|
|
+// @Success 200 {object}
|
|
|
+// @router /statistic [get]
|
|
|
+func (this *OilSupplierController) StatisticalSupplierType() {
|
|
|
+ statisticsService := supplierStatistics.GetSupplierStatisticsService(utils.DBE)
|
|
|
+ var statisticalNum supplierStatistics.OilSupplierStatistics
|
|
|
+
|
|
|
+ statisticsService.GetEntityById(1, &statisticalNum)
|
|
|
|
|
|
this.Data["json"] = &statisticalNum
|
|
|
this.ServeJSON()
|