Files
bj_power/bj_power_wms/ent/runtime.go
T
SunYF 68f50ee46e refactor(wms): 合并库存表为统一inventory,重构业务逻辑
1. 合并inventory_batch与serial_number为统一inventory表,用manage_mode区分结构件批次/精密件SN
2. 移除冗余的material_type字段与相关逻辑
3. 重构库存查询、检验、入库出库等业务逻辑适配新表结构
4. 调整前端路由与菜单,拆分基础数据为区域维护和物料档案
5. 优化入库校验逻辑,避免空单问题
6. 调整Vite构建配置,关闭自动清空输出目录
7. 为各模块添加详细中文注释,统一业务术语
8. 生成并更新Ent自动代码文件
2026-09-02 08:21:11 +08:00

291 lines
20 KiB
Go

// Code generated by ent, DO NOT EDIT.
package ent
import (
"bj_power_wms/ent/inbounddetail"
"bj_power_wms/ent/inboundorder"
"bj_power_wms/ent/inspectionrecord"
"bj_power_wms/ent/inventory"
"bj_power_wms/ent/inventorylock"
"bj_power_wms/ent/material"
"bj_power_wms/ent/ordermaterialledger"
"bj_power_wms/ent/outbounddetail"
"bj_power_wms/ent/outboundorder"
"bj_power_wms/ent/packagebox"
"bj_power_wms/ent/semifinished"
"bj_power_wms/ent/stocktakeitem"
"bj_power_wms/ent/stocktakeorder"
"bj_power_wms/ent/user"
"bj_power_wms/ent/zone"
"bj_power_wms/schema"
)
// The init function reads all schema descriptors with runtime code
// (default values, validators, hooks and policies) and stitches it
// to their package variables.
func init() {
inbounddetailFields := schema.InboundDetail{}.Fields()
_ = inbounddetailFields
// inbounddetailDescQuantity is the schema descriptor for quantity field.
inbounddetailDescQuantity := inbounddetailFields[4].Descriptor()
// inbounddetail.DefaultQuantity holds the default value on creation for the quantity field.
inbounddetail.DefaultQuantity = inbounddetailDescQuantity.Default.(int)
// inbounddetailDescCreatedAt is the schema descriptor for created_at field.
inbounddetailDescCreatedAt := inbounddetailFields[5].Descriptor()
// inbounddetail.DefaultCreatedAt holds the default value on creation for the created_at field.
inbounddetail.DefaultCreatedAt = inbounddetailDescCreatedAt.Default.(func() int64)
inboundorderFields := schema.InboundOrder{}.Fields()
_ = inboundorderFields
// inboundorderDescInboundType is the schema descriptor for inbound_type field.
inboundorderDescInboundType := inboundorderFields[1].Descriptor()
// inboundorder.DefaultInboundType holds the default value on creation for the inbound_type field.
inboundorder.DefaultInboundType = inboundorderDescInboundType.Default.(string)
// inboundorderDescManageMode is the schema descriptor for manage_mode field.
inboundorderDescManageMode := inboundorderFields[4].Descriptor()
// inboundorder.DefaultManageMode holds the default value on creation for the manage_mode field.
inboundorder.DefaultManageMode = inboundorderDescManageMode.Default.(int)
// inboundorderDescQuantity is the schema descriptor for quantity field.
inboundorderDescQuantity := inboundorderFields[7].Descriptor()
// inboundorder.DefaultQuantity holds the default value on creation for the quantity field.
inboundorder.DefaultQuantity = inboundorderDescQuantity.Default.(int)
// inboundorderDescCreatedAt is the schema descriptor for created_at field.
inboundorderDescCreatedAt := inboundorderFields[10].Descriptor()
// inboundorder.DefaultCreatedAt holds the default value on creation for the created_at field.
inboundorder.DefaultCreatedAt = inboundorderDescCreatedAt.Default.(func() int64)
inspectionrecordFields := schema.InspectionRecord{}.Fields()
_ = inspectionrecordFields
// inspectionrecordDescInspectionType is the schema descriptor for inspection_type field.
inspectionrecordDescInspectionType := inspectionrecordFields[3].Descriptor()
// inspectionrecord.DefaultInspectionType holds the default value on creation for the inspection_type field.
inspectionrecord.DefaultInspectionType = inspectionrecordDescInspectionType.Default.(string)
// inspectionrecordDescStatus is the schema descriptor for status field.
inspectionrecordDescStatus := inspectionrecordFields[4].Descriptor()
// inspectionrecord.DefaultStatus holds the default value on creation for the status field.
inspectionrecord.DefaultStatus = inspectionrecordDescStatus.Default.(string)
// inspectionrecordDescCreatedAt is the schema descriptor for created_at field.
inspectionrecordDescCreatedAt := inspectionrecordFields[8].Descriptor()
// inspectionrecord.DefaultCreatedAt holds the default value on creation for the created_at field.
inspectionrecord.DefaultCreatedAt = inspectionrecordDescCreatedAt.Default.(func() int64)
// inspectionrecordDescUpdatedAt is the schema descriptor for updated_at field.
inspectionrecordDescUpdatedAt := inspectionrecordFields[9].Descriptor()
// inspectionrecord.DefaultUpdatedAt holds the default value on creation for the updated_at field.
inspectionrecord.DefaultUpdatedAt = inspectionrecordDescUpdatedAt.Default.(func() int64)
inventoryFields := schema.Inventory{}.Fields()
_ = inventoryFields
// inventoryDescQuantity is the schema descriptor for quantity field.
inventoryDescQuantity := inventoryFields[5].Descriptor()
// inventory.DefaultQuantity holds the default value on creation for the quantity field.
inventory.DefaultQuantity = inventoryDescQuantity.Default.(int)
// inventoryDescLockedQty is the schema descriptor for locked_qty field.
inventoryDescLockedQty := inventoryFields[6].Descriptor()
// inventory.DefaultLockedQty holds the default value on creation for the locked_qty field.
inventory.DefaultLockedQty = inventoryDescLockedQty.Default.(int)
// inventoryDescQualityStatus is the schema descriptor for quality_status field.
inventoryDescQualityStatus := inventoryFields[7].Descriptor()
// inventory.DefaultQualityStatus holds the default value on creation for the quality_status field.
inventory.DefaultQualityStatus = inventoryDescQualityStatus.Default.(string)
// inventoryDescStatus is the schema descriptor for status field.
inventoryDescStatus := inventoryFields[9].Descriptor()
// inventory.DefaultStatus holds the default value on creation for the status field.
inventory.DefaultStatus = inventoryDescStatus.Default.(string)
// inventoryDescCreatedAt is the schema descriptor for created_at field.
inventoryDescCreatedAt := inventoryFields[14].Descriptor()
// inventory.DefaultCreatedAt holds the default value on creation for the created_at field.
inventory.DefaultCreatedAt = inventoryDescCreatedAt.Default.(func() int64)
// inventoryDescUpdatedAt is the schema descriptor for updated_at field.
inventoryDescUpdatedAt := inventoryFields[15].Descriptor()
// inventory.DefaultUpdatedAt holds the default value on creation for the updated_at field.
inventory.DefaultUpdatedAt = inventoryDescUpdatedAt.Default.(func() int64)
inventorylockFields := schema.InventoryLock{}.Fields()
_ = inventorylockFields
// inventorylockDescLockedQty is the schema descriptor for locked_qty field.
inventorylockDescLockedQty := inventorylockFields[3].Descriptor()
// inventorylock.DefaultLockedQty holds the default value on creation for the locked_qty field.
inventorylock.DefaultLockedQty = inventorylockDescLockedQty.Default.(int)
// inventorylockDescStatus is the schema descriptor for status field.
inventorylockDescStatus := inventorylockFields[5].Descriptor()
// inventorylock.DefaultStatus holds the default value on creation for the status field.
inventorylock.DefaultStatus = inventorylockDescStatus.Default.(string)
// inventorylockDescCreatedAt is the schema descriptor for created_at field.
inventorylockDescCreatedAt := inventorylockFields[8].Descriptor()
// inventorylock.DefaultCreatedAt holds the default value on creation for the created_at field.
inventorylock.DefaultCreatedAt = inventorylockDescCreatedAt.Default.(func() int64)
// inventorylockDescUpdatedAt is the schema descriptor for updated_at field.
inventorylockDescUpdatedAt := inventorylockFields[9].Descriptor()
// inventorylock.DefaultUpdatedAt holds the default value on creation for the updated_at field.
inventorylock.DefaultUpdatedAt = inventorylockDescUpdatedAt.Default.(func() int64)
materialFields := schema.Material{}.Fields()
_ = materialFields
// materialDescManageMode is the schema descriptor for manage_mode field.
materialDescManageMode := materialFields[6].Descriptor()
// material.DefaultManageMode holds the default value on creation for the manage_mode field.
material.DefaultManageMode = materialDescManageMode.Default.(int)
// materialDescIsBatchManaged is the schema descriptor for is_batch_managed field.
materialDescIsBatchManaged := materialFields[7].Descriptor()
// material.DefaultIsBatchManaged holds the default value on creation for the is_batch_managed field.
material.DefaultIsBatchManaged = materialDescIsBatchManaged.Default.(bool)
// materialDescIsSerialManaged is the schema descriptor for is_serial_managed field.
materialDescIsSerialManaged := materialFields[8].Descriptor()
// material.DefaultIsSerialManaged holds the default value on creation for the is_serial_managed field.
material.DefaultIsSerialManaged = materialDescIsSerialManaged.Default.(bool)
// materialDescCreatedAt is the schema descriptor for created_at field.
materialDescCreatedAt := materialFields[10].Descriptor()
// material.DefaultCreatedAt holds the default value on creation for the created_at field.
material.DefaultCreatedAt = materialDescCreatedAt.Default.(func() int64)
// materialDescUpdatedAt is the schema descriptor for updated_at field.
materialDescUpdatedAt := materialFields[11].Descriptor()
// material.DefaultUpdatedAt holds the default value on creation for the updated_at field.
material.DefaultUpdatedAt = materialDescUpdatedAt.Default.(func() int64)
ordermaterialledgerFields := schema.OrderMaterialLedger{}.Fields()
_ = ordermaterialledgerFields
// ordermaterialledgerDescTotalQty is the schema descriptor for total_qty field.
ordermaterialledgerDescTotalQty := ordermaterialledgerFields[3].Descriptor()
// ordermaterialledger.DefaultTotalQty holds the default value on creation for the total_qty field.
ordermaterialledger.DefaultTotalQty = ordermaterialledgerDescTotalQty.Default.(int)
// ordermaterialledgerDescOutQty is the schema descriptor for out_qty field.
ordermaterialledgerDescOutQty := ordermaterialledgerFields[4].Descriptor()
// ordermaterialledger.DefaultOutQty holds the default value on creation for the out_qty field.
ordermaterialledger.DefaultOutQty = ordermaterialledgerDescOutQty.Default.(int)
// ordermaterialledgerDescStatus is the schema descriptor for status field.
ordermaterialledgerDescStatus := ordermaterialledgerFields[5].Descriptor()
// ordermaterialledger.DefaultStatus holds the default value on creation for the status field.
ordermaterialledger.DefaultStatus = ordermaterialledgerDescStatus.Default.(string)
// ordermaterialledgerDescCreatedAt is the schema descriptor for created_at field.
ordermaterialledgerDescCreatedAt := ordermaterialledgerFields[7].Descriptor()
// ordermaterialledger.DefaultCreatedAt holds the default value on creation for the created_at field.
ordermaterialledger.DefaultCreatedAt = ordermaterialledgerDescCreatedAt.Default.(func() int64)
// ordermaterialledgerDescUpdatedAt is the schema descriptor for updated_at field.
ordermaterialledgerDescUpdatedAt := ordermaterialledgerFields[8].Descriptor()
// ordermaterialledger.DefaultUpdatedAt holds the default value on creation for the updated_at field.
ordermaterialledger.DefaultUpdatedAt = ordermaterialledgerDescUpdatedAt.Default.(func() int64)
outbounddetailFields := schema.OutboundDetail{}.Fields()
_ = outbounddetailFields
// outbounddetailDescQuantity is the schema descriptor for quantity field.
outbounddetailDescQuantity := outbounddetailFields[4].Descriptor()
// outbounddetail.DefaultQuantity holds the default value on creation for the quantity field.
outbounddetail.DefaultQuantity = outbounddetailDescQuantity.Default.(int)
// outbounddetailDescCreatedAt is the schema descriptor for created_at field.
outbounddetailDescCreatedAt := outbounddetailFields[6].Descriptor()
// outbounddetail.DefaultCreatedAt holds the default value on creation for the created_at field.
outbounddetail.DefaultCreatedAt = outbounddetailDescCreatedAt.Default.(func() int64)
outboundorderFields := schema.OutboundOrder{}.Fields()
_ = outboundorderFields
// outboundorderDescOutboundType is the schema descriptor for outbound_type field.
outboundorderDescOutboundType := outboundorderFields[1].Descriptor()
// outboundorder.DefaultOutboundType holds the default value on creation for the outbound_type field.
outboundorder.DefaultOutboundType = outboundorderDescOutboundType.Default.(string)
// outboundorderDescManageMode is the schema descriptor for manage_mode field.
outboundorderDescManageMode := outboundorderFields[5].Descriptor()
// outboundorder.DefaultManageMode holds the default value on creation for the manage_mode field.
outboundorder.DefaultManageMode = outboundorderDescManageMode.Default.(int)
// outboundorderDescQuantity is the schema descriptor for quantity field.
outboundorderDescQuantity := outboundorderFields[8].Descriptor()
// outboundorder.DefaultQuantity holds the default value on creation for the quantity field.
outboundorder.DefaultQuantity = outboundorderDescQuantity.Default.(int)
// outboundorderDescCreatedAt is the schema descriptor for created_at field.
outboundorderDescCreatedAt := outboundorderFields[13].Descriptor()
// outboundorder.DefaultCreatedAt holds the default value on creation for the created_at field.
outboundorder.DefaultCreatedAt = outboundorderDescCreatedAt.Default.(func() int64)
packageboxFields := schema.PackageBox{}.Fields()
_ = packageboxFields
// packageboxDescQuantity is the schema descriptor for quantity field.
packageboxDescQuantity := packageboxFields[3].Descriptor()
// packagebox.DefaultQuantity holds the default value on creation for the quantity field.
packagebox.DefaultQuantity = packageboxDescQuantity.Default.(int)
// packageboxDescCreatedAt is the schema descriptor for created_at field.
packageboxDescCreatedAt := packageboxFields[7].Descriptor()
// packagebox.DefaultCreatedAt holds the default value on creation for the created_at field.
packagebox.DefaultCreatedAt = packageboxDescCreatedAt.Default.(func() int64)
// packageboxDescUpdatedAt is the schema descriptor for updated_at field.
packageboxDescUpdatedAt := packageboxFields[8].Descriptor()
// packagebox.DefaultUpdatedAt holds the default value on creation for the updated_at field.
packagebox.DefaultUpdatedAt = packageboxDescUpdatedAt.Default.(func() int64)
semifinishedFields := schema.SemiFinished{}.Fields()
_ = semifinishedFields
// semifinishedDescQuantity is the schema descriptor for quantity field.
semifinishedDescQuantity := semifinishedFields[3].Descriptor()
// semifinished.DefaultQuantity holds the default value on creation for the quantity field.
semifinished.DefaultQuantity = semifinishedDescQuantity.Default.(int)
// semifinishedDescStatus is the schema descriptor for status field.
semifinishedDescStatus := semifinishedFields[5].Descriptor()
// semifinished.DefaultStatus holds the default value on creation for the status field.
semifinished.DefaultStatus = semifinishedDescStatus.Default.(string)
// semifinishedDescCreatedAt is the schema descriptor for created_at field.
semifinishedDescCreatedAt := semifinishedFields[7].Descriptor()
// semifinished.DefaultCreatedAt holds the default value on creation for the created_at field.
semifinished.DefaultCreatedAt = semifinishedDescCreatedAt.Default.(func() int64)
// semifinishedDescUpdatedAt is the schema descriptor for updated_at field.
semifinishedDescUpdatedAt := semifinishedFields[8].Descriptor()
// semifinished.DefaultUpdatedAt holds the default value on creation for the updated_at field.
semifinished.DefaultUpdatedAt = semifinishedDescUpdatedAt.Default.(func() int64)
stocktakeitemFields := schema.StocktakeItem{}.Fields()
_ = stocktakeitemFields
// stocktakeitemDescBookQty is the schema descriptor for book_qty field.
stocktakeitemDescBookQty := stocktakeitemFields[5].Descriptor()
// stocktakeitem.DefaultBookQty holds the default value on creation for the book_qty field.
stocktakeitem.DefaultBookQty = stocktakeitemDescBookQty.Default.(int)
// stocktakeitemDescScannedQty is the schema descriptor for scanned_qty field.
stocktakeitemDescScannedQty := stocktakeitemFields[6].Descriptor()
// stocktakeitem.DefaultScannedQty holds the default value on creation for the scanned_qty field.
stocktakeitem.DefaultScannedQty = stocktakeitemDescScannedQty.Default.(int)
// stocktakeitemDescDiffQty is the schema descriptor for diff_qty field.
stocktakeitemDescDiffQty := stocktakeitemFields[7].Descriptor()
// stocktakeitem.DefaultDiffQty holds the default value on creation for the diff_qty field.
stocktakeitem.DefaultDiffQty = stocktakeitemDescDiffQty.Default.(int)
// stocktakeitemDescCounted is the schema descriptor for counted field.
stocktakeitemDescCounted := stocktakeitemFields[8].Descriptor()
// stocktakeitem.DefaultCounted holds the default value on creation for the counted field.
stocktakeitem.DefaultCounted = stocktakeitemDescCounted.Default.(bool)
// stocktakeitemDescUpdatedAt is the schema descriptor for updated_at field.
stocktakeitemDescUpdatedAt := stocktakeitemFields[9].Descriptor()
// stocktakeitem.DefaultUpdatedAt holds the default value on creation for the updated_at field.
stocktakeitem.DefaultUpdatedAt = stocktakeitemDescUpdatedAt.Default.(func() int64)
stocktakeorderFields := schema.StocktakeOrder{}.Fields()
_ = stocktakeorderFields
// stocktakeorderDescStatus is the schema descriptor for status field.
stocktakeorderDescStatus := stocktakeorderFields[1].Descriptor()
// stocktakeorder.DefaultStatus holds the default value on creation for the status field.
stocktakeorder.DefaultStatus = stocktakeorderDescStatus.Default.(string)
// stocktakeorderDescTotalTargets is the schema descriptor for total_targets field.
stocktakeorderDescTotalTargets := stocktakeorderFields[3].Descriptor()
// stocktakeorder.DefaultTotalTargets holds the default value on creation for the total_targets field.
stocktakeorder.DefaultTotalTargets = stocktakeorderDescTotalTargets.Default.(int)
// stocktakeorderDescCreatedAt is the schema descriptor for created_at field.
stocktakeorderDescCreatedAt := stocktakeorderFields[4].Descriptor()
// stocktakeorder.DefaultCreatedAt holds the default value on creation for the created_at field.
stocktakeorder.DefaultCreatedAt = stocktakeorderDescCreatedAt.Default.(func() int64)
userFields := schema.User{}.Fields()
_ = userFields
// userDescRole is the schema descriptor for role field.
userDescRole := userFields[3].Descriptor()
// user.DefaultRole holds the default value on creation for the role field.
user.DefaultRole = userDescRole.Default.(string)
// userDescIsActive is the schema descriptor for is_active field.
userDescIsActive := userFields[6].Descriptor()
// user.DefaultIsActive holds the default value on creation for the is_active field.
user.DefaultIsActive = userDescIsActive.Default.(bool)
// userDescCreatedAt is the schema descriptor for created_at field.
userDescCreatedAt := userFields[8].Descriptor()
// user.DefaultCreatedAt holds the default value on creation for the created_at field.
user.DefaultCreatedAt = userDescCreatedAt.Default.(func() int64)
// userDescUpdatedAt is the schema descriptor for updated_at field.
userDescUpdatedAt := userFields[9].Descriptor()
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() int64)
zoneFields := schema.Zone{}.Fields()
_ = zoneFields
// zoneDescStatus is the schema descriptor for status field.
zoneDescStatus := zoneFields[3].Descriptor()
// zone.DefaultStatus holds the default value on creation for the status field.
zone.DefaultStatus = zoneDescStatus.Default.(string)
// zoneDescCreatedAt is the schema descriptor for created_at field.
zoneDescCreatedAt := zoneFields[4].Descriptor()
// zone.DefaultCreatedAt holds the default value on creation for the created_at field.
zone.DefaultCreatedAt = zoneDescCreatedAt.Default.(func() int64)
// zoneDescUpdatedAt is the schema descriptor for updated_at field.
zoneDescUpdatedAt := zoneFields[5].Descriptor()
// zone.DefaultUpdatedAt holds the default value on creation for the updated_at field.
zone.DefaultUpdatedAt = zoneDescUpdatedAt.Default.(func() int64)
}