| | |
| | | ReorderRuleNum int64 `json:"reorderRuleNum"` |
| | | MoreUnit *bool `json:"moreUnit" gorm:"type:tinyint(1);default:false;comment:启动多单位"` |
| | | MoreUnitList []UnitItems `json:"moreUnitList" gorm:"-"` |
| | | MoreUnitValue string `json:"-" gorm:"type:varchar(255);comment:多单位值"` |
| | | MoreUnitValue string `json:"-" gorm:"type:varchar(255);comment:多单位值"` //多单位换算比例 |
| | | StockMoreUnitList []UnitItems `json:"-" gorm:"-"` //多单位存储的值 |
| | | StockMoreUnitValue string `json:"-" gorm:"type:varchar(512);comment:多单位值"` //多单位存储的值 |
| | | GrossWeight decimal.Decimal `json:"grossWeight" gorm:"type:decimal(20,3);comment:毛重"` |
| | | NetWeight decimal.Decimal `json:"netWeight" gorm:"type:decimal(20,3);comment:净重"` |
| | | GrossUnit string `json:"grossUnit" gorm:"type:varchar(255);comment:毛重单位"` |
| | |
| | | } |
| | | slf.MoreUnitValue = string(str) |
| | | } |
| | | if len(slf.StockMoreUnitList) != 0 { |
| | | items := make([]UnitItems, 0) |
| | | for k, item := range slf.StockMoreUnitList { |
| | | if item.Unit != "" && !item.Amount.IsZero() { |
| | | items = append(items, slf.StockMoreUnitList[k]) |
| | | } |
| | | } |
| | | |
| | | str, err := json.Marshal(items) |
| | | if err != nil { |
| | | return err |
| | | } |
| | | slf.StockMoreUnitValue = string(str) |
| | | } |
| | | return |
| | | } |
| | | |