zhangqian
2024-07-04 c950586b718ae6fc198bedf424609a4ac94cb5d1
models/operation.go
@@ -61,7 +61,7 @@
      CheckedBy    string `json:"checkedBy" gorm:"type:varchar(255);comment:验证者UserId"`
      Remark       string `json:"remark"`
      WarehouseId         int       `json:"warehouseId" gorm:"type:int;not null;comment:仓库id"`
      WarehouseId         int       `json:"warehouseId" gorm:"type:int;not null;default:0;comment:仓库id"`
      Warehouse           Warehouse `json:"warehouse" gorm:"foreignKey:WarehouseId"`
      IsInternalOutput    bool      `json:"isInternalOutput"` //是否调拨产生的出库
      InventoryDealerType int       `json:"inventoryDealerType" gorm:"type:varchar(255);comment:调拨出入库分类(对应dict字典表的ID)"`
@@ -95,6 +95,12 @@
   return &OperationSearch{Orm: mysqlx.GetDB()}
}
func (slf *OperationSearch) BeforeCreate(tx *gorm.DB) {
   for k := range slf.Details {
      slf.Details[k].BaseOperationType = slf.BaseOperationType
   }
}
func (slf *OperationSearch) SetOrm(tx *gorm.DB) *OperationSearch {
   slf.Orm = tx
   return slf