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
+210
View File
@@ -27,6 +27,81 @@ func (_u *ZoneUpdate) Where(ps ...predicate.Zone) *ZoneUpdate {
return _u
}
// SetLevel sets the "level" field.
func (_u *ZoneUpdate) SetLevel(v int) *ZoneUpdate {
_u.mutation.ResetLevel()
_u.mutation.SetLevel(v)
return _u
}
// SetNillableLevel sets the "level" field if the given value is not nil.
func (_u *ZoneUpdate) SetNillableLevel(v *int) *ZoneUpdate {
if v != nil {
_u.SetLevel(*v)
}
return _u
}
// AddLevel adds value to the "level" field.
func (_u *ZoneUpdate) AddLevel(v int) *ZoneUpdate {
_u.mutation.AddLevel(v)
return _u
}
// SetCode sets the "code" field.
func (_u *ZoneUpdate) SetCode(v string) *ZoneUpdate {
_u.mutation.SetCode(v)
return _u
}
// SetNillableCode sets the "code" field if the given value is not nil.
func (_u *ZoneUpdate) SetNillableCode(v *string) *ZoneUpdate {
if v != nil {
_u.SetCode(*v)
}
return _u
}
// SetName sets the "name" field.
func (_u *ZoneUpdate) SetName(v string) *ZoneUpdate {
_u.mutation.SetName(v)
return _u
}
// SetNillableName sets the "name" field if the given value is not nil.
func (_u *ZoneUpdate) SetNillableName(v *string) *ZoneUpdate {
if v != nil {
_u.SetName(*v)
}
return _u
}
// ClearName clears the value of the "name" field.
func (_u *ZoneUpdate) ClearName() *ZoneUpdate {
_u.mutation.ClearName()
return _u
}
// SetParentCode sets the "parent_code" field.
func (_u *ZoneUpdate) SetParentCode(v string) *ZoneUpdate {
_u.mutation.SetParentCode(v)
return _u
}
// SetNillableParentCode sets the "parent_code" field if the given value is not nil.
func (_u *ZoneUpdate) SetNillableParentCode(v *string) *ZoneUpdate {
if v != nil {
_u.SetParentCode(*v)
}
return _u
}
// ClearParentCode clears the value of the "parent_code" field.
func (_u *ZoneUpdate) ClearParentCode() *ZoneUpdate {
_u.mutation.ClearParentCode()
return _u
}
// SetZoneCode sets the "zone_code" field.
func (_u *ZoneUpdate) SetZoneCode(v string) *ZoneUpdate {
_u.mutation.SetZoneCode(v)
@@ -55,6 +130,12 @@ func (_u *ZoneUpdate) SetNillableZoneName(v *string) *ZoneUpdate {
return _u
}
// ClearZoneName clears the value of the "zone_name" field.
func (_u *ZoneUpdate) ClearZoneName() *ZoneUpdate {
_u.mutation.ClearZoneName()
return _u
}
// SetDescription sets the "description" field.
func (_u *ZoneUpdate) SetDescription(v string) *ZoneUpdate {
_u.mutation.SetDescription(v)
@@ -238,12 +319,36 @@ func (_u *ZoneUpdate) sqlSave(ctx context.Context) (_node int, err error) {
}
}
}
if value, ok := _u.mutation.Level(); ok {
_spec.SetField(zone.FieldLevel, field.TypeInt, value)
}
if value, ok := _u.mutation.AddedLevel(); ok {
_spec.AddField(zone.FieldLevel, field.TypeInt, value)
}
if value, ok := _u.mutation.Code(); ok {
_spec.SetField(zone.FieldCode, field.TypeString, value)
}
if value, ok := _u.mutation.Name(); ok {
_spec.SetField(zone.FieldName, field.TypeString, value)
}
if _u.mutation.NameCleared() {
_spec.ClearField(zone.FieldName, field.TypeString)
}
if value, ok := _u.mutation.ParentCode(); ok {
_spec.SetField(zone.FieldParentCode, field.TypeString, value)
}
if _u.mutation.ParentCodeCleared() {
_spec.ClearField(zone.FieldParentCode, field.TypeString)
}
if value, ok := _u.mutation.ZoneCode(); ok {
_spec.SetField(zone.FieldZoneCode, field.TypeString, value)
}
if value, ok := _u.mutation.ZoneName(); ok {
_spec.SetField(zone.FieldZoneName, field.TypeString, value)
}
if _u.mutation.ZoneNameCleared() {
_spec.ClearField(zone.FieldZoneName, field.TypeString)
}
if value, ok := _u.mutation.Description(); ok {
_spec.SetField(zone.FieldDescription, field.TypeString, value)
}
@@ -306,6 +411,81 @@ type ZoneUpdateOne struct {
mutation *ZoneMutation
}
// SetLevel sets the "level" field.
func (_u *ZoneUpdateOne) SetLevel(v int) *ZoneUpdateOne {
_u.mutation.ResetLevel()
_u.mutation.SetLevel(v)
return _u
}
// SetNillableLevel sets the "level" field if the given value is not nil.
func (_u *ZoneUpdateOne) SetNillableLevel(v *int) *ZoneUpdateOne {
if v != nil {
_u.SetLevel(*v)
}
return _u
}
// AddLevel adds value to the "level" field.
func (_u *ZoneUpdateOne) AddLevel(v int) *ZoneUpdateOne {
_u.mutation.AddLevel(v)
return _u
}
// SetCode sets the "code" field.
func (_u *ZoneUpdateOne) SetCode(v string) *ZoneUpdateOne {
_u.mutation.SetCode(v)
return _u
}
// SetNillableCode sets the "code" field if the given value is not nil.
func (_u *ZoneUpdateOne) SetNillableCode(v *string) *ZoneUpdateOne {
if v != nil {
_u.SetCode(*v)
}
return _u
}
// SetName sets the "name" field.
func (_u *ZoneUpdateOne) SetName(v string) *ZoneUpdateOne {
_u.mutation.SetName(v)
return _u
}
// SetNillableName sets the "name" field if the given value is not nil.
func (_u *ZoneUpdateOne) SetNillableName(v *string) *ZoneUpdateOne {
if v != nil {
_u.SetName(*v)
}
return _u
}
// ClearName clears the value of the "name" field.
func (_u *ZoneUpdateOne) ClearName() *ZoneUpdateOne {
_u.mutation.ClearName()
return _u
}
// SetParentCode sets the "parent_code" field.
func (_u *ZoneUpdateOne) SetParentCode(v string) *ZoneUpdateOne {
_u.mutation.SetParentCode(v)
return _u
}
// SetNillableParentCode sets the "parent_code" field if the given value is not nil.
func (_u *ZoneUpdateOne) SetNillableParentCode(v *string) *ZoneUpdateOne {
if v != nil {
_u.SetParentCode(*v)
}
return _u
}
// ClearParentCode clears the value of the "parent_code" field.
func (_u *ZoneUpdateOne) ClearParentCode() *ZoneUpdateOne {
_u.mutation.ClearParentCode()
return _u
}
// SetZoneCode sets the "zone_code" field.
func (_u *ZoneUpdateOne) SetZoneCode(v string) *ZoneUpdateOne {
_u.mutation.SetZoneCode(v)
@@ -334,6 +514,12 @@ func (_u *ZoneUpdateOne) SetNillableZoneName(v *string) *ZoneUpdateOne {
return _u
}
// ClearZoneName clears the value of the "zone_name" field.
func (_u *ZoneUpdateOne) ClearZoneName() *ZoneUpdateOne {
_u.mutation.ClearZoneName()
return _u
}
// SetDescription sets the "description" field.
func (_u *ZoneUpdateOne) SetDescription(v string) *ZoneUpdateOne {
_u.mutation.SetDescription(v)
@@ -547,12 +733,36 @@ func (_u *ZoneUpdateOne) sqlSave(ctx context.Context) (_node *Zone, err error) {
}
}
}
if value, ok := _u.mutation.Level(); ok {
_spec.SetField(zone.FieldLevel, field.TypeInt, value)
}
if value, ok := _u.mutation.AddedLevel(); ok {
_spec.AddField(zone.FieldLevel, field.TypeInt, value)
}
if value, ok := _u.mutation.Code(); ok {
_spec.SetField(zone.FieldCode, field.TypeString, value)
}
if value, ok := _u.mutation.Name(); ok {
_spec.SetField(zone.FieldName, field.TypeString, value)
}
if _u.mutation.NameCleared() {
_spec.ClearField(zone.FieldName, field.TypeString)
}
if value, ok := _u.mutation.ParentCode(); ok {
_spec.SetField(zone.FieldParentCode, field.TypeString, value)
}
if _u.mutation.ParentCodeCleared() {
_spec.ClearField(zone.FieldParentCode, field.TypeString)
}
if value, ok := _u.mutation.ZoneCode(); ok {
_spec.SetField(zone.FieldZoneCode, field.TypeString, value)
}
if value, ok := _u.mutation.ZoneName(); ok {
_spec.SetField(zone.FieldZoneName, field.TypeString, value)
}
if _u.mutation.ZoneNameCleared() {
_spec.ClearField(zone.FieldZoneName, field.TypeString)
}
if value, ok := _u.mutation.Description(); ok {
_spec.SetField(zone.FieldDescription, field.TypeString, value)
}