feat: 完成多模块迭代更新

- 新增过程巡检按步骤上报、数量不符上报、工位退料功能
- 增加工单工程编号三级归属字段
- 新增物料安全库存与缺货预警
- 新增附件管理、退库单管理模块
- 优化生产看板展示逻辑与前端页面文案
- 清理冗余的工艺路线相关代码与备份文件
This commit is contained in:
SunYF
2026-09-15 16:37:39 +08:00
parent 951f3dfecd
commit 4a5e2d7bac
494 changed files with 24702 additions and 139223 deletions
@@ -33,6 +33,14 @@ const (
FieldRemark = "remark"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldProcessCode holds the string denoting the processcode field in the database.
FieldProcessCode = "process_code"
// FieldStepId holds the string denoting the stepid field in the database.
FieldStepId = "step_id"
// FieldStepName holds the string denoting the stepname field in the database.
FieldStepName = "step_name"
// FieldMeasuredValue holds the string denoting the measuredvalue field in the database.
FieldMeasuredValue = "measured_value"
// FieldCreatedAt holds the string denoting the createdat field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the inspectionrecord in the database.
@@ -52,6 +60,10 @@ var Columns = []string{
FieldPhoto,
FieldRemark,
FieldOperator,
FieldProcessCode,
FieldStepId,
FieldStepName,
FieldMeasuredValue,
FieldCreatedAt,
}
@@ -100,6 +112,18 @@ var (
DefaultOperator string
// OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
OperatorValidator func(string) error
// DefaultProcessCode holds the default value on creation for the "processCode" field.
DefaultProcessCode int
// DefaultStepId holds the default value on creation for the "stepId" field.
DefaultStepId int
// DefaultStepName holds the default value on creation for the "stepName" field.
DefaultStepName string
// StepNameValidator is a validator for the "stepName" field. It is called by the builders before save.
StepNameValidator func(string) error
// DefaultMeasuredValue holds the default value on creation for the "measuredValue" field.
DefaultMeasuredValue string
// MeasuredValueValidator is a validator for the "measuredValue" field. It is called by the builders before save.
MeasuredValueValidator func(string) error
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
DefaultCreatedAt func() time.Time
// IDValidator is a validator for the "id" field. It is called by the builders before save.
@@ -159,6 +183,26 @@ func ByOperator(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOperator, opts...).ToFunc()
}
// ByProcessCode orders the results by the processCode field.
func ByProcessCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProcessCode, opts...).ToFunc()
}
// ByStepId orders the results by the stepId field.
func ByStepId(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStepId, opts...).ToFunc()
}
// ByStepName orders the results by the stepName field.
func ByStepName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStepName, opts...).ToFunc()
}
// ByMeasuredValue orders the results by the measuredValue field.
func ByMeasuredValue(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMeasuredValue, opts...).ToFunc()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
+230
View File
@@ -99,6 +99,26 @@ func Operator(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldOperator, v))
}
// ProcessCode applies equality check predicate on the "processCode" field. It's identical to ProcessCodeEQ.
func ProcessCode(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldProcessCode, v))
}
// StepId applies equality check predicate on the "stepId" field. It's identical to StepIdEQ.
func StepId(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldStepId, v))
}
// StepName applies equality check predicate on the "stepName" field. It's identical to StepNameEQ.
func StepName(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldStepName, v))
}
// MeasuredValue applies equality check predicate on the "measuredValue" field. It's identical to MeasuredValueEQ.
func MeasuredValue(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldMeasuredValue, v))
}
// CreatedAt applies equality check predicate on the "createdAt" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldCreatedAt, v))
@@ -699,6 +719,216 @@ func OperatorContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldOperator, v))
}
// ProcessCodeEQ applies the EQ predicate on the "processCode" field.
func ProcessCodeEQ(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldProcessCode, v))
}
// ProcessCodeNEQ applies the NEQ predicate on the "processCode" field.
func ProcessCodeNEQ(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldProcessCode, v))
}
// ProcessCodeIn applies the In predicate on the "processCode" field.
func ProcessCodeIn(vs ...int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldProcessCode, vs...))
}
// ProcessCodeNotIn applies the NotIn predicate on the "processCode" field.
func ProcessCodeNotIn(vs ...int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldProcessCode, vs...))
}
// ProcessCodeGT applies the GT predicate on the "processCode" field.
func ProcessCodeGT(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldProcessCode, v))
}
// ProcessCodeGTE applies the GTE predicate on the "processCode" field.
func ProcessCodeGTE(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldProcessCode, v))
}
// ProcessCodeLT applies the LT predicate on the "processCode" field.
func ProcessCodeLT(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldProcessCode, v))
}
// ProcessCodeLTE applies the LTE predicate on the "processCode" field.
func ProcessCodeLTE(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldProcessCode, v))
}
// StepIdEQ applies the EQ predicate on the "stepId" field.
func StepIdEQ(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldStepId, v))
}
// StepIdNEQ applies the NEQ predicate on the "stepId" field.
func StepIdNEQ(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldStepId, v))
}
// StepIdIn applies the In predicate on the "stepId" field.
func StepIdIn(vs ...int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldStepId, vs...))
}
// StepIdNotIn applies the NotIn predicate on the "stepId" field.
func StepIdNotIn(vs ...int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldStepId, vs...))
}
// StepIdGT applies the GT predicate on the "stepId" field.
func StepIdGT(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldStepId, v))
}
// StepIdGTE applies the GTE predicate on the "stepId" field.
func StepIdGTE(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldStepId, v))
}
// StepIdLT applies the LT predicate on the "stepId" field.
func StepIdLT(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldStepId, v))
}
// StepIdLTE applies the LTE predicate on the "stepId" field.
func StepIdLTE(v int) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldStepId, v))
}
// StepNameEQ applies the EQ predicate on the "stepName" field.
func StepNameEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldStepName, v))
}
// StepNameNEQ applies the NEQ predicate on the "stepName" field.
func StepNameNEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldStepName, v))
}
// StepNameIn applies the In predicate on the "stepName" field.
func StepNameIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldStepName, vs...))
}
// StepNameNotIn applies the NotIn predicate on the "stepName" field.
func StepNameNotIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldStepName, vs...))
}
// StepNameGT applies the GT predicate on the "stepName" field.
func StepNameGT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldStepName, v))
}
// StepNameGTE applies the GTE predicate on the "stepName" field.
func StepNameGTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldStepName, v))
}
// StepNameLT applies the LT predicate on the "stepName" field.
func StepNameLT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldStepName, v))
}
// StepNameLTE applies the LTE predicate on the "stepName" field.
func StepNameLTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldStepName, v))
}
// StepNameContains applies the Contains predicate on the "stepName" field.
func StepNameContains(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContains(FieldStepName, v))
}
// StepNameHasPrefix applies the HasPrefix predicate on the "stepName" field.
func StepNameHasPrefix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasPrefix(FieldStepName, v))
}
// StepNameHasSuffix applies the HasSuffix predicate on the "stepName" field.
func StepNameHasSuffix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasSuffix(FieldStepName, v))
}
// StepNameEqualFold applies the EqualFold predicate on the "stepName" field.
func StepNameEqualFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEqualFold(FieldStepName, v))
}
// StepNameContainsFold applies the ContainsFold predicate on the "stepName" field.
func StepNameContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldStepName, v))
}
// MeasuredValueEQ applies the EQ predicate on the "measuredValue" field.
func MeasuredValueEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldMeasuredValue, v))
}
// MeasuredValueNEQ applies the NEQ predicate on the "measuredValue" field.
func MeasuredValueNEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldMeasuredValue, v))
}
// MeasuredValueIn applies the In predicate on the "measuredValue" field.
func MeasuredValueIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldMeasuredValue, vs...))
}
// MeasuredValueNotIn applies the NotIn predicate on the "measuredValue" field.
func MeasuredValueNotIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldMeasuredValue, vs...))
}
// MeasuredValueGT applies the GT predicate on the "measuredValue" field.
func MeasuredValueGT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldMeasuredValue, v))
}
// MeasuredValueGTE applies the GTE predicate on the "measuredValue" field.
func MeasuredValueGTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldMeasuredValue, v))
}
// MeasuredValueLT applies the LT predicate on the "measuredValue" field.
func MeasuredValueLT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldMeasuredValue, v))
}
// MeasuredValueLTE applies the LTE predicate on the "measuredValue" field.
func MeasuredValueLTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldMeasuredValue, v))
}
// MeasuredValueContains applies the Contains predicate on the "measuredValue" field.
func MeasuredValueContains(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContains(FieldMeasuredValue, v))
}
// MeasuredValueHasPrefix applies the HasPrefix predicate on the "measuredValue" field.
func MeasuredValueHasPrefix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasPrefix(FieldMeasuredValue, v))
}
// MeasuredValueHasSuffix applies the HasSuffix predicate on the "measuredValue" field.
func MeasuredValueHasSuffix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasSuffix(FieldMeasuredValue, v))
}
// MeasuredValueEqualFold applies the EqualFold predicate on the "measuredValue" field.
func MeasuredValueEqualFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEqualFold(FieldMeasuredValue, v))
}
// MeasuredValueContainsFold applies the ContainsFold predicate on the "measuredValue" field.
func MeasuredValueContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldMeasuredValue, v))
}
// CreatedAtEQ applies the EQ predicate on the "createdAt" field.
func CreatedAtEQ(v time.Time) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldCreatedAt, v))