package model import ( "database/sql/driver" "encoding/json" model2 "gas-cylinder-api/common/model" ) type inspectExpand struct { InspectItem string `json:"inspectItem"` ItemCode string `json:"itemCode"` } type InspectExpandList []inspectExpand // 省平台入库安全检查 type ProvInspectRecord struct { OperationLogId string `json:"operationLogId" gorm:"size:36" swaggerignore:"true"` //操作记录Id,要求唯一 CustomerId string `json:"customerId" gorm:"size:36"` //客户ID InspectorId string `json:"inspectorId" gorm:"size:36" swaggerignore:"true"` //检查人ID UserId int `json:"userId" gorm:"size:36" swaggerignore:"true"` //检查人ID HomeCheckImg string `json:"homeCheckImg" gorm:"type:text"` //入户检查图片 SignImg string `json:"signImg" gorm:"type:text"` //送气员签字图片 CustomerImg string `json:"customerImg" gorm:"type:text"` //客户签字图片 InspectTime string `json:"inspectTime" gorm:"size:19" swaggerignore:"true"` //检查时间 BeforeRectifyImg string `json:"beforeRectifyImg" gorm:"type:text"` //整改前图片 AfterRectifyImg string `json:"afterRectifyImg" gorm:"type:text"` //整改后图片 State int `json:"state" gorm:"size:4"` //状态 0-待整改 1-整改中 2-已整改 -1 合格 Remark string `json:"remark" gorm:"size:512"` //备注 CreatorId string `json:"creatorId" gorm:"size:36" swaggerignore:"true"` //创建人员id InspectExpandList InspectExpandList `json:"inspectExpandList"` //安全检查项目列表 } type InspectRecord struct { model2.Model ProvInspectRecord OrderId string `json:"orderId" gorm:"size:48"` // 订单id Customer CustomerOmit `json:"customer" gorm:"->;"` User SysUserOmit `json:"user" gorm:"->;"` model2.ControlBy model2.ModelTime model2.DeptBy } func (InspectRecord) TableName() string { return "inspect_record" } func (e InspectExpandList) Value() (driver.Value, error) { d, err := json.Marshal(e) return string(d), err } func (e *InspectExpandList) Scan(src interface{}) error { return json.Unmarshal(src.([]byte), e) } func (i InspectRecord) GenProvInspectRecord() (p ProvInspectRecord) { p.OperationLogId = i.OperationLogId p.CustomerId = i.CustomerId p.InspectorId = i.InspectorId p.UserId = i.UserId p.HomeCheckImg = i.HomeCheckImg p.SignImg = i.SignImg p.CustomerImg = i.CustomerImg p.InspectTime = i.InspectTime p.BeforeRectifyImg = i.BeforeRectifyImg p.AfterRectifyImg = i.AfterRectifyImg p.State = i.State p.Remark = i.Remark p.CreatorId = i.CreatorId p.InspectExpandList = i.InspectExpandList return }