liujiandao
2023-11-14 2f32021ab211cd901e36c4cbc5875f0f072385bb
models/material.go
@@ -16,15 +16,15 @@
      //MaterialType constvar.ProductType  `gorm:"index;type:int(11);comment:物料类型(数字)" json:"materialType"`
      Model constvar.MaterialMode `gorm:"type:varchar(191);not null;comment:物料类型(字符串)" json:"model"` //物料类型(字符串)
      //Explain           string                  `gorm:"type:varchar(512);comment:编号说明" json:"explain"`
      //CodeStandardID    string                  `gorm:"type:varchar(191);comment:编码规范ID" json:"codeStandardID"`
      //Specs             string                  `gorm:"type:varchar(191);comment:物料规格" json:"specs"`
      //Type              string                  `gorm:"type:varchar(191);comment:物料型号" json:"type"`
      MinInventory decimal.Decimal `gorm:"type:decimal(35,18);comment:最小库存" json:"minInventory"` //最小库存
      MaxInventory decimal.Decimal `gorm:"type:decimal(35,18);comment:最大库存" json:"maxInventory"` //最大库存
      Amount       decimal.Decimal `gorm:"type:decimal(35,18);comment:数量" json:"amount"`         //数量
      CodeStandardID string          `gorm:"type:varchar(191);comment:编码规范ID" json:"codeStandardID"`
      Specs          string          `gorm:"type:varchar(191);comment:物料规格" json:"specs"`
      Type           string          `gorm:"type:varchar(191);comment:物料型号" json:"type"`
      MinInventory   decimal.Decimal `gorm:"type:decimal(35,18);comment:最小库存" json:"minInventory"` //最小库存
      MaxInventory   decimal.Decimal `gorm:"type:decimal(35,18);comment:最大库存" json:"maxInventory"` //最大库存
      Amount         decimal.Decimal `gorm:"type:decimal(35,18);comment:数量" json:"amount"`         //数量
      //LockAmount        decimal.Decimal         `gorm:"type:decimal(35,18);default:0;comment:锁定数量" json:"lockAmount"`
      Unit string `gorm:"type:varchar(100);comment:单位" json:"unit"` //单位
      //Note              string                  `gorm:"type:varchar(1024);comment:备注" json:"note"`
      Unit       string `gorm:"type:varchar(100);comment:单位" json:"unit"` //单位
      Note       string `gorm:"type:varchar(1024);comment:备注" json:"note"`
      TemplateID string `gorm:"type:varchar(191);comment:模板ID" json:"templateID"` //模板ID
      //FSource           string                  `gorm:"type:varchar(191);comment:生产车间" json:"-"`
      //Status            constvar.MaterialStatus `gorm:"type:int(11);comment:状态" json:"status"`
@@ -32,11 +32,11 @@
      PurchasePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:采购价格" json:"purchasePrice"` //采购价格
      //PurchaseAheadDay  int                     `gorm:"type:int(11);comment:采购提前期(天)" json:"purchaseAheadDay"`
      //ProduceAheadDay   int                     `gorm:"type:int(11);comment:制造提前期(天)" json:"produceAheadDay"`
      MinPurchaseAmount decimal.Decimal `gorm:"type:decimal(35,18);comment:最小采购量" json:"minPurchaseAmount"` //最小采购量
      //PurchaseType      constvar.PurchaseType `gorm:"type:int(11);comment:采购类型" json:"purchaseType"`
      IsSale    bool            `gorm:"type:tinyint(1);comment:是否销售" json:"isSale"`        //是否销售
      SalePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:销售单价" json:"salePrice"` //销售单价
      AutoIncr  uint            `gorm:"type:int(11);comment:自增ID;default:0;" json:"-"`
      MinPurchaseAmount decimal.Decimal       `gorm:"type:decimal(35,18);comment:最小采购量" json:"minPurchaseAmount"` //最小采购量
      PurchaseType      constvar.PurchaseType `gorm:"type:int(11);comment:采购类型" json:"purchaseType"`
      IsSale            bool                  `gorm:"type:tinyint(1);comment:是否销售" json:"isSale"`        //是否销售
      SalePrice         decimal.Decimal       `gorm:"type:decimal(35,18);comment:销售单价" json:"salePrice"` //销售单价
      AutoIncr          uint                  `gorm:"type:int(11);comment:自增ID;default:0;" json:"autoIncr"`
      //wms添加字段
      ProductType         constvar.ProductType       `gorm:"type:int(11);comment:产品类型" json:"productType"`                 //产品类型
      InvoicingStrategy   constvar.InvoicingStrategy `gorm:"type:int(11);comment:开票策略" json:"invoicingStrategy"`           //开票策略
@@ -487,9 +487,9 @@
//   return fileName, nil
//}
func (slf *MaterialSearch) MaxAutoIncr() (int64, error) {
func (slf *MaterialSearch) MaxAutoIncr() (int, error) {
   type Result struct {
      Max int64
      Max int
   }
   var (