作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creat…

…ion-manufacture into dev
... ... @@ -30,12 +30,13 @@ func (deviceCollectionService *DeviceCollectionService) CreateDeviceCollection(c
}()
newDeviceCollection := &domain.DeviceCollection{
//DeviceCollectionId: createDeviceCollectionCommand.DeviceCollectionId,
WorkShopName: createDeviceCollectionCommand.WorkShopName,
DeviceType: createDeviceCollectionCommand.DeviceType,
StartupStatus: createDeviceCollectionCommand.StartupStatus,
DeviceSn: createDeviceCollectionCommand.DeviceSn,
ComStatus: createDeviceCollectionCommand.ComStatus,
Values: createDeviceCollectionCommand.Values,
WorkShopName: createDeviceCollectionCommand.WorkShopName,
DeviceType: createDeviceCollectionCommand.DeviceType,
StartupStatus: createDeviceCollectionCommand.StartupStatus,
DeviceSn: createDeviceCollectionCommand.DeviceSn,
ComStatus: createDeviceCollectionCommand.ComStatus,
CollectionTime: createDeviceCollectionCommand.CollectionTime,
Values: createDeviceCollectionCommand.Values,
}
var deviceCollectionRepository domain.DeviceCollectionRepository
if value, err := factory.CreateDeviceCollectionRepository(map[string]interface{}{
... ... @@ -52,7 +53,7 @@ func (deviceCollectionService *DeviceCollectionService) CreateDeviceCollection(c
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return map[string]interface{}{
"deviceCollection":deviceCollection,
"deviceCollection": deviceCollection,
}, nil
}
}
... ... @@ -123,7 +124,7 @@ func (deviceCollectionService *DeviceCollectionService) ListDeviceCollection(lis
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return tool_funs.SimpleWrapGridMap(count,deviceCollections), nil
return tool_funs.SimpleWrapGridMap(count, deviceCollections), nil
}
}
... ... @@ -164,7 +165,7 @@ func (deviceCollectionService *DeviceCollectionService) RemoveDeviceCollection(r
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return map[string]interface{}{
"deviceCollection":deviceCollection,
"deviceCollection": deviceCollection,
}, nil
}
}
... ... @@ -209,7 +210,7 @@ func (deviceCollectionService *DeviceCollectionService) UpdateDeviceCollection(u
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return map[string]interface{}{
"deviceCollection":deviceCollection,
"deviceCollection": deviceCollection,
}, nil
}
}
... ...
... ... @@ -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,
... ...
... ... @@ -110,7 +110,7 @@ func Start() {
}
deviceCollection.Values = tool_funs.SimpleStructToMap(deviceFengXiangJi)
break
//打浆机
//打浆机 //面包屑机
case domain.DeviceTypeDaJiangJi:
default:
}
... ...