feat: 多系统新增扫码中间件与 AGV 对接,优化拧紧与退库流程

新增扫码中间件支持网络型扫码枪键盘注入,AGV 对接从 WMS 迁至 MES 统一管理;新增拧紧不合格人工处置与 PLC 对账机制,优化退库单关联与工位终端功能,同时清理旧 AGV 任务表,完善数据库与配置项。
This commit is contained in:
SunYF
2026-10-14 17:24:59 +08:00
parent 8e6048c64b
commit f65a52d9e1
170 changed files with 15415 additions and 10572 deletions
@@ -15,10 +15,6 @@ const (
FieldID = "id"
// FieldRequestNo holds the string denoting the requestno field in the database.
FieldRequestNo = "request_no"
// FieldOrderNo holds the string denoting the orderno field in the database.
FieldOrderNo = "order_no"
// FieldPlanDate holds the string denoting the plandate field in the database.
FieldPlanDate = "plan_date"
// FieldMaterialCode holds the string denoting the materialcode field in the database.
FieldMaterialCode = "material_code"
// FieldMaterialName holds the string denoting the materialname field in the database.
@@ -35,28 +31,24 @@ const (
FieldTargetDock = "target_dock"
// FieldStationNo holds the string denoting the stationno field in the database.
FieldStationNo = "station_no"
// FieldFlowId holds the string denoting the flowid field in the database.
FieldFlowId = "flow_id"
// FieldSentQty holds the string denoting the sentqty field in the database.
FieldSentQty = "sent_qty"
// FieldReceivedQty holds the string denoting the receivedqty field in the database.
FieldReceivedQty = "received_qty"
// FieldReceivedAt holds the string denoting the receivedat field in the database.
FieldReceivedAt = "received_at"
// FieldReceiveBy holds the string denoting the receiveby field in the database.
FieldReceiveBy = "receive_by"
// FieldReturnedQty holds the string denoting the returnedqty field in the database.
FieldReturnedQty = "returned_qty"
// FieldSource holds the string denoting the source field in the database.
FieldSource = "source"
// FieldOverQty holds the string denoting the overqty field in the database.
FieldOverQty = "over_qty"
// FieldOverReason holds the string denoting the overreason field in the database.
FieldOverReason = "over_reason"
// FieldRefReportNo holds the string denoting the refreportno field in the database.
FieldRefReportNo = "ref_report_no"
// FieldNeedAgv holds the string denoting the needagv field in the database.
FieldNeedAgv = "need_agv"
// FieldBatchNo holds the string denoting the batchno field in the database.
FieldBatchNo = "batch_no"
// FieldAgvTaskNo holds the string denoting the agvtaskno field in the database.
FieldAgvTaskNo = "agv_task_no"
// FieldCrossDay holds the string denoting the crossday field in the database.
FieldCrossDay = "cross_day"
// FieldOutboundNo holds the string denoting the outboundno field in the database.
FieldOutboundNo = "outbound_no"
// FieldRejectReason holds the string denoting the rejectreason field in the database.
FieldRejectReason = "reject_reason"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldCreatedAt holds the string denoting the createdat field in the database.
@@ -71,8 +63,6 @@ const (
var Columns = []string{
FieldID,
FieldRequestNo,
FieldOrderNo,
FieldPlanDate,
FieldMaterialCode,
FieldMaterialName,
FieldUnit,
@@ -81,17 +71,15 @@ var Columns = []string{
FieldStatus,
FieldTargetDock,
FieldStationNo,
FieldFlowId,
FieldSentQty,
FieldReceivedQty,
FieldReceivedAt,
FieldReceiveBy,
FieldReturnedQty,
FieldSource,
FieldOverQty,
FieldOverReason,
FieldRefReportNo,
FieldNeedAgv,
FieldBatchNo,
FieldAgvTaskNo,
FieldCrossDay,
FieldOutboundNo,
FieldRejectReason,
FieldOperator,
FieldCreatedAt,
FieldUpdatedAt,
@@ -110,10 +98,6 @@ func ValidColumn(column string) bool {
var (
// RequestNoValidator is a validator for the "requestNo" field. It is called by the builders before save.
RequestNoValidator func(string) error
// OrderNoValidator is a validator for the "orderNo" field. It is called by the builders before save.
OrderNoValidator func(string) error
// PlanDateValidator is a validator for the "planDate" field. It is called by the builders before save.
PlanDateValidator func(string) error
// MaterialCodeValidator is a validator for the "materialCode" field. It is called by the builders before save.
MaterialCodeValidator func(string) error
// DefaultMaterialName holds the default value on creation for the "materialName" field.
@@ -138,38 +122,34 @@ var (
TargetDockValidator func(string) error
// DefaultStationNo holds the default value on creation for the "stationNo" field.
DefaultStationNo int
// DefaultFlowId holds the default value on creation for the "flowId" field.
DefaultFlowId int
// DefaultSentQty holds the default value on creation for the "sentQty" field.
DefaultSentQty float64
// DefaultReceivedQty holds the default value on creation for the "receivedQty" field.
DefaultReceivedQty float64
// DefaultReceivedAt holds the default value on creation for the "receivedAt" field.
DefaultReceivedAt int64
// DefaultReceiveBy holds the default value on creation for the "receiveBy" field.
DefaultReceiveBy string
// ReceiveByValidator is a validator for the "receiveBy" field. It is called by the builders before save.
ReceiveByValidator func(string) error
// DefaultReturnedQty holds the default value on creation for the "returnedQty" field.
DefaultReturnedQty float64
// DefaultSource holds the default value on creation for the "source" field.
DefaultSource string
// SourceValidator is a validator for the "source" field. It is called by the builders before save.
SourceValidator func(string) error
// DefaultOverQty holds the default value on creation for the "overQty" field.
DefaultOverQty float64
// DefaultOverReason holds the default value on creation for the "overReason" field.
DefaultOverReason string
// OverReasonValidator is a validator for the "overReason" field. It is called by the builders before save.
OverReasonValidator func(string) error
// DefaultRefReportNo holds the default value on creation for the "refReportNo" field.
DefaultRefReportNo string
// RefReportNoValidator is a validator for the "refReportNo" field. It is called by the builders before save.
RefReportNoValidator func(string) error
// DefaultNeedAgv holds the default value on creation for the "needAgv" field.
DefaultNeedAgv bool
// DefaultBatchNo holds the default value on creation for the "batchNo" field.
DefaultBatchNo string
// BatchNoValidator is a validator for the "batchNo" field. It is called by the builders before save.
BatchNoValidator func(string) error
// DefaultAgvTaskNo holds the default value on creation for the "agvTaskNo" field.
DefaultAgvTaskNo string
// AgvTaskNoValidator is a validator for the "agvTaskNo" field. It is called by the builders before save.
AgvTaskNoValidator func(string) error
// DefaultCrossDay holds the default value on creation for the "crossDay" field.
DefaultCrossDay bool
// DefaultOutboundNo holds the default value on creation for the "outboundNo" field.
DefaultOutboundNo string
// OutboundNoValidator is a validator for the "outboundNo" field. It is called by the builders before save.
OutboundNoValidator func(string) error
// DefaultRejectReason holds the default value on creation for the "rejectReason" field.
DefaultRejectReason string
// RejectReasonValidator is a validator for the "rejectReason" field. It is called by the builders before save.
RejectReasonValidator func(string) error
// DefaultOperator holds the default value on creation for the "operator" field.
DefaultOperator string
// OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
@@ -197,16 +177,6 @@ func ByRequestNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRequestNo, opts...).ToFunc()
}
// ByOrderNo orders the results by the orderNo field.
func ByOrderNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOrderNo, opts...).ToFunc()
}
// ByPlanDate orders the results by the planDate field.
func ByPlanDate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPlanDate, opts...).ToFunc()
}
// ByMaterialCode orders the results by the materialCode field.
func ByMaterialCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMaterialCode, opts...).ToFunc()
@@ -247,29 +217,14 @@ func ByStationNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStationNo, opts...).ToFunc()
}
// ByFlowId orders the results by the flowId field.
func ByFlowId(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlowId, opts...).ToFunc()
}
// BySentQty orders the results by the sentQty field.
func BySentQty(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSentQty, opts...).ToFunc()
}
// ByReceivedQty orders the results by the receivedQty field.
func ByReceivedQty(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReceivedQty, opts...).ToFunc()
}
// ByReceivedAt orders the results by the receivedAt field.
func ByReceivedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReceivedAt, opts...).ToFunc()
}
// ByReceiveBy orders the results by the receiveBy field.
func ByReceiveBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReceiveBy, opts...).ToFunc()
// ByReturnedQty orders the results by the returnedQty field.
func ByReturnedQty(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReturnedQty, opts...).ToFunc()
}
// BySource orders the results by the source field.
@@ -277,16 +232,6 @@ func BySource(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSource, opts...).ToFunc()
}
// ByOverQty orders the results by the overQty field.
func ByOverQty(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOverQty, opts...).ToFunc()
}
// ByOverReason orders the results by the overReason field.
func ByOverReason(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOverReason, opts...).ToFunc()
}
// ByRefReportNo orders the results by the refReportNo field.
func ByRefReportNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRefReportNo, opts...).ToFunc()
@@ -297,9 +242,24 @@ func ByNeedAgv(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldNeedAgv, opts...).ToFunc()
}
// ByBatchNo orders the results by the batchNo field.
func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
// ByAgvTaskNo orders the results by the agvTaskNo field.
func ByAgvTaskNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAgvTaskNo, opts...).ToFunc()
}
// ByCrossDay orders the results by the crossDay field.
func ByCrossDay(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCrossDay, opts...).ToFunc()
}
// ByOutboundNo orders the results by the outboundNo field.
func ByOutboundNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOutboundNo, opts...).ToFunc()
}
// ByRejectReason orders the results by the rejectReason field.
func ByRejectReason(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRejectReason, opts...).ToFunc()
}
// ByOperator orders the results by the operator field.