作者 yangfu

refactor: 设备消息结构修改

... ... @@ -13,7 +13,6 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/redis"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
"math/rand"
"strconv"
"sync"
"time"
... ... @@ -144,9 +143,9 @@ func (deviceCollectionService *DeviceCollectionService) DeviceCollection(createD
}
}
// TODO:测试假数据,后期注释掉
if createDeviceCollectionCommand.DeviceType == domain.DeviceTypeChuanChuanJi {
newDeviceCollection.Values["Count"] = rand.Intn(300)
}
//if createDeviceCollectionCommand.DeviceType == domain.DeviceTypeChuanChuanJi {
// newDeviceCollection.Values["Count"] = rand.Intn(300)
//}
deviceCollection, err := deviceCollectionRepository.Save(newDeviceCollection)
if err != nil {
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
// 包馅机
type DeviceBaoXianJi struct {
InterSpeed int64 `json:"InterSpeed"` // 内包材速度:内包材运行速率
ExterSpeed int64 `json:"ExterSpeed"` // 外包材速度:内包材运行速率
KnifeSpeed int64 `json:"KnifeSpeed"` // 切刀速度:切刀运行速率
TransSpeed int64 `json:"TransSpeed"` // 输送速度:输送带运行速率
Count int64 `json:"Count"` // 生产计数:生产统计数量
//InterSpeed int64 `json:"InterSpeed"` // 内包材速度:内包材运行速率
//ExterSpeed int64 `json:"ExterSpeed"` // 外包材速度:内包材运行速率
//KnifeSpeed int64 `json:"KnifeSpeed"` // 切刀速度:切刀运行速率
//TransSpeed int64 `json:"TransSpeed"` // 输送速度:输送带运行速率
Count int64 `json:"Count"` // 生产计数:生产统计数量
}
// 油炸机
... ... @@ -17,6 +17,7 @@ type DeviceYouZhaJi struct {
BackTemp float64 `json:"BackTemp"` // 炸机后段温度:炸机后段当前温度
TankTemp float64 `json:"TankTemp"` // 储油罐温度 :储油罐当前温度
TubeTemp float64 `json:"TubeTemp"` // 管路温度:管路当前温度
Alarm int `json:"alarm"` // 报警
}
// 油炸机2
... ... @@ -24,17 +25,18 @@ type DeviceYouZhaJi2 struct {
Temp1 float64 `json:"Temp1"` // 温度1当前温度
Temp2 float64 `json:"Temp2"` // 温度2当前温度
Temp3 float64 `json:"Temp3"` // 温度3当前温度
Alarm int `json:"alarm"` // 报警
}
// 串串机
type DeviceChuanChuanJi struct {
Total int64 `json:"Total"` // 累计生产计数:生产统计数量
Count int64 `json:"Count"` // 生产计数:生产统计数量
Year int `json:"Year"` // 年
Month int `json:"Month"` // 月
Day int `json:"Day"` // 日
ProductType int `json:"ProductType"`
ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
Total int64 `json:"Total"` // 累计生产计数:生产统计数量
Count int64 `json:"Count"` // 生产计数:生产统计数量
Year int `json:"Year"` // 年
Month int `json:"Month"` // 月
Day int `json:"Day"` // 日
ProductType int `json:"ProductType"`
//ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
}
// 速冻线
... ... @@ -44,22 +46,22 @@ type DeviceSuDongXian struct {
// 封口机
type DeviceFengKouJi struct {
Count int64 `json:"Count"` // 生产计数:生产统计数量
Year int `json:"Year"` // 年
Month int `json:"Month"` // 月
Day int `json:"Day"` // 日
ProductType int `json:"ProductType"`
ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
Count int64 `json:"Count"` // 生产计数:生产统计数量
Year int `json:"Year"` // 年
Month int `json:"Month"` // 月
Day int `json:"Day"` // 日
ProductType int `json:"ProductType"`
//ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
}
// 封箱机
type DeviceFengXiangJi struct {
Count int64 `json:"Count"` // 生产计数:生产统计数量
Year int `json:"Year"` // 年
Month int `json:"Month"` // 月
Day int `json:"Day"` // 日
ProductType int `json:"ProductType"`
ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
Count int64 `json:"Count"` // 生产计数:生产统计数量
Year int `json:"Year"` // 年
Month int `json:"Month"` // 月
Day int `json:"Day"` // 日
ProductType int `json:"ProductType"`
//ProductType1 string `json:"ProductType1"` // 产品类型:当前产品种类
}
func ProductTypeToProductCode(productType int) string {
... ...