feat: 完成附件存储重构与磁盘监控功能,同步物料档案与入库单规则更新

1.  新增跨平台磁盘空间监控能力,每日7点自动检测附件目录剩余空间,触发阈值告警
2.  重构附件存储方案为年/月/日/文件类型分层结构,统一MES与WMS的附件管理逻辑
3.  对齐物料档案与入库单的质量状态校验规则,仅合格品计入库存与出库
4.  实现入库单作废功能与区域库位的多级父子结构管理
5.  删除物料简称字段,补充规格型号与单位必填项,统一系统数据口径
6.  新增附件中心与磁盘状态查询接口,完善权限控制与操作日志
This commit is contained in:
SunYF
2026-09-19 10:54:15 +08:00
parent 9002d9a642
commit 62e45b7379
95 changed files with 10467 additions and 2677 deletions
+285
View File
@@ -53,6 +53,26 @@ func IDLTE(id int) predicate.Zone {
return predicate.Zone(sql.FieldLTE(FieldID, id))
}
// Level applies equality check predicate on the "level" field. It's identical to LevelEQ.
func Level(v int) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldLevel, v))
}
// Code applies equality check predicate on the "code" field. It's identical to CodeEQ.
func Code(v string) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldCode, v))
}
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
func Name(v string) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldName, v))
}
// ParentCode applies equality check predicate on the "parent_code" field. It's identical to ParentCodeEQ.
func ParentCode(v string) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldParentCode, v))
}
// ZoneCode applies equality check predicate on the "zone_code" field. It's identical to ZoneCodeEQ.
func ZoneCode(v string) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldZoneCode, v))
@@ -98,6 +118,261 @@ func UpdatedAt(v int64) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldUpdatedAt, v))
}
// LevelEQ applies the EQ predicate on the "level" field.
func LevelEQ(v int) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldLevel, v))
}
// LevelNEQ applies the NEQ predicate on the "level" field.
func LevelNEQ(v int) predicate.Zone {
return predicate.Zone(sql.FieldNEQ(FieldLevel, v))
}
// LevelIn applies the In predicate on the "level" field.
func LevelIn(vs ...int) predicate.Zone {
return predicate.Zone(sql.FieldIn(FieldLevel, vs...))
}
// LevelNotIn applies the NotIn predicate on the "level" field.
func LevelNotIn(vs ...int) predicate.Zone {
return predicate.Zone(sql.FieldNotIn(FieldLevel, vs...))
}
// LevelGT applies the GT predicate on the "level" field.
func LevelGT(v int) predicate.Zone {
return predicate.Zone(sql.FieldGT(FieldLevel, v))
}
// LevelGTE applies the GTE predicate on the "level" field.
func LevelGTE(v int) predicate.Zone {
return predicate.Zone(sql.FieldGTE(FieldLevel, v))
}
// LevelLT applies the LT predicate on the "level" field.
func LevelLT(v int) predicate.Zone {
return predicate.Zone(sql.FieldLT(FieldLevel, v))
}
// LevelLTE applies the LTE predicate on the "level" field.
func LevelLTE(v int) predicate.Zone {
return predicate.Zone(sql.FieldLTE(FieldLevel, v))
}
// CodeEQ applies the EQ predicate on the "code" field.
func CodeEQ(v string) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldCode, v))
}
// CodeNEQ applies the NEQ predicate on the "code" field.
func CodeNEQ(v string) predicate.Zone {
return predicate.Zone(sql.FieldNEQ(FieldCode, v))
}
// CodeIn applies the In predicate on the "code" field.
func CodeIn(vs ...string) predicate.Zone {
return predicate.Zone(sql.FieldIn(FieldCode, vs...))
}
// CodeNotIn applies the NotIn predicate on the "code" field.
func CodeNotIn(vs ...string) predicate.Zone {
return predicate.Zone(sql.FieldNotIn(FieldCode, vs...))
}
// CodeGT applies the GT predicate on the "code" field.
func CodeGT(v string) predicate.Zone {
return predicate.Zone(sql.FieldGT(FieldCode, v))
}
// CodeGTE applies the GTE predicate on the "code" field.
func CodeGTE(v string) predicate.Zone {
return predicate.Zone(sql.FieldGTE(FieldCode, v))
}
// CodeLT applies the LT predicate on the "code" field.
func CodeLT(v string) predicate.Zone {
return predicate.Zone(sql.FieldLT(FieldCode, v))
}
// CodeLTE applies the LTE predicate on the "code" field.
func CodeLTE(v string) predicate.Zone {
return predicate.Zone(sql.FieldLTE(FieldCode, v))
}
// CodeContains applies the Contains predicate on the "code" field.
func CodeContains(v string) predicate.Zone {
return predicate.Zone(sql.FieldContains(FieldCode, v))
}
// CodeHasPrefix applies the HasPrefix predicate on the "code" field.
func CodeHasPrefix(v string) predicate.Zone {
return predicate.Zone(sql.FieldHasPrefix(FieldCode, v))
}
// CodeHasSuffix applies the HasSuffix predicate on the "code" field.
func CodeHasSuffix(v string) predicate.Zone {
return predicate.Zone(sql.FieldHasSuffix(FieldCode, v))
}
// CodeEqualFold applies the EqualFold predicate on the "code" field.
func CodeEqualFold(v string) predicate.Zone {
return predicate.Zone(sql.FieldEqualFold(FieldCode, v))
}
// CodeContainsFold applies the ContainsFold predicate on the "code" field.
func CodeContainsFold(v string) predicate.Zone {
return predicate.Zone(sql.FieldContainsFold(FieldCode, v))
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldName, v))
}
// NameNEQ applies the NEQ predicate on the "name" field.
func NameNEQ(v string) predicate.Zone {
return predicate.Zone(sql.FieldNEQ(FieldName, v))
}
// NameIn applies the In predicate on the "name" field.
func NameIn(vs ...string) predicate.Zone {
return predicate.Zone(sql.FieldIn(FieldName, vs...))
}
// NameNotIn applies the NotIn predicate on the "name" field.
func NameNotIn(vs ...string) predicate.Zone {
return predicate.Zone(sql.FieldNotIn(FieldName, vs...))
}
// NameGT applies the GT predicate on the "name" field.
func NameGT(v string) predicate.Zone {
return predicate.Zone(sql.FieldGT(FieldName, v))
}
// NameGTE applies the GTE predicate on the "name" field.
func NameGTE(v string) predicate.Zone {
return predicate.Zone(sql.FieldGTE(FieldName, v))
}
// NameLT applies the LT predicate on the "name" field.
func NameLT(v string) predicate.Zone {
return predicate.Zone(sql.FieldLT(FieldName, v))
}
// NameLTE applies the LTE predicate on the "name" field.
func NameLTE(v string) predicate.Zone {
return predicate.Zone(sql.FieldLTE(FieldName, v))
}
// NameContains applies the Contains predicate on the "name" field.
func NameContains(v string) predicate.Zone {
return predicate.Zone(sql.FieldContains(FieldName, v))
}
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
func NameHasPrefix(v string) predicate.Zone {
return predicate.Zone(sql.FieldHasPrefix(FieldName, v))
}
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
func NameHasSuffix(v string) predicate.Zone {
return predicate.Zone(sql.FieldHasSuffix(FieldName, v))
}
// NameIsNil applies the IsNil predicate on the "name" field.
func NameIsNil() predicate.Zone {
return predicate.Zone(sql.FieldIsNull(FieldName))
}
// NameNotNil applies the NotNil predicate on the "name" field.
func NameNotNil() predicate.Zone {
return predicate.Zone(sql.FieldNotNull(FieldName))
}
// NameEqualFold applies the EqualFold predicate on the "name" field.
func NameEqualFold(v string) predicate.Zone {
return predicate.Zone(sql.FieldEqualFold(FieldName, v))
}
// NameContainsFold applies the ContainsFold predicate on the "name" field.
func NameContainsFold(v string) predicate.Zone {
return predicate.Zone(sql.FieldContainsFold(FieldName, v))
}
// ParentCodeEQ applies the EQ predicate on the "parent_code" field.
func ParentCodeEQ(v string) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldParentCode, v))
}
// ParentCodeNEQ applies the NEQ predicate on the "parent_code" field.
func ParentCodeNEQ(v string) predicate.Zone {
return predicate.Zone(sql.FieldNEQ(FieldParentCode, v))
}
// ParentCodeIn applies the In predicate on the "parent_code" field.
func ParentCodeIn(vs ...string) predicate.Zone {
return predicate.Zone(sql.FieldIn(FieldParentCode, vs...))
}
// ParentCodeNotIn applies the NotIn predicate on the "parent_code" field.
func ParentCodeNotIn(vs ...string) predicate.Zone {
return predicate.Zone(sql.FieldNotIn(FieldParentCode, vs...))
}
// ParentCodeGT applies the GT predicate on the "parent_code" field.
func ParentCodeGT(v string) predicate.Zone {
return predicate.Zone(sql.FieldGT(FieldParentCode, v))
}
// ParentCodeGTE applies the GTE predicate on the "parent_code" field.
func ParentCodeGTE(v string) predicate.Zone {
return predicate.Zone(sql.FieldGTE(FieldParentCode, v))
}
// ParentCodeLT applies the LT predicate on the "parent_code" field.
func ParentCodeLT(v string) predicate.Zone {
return predicate.Zone(sql.FieldLT(FieldParentCode, v))
}
// ParentCodeLTE applies the LTE predicate on the "parent_code" field.
func ParentCodeLTE(v string) predicate.Zone {
return predicate.Zone(sql.FieldLTE(FieldParentCode, v))
}
// ParentCodeContains applies the Contains predicate on the "parent_code" field.
func ParentCodeContains(v string) predicate.Zone {
return predicate.Zone(sql.FieldContains(FieldParentCode, v))
}
// ParentCodeHasPrefix applies the HasPrefix predicate on the "parent_code" field.
func ParentCodeHasPrefix(v string) predicate.Zone {
return predicate.Zone(sql.FieldHasPrefix(FieldParentCode, v))
}
// ParentCodeHasSuffix applies the HasSuffix predicate on the "parent_code" field.
func ParentCodeHasSuffix(v string) predicate.Zone {
return predicate.Zone(sql.FieldHasSuffix(FieldParentCode, v))
}
// ParentCodeIsNil applies the IsNil predicate on the "parent_code" field.
func ParentCodeIsNil() predicate.Zone {
return predicate.Zone(sql.FieldIsNull(FieldParentCode))
}
// ParentCodeNotNil applies the NotNil predicate on the "parent_code" field.
func ParentCodeNotNil() predicate.Zone {
return predicate.Zone(sql.FieldNotNull(FieldParentCode))
}
// ParentCodeEqualFold applies the EqualFold predicate on the "parent_code" field.
func ParentCodeEqualFold(v string) predicate.Zone {
return predicate.Zone(sql.FieldEqualFold(FieldParentCode, v))
}
// ParentCodeContainsFold applies the ContainsFold predicate on the "parent_code" field.
func ParentCodeContainsFold(v string) predicate.Zone {
return predicate.Zone(sql.FieldContainsFold(FieldParentCode, v))
}
// ZoneCodeEQ applies the EQ predicate on the "zone_code" field.
func ZoneCodeEQ(v string) predicate.Zone {
return predicate.Zone(sql.FieldEQ(FieldZoneCode, v))
@@ -218,6 +493,16 @@ func ZoneNameHasSuffix(v string) predicate.Zone {
return predicate.Zone(sql.FieldHasSuffix(FieldZoneName, v))
}
// ZoneNameIsNil applies the IsNil predicate on the "zone_name" field.
func ZoneNameIsNil() predicate.Zone {
return predicate.Zone(sql.FieldIsNull(FieldZoneName))
}
// ZoneNameNotNil applies the NotNil predicate on the "zone_name" field.
func ZoneNameNotNil() predicate.Zone {
return predicate.Zone(sql.FieldNotNull(FieldZoneName))
}
// ZoneNameEqualFold applies the EqualFold predicate on the "zone_name" field.
func ZoneNameEqualFold(v string) predicate.Zone {
return predicate.Zone(sql.FieldEqualFold(FieldZoneName, v))
+32
View File
@@ -11,6 +11,14 @@ const (
Label = "zone"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldLevel holds the string denoting the level field in the database.
FieldLevel = "level"
// FieldCode holds the string denoting the code field in the database.
FieldCode = "code"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldParentCode holds the string denoting the parent_code field in the database.
FieldParentCode = "parent_code"
// FieldZoneCode holds the string denoting the zone_code field in the database.
FieldZoneCode = "zone_code"
// FieldZoneName holds the string denoting the zone_name field in the database.
@@ -36,6 +44,10 @@ const (
// Columns holds all SQL columns for zone fields.
var Columns = []string{
FieldID,
FieldLevel,
FieldCode,
FieldName,
FieldParentCode,
FieldZoneCode,
FieldZoneName,
FieldDescription,
@@ -74,6 +86,26 @@ func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByLevel orders the results by the level field.
func ByLevel(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLevel, opts...).ToFunc()
}
// ByCode orders the results by the code field.
func ByCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCode, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByParentCode orders the results by the parent_code field.
func ByParentCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldParentCode, opts...).ToFunc()
}
// ByZoneCode orders the results by the zone_code field.
func ByZoneCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldZoneCode, opts...).ToFunc()