123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- package model
- import model2 "cold-delivery/common/model"
- const (
- IceRaftStatusNormal = "2"
- IceRaftStatusDisable = "1"
- )
- // 冰排
- type IceRaft struct {
- model2.Model
- Code string `json:"code" gorm:"size:128"` // 冰排编号
- Status string `json:"status" gorm:"size:4;not null;default:'2';comment:状态"` // 1-停用 2-正常
- IceRaftRecordId int `json:"iceRaftRecordId" gorm:"size:128"` // 最新入库记录
- FreezeClaim model2.FloatList `json:"freezeClaim" gorm:"type:json;comment:冷冻要求"` // 冷冻要求 单位小时
- IceRaftRecord IceRaftRecordOmit `json:"iceRaftRecord" gorm:"->;foreignkey:IceRaftRecordId;references:Id"`
- Label string `json:"label" gorm:"size:128;comment:标签"` // 标签
- IceColdAddress string `json:"iceColdAddress" gorm:"size:128;comment:冰排预冷地点"` //冰排预冷地点
- SuitableForCold string `json:"suitableForCold" gorm:"size:128;comment:冰排适冷温度"` // 冰排遇冷温度
- Sort int `json:"sort" gorm:"size:4;comment:排序"` // 排序
- ForColdTime float64 `json:"forColdTime" gorm:"type:decimal(10,2);comment:适冷时长"` // 适冷时长 单位小时
- BindCoolerBox model2.IntList `json:"bindCoolerBox" gorm:"type:json;comment:绑定保温箱"` //绑定保温箱 当该字段为零时,代表未绑定保温箱可正常出库
- CoolerBoxName model2.StringList `json:"coolerBoxName" gorm:"type:json;comment:保温箱名称"` // 保温箱名称
- model2.ControlBy
- model2.ModelTime
- model2.DeptBy
- }
- type IceRaftOmit struct {
- Id int `json:"id,omitempty"` // 主键编码
- Code string `json:"code,omitempty"` // 商品名称
- Label string `json:"label" gorm:"size:128;comment:标签"` // 标签
- }
- func (IceRaft) TableName() string {
- return "ice_raft"
- }
- func (IceRaftOmit) TableName() string {
- return "ice_raft"
- }
- const (
- IceRaftRecordStatusFreezing = "1" // 冷冻中
- IceRaftRecordStatusWaitUse = "2" // 待使用
- IceRaftRecordStatusUsing = "3" // 使用中
- IceRaftRecordStatusFinish = "4" // 已结束
- IceRaftRecordReleasedInTheCold = "5" // 释冷中
- IceRaftRecordReleasedInTheColdEnd = "6" // 释冷完成
- )
- func GetIceRaftRecordStatus(s string) string {
- switch s {
- case "":
- return "未入库"
- case IceRaftRecordStatusFreezing:
- return "冷冻中"
- case IceRaftRecordStatusWaitUse:
- return "待使用"
- case IceRaftRecordStatusUsing:
- return "使用中"
- case IceRaftRecordStatusFinish:
- return "已结束"
- case IceRaftRecordReleasedInTheCold:
- return "释冷中"
- case IceRaftRecordReleasedInTheColdEnd:
- return "释冷完成"
- }
- return ""
- }
- // IceRaftRecord 冰排记录
- type IceRaftRecord struct {
- model2.Model
- IceRaftId int `json:"iceRaftId" gorm:"size:128;comment:冰排id"`
- Label string `json:"label" gorm:"size:128;comment:标签"` // 标签
- Code string `json:"code" gorm:"size:128;comment:编号"` // 编号
- Status string `json:"status" gorm:"size:4;not null;default:'2';comment:状态"` // 0未入库 1-冷冻中 2-待使用 3-使用中 4已结束 5-释冷中 6-释冷完成
- Sort int `json:"sort" gorm:"size:4;comment:排序"` // 排序
- ForColdTime float64 `json:"forColdTime" gorm:"type:decimal(10,2);comment:要求适冷时间"` // 适冷时长 单位小时
- ForColdTimeActual float64 `json:"forColdTimeActual" gorm:"type:decimal(10,0);comment:实际适冷时间"` // 适冷时长 单位分钟
- InStorageTime model2.Time `json:"inStorageTime" gorm:"size:128;comment:入库时间"` // 入库时间
- OutStorageTime model2.Time `json:"outStorageTime" gorm:"size:128;comment:出库时间"` // 出库时间
- IceLockerId int `json:"iceLockerId" gorm:"size:128;comment:冷冻柜id"` // 冷冻柜id
- CoolerBoxId int `json:"coolerBoxId" gorm:"size:128;comment:保温箱id"` // 保温箱id
- FreezeClaim model2.FloatList `json:"freezeClaim" gorm:"type:json;comment:冷冻要求"` // 冷冻要求 单位小时
- FreezeDuration float64 `json:"freezeDuration" gorm:"type:decimal(10,2);comment:冷冻时长"` // 冷冻时长 单位分钟
- SuitableForCold string `json:"suitableForCold" gorm:"size:128;comment:冰排适冷温度"` // 冰排适冷温度
- EndForColdTime model2.Time `json:"endForColdTime" gorm:"size:128;comment:适冷结束时间"` // 适冷结束时间
- IsSuitableForCold int `json:"isSuitableForCold" gorm:"size:4;not null;comment:是否结束适冷"` //0 未适冷 1已适冷
- CoolerBoxStarTime model2.Time `json:"coolerBoxStarTime" gorm:"size:128;comment:保温箱开始预冷时间"` //保温箱开始预冷时间
- CoolerBoxEndTime model2.Time `json:"coolerBoxEndTime" gorm:"size:128;comment:保温箱结束记录时间"` //保温箱结束记录时间
- StartIceColdTime model2.Time `json:"start_ice_cold_time" gorm:"size:128;comment:释冷开始时间"` //冰排释冷开始时间
- IceColdAddress string `json:"ice_cold_address" gorm:"size:128;comment:冰排预冷地点"` //冰排预冷地点
- IceColdUsers string `json:"ice_cold_users" gorm:"size:128;comment:冰排预冷操作人员"` //冰排预冷操作人员
- IceUseUsers string `json:"ice_use_users" gorm:"size:128;comment:冰排使用操作人员"` //冰排使用操作人员
- IceUseTime model2.Time `json:"ice_use_time" gorm:"size:128;comment:冰排使用时间"` //冰排使用时间
- CoolerColdAddress string `json:"cooler-cold-address" gorm:"size:128;comment:保温箱预冷地点"` //保温箱预冷地点
- CoolerColdUsers string `json:"cooler-cold-users" gorm:"size:128;comment:保温箱预冷操作人员"` //保温箱预冷操作人员
- CoolerUseUsers string `json:"cooler-use-users" gorm:"size:128;comment:保温箱使用操作人员"` //保温箱使用操作人员
- ReturnDate model2.Time `json:"returnDate" gorm:"size:128;comment:归还日期"` // 归还日期
- CoolingTime string `json:"coolingTime" gorm:"-"` //释冷时间
- IceLocker IceLockerOmit `json:"iceLocker" gorm:"->"`
- CoolerBox CoolerBoxOmit `json:"coolerBox" gorm:"->"`
- CoolerBoxRecord CoolerBoxRecord `json:"coolerBoxRecord" gorm:"-"`
- IceRafts IceRaftOmit `json:"iceRafts" gorm:"-"`
- model2.ControlBy
- model2.ModelTime
- model2.DeptBy
- }
- type IceRaftRecordOmit struct {
- Id int `json:"id,omitempty"` // 主键编码
- IceRaftId int `json:"iceRaftId,omitempty"` // 冰排id
- Status string `json:"status"` // 1-停用 2-正常
- InStorageTime model2.Time `json:"inStorageTime,omitempty"` // 入库时间
- OutStorageTime model2.Time `json:"outStorageTime,omitempty"` // 出库时间
- IceLockerId int `json:"iceLockerId,omitempty"` // 冷冻柜id
- CoolerBoxId int `json:"coolerBoxId,omitempty"` // 保温箱id
- FreezeClaim model2.FloatList `json:"freezeClaim" gorm:"type:json;comment:冷冻要求"` // 冷冻要求 单位小时
- FreezeDuration float64 `json:"freezeDuration"` // 冷冻时长 单位分钟
- SuitableForCold string `json:"suitableForCold" ` // 冰排适冷温度
- EndForColdTime model2.Time `json:"endForColdTime" ` // 适冷结束时间
- IsSuitableForCold int `json:"isSuitableForCold" ` //0 未适冷 1已适冷
- StartIceColdTime model2.Time `json:"start_ice_cold_time" gorm:"size:128;comment:释冷开始时间"` //冰排释冷开始时间
- ForColdTimeActual float64 `json:"forColdTimeActual"`
- IceColdAddress string `json:"ice_cold_address" gorm:"size:128;comment:冰排预冷地点"` //冰排预冷地点
- IceColdUsers string `json:"ice_cold_users" gorm:"size:128;comment:冰排预冷操作人员"` //冰排预冷操作人员
- IceUseUsers string `json:"ice_use_users" gorm:"size:128;comment:冰排使用操作人员"` //冰排使用操作人员
- IceUseTime model2.Time `json:"ice_use_time" gorm:"size:128;comment:冰排使用时间"` //冰排使用时间
- CoolerColdAddress string `json:"cooler-cold-address" gorm:"size:128;comment:保温箱预冷地点"` //保温箱预冷地点
- CoolerColdUsers string `json:"cooler-cold-users" gorm:"size:128;comment:保温箱预冷操作人员"` //保温箱预冷操作人员
- CoolerUseUsers string `json:"cooler-use-users" gorm:"size:128;comment:保温箱使用操作人员"` //保温箱使用操作人员
- ReturnDate model2.Time `json:"returnDate" gorm:"size:128;comment:归还日期"` // 归还日期
- CoolingTime string `json:"coolingTime" gorm:"-"` //释冷时间
- IceLocker IceLockerOmit `json:"iceLocker" gorm:"->"`
- CoolerBox CoolerBoxOmit `json:"coolerBox" gorm:"->"`
- model2.ControlBy
- model2.ModelTime
- }
- func (IceRaftRecord) TableName() string {
- return "ice_raft_record"
- }
- func (IceRaftRecordOmit) TableName() string {
- return "ice_raft_record"
- }
|