feat: 新增检测单关联、基础数据优化与入库单升级
1. 新增出库单检测单号字段并添加索引支持溯源 2. 优化基础数据页面物料类型展示与选择逻辑 3. 升级入库单导入功能,支持自动生成单号并返回导入结果 4. 优化接驳台查询排序方式 5. 修复字符串拼接空格问题
This commit is contained in:
@@ -0,0 +1,250 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package inspectionrecord
|
||||
|
||||
import (
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the inspectionrecord type in the database.
|
||||
Label = "inspection_record"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldTargetType holds the string denoting the target_type field in the database.
|
||||
FieldTargetType = "target_type"
|
||||
// FieldTargetID holds the string denoting the target_id field in the database.
|
||||
FieldTargetID = "target_id"
|
||||
// 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"
|
||||
// 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"
|
||||
// FieldRelatedStandard holds the string denoting the related_standard field in the database.
|
||||
FieldRelatedStandard = "related_standard"
|
||||
// FieldManufacturer holds the string denoting the manufacturer field in the database.
|
||||
FieldManufacturer = "manufacturer"
|
||||
// FieldInspectionType holds the string denoting the inspection_type field in the database.
|
||||
FieldInspectionType = "inspection_type"
|
||||
// FieldStatus holds the string denoting the status field in the database.
|
||||
FieldStatus = "status"
|
||||
// FieldResultValue holds the string denoting the result_value field in the database.
|
||||
FieldResultValue = "result_value"
|
||||
// FieldInspectQty holds the string denoting the inspect_qty field in the database.
|
||||
FieldInspectQty = "inspect_qty"
|
||||
// FieldPassQty holds the string denoting the pass_qty field in the database.
|
||||
FieldPassQty = "pass_qty"
|
||||
// FieldRejectQty holds the string denoting the reject_qty field in the database.
|
||||
FieldRejectQty = "reject_qty"
|
||||
// FieldCheckDesc holds the string denoting the check_desc field in the database.
|
||||
FieldCheckDesc = "check_desc"
|
||||
// FieldInspector holds the string denoting the inspector field in the database.
|
||||
FieldInspector = "inspector"
|
||||
// FieldInspectionNo holds the string denoting the inspection_no field in the database.
|
||||
FieldInspectionNo = "inspection_no"
|
||||
// FieldReportNo holds the string denoting the report_no field in the database.
|
||||
FieldReportNo = "report_no"
|
||||
// FieldDisposalType holds the string denoting the disposal_type field in the database.
|
||||
FieldDisposalType = "disposal_type"
|
||||
// FieldDisposalRemark holds the string denoting the disposal_remark field in the database.
|
||||
FieldDisposalRemark = "disposal_remark"
|
||||
// FieldReturnTrackingNo holds the string denoting the return_tracking_no field in the database.
|
||||
FieldReturnTrackingNo = "return_tracking_no"
|
||||
// FieldRemark holds the string denoting the remark field in the database.
|
||||
FieldRemark = "remark"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
||||
FieldUpdatedAt = "updated_at"
|
||||
// Table holds the table name of the inspectionrecord in the database.
|
||||
Table = "inspection_records"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for inspectionrecord fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldTargetType,
|
||||
FieldTargetID,
|
||||
FieldMaterialCode,
|
||||
FieldMaterialName,
|
||||
FieldOwnershipType,
|
||||
FieldOwnershipNo,
|
||||
FieldRelatedStandard,
|
||||
FieldManufacturer,
|
||||
FieldInspectionType,
|
||||
FieldStatus,
|
||||
FieldResultValue,
|
||||
FieldInspectQty,
|
||||
FieldPassQty,
|
||||
FieldRejectQty,
|
||||
FieldCheckDesc,
|
||||
FieldInspector,
|
||||
FieldInspectionNo,
|
||||
FieldReportNo,
|
||||
FieldDisposalType,
|
||||
FieldDisposalRemark,
|
||||
FieldReturnTrackingNo,
|
||||
FieldRemark,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
}
|
||||
|
||||
// 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 (
|
||||
// DefaultInspectionType holds the default value on creation for the "inspection_type" field.
|
||||
DefaultInspectionType string
|
||||
// DefaultStatus holds the default value on creation for the "status" field.
|
||||
DefaultStatus string
|
||||
// DefaultInspectQty holds the default value on creation for the "inspect_qty" field.
|
||||
DefaultInspectQty int
|
||||
// DefaultPassQty holds the default value on creation for the "pass_qty" field.
|
||||
DefaultPassQty int
|
||||
// DefaultRejectQty holds the default value on creation for the "reject_qty" field.
|
||||
DefaultRejectQty int
|
||||
// DefaultDisposalType holds the default value on creation for the "disposal_type" field.
|
||||
DefaultDisposalType string
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() int64
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
DefaultUpdatedAt func() int64
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the InspectionRecord 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()
|
||||
}
|
||||
|
||||
// ByTargetType orders the results by the target_type field.
|
||||
func ByTargetType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldTargetType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByTargetID orders the results by the target_id field.
|
||||
func ByTargetID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldTargetID, 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()
|
||||
}
|
||||
|
||||
// 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()
|
||||
}
|
||||
|
||||
// ByRelatedStandard orders the results by the related_standard field.
|
||||
func ByRelatedStandard(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRelatedStandard, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByManufacturer orders the results by the manufacturer field.
|
||||
func ByManufacturer(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldManufacturer, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByInspectionType orders the results by the inspection_type field.
|
||||
func ByInspectionType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldInspectionType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByStatus orders the results by the status field.
|
||||
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByResultValue orders the results by the result_value field.
|
||||
func ByResultValue(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldResultValue, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByInspectQty orders the results by the inspect_qty field.
|
||||
func ByInspectQty(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldInspectQty, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPassQty orders the results by the pass_qty field.
|
||||
func ByPassQty(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPassQty, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRejectQty orders the results by the reject_qty field.
|
||||
func ByRejectQty(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRejectQty, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCheckDesc orders the results by the check_desc field.
|
||||
func ByCheckDesc(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCheckDesc, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByInspector orders the results by the inspector field.
|
||||
func ByInspector(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldInspector, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByInspectionNo orders the results by the inspection_no field.
|
||||
func ByInspectionNo(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldInspectionNo, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByReportNo orders the results by the report_no field.
|
||||
func ByReportNo(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldReportNo, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDisposalType orders the results by the disposal_type field.
|
||||
func ByDisposalType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDisposalType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDisposalRemark orders the results by the disposal_remark field.
|
||||
func ByDisposalRemark(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDisposalRemark, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByReturnTrackingNo orders the results by the return_tracking_no field.
|
||||
func ByReturnTrackingNo(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldReturnTrackingNo, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRemark orders the results by the remark field.
|
||||
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRemark, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUpdatedAt orders the results by the updated_at field.
|
||||
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user