feat: 实现工位终端滑动续签机制,强化安全与身份追溯
- 新增滑动续签功能:人工触屏触发本地心跳 + 30秒节流刷新JWT,避免作业中令牌过期 - 拆分质量检验权限:过程检/完工检使用不同权限码,细化权限粒度 - 新增操作人用户ID字段:报工、拧紧记录落库时携带可信用户ID,解决身份追溯问题 - 移除编译期默认密钥,启动期校验所有必要密钥非空,防止密钥泄露风险 - 修复WMS附件越权遍历问题:使用UUID文件名替代顺序ID访问附件 - 实现登录态过期数据隔离:仅返回当前操作人的待同步数据,避免身份混淆
This commit is contained in:
@@ -89,6 +89,11 @@ func Operator(v string) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldOperator, v))
|
||||
}
|
||||
|
||||
// OperatorId applies equality check predicate on the "operatorId" field. It's identical to OperatorIdEQ.
|
||||
func OperatorId(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldOperatorId, v))
|
||||
}
|
||||
|
||||
// Result applies equality check predicate on the "result" field. It's identical to ResultEQ.
|
||||
func Result(v string) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldResult, v))
|
||||
@@ -549,6 +554,46 @@ func OperatorContainsFold(v string) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldContainsFold(FieldOperator, v))
|
||||
}
|
||||
|
||||
// OperatorIdEQ applies the EQ predicate on the "operatorId" field.
|
||||
func OperatorIdEQ(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldOperatorId, v))
|
||||
}
|
||||
|
||||
// OperatorIdNEQ applies the NEQ predicate on the "operatorId" field.
|
||||
func OperatorIdNEQ(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldNEQ(FieldOperatorId, v))
|
||||
}
|
||||
|
||||
// OperatorIdIn applies the In predicate on the "operatorId" field.
|
||||
func OperatorIdIn(vs ...int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldIn(FieldOperatorId, vs...))
|
||||
}
|
||||
|
||||
// OperatorIdNotIn applies the NotIn predicate on the "operatorId" field.
|
||||
func OperatorIdNotIn(vs ...int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldNotIn(FieldOperatorId, vs...))
|
||||
}
|
||||
|
||||
// OperatorIdGT applies the GT predicate on the "operatorId" field.
|
||||
func OperatorIdGT(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldGT(FieldOperatorId, v))
|
||||
}
|
||||
|
||||
// OperatorIdGTE applies the GTE predicate on the "operatorId" field.
|
||||
func OperatorIdGTE(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldGTE(FieldOperatorId, v))
|
||||
}
|
||||
|
||||
// OperatorIdLT applies the LT predicate on the "operatorId" field.
|
||||
func OperatorIdLT(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldLT(FieldOperatorId, v))
|
||||
}
|
||||
|
||||
// OperatorIdLTE applies the LTE predicate on the "operatorId" field.
|
||||
func OperatorIdLTE(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldLTE(FieldOperatorId, v))
|
||||
}
|
||||
|
||||
// ResultEQ applies the EQ predicate on the "result" field.
|
||||
func ResultEQ(v string) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldResult, v))
|
||||
|
||||
@@ -27,6 +27,8 @@ const (
|
||||
FieldStatus = "status"
|
||||
// FieldOperator holds the string denoting the operator field in the database.
|
||||
FieldOperator = "operator"
|
||||
// FieldOperatorId holds the string denoting the operatorid field in the database.
|
||||
FieldOperatorId = "operator_id"
|
||||
// FieldResult holds the string denoting the result field in the database.
|
||||
FieldResult = "result"
|
||||
// FieldStartedAt holds the string denoting the startedat field in the database.
|
||||
@@ -53,6 +55,7 @@ var Columns = []string{
|
||||
FieldProcessName,
|
||||
FieldStatus,
|
||||
FieldOperator,
|
||||
FieldOperatorId,
|
||||
FieldResult,
|
||||
FieldStartedAt,
|
||||
FieldEndedAt,
|
||||
@@ -94,6 +97,8 @@ var (
|
||||
DefaultOperator string
|
||||
// OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
|
||||
OperatorValidator func(string) error
|
||||
// DefaultOperatorId holds the default value on creation for the "operatorId" field.
|
||||
DefaultOperatorId int
|
||||
// DefaultResult holds the default value on creation for the "result" field.
|
||||
DefaultResult string
|
||||
// ResultValidator is a validator for the "result" field. It is called by the builders before save.
|
||||
@@ -153,6 +158,11 @@ func ByOperator(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOperator, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOperatorId orders the results by the operatorId field.
|
||||
func ByOperatorId(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOperatorId, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByResult orders the results by the result field.
|
||||
func ByResult(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldResult, opts...).ToFunc()
|
||||
|
||||
Reference in New Issue
Block a user