|
|
@@ -4413,9 +4413,31 @@ func (this *OilSupplierController) StatisticalNum() {
|
|
|
if err != nil {
|
|
|
log.Println("统计更新首页数据失败")
|
|
|
}
|
|
|
+
|
|
|
+ typeNums := statisticService.GetTypeNumByYear()
|
|
|
+
|
|
|
+ for _, typeNum := range typeNums {
|
|
|
+ var typeCols []string
|
|
|
+ var updateNum supplierStatistics.OilSupplierStatistics
|
|
|
+ whereType := "Year = " + strconv.Itoa(typeNum.Year)
|
|
|
+ if typeNum.Type == "01" {
|
|
|
+ typeCols = append(typeCols, "GoodsNum")
|
|
|
+ updateNum.GoodsNum = typeNum.Num
|
|
|
+ } else if typeNum.Type == "02" {
|
|
|
+ typeCols = append(typeCols, "TecNum")
|
|
|
+ updateNum.TecNum = typeNum.Num
|
|
|
+ } else if typeNum.Type == "03" {
|
|
|
+ typeCols = append(typeCols, "BasNum")
|
|
|
+ updateNum.BasNum = typeNum.Num
|
|
|
+ }
|
|
|
+ err1 := statisticService.UpdateEntityBywheretbl("OilSupplierStatistics", &updateNum, typeCols, whereType)
|
|
|
+ if err1 != nil {
|
|
|
+ log.Println("统计更新首页数据失败")
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-// @Title 首页统计饼图
|
|
|
+// @Title 首页统计--饼图
|
|
|
// @Description 首页统计饼图
|
|
|
// @Success 200 {object}
|
|
|
// @router /statistic [get]
|
|
|
@@ -4429,23 +4451,36 @@ func (this *OilSupplierController) StatisticalSupplierType() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-// @Title 首页统计待办
|
|
|
+// @Title 首页统计--折线数据-更多
|
|
|
+// @Description 首页统计饼图
|
|
|
+// @Success 200 {object}
|
|
|
+// @router /broken-line [get]
|
|
|
+func (this *OilSupplierController) BrokenLineDta() {
|
|
|
+ statisticsService := supplierStatistics.GetSupplierStatisticsService(utils.DBE)
|
|
|
+ var statisticalNums []supplierStatistics.OilSupplierStatistics
|
|
|
+ statisticsService.GetEntitiesByWhereOrder(&statisticalNums, "Year", "Year > 0")
|
|
|
+ data := statisticalNums[len(statisticalNums) -5:]
|
|
|
+ this.Data["json"] = &data
|
|
|
+ this.ServeJSON()
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 首页统计--待办
|
|
|
// @Description 首页统计图标
|
|
|
// @Success 200 {object}
|
|
|
// @router /todoNum [get]
|
|
|
func (this *OilSupplierController) TodoNum() {
|
|
|
var todo supplier.TodoNum
|
|
|
- todo.SupplierNum = this.GetTodoNum("1")
|
|
|
- todo.AppendNum = this.GetTodoNum("2")
|
|
|
- todo.AnnualNum = this.GetTodoNum("3")
|
|
|
- todo.InfoChangeNum = this.GetTodoNum("4")
|
|
|
- todo.EvaluationNum = this.GetTodoNum("10") // 业绩评价
|
|
|
+ todo.SupplierNum = this.getTodoNum("1")
|
|
|
+ todo.AppendNum = this.getTodoNum("2")
|
|
|
+ todo.AnnualNum = this.getTodoNum("3")
|
|
|
+ todo.InfoChangeNum = this.getTodoNum("4")
|
|
|
+ todo.EvaluationNum = this.getTodoNum("10") // 业绩评价
|
|
|
|
|
|
this.Data["json"] = &todo
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-func (this *OilSupplierController) GetTodoNum(stype string) int {
|
|
|
+func (this *OilSupplierController) getTodoNum(stype string) int {
|
|
|
wfNames := ""
|
|
|
//wfNames = workflow.OIL_ENUSER_SUPPLIER_APPLY + "," + workflow.OIL_ENUSER_APPEND_APPLY + "," + workflow.OIL_INFO_CHANGE + "," + workflow.OIL_AUDIT_APPLY + "," + workflow.OIL_SUPPLIER_VERIFY+ "," + workflow.OIL_DAILY_CONTRACT_EVALUATION+ "," + workflow.OIL_ANNUAL_CONTRACT_EVALUATION+ "," + workflow.OIL_Catalog+ "," + workflow.OIL_REGISTER_APPLY
|
|
|
if stype == "1" {
|