| | |
| | | ToLocationID: params.ToLocationId, |
| | | OperationDate: params.OperationDate, |
| | | Details: []*models.OperationDetails{detail}, |
| | | BaseOperationType: params.BaseOperationType, |
| | | } |
| | | if err := models.WithTransaction(func(tx *gorm.DB) error { |
| | | if err := models.NewOperationDetailsSearch().SetOrm(tx).SetOperationId(params.Id).Delete(); err != nil { |
| | |
| | | ProductName string `json:"productName" gorm:"type:varchar(255);not null;comment:产品名称"` //产品名称 |
| | | Amount decimal.Decimal `json:"amount" gorm:"type:decimal(20,2);not null;comment:数量"` //数量 |
| | | Unit string `json:"unit" gorm:"type:varchar(31);comment:单位"` |
| | | BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:基础作业类型"` //基础作业类型 |
| | | } |
| | | |
| | | func (slf *MaterialSearch) Update(record *Material) error { |