feat&refactor: 完成多模块功能迭代与配置优化
本次提交覆盖多个业务模块的功能完善与体验优化:
1. **鉴权与配置调整**:
- 统一JWT滑动续签逻辑,简化Token存储,移除RefreshToken相关冗余代码
- 调整多项目配置文件中JWT过期时间为3600秒,统一会话闲置窗口
- 工位配置放开1~12限制,改为仅校验大于0
2. **术语统一替换**:全链路将"精密件"替换为"电气件",修正物料管理描述
3. **功能新增**:
- 新增工位类型、工艺路线与产线点位台账模块
- 添加工艺PDF预览面板、工位终端代理转发接口
- 新增操作日志按操作人列表筛选、工位登出日志记录
- 新增PLC移料指令与产线点位状态管理
4. **业务流程优化**:
- 调整BOM物料删除校验逻辑,优化工单备料计算
- 补充物料图号、检测单号等追溯字段
- 完善工艺流程图与工位绑定关系说明
- 优化前端页面文案与交互细节
5. **代码规范与维护**:
- 新增通用工具函数与前端静态资源
- 整理路由权限与中间件逻辑
- 修复部分接口与配置的不兼容问题
This commit is contained in:
@@ -187,6 +187,32 @@ var (
|
||||
},
|
||||
},
|
||||
}
|
||||
// LinePointColumns holds the columns for the "line_point" table.
|
||||
LinePointColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "point_type", Type: field.TypeString, Size: 20},
|
||||
{Name: "point_no", Type: field.TypeString, Size: 32},
|
||||
{Name: "label", Type: field.TypeString, Size: 64, Default: ""},
|
||||
{Name: "seq", Type: field.TypeInt, Default: 0},
|
||||
{Name: "station_no", Type: field.TypeInt, Default: 0},
|
||||
{Name: "current_sn", Type: field.TypeString, Size: 128, Default: ""},
|
||||
{Name: "order_no", Type: field.TypeString, Size: 64, Default: ""},
|
||||
{Name: "occupied", Type: field.TypeBool, Default: false},
|
||||
{Name: "updated_at", Type: field.TypeTime},
|
||||
}
|
||||
// LinePointTable holds the schema information for the "line_point" table.
|
||||
LinePointTable = &schema.Table{
|
||||
Name: "line_point",
|
||||
Columns: LinePointColumns,
|
||||
PrimaryKey: []*schema.Column{LinePointColumns[0]},
|
||||
Indexes: []*schema.Index{
|
||||
{
|
||||
Name: "linepoint_point_type_point_no",
|
||||
Unique: true,
|
||||
Columns: []*schema.Column{LinePointColumns[1], LinePointColumns[2]},
|
||||
},
|
||||
},
|
||||
}
|
||||
// MaterialRequestColumns holds the columns for the "material_request" table.
|
||||
MaterialRequestColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
@@ -253,6 +279,43 @@ var (
|
||||
},
|
||||
},
|
||||
}
|
||||
// PlcMoveCmdColumns holds the columns for the "plc_move_cmd" table.
|
||||
PlcMoveCmdColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "cmd_no", Type: field.TypeString, Size: 64},
|
||||
{Name: "sn", Type: field.TypeString, Size: 128},
|
||||
{Name: "order_no", Type: field.TypeString, Size: 64, Default: ""},
|
||||
{Name: "from_point", Type: field.TypeString, Size: 32},
|
||||
{Name: "to_point", Type: field.TypeString, Size: 32},
|
||||
{Name: "status", Type: field.TypeString, Size: 20, Default: "ISSUED"},
|
||||
{Name: "operator", Type: field.TypeString, Size: 64, Default: ""},
|
||||
{Name: "message", Type: field.TypeString, Size: 255, Default: ""},
|
||||
{Name: "created_at", Type: field.TypeTime},
|
||||
{Name: "updated_at", Type: field.TypeTime},
|
||||
}
|
||||
// PlcMoveCmdTable holds the schema information for the "plc_move_cmd" table.
|
||||
PlcMoveCmdTable = &schema.Table{
|
||||
Name: "plc_move_cmd",
|
||||
Columns: PlcMoveCmdColumns,
|
||||
PrimaryKey: []*schema.Column{PlcMoveCmdColumns[0]},
|
||||
Indexes: []*schema.Index{
|
||||
{
|
||||
Name: "plcmovecmd_cmd_no",
|
||||
Unique: true,
|
||||
Columns: []*schema.Column{PlcMoveCmdColumns[1]},
|
||||
},
|
||||
{
|
||||
Name: "plcmovecmd_sn",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{PlcMoveCmdColumns[2]},
|
||||
},
|
||||
{
|
||||
Name: "plcmovecmd_status",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{PlcMoveCmdColumns[6]},
|
||||
},
|
||||
},
|
||||
}
|
||||
// PlcSendLogColumns holds the columns for the "plc_send_log" table.
|
||||
PlcSendLogColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
@@ -296,7 +359,6 @@ var (
|
||||
ProcessFlowColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "name", Type: field.TypeString, Size: 128},
|
||||
{Name: "process_code", Type: field.TypeInt},
|
||||
{Name: "pdf_file", Type: field.TypeString, Size: 255, Default: ""},
|
||||
{Name: "status", Type: field.TypeString, Size: 20, Default: "ACTIVE"},
|
||||
{Name: "remark", Type: field.TypeString, Size: 255, Default: ""},
|
||||
@@ -309,27 +371,38 @@ var (
|
||||
Columns: ProcessFlowColumns,
|
||||
PrimaryKey: []*schema.Column{ProcessFlowColumns[0]},
|
||||
Indexes: []*schema.Index{
|
||||
{
|
||||
Name: "processflow_process_code",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{ProcessFlowColumns[2]},
|
||||
},
|
||||
{
|
||||
Name: "processflow_status",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{ProcessFlowColumns[4]},
|
||||
Columns: []*schema.Column{ProcessFlowColumns[3]},
|
||||
},
|
||||
},
|
||||
}
|
||||
// ProcessRouteColumns holds the columns for the "process_route" table.
|
||||
ProcessRouteColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "name", Type: field.TypeString, Size: 128},
|
||||
{Name: "product_type_id", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "status", Type: field.TypeString, Size: 20, Default: "ACTIVE"},
|
||||
{Name: "remark", Type: field.TypeString, Size: 255, Default: ""},
|
||||
{Name: "created_at", Type: field.TypeTime},
|
||||
{Name: "updated_at", Type: field.TypeTime, Nullable: true},
|
||||
}
|
||||
// ProcessRouteTable holds the schema information for the "process_route" table.
|
||||
ProcessRouteTable = &schema.Table{
|
||||
Name: "process_route",
|
||||
Columns: ProcessRouteColumns,
|
||||
PrimaryKey: []*schema.Column{ProcessRouteColumns[0]},
|
||||
}
|
||||
// ProcessStepColumns holds the columns for the "process_step" table.
|
||||
ProcessStepColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "flow_id", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "process_code", Type: field.TypeInt},
|
||||
{Name: "seq", Type: field.TypeInt, Default: 1},
|
||||
{Name: "name", Type: field.TypeString, Size: 128},
|
||||
{Name: "collect_type", Type: field.TypeString, Size: 20, Default: "NONE"},
|
||||
{Name: "is_torque", Type: field.TypeBool, Default: false},
|
||||
{Name: "need_check", Type: field.TypeBool, Default: false},
|
||||
{Name: "remark", Type: field.TypeString, Size: 255, Default: ""},
|
||||
{Name: "created_at", Type: field.TypeTime},
|
||||
}
|
||||
@@ -339,11 +412,6 @@ var (
|
||||
Columns: ProcessStepColumns,
|
||||
PrimaryKey: []*schema.Column{ProcessStepColumns[0]},
|
||||
Indexes: []*schema.Index{
|
||||
{
|
||||
Name: "processstep_process_code",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{ProcessStepColumns[2]},
|
||||
},
|
||||
{
|
||||
Name: "processstep_flow_id",
|
||||
Unique: false,
|
||||
@@ -402,6 +470,23 @@ var (
|
||||
},
|
||||
},
|
||||
}
|
||||
// RouteSegmentColumns holds the columns for the "route_segment" table.
|
||||
RouteSegmentColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "route_id", Type: field.TypeInt},
|
||||
{Name: "seq", Type: field.TypeInt, Default: 1},
|
||||
{Name: "flow_id", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "stations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
|
||||
{Name: "segment_type", Type: field.TypeString, Size: 20, Default: "LINE"},
|
||||
{Name: "remark", Type: field.TypeString, Size: 255, Default: ""},
|
||||
{Name: "created_at", Type: field.TypeTime},
|
||||
}
|
||||
// RouteSegmentTable holds the schema information for the "route_segment" table.
|
||||
RouteSegmentTable = &schema.Table{
|
||||
Name: "route_segment",
|
||||
Columns: RouteSegmentColumns,
|
||||
PrimaryKey: []*schema.Column{RouteSegmentColumns[0]},
|
||||
}
|
||||
// ScanRecordColumns holds the columns for the "scan_record" table.
|
||||
ScanRecordColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
@@ -482,6 +567,7 @@ var (
|
||||
{Name: "station_no", Type: field.TypeInt, Unique: true},
|
||||
{Name: "name", Type: field.TypeString, Size: 64, Default: ""},
|
||||
{Name: "flow_id", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "station_type", Type: field.TypeString, Size: 20, Default: "LINE"},
|
||||
{Name: "status", Type: field.TypeString, Size: 20, Default: "ENABLED"},
|
||||
{Name: "created_at", Type: field.TypeTime},
|
||||
}
|
||||
@@ -706,12 +792,13 @@ var (
|
||||
{Name: "work_order_no", Type: field.TypeString, Size: 64},
|
||||
{Name: "product_type_id", Type: field.TypeInt},
|
||||
{Name: "product_code", Type: field.TypeString, Size: 64, Default: ""},
|
||||
{Name: "bom_name", Type: field.TypeString, Size: 64, Default: "默认"},
|
||||
{Name: "product_name", Type: field.TypeString, Size: 128, Default: ""},
|
||||
{Name: "quantity", Type: field.TypeInt, Default: 1},
|
||||
{Name: "finished_num", Type: field.TypeInt, Default: 0},
|
||||
{Name: "fail_num", Type: field.TypeInt, Default: 0},
|
||||
{Name: "process_seq", Type: field.TypeString, Size: 64, Default: ""},
|
||||
{Name: "route_id", Type: field.TypeInt, Nullable: true},
|
||||
{Name: "route_snapshot", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
|
||||
{Name: "status", Type: field.TypeString, Size: 20, Default: "CREATED"},
|
||||
{Name: "plan_start", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "plan_end", Type: field.TypeTime, Nullable: true},
|
||||
@@ -734,7 +821,7 @@ var (
|
||||
{
|
||||
Name: "workorder_status",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{WorkOrderColumns[10]},
|
||||
Columns: []*schema.Column{WorkOrderColumns[11]},
|
||||
},
|
||||
{
|
||||
Name: "workorder_product_type_id",
|
||||
@@ -881,13 +968,17 @@ var (
|
||||
DailyPlanTable,
|
||||
EventLogTable,
|
||||
InspectionRecordTable,
|
||||
LinePointTable,
|
||||
MaterialRequestTable,
|
||||
PermissionTable,
|
||||
PlcMoveCmdTable,
|
||||
PlcSendLogTable,
|
||||
ProcessFlowTable,
|
||||
ProcessRouteTable,
|
||||
ProcessStepTable,
|
||||
ProductTypeTable,
|
||||
RoleTable,
|
||||
RouteSegmentTable,
|
||||
ScanRecordTable,
|
||||
SemiFlowTable,
|
||||
StationTable,
|
||||
@@ -920,18 +1011,27 @@ func init() {
|
||||
InspectionRecordTable.Annotation = &entsql.Annotation{
|
||||
Table: "inspection_record",
|
||||
}
|
||||
LinePointTable.Annotation = &entsql.Annotation{
|
||||
Table: "line_point",
|
||||
}
|
||||
MaterialRequestTable.Annotation = &entsql.Annotation{
|
||||
Table: "material_request",
|
||||
}
|
||||
PermissionTable.Annotation = &entsql.Annotation{
|
||||
Table: "permission",
|
||||
}
|
||||
PlcMoveCmdTable.Annotation = &entsql.Annotation{
|
||||
Table: "plc_move_cmd",
|
||||
}
|
||||
PlcSendLogTable.Annotation = &entsql.Annotation{
|
||||
Table: "plc_send_log",
|
||||
}
|
||||
ProcessFlowTable.Annotation = &entsql.Annotation{
|
||||
Table: "process_flow",
|
||||
}
|
||||
ProcessRouteTable.Annotation = &entsql.Annotation{
|
||||
Table: "process_route",
|
||||
}
|
||||
ProcessStepTable.Annotation = &entsql.Annotation{
|
||||
Table: "process_step",
|
||||
}
|
||||
@@ -941,6 +1041,9 @@ func init() {
|
||||
RoleTable.Annotation = &entsql.Annotation{
|
||||
Table: "role",
|
||||
}
|
||||
RouteSegmentTable.Annotation = &entsql.Annotation{
|
||||
Table: "route_segment",
|
||||
}
|
||||
ScanRecordTable.Annotation = &entsql.Annotation{
|
||||
Table: "scan_record",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user