浏览代码

修改mongodb格式

xyxie 11 月之前
父节点
当前提交
fe527b50aa
共有 1 个文件被更改,包括 16 次插入8 次删除
  1. 16 8
      services/edb_data.go

+ 16 - 8
services/edb_data.go

@@ -50,10 +50,14 @@ func AddOrUpdateEdbData(edbCode string, dataList []*models.EdbDataBase) (err err
 		}
 		if oldObj, ok := existMap[dataTime]; !ok {
 			tmp := &mgodb.EdbDataBase{
-				DataTime:   dataTime,
-				Value:      val,
-				CreateTime: time.Now(),
-				ModifyTime: time.Now(),
+				EdbInfoId:     0,
+				EdbCode:       v.EdbCode,
+				DataTime:      dataTime,
+				Value:         val,
+				Status:        v.Status,
+				CreateTime:    time.Now(),
+				ModifyTime:    time.Now(),
+				DataTimestamp: v.DataTimestamp,
 			}
 			addList = append(addList, tmp)
 		} else {
@@ -96,10 +100,14 @@ func AddOrUpdateEdbDataCalculate(edbCode string, dataList []*models.EdbDataBase)
 		}
 		if oldObj, ok := existMap[dataTime]; !ok {
 			tmp := &mgodb.EdbDataBase{
-				DataTime:   dataTime,
-				Value:      val,
-				CreateTime: time.Now(),
-				ModifyTime: time.Now(),
+				EdbInfoId:     0,
+				EdbCode:       v.EdbCode,
+				DataTime:      dataTime,
+				Value:         val,
+				Status:        v.Status,
+				CreateTime:    time.Now(),
+				ModifyTime:    time.Now(),
+				DataTimestamp: v.DataTimestamp,
 			}
 			addList = append(addList, tmp)
 		} else {