作者 yangfu

refactor: 设备消息结构修改

@@ -13,7 +13,6 @@ import ( @@ -13,7 +13,6 @@ import (
13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/redis" 13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/redis"
14 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils" 14 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
15 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log" 15 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
16 - "math/rand"  
17 "strconv" 16 "strconv"
18 "sync" 17 "sync"
19 "time" 18 "time"
@@ -144,9 +143,9 @@ func (deviceCollectionService *DeviceCollectionService) DeviceCollection(createD @@ -144,9 +143,9 @@ func (deviceCollectionService *DeviceCollectionService) DeviceCollection(createD
144 } 143 }
145 } 144 }
146 // TODO:测试假数据,后期注释掉 145 // TODO:测试假数据,后期注释掉
147 - if createDeviceCollectionCommand.DeviceType == domain.DeviceTypeChuanChuanJi {  
148 - newDeviceCollection.Values["Count"] = rand.Intn(300)  
149 - } 146 + //if createDeviceCollectionCommand.DeviceType == domain.DeviceTypeChuanChuanJi {
  147 + // newDeviceCollection.Values["Count"] = rand.Intn(300)
  148 + //}
150 deviceCollection, err := deviceCollectionRepository.Save(newDeviceCollection) 149 deviceCollection, err := deviceCollectionRepository.Save(newDeviceCollection)
151 if err != nil { 150 if err != nil {
152 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 151 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -4,11 +4,11 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/c @@ -4,11 +4,11 @@ import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/c
4 4
5 // 包馅机 5 // 包馅机
6 type DeviceBaoXianJi struct { 6 type DeviceBaoXianJi struct {
7 - InterSpeed int64 `json:"InterSpeed"` // 内包材速度:内包材运行速率  
8 - ExterSpeed int64 `json:"ExterSpeed"` // 外包材速度:内包材运行速率  
9 - KnifeSpeed int64 `json:"KnifeSpeed"` // 切刀速度:切刀运行速率  
10 - TransSpeed int64 `json:"TransSpeed"` // 输送速度:输送带运行速率  
11 - Count int64 `json:"Count"` // 生产计数:生产统计数量 7 + //InterSpeed int64 `json:"InterSpeed"` // 内包材速度:内包材运行速率
  8 + //ExterSpeed int64 `json:"ExterSpeed"` // 外包材速度:内包材运行速率
  9 + //KnifeSpeed int64 `json:"KnifeSpeed"` // 切刀速度:切刀运行速率
  10 + //TransSpeed int64 `json:"TransSpeed"` // 输送速度:输送带运行速率
  11 + Count int64 `json:"Count"` // 生产计数:生产统计数量
12 } 12 }
13 13
14 // 油炸机 14 // 油炸机
@@ -17,6 +17,7 @@ type DeviceYouZhaJi struct { @@ -17,6 +17,7 @@ type DeviceYouZhaJi struct {
17 BackTemp float64 `json:"BackTemp"` // 炸机后段温度:炸机后段当前温度 17 BackTemp float64 `json:"BackTemp"` // 炸机后段温度:炸机后段当前温度
18 TankTemp float64 `json:"TankTemp"` // 储油罐温度 :储油罐当前温度 18 TankTemp float64 `json:"TankTemp"` // 储油罐温度 :储油罐当前温度
19 TubeTemp float64 `json:"TubeTemp"` // 管路温度:管路当前温度 19 TubeTemp float64 `json:"TubeTemp"` // 管路温度:管路当前温度
  20 + Alarm int `json:"alarm"` // 报警
20 } 21 }
21 22
22 // 油炸机2 23 // 油炸机2
@@ -24,17 +25,18 @@ type DeviceYouZhaJi2 struct { @@ -24,17 +25,18 @@ type DeviceYouZhaJi2 struct {
24 Temp1 float64 `json:"Temp1"` // 温度1当前温度 25 Temp1 float64 `json:"Temp1"` // 温度1当前温度
25 Temp2 float64 `json:"Temp2"` // 温度2当前温度 26 Temp2 float64 `json:"Temp2"` // 温度2当前温度
26 Temp3 float64 `json:"Temp3"` // 温度3当前温度 27 Temp3 float64 `json:"Temp3"` // 温度3当前温度
  28 + Alarm int `json:"alarm"` // 报警
27 } 29 }
28 30
29 // 串串机 31 // 串串机
30 type DeviceChuanChuanJi struct { 32 type DeviceChuanChuanJi struct {
31 - Total int64 `json:"Total"` // 累计生产计数:生产统计数量  
32 - Count int64 `json:"Count"` // 生产计数:生产统计数量  
33 - Year int `json:"Year"` // 年  
34 - Month int `json:"Month"` // 月  
35 - Day int `json:"Day"` // 日  
36 - ProductType int `json:"ProductType"`  
37 - ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类 33 + Total int64 `json:"Total"` // 累计生产计数:生产统计数量
  34 + Count int64 `json:"Count"` // 生产计数:生产统计数量
  35 + Year int `json:"Year"` // 年
  36 + Month int `json:"Month"` // 月
  37 + Day int `json:"Day"` // 日
  38 + ProductType int `json:"ProductType"`
  39 + //ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
38 } 40 }
39 41
40 // 速冻线 42 // 速冻线
@@ -44,22 +46,22 @@ type DeviceSuDongXian struct { @@ -44,22 +46,22 @@ type DeviceSuDongXian struct {
44 46
45 // 封口机 47 // 封口机
46 type DeviceFengKouJi struct { 48 type DeviceFengKouJi struct {
47 - Count int64 `json:"Count"` // 生产计数:生产统计数量  
48 - Year int `json:"Year"` // 年  
49 - Month int `json:"Month"` // 月  
50 - Day int `json:"Day"` // 日  
51 - ProductType int `json:"ProductType"`  
52 - ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类 49 + Count int64 `json:"Count"` // 生产计数:生产统计数量
  50 + Year int `json:"Year"` // 年
  51 + Month int `json:"Month"` // 月
  52 + Day int `json:"Day"` // 日
  53 + ProductType int `json:"ProductType"`
  54 + //ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
53 } 55 }
54 56
55 // 封箱机 57 // 封箱机
56 type DeviceFengXiangJi struct { 58 type DeviceFengXiangJi struct {
57 - Count int64 `json:"Count"` // 生产计数:生产统计数量  
58 - Year int `json:"Year"` // 年  
59 - Month int `json:"Month"` // 月  
60 - Day int `json:"Day"` // 日  
61 - ProductType int `json:"ProductType"`  
62 - ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类 59 + Count int64 `json:"Count"` // 生产计数:生产统计数量
  60 + Year int `json:"Year"` // 年
  61 + Month int `json:"Month"` // 月
  62 + Day int `json:"Day"` // 日
  63 + ProductType int `json:"ProductType"`
  64 + //ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
63 } 65 }
64 66
65 func ProductTypeToProductCode(productType int) string { 67 func ProductTypeToProductCode(productType int) string {