| | |
| | | } |
| | | |
| | | func (slf DictController) ParamsCheck(params models.Dict) (err error) { |
| | | if params.Number == "" || params.Name == "" { |
| | | return errors.New("参数缺失") |
| | | } |
| | | dict, err := models.NewDictSearch().SetNumber(params.Number).First() |
| | | if err != gorm.ErrRecordNotFound && dict != nil && dict.ID != params.ID { |
| | | return errors.New("编号重复") |
| | |
| | | FinenessList []FinenessItem `json:"finenessList"` //纤度数组 |
| | | SumFineness decimal.Decimal `gorm:"type:decimal(12,2);not null;comment:合计纤度" json:"sumFineness"` //合计纤度 |
| | | SumQuantity decimal.Decimal `gorm:"type:decimal(12,2);not null;comment:合计数量" json:"sumQuantity"` //合计数量 |
| | | Position int `gorm:"not null;default:0;comment:车号" json:"position"` //最后一个车号 |
| | | } |
| | | |
| | | type FinenessItem struct { |
| | |
| | | "description": "编号", |
| | | "type": "string" |
| | | }, |
| | | "position": { |
| | | "description": "最后一个车号", |
| | | "type": "integer" |
| | | }, |
| | | "spec": { |
| | | "description": "规格", |
| | | "type": "string" |
| | |
| | | "description": "编号", |
| | | "type": "string" |
| | | }, |
| | | "position": { |
| | | "description": "最后一个车号", |
| | | "type": "integer" |
| | | }, |
| | | "spec": { |
| | | "description": "规格", |
| | | "type": "string" |
| | |
| | | "description": "编号", |
| | | "type": "string" |
| | | }, |
| | | "position": { |
| | | "description": "最后一个车号", |
| | | "type": "integer" |
| | | }, |
| | | "spec": { |
| | | "description": "规格", |
| | | "type": "string" |
| | |
| | | "description": "编号", |
| | | "type": "string" |
| | | }, |
| | | "position": { |
| | | "description": "最后一个车号", |
| | | "type": "integer" |
| | | }, |
| | | "spec": { |
| | | "description": "规格", |
| | | "type": "string" |
| | |
| | | number: |
| | | description: 编号 |
| | | type: string |
| | | position: |
| | | description: 最后一个车号 |
| | | type: integer |
| | | spec: |
| | | description: 规格 |
| | | type: string |
| | |
| | | number: |
| | | description: 编号 |
| | | type: string |
| | | position: |
| | | description: 最后一个车号 |
| | | type: integer |
| | | spec: |
| | | description: 规格 |
| | | type: string |
| | |
| | | db = db.Where("dict_type = ?", slf.DictType) |
| | | } |
| | | |
| | | if slf.Name != "" { |
| | | db = db.Where("name = ?", slf.Name) |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |
| | |
| | | WorkshopGroup int `gorm:"type:int(11);not null;default:0;comment:车组" json:"workshopGroup"` //车组 |
| | | Market string `gorm:"type:varchar(255);not null;comment:庄口" json:"market"` //庄口 |
| | | Spec string `gorm:"type:varchar(255);not null;comment:规格" json:"spec"` //规格 |
| | | Circle uint8 `gorm:"not null;comment:回数" json:"circle"` //回数 |
| | | TotalCircle uint8 `gorm:"not null;comment:总回数" json:"totalCircle"` //总回数 |
| | | Circle uint8 `gorm:"not null;default:0;comment:回数" json:"circle"` //回数 |
| | | TotalCircle uint8 `gorm:"not null;default:0;comment:总回数" json:"totalCircle"` //总回数 |
| | | FinenessList []FinenessItem `gorm:"foreignkey:FinenessRegisterID;references:ID" json:"finenessList"` |
| | | SumFineness decimal.Decimal `gorm:"type:decimal(12,2);not null;comment:合计纤度" json:"sumFineness"` |
| | | SumQuantity decimal.Decimal `gorm:"type:decimal(12,2);not null;comment:合计数量" json:"sumQuantity"` |
| | | Position int `gorm:"not null;default:0;comment:车号" json:"position"` //最后一个车号 |
| | | } |
| | | FinenessRegisterSearch struct { |
| | | FinenessRegister |