fix
zhangqian
2024-07-04 286adacbe154f984b500cd7df16e332e255f2010
models/operation.go
@@ -19,10 +19,6 @@
      OperationTypeId   int                      `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"`   //作业类型id
      OperationTypeName string                   `json:"operationTypeName" gorm:"type:varchar(127);comment:作业类型名称"` //作业类型名称
      Status            constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:状态"`            //状态
      //FromLocationID    int                      `json:"fromLocationId"   gorm:"type:int;not null;comment:源位置id"`         //源位置id
      //FromLocation      Location                 `json:"fromLocation"     gorm:"foreignKey:FromLocationID;references:Id"` //源位置
      //ToLocationID      int                      `json:"toLocationId"    gorm:"type:int;not null;comment:目标位置id"`         //目标位置id
      //ToLocation        Location                 `json:"toLocation"      gorm:"foreignKey:ToLocationID;references:Id"`    //目标位置
      OperationDate     string                   `json:"operationDate" gorm:"type:varchar(31);comment:安排日期"`
      ContacterID       int                      `json:"contacterID" gorm:"type:int;comment:联系人ID"`
      ContacterName     string                   `json:"contacterName" gorm:"type:varchar(63);comment:联系人姓名"`
@@ -61,11 +57,10 @@
      CheckedBy    string `json:"checkedBy" gorm:"type:varchar(255);comment:验证者UserId"`
      Remark       string `json:"remark"`
      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)"`
      InventoryDealer     MiniDict  `json:"inventoryDealer" gorm:"foreignKey:InventoryDealerType;"`
      WarehouseId      int       `json:"warehouseId" gorm:"type:int;not null;default:0;comment:仓库id"`
      Warehouse        Warehouse `json:"warehouse" gorm:"foreignKey:WarehouseId"`
      IsInternalOutput bool      `json:"isInternalOutput"` //是否调拨产生的出库
      DealerType       string    `json:"dealerType" gorm:"type:varchar(255);comment:调拨出入库类型"`
   }
   OperationSearch struct {
@@ -98,6 +93,7 @@
func (slf *OperationSearch) BeforeCreate(tx *gorm.DB) {
   for k := range slf.Details {
      slf.Details[k].BaseOperationType = slf.BaseOperationType
      slf.Details[k].DealerType = slf.DealerType
   }
}
@@ -244,8 +240,7 @@
         Preload("Location").
         Preload("ToLocation").
         Preload("Details.FromLocation").
         Preload("Details.ToLocation").
         Preload("InventoryDealer").Preload("Warehouse")
         Preload("Details.ToLocation").Preload("Warehouse")
   }
   if slf.Disuse {