|
@@ -3,6 +3,7 @@ package models
|
|
|
import (
|
|
|
"fmt"
|
|
|
"github.com/beego/beego/v2/client/orm"
|
|
|
+ "github.com/shopspring/decimal"
|
|
|
"hongze/hongze_edb_lib/utils"
|
|
|
"strconv"
|
|
|
"strings"
|
|
@@ -54,6 +55,13 @@ func AddEdbDataFromManual(edbCode string) (err error) {
|
|
|
item := manualDataList[i]
|
|
|
eDate := item.Dt
|
|
|
sValue := item.Close
|
|
|
+ tmpDecimal, err := decimal.NewFromString(sValue)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ sValue = tmpDecimal.Round(4).String()
|
|
|
+
|
|
|
+
|
|
|
dataTime, err := time.ParseInLocation(utils.FormatDate, eDate, time.Local)
|
|
|
if err != nil {
|
|
|
return err
|
|
@@ -147,6 +155,11 @@ func RefreshEdbDataFromManual(edbInfoId int, edbCode, startDate string) (err err
|
|
|
item := v
|
|
|
eDate := item.Dt
|
|
|
sValue := item.Close
|
|
|
+ tmpDecimal, err := decimal.NewFromString(sValue)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ sValue = tmpDecimal.Round(4).String()
|
|
|
|
|
|
dataTime, err := time.ParseInLocation(utils.FormatDate, eDate, time.Local)
|
|
|
if err != nil {
|