package model import ( model2 "cold-delivery/common/model" natsModel "cold-delivery/common/nats/nats_server" ) const ( CoolerBoxStatusNormal = "2" CoolerBoxStatusDisable = "1" ) // CoolerBox 保温箱 type CoolerBox struct { model2.Model Name string `json:"name" gorm:"size:128"` // 商品名称 Sn string `json:"sn" gorm:"size:128"` // sn Status string `json:"status" gorm:"size:4;not null;default:'2';comment:状态"` // 1-停用 2-正常 HistorySn model2.StringList `json:"historySn"` // 历史绑定的sn ColdSpots string `json:"cold_spots"` //遇冷地点 ColdTemperatures string `json:"cold_temperatures"` //遇冷温度 ForColdCoolerTime float64 `json:"for_cold_cooler_time" gorm:"type:decimal(10,2);comment:预冷要求"` //保温箱预冷要求 DeviceData natsModel.DeviceData_R2 `json:"deviceData" gorm:"-"` MonitorStatus int `json:"monitorStatus" gorm:"comment:监控状态"` // 监控状态 0-未监控 1-监控中 ForColdStatus int `json:"forColdStatus" gorm:"default:0;comment:预冷状态"` // 0-未预冷 1-预冷中 2-使用中 BindIceRaftId model2.StringList `json:"bindIceRaftId" gorm:"comment:绑定冰排"` // 绑定的冰排id UseStatus int `json:"useStatus" gorm:"default:0;comment:预冷状态"` // 0-未预冷 1-预冷中 2-使用中 3遇冷结束 model2.ControlBy model2.ModelTime model2.DeptBy IceRaft []IceRaft `json:"ice_raft" gorm:"-"` CoolerBoxRecords CoolerBoxRecord `json:"cooler_box_record" gorm:"-"` } // CoolerBoxRecord 保温箱历史记录 type CoolerBoxRecord struct { model2.Model CoolerBoxId int `json:"coolerBoxId" gorm:"size:128"` Name string `json:"name" gorm:"size:128"` // 保温箱名称 Sn string `json:"sn" gorm:"size:128"` // sn HistoryCode model2.StringList `json:"historyCode"` // 历史冰排 Status string `json:"status" gorm:"size:4;not null;default:'0';comment:状态"` // 0待使用 1-使用中 2-使用结束 CoolerBoxStarTime model2.Time `json:"coolerBoxStarTime" gorm:"size:128;comment:保温箱开始预冷时间"` //保温箱开始预冷时间 CoolerUserTime model2.Time `json:"coolerBoxUserTime" gorm:"size:128;comment:保温箱开始使用时间"` //保温箱使用时间 CoolerColdAddress string `json:"cooler-cold-address" gorm:"size:128;comment:保温箱预冷地点"` //保温箱预冷地点 ColdTemperatures string `json:"cold_temperatures" gorm:"size:128;comment:保温箱预冷温度"` //遇冷温度 CoolerColdUsers string `json:"cooler-cold-users" gorm:"size:128;comment:保温箱预冷操作人员"` //保温箱预冷操作人员 CoolerUseUsers string `json:"cooler-use-users" gorm:"size:128;comment:保温箱使用操作人员"` //保温箱使用操作人员 CoolerEndUseTime model2.Time `json:"coolerEndUseTime" gorm:"size:128;comment:保温箱结束使用时间"` ForColdCoolerTime float64 `json:"for_cold_cooler_time" gorm:"type:decimal(10,2);comment:预冷要求"` ForColdDuration string `json:"for_cold_duration" gorm:"comment:预冷累计时长"` // 预冷累计时长 model2.ControlBy model2.ModelTime model2.DeptBy } type CoolerBoxAndIceRaft struct { model2.Model Name string `json:"name" gorm:"size:128"` // 商品名称 Sn string `json:"sn" gorm:"size:128"` // sn Status string `json:"status" gorm:"size:4;not null;default:'2';comment:状态"` // 1-停用 2-正常 HistorySn model2.StringList `json:"historySn"` // 历史绑定的sn DeviceData natsModel.DeviceData_R2 `json:"deviceData" gorm:"-"` model2.ControlBy model2.ModelTime model2.DeptBy IceRaft []IceRaft `json:"ice_raft"` } type CoolerBoxOmit struct { Id int `json:"id,omitempty"` // 主键编码 Name string `json:"name,omitempty"` // 商品名称 Sn string `json:"sn" gorm:"size:128"` // sn } func (CoolerBox) TableName() string { return "cooler_box" } func (CoolerBoxRecord) TableName() string { return "cooler_box_record" } func (CoolerBoxOmit) TableName() string { return "cooler_box" }