feat: 完成客户第12条需求+多系统改造

1. 新增预警表添加工单号字段,支持按工单号检索预警
2. 添加工单过滤在制品/绩效报表/预警中心查询
3. 补全WMS台账字段口径与权限配置
4. 修复备料单与数量不符处理流程
5. 新增配送进度/库位联动/自动出库功能
6. 修复AGV配送状态更新逻辑
7. 优化退料与库存管理细节
This commit is contained in:
SunYF
2026-09-19 17:04:58 +08:00
parent 62e45b7379
commit 05b0b8a909
89 changed files with 7912 additions and 429 deletions
@@ -15,6 +15,10 @@ const (
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.
@@ -35,6 +39,12 @@ const (
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.
@@ -62,6 +72,8 @@ var Columns = []string{
FieldID,
FieldOutboundNo,
FieldOutboundType,
FieldStatus,
FieldNeedAgv,
FieldOutboundCategory,
FieldOwnershipType,
FieldOwnershipNo,
@@ -72,6 +84,9 @@ var Columns = []string{
FieldManageMode,
FieldBatchNo,
FieldZoneCode,
FieldShelfNo,
FieldLayerNo,
FieldPositionNo,
FieldQuantity,
FieldOperator,
FieldReviewer,
@@ -96,6 +111,10 @@ func ValidColumn(column string) bool {
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
// DefaultQuantity holds the default value on creation for the "quantity" field.
@@ -122,6 +141,16 @@ 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()
@@ -172,6 +201,21 @@ 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()
+325
View File
@@ -63,6 +63,16 @@ func OutboundType(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldOutboundType, v))
}
// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
func Status(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldStatus, v))
}
// NeedAgv applies equality check predicate on the "need_agv" field. It's identical to NeedAgvEQ.
func NeedAgv(v bool) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldNeedAgv, v))
}
// OutboundCategory applies equality check predicate on the "outbound_category" field. It's identical to OutboundCategoryEQ.
func OutboundCategory(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldOutboundCategory, v))
@@ -113,6 +123,21 @@ func ZoneCode(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldZoneCode, v))
}
// ShelfNo applies equality check predicate on the "shelf_no" field. It's identical to ShelfNoEQ.
func ShelfNo(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldShelfNo, v))
}
// LayerNo applies equality check predicate on the "layer_no" field. It's identical to LayerNoEQ.
func LayerNo(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldLayerNo, v))
}
// PositionNo applies equality check predicate on the "position_no" field. It's identical to PositionNoEQ.
func PositionNo(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldPositionNo, v))
}
// Quantity applies equality check predicate on the "quantity" field. It's identical to QuantityEQ.
func Quantity(v int) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldQuantity, v))
@@ -288,6 +313,81 @@ func OutboundTypeContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldOutboundType, v))
}
// StatusEQ applies the EQ predicate on the "status" field.
func StatusEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldStatus, v))
}
// StatusNEQ applies the NEQ predicate on the "status" field.
func StatusNEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNEQ(FieldStatus, v))
}
// StatusIn applies the In predicate on the "status" field.
func StatusIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIn(FieldStatus, vs...))
}
// StatusNotIn applies the NotIn predicate on the "status" field.
func StatusNotIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotIn(FieldStatus, vs...))
}
// StatusGT applies the GT predicate on the "status" field.
func StatusGT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGT(FieldStatus, v))
}
// StatusGTE applies the GTE predicate on the "status" field.
func StatusGTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGTE(FieldStatus, v))
}
// StatusLT applies the LT predicate on the "status" field.
func StatusLT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLT(FieldStatus, v))
}
// StatusLTE applies the LTE predicate on the "status" field.
func StatusLTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLTE(FieldStatus, v))
}
// StatusContains applies the Contains predicate on the "status" field.
func StatusContains(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContains(FieldStatus, v))
}
// StatusHasPrefix applies the HasPrefix predicate on the "status" field.
func StatusHasPrefix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasPrefix(FieldStatus, v))
}
// StatusHasSuffix applies the HasSuffix predicate on the "status" field.
func StatusHasSuffix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasSuffix(FieldStatus, v))
}
// StatusEqualFold applies the EqualFold predicate on the "status" field.
func StatusEqualFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEqualFold(FieldStatus, v))
}
// StatusContainsFold applies the ContainsFold predicate on the "status" field.
func StatusContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldStatus, v))
}
// NeedAgvEQ applies the EQ predicate on the "need_agv" field.
func NeedAgvEQ(v bool) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldNeedAgv, v))
}
// NeedAgvNEQ applies the NEQ predicate on the "need_agv" field.
func NeedAgvNEQ(v bool) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNEQ(FieldNeedAgv, v))
}
// OutboundCategoryEQ applies the EQ predicate on the "outbound_category" field.
func OutboundCategoryEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldOutboundCategory, v))
@@ -993,6 +1093,231 @@ func ZoneCodeContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldZoneCode, v))
}
// ShelfNoEQ applies the EQ predicate on the "shelf_no" field.
func ShelfNoEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldShelfNo, v))
}
// ShelfNoNEQ applies the NEQ predicate on the "shelf_no" field.
func ShelfNoNEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNEQ(FieldShelfNo, v))
}
// ShelfNoIn applies the In predicate on the "shelf_no" field.
func ShelfNoIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIn(FieldShelfNo, vs...))
}
// ShelfNoNotIn applies the NotIn predicate on the "shelf_no" field.
func ShelfNoNotIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotIn(FieldShelfNo, vs...))
}
// ShelfNoGT applies the GT predicate on the "shelf_no" field.
func ShelfNoGT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGT(FieldShelfNo, v))
}
// ShelfNoGTE applies the GTE predicate on the "shelf_no" field.
func ShelfNoGTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGTE(FieldShelfNo, v))
}
// ShelfNoLT applies the LT predicate on the "shelf_no" field.
func ShelfNoLT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLT(FieldShelfNo, v))
}
// ShelfNoLTE applies the LTE predicate on the "shelf_no" field.
func ShelfNoLTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLTE(FieldShelfNo, v))
}
// ShelfNoContains applies the Contains predicate on the "shelf_no" field.
func ShelfNoContains(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContains(FieldShelfNo, v))
}
// ShelfNoHasPrefix applies the HasPrefix predicate on the "shelf_no" field.
func ShelfNoHasPrefix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasPrefix(FieldShelfNo, v))
}
// ShelfNoHasSuffix applies the HasSuffix predicate on the "shelf_no" field.
func ShelfNoHasSuffix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasSuffix(FieldShelfNo, v))
}
// ShelfNoIsNil applies the IsNil predicate on the "shelf_no" field.
func ShelfNoIsNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIsNull(FieldShelfNo))
}
// ShelfNoNotNil applies the NotNil predicate on the "shelf_no" field.
func ShelfNoNotNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotNull(FieldShelfNo))
}
// ShelfNoEqualFold applies the EqualFold predicate on the "shelf_no" field.
func ShelfNoEqualFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEqualFold(FieldShelfNo, v))
}
// ShelfNoContainsFold applies the ContainsFold predicate on the "shelf_no" field.
func ShelfNoContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldShelfNo, v))
}
// LayerNoEQ applies the EQ predicate on the "layer_no" field.
func LayerNoEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldLayerNo, v))
}
// LayerNoNEQ applies the NEQ predicate on the "layer_no" field.
func LayerNoNEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNEQ(FieldLayerNo, v))
}
// LayerNoIn applies the In predicate on the "layer_no" field.
func LayerNoIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIn(FieldLayerNo, vs...))
}
// LayerNoNotIn applies the NotIn predicate on the "layer_no" field.
func LayerNoNotIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotIn(FieldLayerNo, vs...))
}
// LayerNoGT applies the GT predicate on the "layer_no" field.
func LayerNoGT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGT(FieldLayerNo, v))
}
// LayerNoGTE applies the GTE predicate on the "layer_no" field.
func LayerNoGTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGTE(FieldLayerNo, v))
}
// LayerNoLT applies the LT predicate on the "layer_no" field.
func LayerNoLT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLT(FieldLayerNo, v))
}
// LayerNoLTE applies the LTE predicate on the "layer_no" field.
func LayerNoLTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLTE(FieldLayerNo, v))
}
// LayerNoContains applies the Contains predicate on the "layer_no" field.
func LayerNoContains(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContains(FieldLayerNo, v))
}
// LayerNoHasPrefix applies the HasPrefix predicate on the "layer_no" field.
func LayerNoHasPrefix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasPrefix(FieldLayerNo, v))
}
// LayerNoHasSuffix applies the HasSuffix predicate on the "layer_no" field.
func LayerNoHasSuffix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasSuffix(FieldLayerNo, v))
}
// LayerNoIsNil applies the IsNil predicate on the "layer_no" field.
func LayerNoIsNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIsNull(FieldLayerNo))
}
// LayerNoNotNil applies the NotNil predicate on the "layer_no" field.
func LayerNoNotNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotNull(FieldLayerNo))
}
// LayerNoEqualFold applies the EqualFold predicate on the "layer_no" field.
func LayerNoEqualFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEqualFold(FieldLayerNo, v))
}
// LayerNoContainsFold applies the ContainsFold predicate on the "layer_no" field.
func LayerNoContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldLayerNo, v))
}
// PositionNoEQ applies the EQ predicate on the "position_no" field.
func PositionNoEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldPositionNo, v))
}
// PositionNoNEQ applies the NEQ predicate on the "position_no" field.
func PositionNoNEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNEQ(FieldPositionNo, v))
}
// PositionNoIn applies the In predicate on the "position_no" field.
func PositionNoIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIn(FieldPositionNo, vs...))
}
// PositionNoNotIn applies the NotIn predicate on the "position_no" field.
func PositionNoNotIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotIn(FieldPositionNo, vs...))
}
// PositionNoGT applies the GT predicate on the "position_no" field.
func PositionNoGT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGT(FieldPositionNo, v))
}
// PositionNoGTE applies the GTE predicate on the "position_no" field.
func PositionNoGTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGTE(FieldPositionNo, v))
}
// PositionNoLT applies the LT predicate on the "position_no" field.
func PositionNoLT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLT(FieldPositionNo, v))
}
// PositionNoLTE applies the LTE predicate on the "position_no" field.
func PositionNoLTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLTE(FieldPositionNo, v))
}
// PositionNoContains applies the Contains predicate on the "position_no" field.
func PositionNoContains(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContains(FieldPositionNo, v))
}
// PositionNoHasPrefix applies the HasPrefix predicate on the "position_no" field.
func PositionNoHasPrefix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasPrefix(FieldPositionNo, v))
}
// PositionNoHasSuffix applies the HasSuffix predicate on the "position_no" field.
func PositionNoHasSuffix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasSuffix(FieldPositionNo, v))
}
// PositionNoIsNil applies the IsNil predicate on the "position_no" field.
func PositionNoIsNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIsNull(FieldPositionNo))
}
// PositionNoNotNil applies the NotNil predicate on the "position_no" field.
func PositionNoNotNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotNull(FieldPositionNo))
}
// PositionNoEqualFold applies the EqualFold predicate on the "position_no" field.
func PositionNoEqualFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEqualFold(FieldPositionNo, v))
}
// PositionNoContainsFold applies the ContainsFold predicate on the "position_no" field.
func PositionNoContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldPositionNo, v))
}
// QuantityEQ applies the EQ predicate on the "quantity" field.
func QuantityEQ(v int) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldQuantity, v))