uint/uint64全部改为uint32

This commit is contained in:
2025-11-10 22:23:31 +08:00
parent 3e711551e7
commit ecd2d37c70
96 changed files with 775 additions and 785 deletions

View File

@@ -2,21 +2,19 @@ package models
import (
"time"
"gorm.io/gorm"
)
// PigPurchase 记录了猪只采购信息
type PigPurchase struct {
gorm.Model
PigBatchID uint `gorm:"not null;index;comment:关联的猪批次ID"`
Model
PigBatchID uint32 `gorm:"not null;index;comment:关联的猪批次ID"`
PurchaseDate time.Time `gorm:"primaryKey;comment:采购日期"`
Supplier string `gorm:"comment:供应商"`
Quantity int `gorm:"not null;comment:采购数量"`
UnitPrice float32 `gorm:"not null;comment:单价"`
TotalPrice float32 `gorm:"not null;comment:总价"`
Remarks string `gorm:"size:255;comment:备注"`
OperatorID uint `gorm:"comment:操作员ID"`
OperatorID uint32 `gorm:"comment:操作员ID"`
}
func (PigPurchase) TableName() string {
@@ -25,15 +23,15 @@ func (PigPurchase) TableName() string {
// PigSale 记录了猪只销售信息
type PigSale struct {
gorm.Model
PigBatchID uint `gorm:"not null;index;comment:关联的猪批次ID"`
Model
PigBatchID uint32 `gorm:"not null;index;comment:关联的猪批次ID"`
SaleDate time.Time `gorm:"primaryKey;comment:销售日期"`
Buyer string `gorm:"comment:购买方"`
Quantity int `gorm:"not null;comment:销售数量"`
UnitPrice float32 `gorm:"not null;comment:单价"`
TotalPrice float32 `gorm:"not null;comment:总价"`
Remarks string `gorm:"size:255;comment:备注"`
OperatorID uint `gorm:"comment:操作员ID"`
OperatorID uint32 `gorm:"comment:操作员ID"`
}
func (PigSale) TableName() string {