feat: 新增检测单关联、基础数据优化与入库单升级

1. 新增出库单检测单号字段并添加索引支持溯源
2. 优化基础数据页面物料类型展示与选择逻辑
3. 升级入库单导入功能,支持自动生成单号并返回导入结果
4. 优化接驳台查询排序方式
5. 修复字符串拼接空格问题
This commit is contained in:
SunYF
2026-09-21 15:28:14 +08:00
parent 0e769f3813
commit 12ca493c61
70 changed files with 25782 additions and 119 deletions
@@ -61,6 +61,8 @@ const (
FieldBoxSnList = "box_sn_list"
// FieldContractNo holds the string denoting the contract_no field in the database.
FieldContractNo = "contract_no"
// FieldInspectionNo holds the string denoting the inspection_no field in the database.
FieldInspectionNo = "inspection_no"
// 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.
@@ -95,6 +97,7 @@ var Columns = []string{
FieldBoxNo,
FieldBoxSnList,
FieldContractNo,
FieldInspectionNo,
FieldCreatedAt,
}
@@ -256,6 +259,11 @@ 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()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
+80
View File
@@ -178,6 +178,11 @@ func ContractNo(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldContractNo, v))
}
// InspectionNo applies equality check predicate on the "inspection_no" field. It's identical to InspectionNoEQ.
func InspectionNo(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldInspectionNo, v))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v int64) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldCreatedAt, v))
@@ -1883,6 +1888,81 @@ func ContractNoContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldContractNo, v))
}
// InspectionNoEQ applies the EQ predicate on the "inspection_no" field.
func InspectionNoEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldInspectionNo, v))
}
// InspectionNoNEQ applies the NEQ predicate on the "inspection_no" field.
func InspectionNoNEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNEQ(FieldInspectionNo, v))
}
// InspectionNoIn applies the In predicate on the "inspection_no" field.
func InspectionNoIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIn(FieldInspectionNo, vs...))
}
// InspectionNoNotIn applies the NotIn predicate on the "inspection_no" field.
func InspectionNoNotIn(vs ...string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotIn(FieldInspectionNo, vs...))
}
// InspectionNoGT applies the GT predicate on the "inspection_no" field.
func InspectionNoGT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGT(FieldInspectionNo, v))
}
// InspectionNoGTE applies the GTE predicate on the "inspection_no" field.
func InspectionNoGTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldGTE(FieldInspectionNo, v))
}
// InspectionNoLT applies the LT predicate on the "inspection_no" field.
func InspectionNoLT(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLT(FieldInspectionNo, v))
}
// InspectionNoLTE applies the LTE predicate on the "inspection_no" field.
func InspectionNoLTE(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldLTE(FieldInspectionNo, v))
}
// InspectionNoContains applies the Contains predicate on the "inspection_no" field.
func InspectionNoContains(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContains(FieldInspectionNo, v))
}
// InspectionNoHasPrefix applies the HasPrefix predicate on the "inspection_no" field.
func InspectionNoHasPrefix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasPrefix(FieldInspectionNo, v))
}
// InspectionNoHasSuffix applies the HasSuffix predicate on the "inspection_no" field.
func InspectionNoHasSuffix(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldHasSuffix(FieldInspectionNo, v))
}
// InspectionNoIsNil applies the IsNil predicate on the "inspection_no" field.
func InspectionNoIsNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIsNull(FieldInspectionNo))
}
// InspectionNoNotNil applies the NotNil predicate on the "inspection_no" field.
func InspectionNoNotNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotNull(FieldInspectionNo))
}
// InspectionNoEqualFold applies the EqualFold predicate on the "inspection_no" field.
func InspectionNoEqualFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEqualFold(FieldInspectionNo, v))
}
// InspectionNoContainsFold applies the ContainsFold predicate on the "inspection_no" field.
func InspectionNoContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldInspectionNo, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v int64) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldCreatedAt, v))