12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- package model
- import (
- "database/sql/driver"
- "encoding/json"
- model2 "gas-cylinder-api/common/model"
- )
- type TbGasLog struct {
- Id string `json:"id" gorm:"size:36"` // 主键 是 UUID
- OrgHex string `json:"orgHex" gorm:"size:128"` // 源码字符串 是 充装枪上报源码
- GunCode string `json:"gunCode" gorm:"size:14"` // 枪编码 是 需要现在平台录入/接口平台上传后返回的对应id
- InnerCode string `json:"innerCode" gorm:"size:36"` // 气瓶唯一性编码,单位内编号 否 气瓶唯一编号
- ChipId string `json:"chipId" gorm:"size:14"` // 气瓶标签ID 否
- PersonCode string `json:"personCode" gorm:"size:36"` // 充装人员编码 否 需要先在平台录入/接口平台上传后返回的对应id
- ChipContent string `json:"chipContent" gorm:"size:200"` // 标签内容 否
- PersonFlag int `json:"personFlag" gorm:"size:4"` // 是否绑定充装人员 否 0:false;1:true
- ChipFlag int `json:"chipFlag" gorm:"size:4"` // 是否读到标签 否 0:false;1:true
- OpenStatus int `json:"openStatus" gorm:"size:4"` // 阀开关状态 否 0:open;1:close
- ReturnOpenStatus int `json:"returnOpenStatus" gorm:"size:4"` // 返回开关状态 否 0:open;1:close
- ReturnLightStatus int `json:"returnLightStatus" gorm:"size:4"` // 返回灯状态,消息码 否
- ReturnMsgId int `json:"returnMsgId" gorm:"size:4"` // 返回消息ID 否
- FillTime int `json:"fillTime" gorm:"size:4"` // 充装时长 否 单位s
- CreateTime string `json:"createTime" gorm:"size:19"` // 创建时间 否 格式:yyyy-MM-dd HH:mm:ss
- }
- type TbFillData struct {
- FillId string `json:"fillId" gorm:"size:36"` // 主键 是
- GunCode string `json:"gunCode" gorm:"size:14"` // 枪编码 是
- StationId string `json:"stationId" gorm:"size:36"` // 气站ID 否
- CompanyId string `json:"companyId" gorm:"size:36"` // 企业Id 否
- Area string `json:"area" gorm:"size:6"` // 所在区 否
- City string `json:"city" gorm:"size:6"` // 所在市 否
- UserId string `json:"userId" gorm:"size:36"` // 充装工id 否
- PersonCode string `json:"personCode" gorm:"size:36"` // 充装人员编码 否
- InnerCode string `json:"innerCode" gorm:"size:36"` // 气瓶编号 否
- ChipId string `json:"chipId" gorm:"size:14"` // 气瓶标签ID 否
- ProductId int `json:"productId" gorm:"size:4"` // 气瓶类型id 否
- ProductMediaId int `json:"productMediaId" gorm:"size:4"` // 充装介质id 否
- ChipContent string `json:"chipContent" gorm:"size:200"` // 标签内容 否
- FillTime string `json:"fillTime" gorm:"size:19"` // 充装时间 否 yyyy-MM-dd HH:mm:ss
- FillDuration int `json:"fillDuration" gorm:"size:4"` // 充装时长 否 单位s
- CreateTime string `json:"createTime" gorm:"size:19"` // 创建时间 否 yyyy-MM-dd HH:mm:ss
- }
- type TbGasLogList []TbGasLog
- type TbFillDataList []TbFillData
- type FillData struct {
- model2.Model
- Status int
- GasLog TbGasLog `json:"gasLog"`
- TbGasLog TbGasLog `json:"tbGasLog"`
- TbFillData TbFillData `json:"tbFillData"`
- StationId string `json:"stationId" gorm:"size:36"` // 气站ID 否
- CompanyId string `json:"companyId" gorm:"size:36"` // 企业Id 否
- UserId string `json:"userId" gorm:"size:36"` // 充装工id 否
- User SysUserOmit `json:"user" gorm:"->;foreignkey:UserId;references:ProvUserId"`
- Station SysDeptOmit `json:"station" gorm:"->;foreignkey:StationId;references:CmpCode"`
- Company SysDeptOmit `json:"company" gorm:"->;foreignkey:CompanyId;references:CmpCode"`
- model2.ControlBy
- model2.ModelTime
- model2.DeptBy
- }
- type FillDataDistinctStation struct {
- StationId string `json:"stationId" gorm:"size:36"` // 气站ID 否
- Station SysDeptOmit `json:"station" gorm:"->;foreignkey:StationId;references:CmpCode"`
- }
- type FillDataDistinctUser struct {
- UserId string `json:"userId" gorm:"size:36"` // 充装工id 否
- User SysUserOmit `json:"user" gorm:"->;foreignkey:UserId;references:ProvUserId"`
- }
- func (FillData) TableName() string {
- return "fill_data"
- }
- func (e TbGasLog) Value() (driver.Value, error) {
- d, err := json.Marshal(e)
- return string(d), err
- }
- func (e *TbGasLog) Scan(src interface{}) error {
- return json.Unmarshal(src.([]byte), e)
- }
- func (e TbFillData) Value() (driver.Value, error) {
- d, err := json.Marshal(e)
- return string(d), err
- }
- func (e *TbFillData) Scan(src interface{}) error {
- return json.Unmarshal(src.([]byte), e)
- }
|