出入库调拨产品明细增加备注字段(同步产品的备注字段)添加字段
| | |
| | | return |
| | | } |
| | | |
| | | var productIds []string |
| | | for _, v := range params.Details { |
| | | productIds = append(productIds, v.ProductId) |
| | | } |
| | | products, err := models.NewMaterialSearch().SetIDs(productIds).FindNotTotal() |
| | | if err != nil { |
| | | logx.Errorf("MonthStats get products err:%v", err) |
| | | return |
| | | } |
| | | productMap := models.MaterialMap(products) |
| | | for i, v := range params.Details { |
| | | material := productMap[v.ProductId] |
| | | if material != nil { |
| | | params.Details[i].Note = material.Note |
| | | } |
| | | } |
| | | |
| | | if err := models.NewOperationSearch().Create(¶ms); err != nil { |
| | | logx.Errorf("Operation create err: %v", err) |
| | | util.ResponseFormat(c, code.SaveFail, "添加失败:"+err.Error()) |
| | |
| | | TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:总净重"` |
| | | AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:辅助数量"` |
| | | AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:辅助单位"` |
| | | Note string `gorm:"type:varchar(1024);comment:备注" json:"note"` |
| | | Remark string `gorm:"type:varchar(1024);comment:备注" json:"remark"` |
| | | } |
| | | |
| | | OperationDetailsSearch struct { |
| | |
| | | TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:总净重"` //总净重 |
| | | AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:辅助数量"` //辅助数量 |
| | | AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:辅助单位"` //辅助单位 |
| | | Remark string `gorm:"type:varchar(1024);comment:备注" json:"remark"` |
| | | } |
| | | |
| | | type OperationList struct { |