feat&refactor: 完成多模块功能迭代与配置优化

本次提交覆盖多个业务模块的功能完善与体验优化:
1.  **鉴权与配置调整**:
    - 统一JWT滑动续签逻辑,简化Token存储,移除RefreshToken相关冗余代码
    - 调整多项目配置文件中JWT过期时间为3600秒,统一会话闲置窗口
    - 工位配置放开1~12限制,改为仅校验大于0
2.  **术语统一替换**:全链路将"精密件"替换为"电气件",修正物料管理描述
3.  **功能新增**:
    - 新增工位类型、工艺路线与产线点位台账模块
    - 添加工艺PDF预览面板、工位终端代理转发接口
    - 新增操作日志按操作人列表筛选、工位登出日志记录
    - 新增PLC移料指令与产线点位状态管理
4.  **业务流程优化**:
    - 调整BOM物料删除校验逻辑,优化工单备料计算
    - 补充物料图号、检测单号等追溯字段
    - 完善工艺流程图与工位绑定关系说明
    - 优化前端页面文案与交互细节
5.  **代码规范与维护**:
    - 新增通用工具函数与前端静态资源
    - 整理路由权限与中间件逻辑
    - 修复部分接口与配置的不兼容问题
This commit is contained in:
SunYF
2026-09-10 16:59:15 +08:00
parent 6d8bb75696
commit 0ab21b1234
202 changed files with 21397 additions and 3172 deletions
@@ -29,10 +29,12 @@ const (
FieldPassQty = "pass_qty"
// FieldCheckDesc holds the string denoting the check_desc field in the database.
FieldCheckDesc = "check_desc"
// FieldFailReason holds the string denoting the fail_reason field in the database.
FieldFailReason = "fail_reason"
// 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"
// 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.
@@ -55,8 +57,9 @@ var Columns = []string{
FieldInspectQty,
FieldPassQty,
FieldCheckDesc,
FieldFailReason,
FieldInspector,
FieldInspectionNo,
FieldReportNo,
FieldRemark,
FieldCreatedAt,
FieldUpdatedAt,
@@ -140,16 +143,21 @@ func ByCheckDesc(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCheckDesc, opts...).ToFunc()
}
// ByFailReason orders the results by the fail_reason field.
func ByFailReason(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFailReason, 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()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, opts...).ToFunc()
+160 -80
View File
@@ -98,16 +98,21 @@ func CheckDesc(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldCheckDesc, v))
}
// FailReason applies equality check predicate on the "fail_reason" field. It's identical to FailReasonEQ.
func FailReason(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldFailReason, v))
}
// Inspector applies equality check predicate on the "inspector" field. It's identical to InspectorEQ.
func Inspector(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldInspector, v))
}
// InspectionNo applies equality check predicate on the "inspection_no" field. It's identical to InspectionNoEQ.
func InspectionNo(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldInspectionNo, v))
}
// ReportNo applies equality check predicate on the "report_no" field. It's identical to ReportNoEQ.
func ReportNo(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldReportNo, v))
}
// Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ.
func Remark(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldRemark, v))
@@ -678,81 +683,6 @@ func CheckDescContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldCheckDesc, v))
}
// FailReasonEQ applies the EQ predicate on the "fail_reason" field.
func FailReasonEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldFailReason, v))
}
// FailReasonNEQ applies the NEQ predicate on the "fail_reason" field.
func FailReasonNEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldFailReason, v))
}
// FailReasonIn applies the In predicate on the "fail_reason" field.
func FailReasonIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldFailReason, vs...))
}
// FailReasonNotIn applies the NotIn predicate on the "fail_reason" field.
func FailReasonNotIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldFailReason, vs...))
}
// FailReasonGT applies the GT predicate on the "fail_reason" field.
func FailReasonGT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldFailReason, v))
}
// FailReasonGTE applies the GTE predicate on the "fail_reason" field.
func FailReasonGTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldFailReason, v))
}
// FailReasonLT applies the LT predicate on the "fail_reason" field.
func FailReasonLT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldFailReason, v))
}
// FailReasonLTE applies the LTE predicate on the "fail_reason" field.
func FailReasonLTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldFailReason, v))
}
// FailReasonContains applies the Contains predicate on the "fail_reason" field.
func FailReasonContains(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContains(FieldFailReason, v))
}
// FailReasonHasPrefix applies the HasPrefix predicate on the "fail_reason" field.
func FailReasonHasPrefix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasPrefix(FieldFailReason, v))
}
// FailReasonHasSuffix applies the HasSuffix predicate on the "fail_reason" field.
func FailReasonHasSuffix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasSuffix(FieldFailReason, v))
}
// FailReasonIsNil applies the IsNil predicate on the "fail_reason" field.
func FailReasonIsNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIsNull(FieldFailReason))
}
// FailReasonNotNil applies the NotNil predicate on the "fail_reason" field.
func FailReasonNotNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotNull(FieldFailReason))
}
// FailReasonEqualFold applies the EqualFold predicate on the "fail_reason" field.
func FailReasonEqualFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEqualFold(FieldFailReason, v))
}
// FailReasonContainsFold applies the ContainsFold predicate on the "fail_reason" field.
func FailReasonContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldFailReason, v))
}
// InspectorEQ applies the EQ predicate on the "inspector" field.
func InspectorEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldInspector, v))
@@ -828,6 +758,156 @@ func InspectorContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldInspector, v))
}
// InspectionNoEQ applies the EQ predicate on the "inspection_no" field.
func InspectionNoEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldInspectionNo, v))
}
// InspectionNoNEQ applies the NEQ predicate on the "inspection_no" field.
func InspectionNoNEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldInspectionNo, v))
}
// InspectionNoIn applies the In predicate on the "inspection_no" field.
func InspectionNoIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldInspectionNo, vs...))
}
// InspectionNoNotIn applies the NotIn predicate on the "inspection_no" field.
func InspectionNoNotIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldInspectionNo, vs...))
}
// InspectionNoGT applies the GT predicate on the "inspection_no" field.
func InspectionNoGT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldInspectionNo, v))
}
// InspectionNoGTE applies the GTE predicate on the "inspection_no" field.
func InspectionNoGTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldInspectionNo, v))
}
// InspectionNoLT applies the LT predicate on the "inspection_no" field.
func InspectionNoLT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldInspectionNo, v))
}
// InspectionNoLTE applies the LTE predicate on the "inspection_no" field.
func InspectionNoLTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldInspectionNo, v))
}
// InspectionNoContains applies the Contains predicate on the "inspection_no" field.
func InspectionNoContains(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContains(FieldInspectionNo, v))
}
// InspectionNoHasPrefix applies the HasPrefix predicate on the "inspection_no" field.
func InspectionNoHasPrefix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasPrefix(FieldInspectionNo, v))
}
// InspectionNoHasSuffix applies the HasSuffix predicate on the "inspection_no" field.
func InspectionNoHasSuffix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasSuffix(FieldInspectionNo, v))
}
// InspectionNoIsNil applies the IsNil predicate on the "inspection_no" field.
func InspectionNoIsNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIsNull(FieldInspectionNo))
}
// InspectionNoNotNil applies the NotNil predicate on the "inspection_no" field.
func InspectionNoNotNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotNull(FieldInspectionNo))
}
// InspectionNoEqualFold applies the EqualFold predicate on the "inspection_no" field.
func InspectionNoEqualFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEqualFold(FieldInspectionNo, v))
}
// InspectionNoContainsFold applies the ContainsFold predicate on the "inspection_no" field.
func InspectionNoContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldInspectionNo, v))
}
// ReportNoEQ applies the EQ predicate on the "report_no" field.
func ReportNoEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldReportNo, v))
}
// ReportNoNEQ applies the NEQ predicate on the "report_no" field.
func ReportNoNEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldReportNo, v))
}
// ReportNoIn applies the In predicate on the "report_no" field.
func ReportNoIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldReportNo, vs...))
}
// ReportNoNotIn applies the NotIn predicate on the "report_no" field.
func ReportNoNotIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldReportNo, vs...))
}
// ReportNoGT applies the GT predicate on the "report_no" field.
func ReportNoGT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldReportNo, v))
}
// ReportNoGTE applies the GTE predicate on the "report_no" field.
func ReportNoGTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldReportNo, v))
}
// ReportNoLT applies the LT predicate on the "report_no" field.
func ReportNoLT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldReportNo, v))
}
// ReportNoLTE applies the LTE predicate on the "report_no" field.
func ReportNoLTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldReportNo, v))
}
// ReportNoContains applies the Contains predicate on the "report_no" field.
func ReportNoContains(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContains(FieldReportNo, v))
}
// ReportNoHasPrefix applies the HasPrefix predicate on the "report_no" field.
func ReportNoHasPrefix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasPrefix(FieldReportNo, v))
}
// ReportNoHasSuffix applies the HasSuffix predicate on the "report_no" field.
func ReportNoHasSuffix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasSuffix(FieldReportNo, v))
}
// ReportNoIsNil applies the IsNil predicate on the "report_no" field.
func ReportNoIsNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIsNull(FieldReportNo))
}
// ReportNoNotNil applies the NotNil predicate on the "report_no" field.
func ReportNoNotNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotNull(FieldReportNo))
}
// ReportNoEqualFold applies the EqualFold predicate on the "report_no" field.
func ReportNoEqualFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEqualFold(FieldReportNo, v))
}
// ReportNoContainsFold applies the ContainsFold predicate on the "report_no" field.
func ReportNoContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldReportNo, v))
}
// RemarkEQ applies the EQ predicate on the "remark" field.
func RemarkEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldRemark, v))