|
@@ -8,6 +8,7 @@ import (
|
|
|
"time"
|
|
|
|
|
|
"github.com/kataras/iris/v12"
|
|
|
+ "github.com/shopspring/decimal"
|
|
|
"go.mod/comm"
|
|
|
"go.mod/conf"
|
|
|
"go.mod/dao"
|
|
@@ -194,7 +195,7 @@ func (s *safeService) GetSurvey(projectId int, bidsectionId int) map[string]inte
|
|
|
columnarData = append(columnarData, item)
|
|
|
item = map[string]interface{}{
|
|
|
"month": fmt.Sprintf("%d-%02d", year, i),
|
|
|
- "count": "0",
|
|
|
+ "count": 0,
|
|
|
}
|
|
|
lineData = append(lineData, item)
|
|
|
|
|
@@ -262,8 +263,10 @@ func (s *safeService) GetSurvey(projectId int, bidsectionId int) map[string]inte
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- lineData[index]["count"] = rectifyedCount / submitCount
|
|
|
+ lineData[index]["count"] = 0.00
|
|
|
+ if rectifyedCount != 0 && submitCount != 0 {
|
|
|
+ lineData[index]["count"] = decimal.NewFromFloat(float64(rectifyedCount)).Div(decimal.NewFromFloat(float64(submitCount)))
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 整改占总数比例 - 完成整改/提交巡检
|
|
@@ -273,6 +276,7 @@ func (s *safeService) GetSurvey(projectId int, bidsectionId int) map[string]inte
|
|
|
"approvalTotal": approvalTotal,
|
|
|
"rectifyedTotal": rectifyedTotal,
|
|
|
"columnarData": columnarData,
|
|
|
+ "lineData": lineData,
|
|
|
// "submitData": submitData,
|
|
|
// "rectifyedData": rectifyedData,
|
|
|
}
|