一、MES — 叫料单扩展(schema + 逻辑) material_request 新增字段:packageNo(叫料包号,一次提交=一包)、callDate(叫料日,默认当天)、planBreakdown(jsonb,工单×排产日明细 []CallPlanBreakdown);targetDock 语义降级为"期望接驳台(可空,配送时 WMS 确定实际台)"。 新增 internal/logic/call_plan.go:实时计算「叫料需求明细(工单×排产日×物料)」,派生两类提示(当日剩余未叫 / 跨日量明细),不落库、不拦提交;接驳台空台校验 EnsureStationDocksEmpty、托盘回库 DispatchPalletReturnManual、人工清台 ClearDockLedger、配送单派车 DispatchDeliveryAgv、工位物料明细 StationMaterialDetail。 新增 internal/handler/production/call_pkg.go:8 个 MES 内部端点(X-API-TOKEN 网关),供 WMS 调用——叫料需求明细、按包查单、接驳台状态、托盘回库、人工清台、配送单派车、叫料池原始行、工位物料明细、WMS 代叫料。 internal/handler/production/call.go、internal/logic/call.go、agv.go、qty_report.go、routes_production.go、wmsclient/client.go、db.go 同步接入上述逻辑。 二、WMS — 配送单(新功能,叫料与送料彻底拆开) 新增 schema/delivery_order.go + delivery_order_item.go 及 ent 生成代码:delivery_order(PENDING→DISPATCHED→DONE / CANCELLED,一单=一次托盘配送)、delivery_order_item(配送物料明细快照:工单/工艺/排产日)。 新增 internal/handler/delivery.go + 路由 + DeliveryOrders.vue 页面(仓储作业 → 配送单)。 mesclient/client.go 扩展:MES 叫料单结构补 packageNo/callDate/workOrderNo/planBreakdown,新增 PoolRow/DockPalletState/DeliveryAgvItem/getJSON 等。 CallQueue.vue:按叫料包展示,新增「代叫料」「建配送单」按钮与对话框;出库单回写所属配送单号(outbound_order 加字段);AGV 派送改由配送单驱动。 三、工位终端 — 叫料体验升级 MaterialPanel.vue:新增「本工位物料明细」卡(工艺物料全集×工位账四数,量为 0 也显示);叫料改为「叫料包」模式(默认当天、可勾选分批、可选其他排产日、期望接驳台可空),新增叫料日选择器、两条提示横幅(当日剩余未叫 / 跨日量明细)、托盘回库按钮。 InspectPanel.vue/Main.vue/OnlinePanel.vue/OfflinePanel.vue/WorkPanel.vue/SyncQueueDialog.vue/api/index.js/internal/handler/line.go/routes.go 同步接入接驳台状态、托盘回库、下班双台空台校验等。 web/static/index.html 构建刷新。 四、文档 案例.md:重写第 5/6/8/9 节与新「配送单」流程,补「模拟模式跳过接驳台校验」说明,库管员菜单加「配送单」;并修正"本单箱体"等措辞歧义。 客户问题.md:同步本轮拍板口径。 五、构建产物 / 同步 多个 MES 前端页面(.vue)随本次改动统一重新构建刷新;ent 生成代码(MES material_request、WMS delivery_order/outbound_order 相关)随 schema 更新重新生成。
340 lines
13 KiB
Go
340 lines
13 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package outboundorder
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the outboundorder type in the database.
|
|
Label = "outbound_order"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldOutboundNo holds the string denoting the outbound_no field in the database.
|
|
FieldOutboundNo = "outbound_no"
|
|
// FieldOutboundType holds the string denoting the outbound_type field in the database.
|
|
FieldOutboundType = "outbound_type"
|
|
// FieldStatus holds the string denoting the status field in the database.
|
|
FieldStatus = "status"
|
|
// FieldNeedAgv holds the string denoting the need_agv field in the database.
|
|
FieldNeedAgv = "need_agv"
|
|
// FieldOutboundCategory holds the string denoting the outbound_category field in the database.
|
|
FieldOutboundCategory = "outbound_category"
|
|
// FieldOwnershipType holds the string denoting the ownership_type field in the database.
|
|
FieldOwnershipType = "ownership_type"
|
|
// FieldOwnershipNo holds the string denoting the ownership_no field in the database.
|
|
FieldOwnershipNo = "ownership_no"
|
|
// FieldTargetStation holds the string denoting the target_station field in the database.
|
|
FieldTargetStation = "target_station"
|
|
// FieldOrderNo holds the string denoting the order_no field in the database.
|
|
FieldOrderNo = "order_no"
|
|
// FieldMaterialCode holds the string denoting the material_code field in the database.
|
|
FieldMaterialCode = "material_code"
|
|
// FieldMaterialName holds the string denoting the material_name field in the database.
|
|
FieldMaterialName = "material_name"
|
|
// FieldManageMode holds the string denoting the manage_mode field in the database.
|
|
FieldManageMode = "manage_mode"
|
|
// FieldSnMode holds the string denoting the sn_mode field in the database.
|
|
FieldSnMode = "sn_mode"
|
|
// FieldBatchNo holds the string denoting the batch_no field in the database.
|
|
FieldBatchNo = "batch_no"
|
|
// FieldZoneCode holds the string denoting the zone_code field in the database.
|
|
FieldZoneCode = "zone_code"
|
|
// FieldShelfNo holds the string denoting the shelf_no field in the database.
|
|
FieldShelfNo = "shelf_no"
|
|
// FieldLayerNo holds the string denoting the layer_no field in the database.
|
|
FieldLayerNo = "layer_no"
|
|
// FieldPositionNo holds the string denoting the position_no field in the database.
|
|
FieldPositionNo = "position_no"
|
|
// FieldQuantity holds the string denoting the quantity field in the database.
|
|
FieldQuantity = "quantity"
|
|
// FieldOperator holds the string denoting the operator field in the database.
|
|
FieldOperator = "operator"
|
|
// FieldReviewer holds the string denoting the reviewer field in the database.
|
|
FieldReviewer = "reviewer"
|
|
// FieldTargetDock holds the string denoting the target_dock field in the database.
|
|
FieldTargetDock = "target_dock"
|
|
// FieldRemark holds the string denoting the remark field in the database.
|
|
FieldRemark = "remark"
|
|
// FieldBoxNo holds the string denoting the box_no field in the database.
|
|
FieldBoxNo = "box_no"
|
|
// FieldBoxSnList holds the string denoting the box_sn_list field in the database.
|
|
FieldBoxSnList = "box_sn_list"
|
|
// FieldContractNo holds the string denoting the contract_no field in the database.
|
|
FieldContractNo = "contract_no"
|
|
// FieldBorrowFrom holds the string denoting the borrowfrom field in the database.
|
|
FieldBorrowFrom = "borrow_from"
|
|
// FieldInspectionNo holds the string denoting the inspection_no field in the database.
|
|
FieldInspectionNo = "inspection_no"
|
|
// FieldDeliveryNo holds the string denoting the delivery_no field in the database.
|
|
FieldDeliveryNo = "delivery_no"
|
|
// FieldProductWorkNo holds the string denoting the product_work_no field in the database.
|
|
FieldProductWorkNo = "product_work_no"
|
|
// FieldVoided holds the string denoting the voided field in the database.
|
|
FieldVoided = "voided"
|
|
// FieldVoidReason holds the string denoting the void_reason field in the database.
|
|
FieldVoidReason = "void_reason"
|
|
// FieldVoidedBy holds the string denoting the voided_by field in the database.
|
|
FieldVoidedBy = "voided_by"
|
|
// FieldVoidedAt holds the string denoting the voided_at field in the database.
|
|
FieldVoidedAt = "voided_at"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// Table holds the table name of the outboundorder in the database.
|
|
Table = "outbound_orders"
|
|
)
|
|
|
|
// Columns holds all SQL columns for outboundorder fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldOutboundNo,
|
|
FieldOutboundType,
|
|
FieldStatus,
|
|
FieldNeedAgv,
|
|
FieldOutboundCategory,
|
|
FieldOwnershipType,
|
|
FieldOwnershipNo,
|
|
FieldTargetStation,
|
|
FieldOrderNo,
|
|
FieldMaterialCode,
|
|
FieldMaterialName,
|
|
FieldManageMode,
|
|
FieldSnMode,
|
|
FieldBatchNo,
|
|
FieldZoneCode,
|
|
FieldShelfNo,
|
|
FieldLayerNo,
|
|
FieldPositionNo,
|
|
FieldQuantity,
|
|
FieldOperator,
|
|
FieldReviewer,
|
|
FieldTargetDock,
|
|
FieldRemark,
|
|
FieldBoxNo,
|
|
FieldBoxSnList,
|
|
FieldContractNo,
|
|
FieldBorrowFrom,
|
|
FieldInspectionNo,
|
|
FieldDeliveryNo,
|
|
FieldProductWorkNo,
|
|
FieldVoided,
|
|
FieldVoidReason,
|
|
FieldVoidedBy,
|
|
FieldVoidedAt,
|
|
FieldCreatedAt,
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// DefaultOutboundType holds the default value on creation for the "outbound_type" field.
|
|
DefaultOutboundType string
|
|
// DefaultStatus holds the default value on creation for the "status" field.
|
|
DefaultStatus string
|
|
// DefaultNeedAgv holds the default value on creation for the "need_agv" field.
|
|
DefaultNeedAgv bool
|
|
// DefaultManageMode holds the default value on creation for the "manage_mode" field.
|
|
DefaultManageMode int
|
|
// DefaultSnMode holds the default value on creation for the "sn_mode" field.
|
|
DefaultSnMode int
|
|
// DefaultQuantity holds the default value on creation for the "quantity" field.
|
|
DefaultQuantity int
|
|
// DefaultDeliveryNo holds the default value on creation for the "delivery_no" field.
|
|
DefaultDeliveryNo string
|
|
// DefaultVoided holds the default value on creation for the "voided" field.
|
|
DefaultVoided bool
|
|
// DefaultVoidReason holds the default value on creation for the "void_reason" field.
|
|
DefaultVoidReason string
|
|
// DefaultVoidedBy holds the default value on creation for the "voided_by" field.
|
|
DefaultVoidedBy string
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() int64
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the OutboundOrder queries.
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
// ByID orders the results by the id field.
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOutboundNo orders the results by the outbound_no field.
|
|
func ByOutboundNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOutboundNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOutboundType orders the results by the outbound_type field.
|
|
func ByOutboundType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOutboundType, opts...).ToFunc()
|
|
}
|
|
|
|
// ByStatus orders the results by the status field.
|
|
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByNeedAgv orders the results by the need_agv field.
|
|
func ByNeedAgv(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldNeedAgv, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOutboundCategory orders the results by the outbound_category field.
|
|
func ByOutboundCategory(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOutboundCategory, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOwnershipType orders the results by the ownership_type field.
|
|
func ByOwnershipType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOwnershipType, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOwnershipNo orders the results by the ownership_no field.
|
|
func ByOwnershipNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOwnershipNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTargetStation orders the results by the target_station field.
|
|
func ByTargetStation(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTargetStation, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOrderNo orders the results by the order_no field.
|
|
func ByOrderNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOrderNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByMaterialCode orders the results by the material_code field.
|
|
func ByMaterialCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldMaterialCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByMaterialName orders the results by the material_name field.
|
|
func ByMaterialName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldMaterialName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByManageMode orders the results by the manage_mode field.
|
|
func ByManageMode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldManageMode, opts...).ToFunc()
|
|
}
|
|
|
|
// BySnMode orders the results by the sn_mode field.
|
|
func BySnMode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSnMode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByBatchNo orders the results by the batch_no field.
|
|
func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByZoneCode orders the results by the zone_code field.
|
|
func ByZoneCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldZoneCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByShelfNo orders the results by the shelf_no field.
|
|
func ByShelfNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldShelfNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLayerNo orders the results by the layer_no field.
|
|
func ByLayerNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLayerNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPositionNo orders the results by the position_no field.
|
|
func ByPositionNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPositionNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByQuantity orders the results by the quantity field.
|
|
func ByQuantity(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldQuantity, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOperator orders the results by the operator field.
|
|
func ByOperator(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOperator, opts...).ToFunc()
|
|
}
|
|
|
|
// ByReviewer orders the results by the reviewer field.
|
|
func ByReviewer(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldReviewer, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTargetDock orders the results by the target_dock field.
|
|
func ByTargetDock(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTargetDock, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRemark orders the results by the remark field.
|
|
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRemark, opts...).ToFunc()
|
|
}
|
|
|
|
// ByBoxNo orders the results by the box_no field.
|
|
func ByBoxNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldBoxNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByBoxSnList orders the results by the box_sn_list field.
|
|
func ByBoxSnList(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldBoxSnList, opts...).ToFunc()
|
|
}
|
|
|
|
// ByContractNo orders the results by the contract_no field.
|
|
func ByContractNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldContractNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByInspectionNo orders the results by the inspection_no field.
|
|
func ByInspectionNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldInspectionNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDeliveryNo orders the results by the delivery_no field.
|
|
func ByDeliveryNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDeliveryNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByProductWorkNo orders the results by the product_work_no field.
|
|
func ByProductWorkNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldProductWorkNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVoided orders the results by the voided field.
|
|
func ByVoided(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVoided, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVoidReason orders the results by the void_reason field.
|
|
func ByVoidReason(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVoidReason, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVoidedBy orders the results by the voided_by field.
|
|
func ByVoidedBy(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVoidedBy, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVoidedAt orders the results by the voided_at field.
|
|
func ByVoidedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVoidedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|