作者 庄敏学

合并分支 'dev' 到 'test'

设备采集增加时间字段



查看合并请求 !3
... ... @@ -12,6 +12,8 @@ type DeviceCollection struct {
DeviceSn string `comment:"设备名"`
// 设备类型
DeviceType string `comment:"设备类型"`
// 采集时间
CollectionTime time.Time `comment:"采集时间"`
// 启动状态 1-启动 0-停止
StartupStatus int64 `comment:"启动状态 1-启动 0-停止" pg:",use_zero"`
// 通讯状态 1-通讯正常 0-设备未上电或与采集端通讯故障
... ...
... ... @@ -12,6 +12,7 @@ func TransformToDeviceCollectionDomainModelFromPgModels(deviceCollectionModel *m
DeviceSn: deviceCollectionModel.DeviceSn,
DeviceType: deviceCollectionModel.DeviceType,
StartupStatus: deviceCollectionModel.StartupStatus,
CollectionTime: deviceCollectionModel.CreatedAt,
ComStatus: deviceCollectionModel.ComStatus,
Values: deviceCollectionModel.Values,
}, nil
... ...
... ... @@ -30,6 +30,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
"work_shop_name",
"device_sn",
"device_type",
"collection_time",
"startup_status",
"com_status",
"values",
... ... @@ -53,6 +54,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
&deviceCollection.WorkShopName,
&deviceCollection.DeviceSn,
&deviceCollection.DeviceType,
&deviceCollection.CollectionTime,
&deviceCollection.StartupStatus,
&deviceCollection.ComStatus,
&deviceCollection.Values,
... ... @@ -62,6 +64,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
deviceCollection.WorkShopName,
deviceCollection.DeviceSn,
deviceCollection.DeviceType,
deviceCollection.CollectionTime,
deviceCollection.StartupStatus,
deviceCollection.ComStatus,
deviceCollection.Values,
... ... @@ -75,6 +78,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
&deviceCollection.WorkShopName,
&deviceCollection.DeviceSn,
&deviceCollection.DeviceType,
&deviceCollection.CollectionTime,
&deviceCollection.StartupStatus,
&deviceCollection.ComStatus,
&deviceCollection.Values,
... ... @@ -84,6 +88,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
deviceCollection.WorkShopName,
deviceCollection.DeviceSn,
deviceCollection.DeviceType,
deviceCollection.CollectionTime,
deviceCollection.StartupStatus,
deviceCollection.ComStatus,
deviceCollection.Values,
... ...