|
@@ -205,11 +205,11 @@ func fillMappingChartInfo(req residual_analysis_model.ResidualAnalysisReq, edbIn
|
|
|
// 映射残差 计算a,b
|
|
|
if req.ResidualType == 1 {
|
|
|
if req.IsOrder {
|
|
|
- a = (req.LeftIndexMax - req.LeftIndexMin) / (req.RightIndexMax - req.RightIndexMin)
|
|
|
- b = req.LeftIndexMax - req.RightIndexMax*a
|
|
|
- } else {
|
|
|
a = (req.LeftIndexMax - req.LeftIndexMin) / (req.RightIndexMin - req.RightIndexMax)
|
|
|
b = req.LeftIndexMax - req.RightIndexMin*a
|
|
|
+ } else {
|
|
|
+ a = (req.LeftIndexMax - req.LeftIndexMin) / (req.RightIndexMax - req.RightIndexMin)
|
|
|
+ b = req.LeftIndexMax - req.RightIndexMax*a
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -284,9 +284,8 @@ func fillMappingChartInfo(req residual_analysis_model.ResidualAnalysisReq, edbIn
|
|
|
if _, ok := indexADataMap[indexData.DataTime]; ok {
|
|
|
indexDataCopy := *indexData
|
|
|
|
|
|
- fmt.Println(math.Round(a*indexData.Value+b) / 10000)
|
|
|
// 计算指标B映射值
|
|
|
- indexDataCopy.Value = math.Round(a*indexData.Value+b) / 10000
|
|
|
+ indexDataCopy.Value = math.Round((a*indexData.Value+b)*10000) / 10000
|
|
|
|
|
|
// 将副本添加到 dataBList
|
|
|
dataBList = append(dataBList, &indexDataCopy)
|