Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creat…
…ion-manufacture into dev
正在显示
5 个修改的文件
包含
20 行增加
和
11 行删除
@@ -30,12 +30,13 @@ func (deviceCollectionService *DeviceCollectionService) CreateDeviceCollection(c | @@ -30,12 +30,13 @@ func (deviceCollectionService *DeviceCollectionService) CreateDeviceCollection(c | ||
30 | }() | 30 | }() |
31 | newDeviceCollection := &domain.DeviceCollection{ | 31 | newDeviceCollection := &domain.DeviceCollection{ |
32 | //DeviceCollectionId: createDeviceCollectionCommand.DeviceCollectionId, | 32 | //DeviceCollectionId: createDeviceCollectionCommand.DeviceCollectionId, |
33 | - WorkShopName: createDeviceCollectionCommand.WorkShopName, | ||
34 | - DeviceType: createDeviceCollectionCommand.DeviceType, | ||
35 | - StartupStatus: createDeviceCollectionCommand.StartupStatus, | ||
36 | - DeviceSn: createDeviceCollectionCommand.DeviceSn, | ||
37 | - ComStatus: createDeviceCollectionCommand.ComStatus, | ||
38 | - Values: createDeviceCollectionCommand.Values, | 33 | + WorkShopName: createDeviceCollectionCommand.WorkShopName, |
34 | + DeviceType: createDeviceCollectionCommand.DeviceType, | ||
35 | + StartupStatus: createDeviceCollectionCommand.StartupStatus, | ||
36 | + DeviceSn: createDeviceCollectionCommand.DeviceSn, | ||
37 | + ComStatus: createDeviceCollectionCommand.ComStatus, | ||
38 | + CollectionTime: createDeviceCollectionCommand.CollectionTime, | ||
39 | + Values: createDeviceCollectionCommand.Values, | ||
39 | } | 40 | } |
40 | var deviceCollectionRepository domain.DeviceCollectionRepository | 41 | var deviceCollectionRepository domain.DeviceCollectionRepository |
41 | if value, err := factory.CreateDeviceCollectionRepository(map[string]interface{}{ | 42 | if value, err := factory.CreateDeviceCollectionRepository(map[string]interface{}{ |
@@ -52,7 +53,7 @@ func (deviceCollectionService *DeviceCollectionService) CreateDeviceCollection(c | @@ -52,7 +53,7 @@ func (deviceCollectionService *DeviceCollectionService) CreateDeviceCollection(c | ||
52 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 53 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
53 | } | 54 | } |
54 | return map[string]interface{}{ | 55 | return map[string]interface{}{ |
55 | - "deviceCollection":deviceCollection, | 56 | + "deviceCollection": deviceCollection, |
56 | }, nil | 57 | }, nil |
57 | } | 58 | } |
58 | } | 59 | } |
@@ -123,7 +124,7 @@ func (deviceCollectionService *DeviceCollectionService) ListDeviceCollection(lis | @@ -123,7 +124,7 @@ func (deviceCollectionService *DeviceCollectionService) ListDeviceCollection(lis | ||
123 | if err := transactionContext.CommitTransaction(); err != nil { | 124 | if err := transactionContext.CommitTransaction(); err != nil { |
124 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 125 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
125 | } | 126 | } |
126 | - return tool_funs.SimpleWrapGridMap(count,deviceCollections), nil | 127 | + return tool_funs.SimpleWrapGridMap(count, deviceCollections), nil |
127 | } | 128 | } |
128 | } | 129 | } |
129 | 130 | ||
@@ -164,7 +165,7 @@ func (deviceCollectionService *DeviceCollectionService) RemoveDeviceCollection(r | @@ -164,7 +165,7 @@ func (deviceCollectionService *DeviceCollectionService) RemoveDeviceCollection(r | ||
164 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 165 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
165 | } | 166 | } |
166 | return map[string]interface{}{ | 167 | return map[string]interface{}{ |
167 | - "deviceCollection":deviceCollection, | 168 | + "deviceCollection": deviceCollection, |
168 | }, nil | 169 | }, nil |
169 | } | 170 | } |
170 | } | 171 | } |
@@ -209,7 +210,7 @@ func (deviceCollectionService *DeviceCollectionService) UpdateDeviceCollection(u | @@ -209,7 +210,7 @@ func (deviceCollectionService *DeviceCollectionService) UpdateDeviceCollection(u | ||
209 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 210 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
210 | } | 211 | } |
211 | return map[string]interface{}{ | 212 | return map[string]interface{}{ |
212 | - "deviceCollection":deviceCollection, | 213 | + "deviceCollection": deviceCollection, |
213 | }, nil | 214 | }, nil |
214 | } | 215 | } |
215 | } | 216 | } |
@@ -12,6 +12,8 @@ type DeviceCollection struct { | @@ -12,6 +12,8 @@ type DeviceCollection struct { | ||
12 | DeviceSn string `comment:"设备名"` | 12 | DeviceSn string `comment:"设备名"` |
13 | // 设备类型 | 13 | // 设备类型 |
14 | DeviceType string `comment:"设备类型"` | 14 | DeviceType string `comment:"设备类型"` |
15 | + // 采集时间 | ||
16 | + CollectionTime time.Time `comment:"采集时间"` | ||
15 | // 启动状态 1-启动 0-停止 | 17 | // 启动状态 1-启动 0-停止 |
16 | StartupStatus int64 `comment:"启动状态 1-启动 0-停止" pg:",use_zero"` | 18 | StartupStatus int64 `comment:"启动状态 1-启动 0-停止" pg:",use_zero"` |
17 | // 通讯状态 1-通讯正常 0-设备未上电或与采集端通讯故障 | 19 | // 通讯状态 1-通讯正常 0-设备未上电或与采集端通讯故障 |
@@ -12,6 +12,7 @@ func TransformToDeviceCollectionDomainModelFromPgModels(deviceCollectionModel *m | @@ -12,6 +12,7 @@ func TransformToDeviceCollectionDomainModelFromPgModels(deviceCollectionModel *m | ||
12 | DeviceSn: deviceCollectionModel.DeviceSn, | 12 | DeviceSn: deviceCollectionModel.DeviceSn, |
13 | DeviceType: deviceCollectionModel.DeviceType, | 13 | DeviceType: deviceCollectionModel.DeviceType, |
14 | StartupStatus: deviceCollectionModel.StartupStatus, | 14 | StartupStatus: deviceCollectionModel.StartupStatus, |
15 | + CollectionTime: deviceCollectionModel.CreatedAt, | ||
15 | ComStatus: deviceCollectionModel.ComStatus, | 16 | ComStatus: deviceCollectionModel.ComStatus, |
16 | Values: deviceCollectionModel.Values, | 17 | Values: deviceCollectionModel.Values, |
17 | }, nil | 18 | }, nil |
@@ -30,6 +30,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | @@ -30,6 +30,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | ||
30 | "work_shop_name", | 30 | "work_shop_name", |
31 | "device_sn", | 31 | "device_sn", |
32 | "device_type", | 32 | "device_type", |
33 | + "collection_time", | ||
33 | "startup_status", | 34 | "startup_status", |
34 | "com_status", | 35 | "com_status", |
35 | "values", | 36 | "values", |
@@ -53,6 +54,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | @@ -53,6 +54,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | ||
53 | &deviceCollection.WorkShopName, | 54 | &deviceCollection.WorkShopName, |
54 | &deviceCollection.DeviceSn, | 55 | &deviceCollection.DeviceSn, |
55 | &deviceCollection.DeviceType, | 56 | &deviceCollection.DeviceType, |
57 | + &deviceCollection.CollectionTime, | ||
56 | &deviceCollection.StartupStatus, | 58 | &deviceCollection.StartupStatus, |
57 | &deviceCollection.ComStatus, | 59 | &deviceCollection.ComStatus, |
58 | &deviceCollection.Values, | 60 | &deviceCollection.Values, |
@@ -62,6 +64,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | @@ -62,6 +64,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | ||
62 | deviceCollection.WorkShopName, | 64 | deviceCollection.WorkShopName, |
63 | deviceCollection.DeviceSn, | 65 | deviceCollection.DeviceSn, |
64 | deviceCollection.DeviceType, | 66 | deviceCollection.DeviceType, |
67 | + deviceCollection.CollectionTime, | ||
65 | deviceCollection.StartupStatus, | 68 | deviceCollection.StartupStatus, |
66 | deviceCollection.ComStatus, | 69 | deviceCollection.ComStatus, |
67 | deviceCollection.Values, | 70 | deviceCollection.Values, |
@@ -75,6 +78,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | @@ -75,6 +78,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | ||
75 | &deviceCollection.WorkShopName, | 78 | &deviceCollection.WorkShopName, |
76 | &deviceCollection.DeviceSn, | 79 | &deviceCollection.DeviceSn, |
77 | &deviceCollection.DeviceType, | 80 | &deviceCollection.DeviceType, |
81 | + &deviceCollection.CollectionTime, | ||
78 | &deviceCollection.StartupStatus, | 82 | &deviceCollection.StartupStatus, |
79 | &deviceCollection.ComStatus, | 83 | &deviceCollection.ComStatus, |
80 | &deviceCollection.Values, | 84 | &deviceCollection.Values, |
@@ -84,6 +88,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | @@ -84,6 +88,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi | ||
84 | deviceCollection.WorkShopName, | 88 | deviceCollection.WorkShopName, |
85 | deviceCollection.DeviceSn, | 89 | deviceCollection.DeviceSn, |
86 | deviceCollection.DeviceType, | 90 | deviceCollection.DeviceType, |
91 | + deviceCollection.CollectionTime, | ||
87 | deviceCollection.StartupStatus, | 92 | deviceCollection.StartupStatus, |
88 | deviceCollection.ComStatus, | 93 | deviceCollection.ComStatus, |
89 | deviceCollection.Values, | 94 | deviceCollection.Values, |
@@ -110,7 +110,7 @@ func Start() { | @@ -110,7 +110,7 @@ func Start() { | ||
110 | } | 110 | } |
111 | deviceCollection.Values = tool_funs.SimpleStructToMap(deviceFengXiangJi) | 111 | deviceCollection.Values = tool_funs.SimpleStructToMap(deviceFengXiangJi) |
112 | break | 112 | break |
113 | - //打浆机 | 113 | + //打浆机 //面包屑机 |
114 | case domain.DeviceTypeDaJiangJi: | 114 | case domain.DeviceTypeDaJiangJi: |
115 | default: | 115 | default: |
116 | } | 116 | } |
-
请 注册 或 登录 后发表评论