feat: 完成附件存储重构与磁盘监控功能,同步物料档案与入库单规则更新
1. 新增跨平台磁盘空间监控能力,每日7点自动检测附件目录剩余空间,触发阈值告警 2. 重构附件存储方案为年/月/日/文件类型分层结构,统一MES与WMS的附件管理逻辑 3. 对齐物料档案与入库单的质量状态校验规则,仅合格品计入库存与出库 4. 实现入库单作废功能与区域库位的多级父子结构管理 5. 删除物料简称字段,补充规格型号与单位必填项,统一系统数据口径 6. 新增附件中心与磁盘状态查询接口,完善权限控制与操作日志
This commit is contained in:
@@ -83,6 +83,66 @@ func (_u *AttachmentUpdate) SetNillableFilePath(v *string) *AttachmentUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFileType sets the "file_type" field.
|
||||
func (_u *AttachmentUpdate) SetFileType(v string) *AttachmentUpdate {
|
||||
_u.mutation.SetFileType(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableFileType sets the "file_type" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdate) SetNillableFileType(v *string) *AttachmentUpdate {
|
||||
if v != nil {
|
||||
_u.SetFileType(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearFileType clears the value of the "file_type" field.
|
||||
func (_u *AttachmentUpdate) ClearFileType() *AttachmentUpdate {
|
||||
_u.mutation.ClearFileType()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFileExt sets the "file_ext" field.
|
||||
func (_u *AttachmentUpdate) SetFileExt(v string) *AttachmentUpdate {
|
||||
_u.mutation.SetFileExt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableFileExt sets the "file_ext" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdate) SetNillableFileExt(v *string) *AttachmentUpdate {
|
||||
if v != nil {
|
||||
_u.SetFileExt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearFileExt clears the value of the "file_ext" field.
|
||||
func (_u *AttachmentUpdate) ClearFileExt() *AttachmentUpdate {
|
||||
_u.mutation.ClearFileExt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFileMd5 sets the "file_md5" field.
|
||||
func (_u *AttachmentUpdate) SetFileMd5(v string) *AttachmentUpdate {
|
||||
_u.mutation.SetFileMd5(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableFileMd5 sets the "file_md5" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdate) SetNillableFileMd5(v *string) *AttachmentUpdate {
|
||||
if v != nil {
|
||||
_u.SetFileMd5(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearFileMd5 clears the value of the "file_md5" field.
|
||||
func (_u *AttachmentUpdate) ClearFileMd5() *AttachmentUpdate {
|
||||
_u.mutation.ClearFileMd5()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFileSize sets the "file_size" field.
|
||||
func (_u *AttachmentUpdate) SetFileSize(v int64) *AttachmentUpdate {
|
||||
_u.mutation.ResetFileSize()
|
||||
@@ -144,6 +204,108 @@ func (_u *AttachmentUpdate) ClearUploadedBy() *AttachmentUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetArchived sets the "archived" field.
|
||||
func (_u *AttachmentUpdate) SetArchived(v bool) *AttachmentUpdate {
|
||||
_u.mutation.SetArchived(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableArchived sets the "archived" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdate) SetNillableArchived(v *bool) *AttachmentUpdate {
|
||||
if v != nil {
|
||||
_u.SetArchived(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetArchivedAt sets the "archived_at" field.
|
||||
func (_u *AttachmentUpdate) SetArchivedAt(v int64) *AttachmentUpdate {
|
||||
_u.mutation.ResetArchivedAt()
|
||||
_u.mutation.SetArchivedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableArchivedAt sets the "archived_at" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdate) SetNillableArchivedAt(v *int64) *AttachmentUpdate {
|
||||
if v != nil {
|
||||
_u.SetArchivedAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddArchivedAt adds value to the "archived_at" field.
|
||||
func (_u *AttachmentUpdate) AddArchivedAt(v int64) *AttachmentUpdate {
|
||||
_u.mutation.AddArchivedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearArchivedAt clears the value of the "archived_at" field.
|
||||
func (_u *AttachmentUpdate) ClearArchivedAt() *AttachmentUpdate {
|
||||
_u.mutation.ClearArchivedAt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetDeleted sets the "deleted" field.
|
||||
func (_u *AttachmentUpdate) SetDeleted(v bool) *AttachmentUpdate {
|
||||
_u.mutation.SetDeleted(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableDeleted sets the "deleted" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdate) SetNillableDeleted(v *bool) *AttachmentUpdate {
|
||||
if v != nil {
|
||||
_u.SetDeleted(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetDeletedAt sets the "deleted_at" field.
|
||||
func (_u *AttachmentUpdate) SetDeletedAt(v int64) *AttachmentUpdate {
|
||||
_u.mutation.ResetDeletedAt()
|
||||
_u.mutation.SetDeletedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdate) SetNillableDeletedAt(v *int64) *AttachmentUpdate {
|
||||
if v != nil {
|
||||
_u.SetDeletedAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddDeletedAt adds value to the "deleted_at" field.
|
||||
func (_u *AttachmentUpdate) AddDeletedAt(v int64) *AttachmentUpdate {
|
||||
_u.mutation.AddDeletedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearDeletedAt clears the value of the "deleted_at" field.
|
||||
func (_u *AttachmentUpdate) ClearDeletedAt() *AttachmentUpdate {
|
||||
_u.mutation.ClearDeletedAt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetDeletedBy sets the "deleted_by" field.
|
||||
func (_u *AttachmentUpdate) SetDeletedBy(v string) *AttachmentUpdate {
|
||||
_u.mutation.SetDeletedBy(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdate) SetNillableDeletedBy(v *string) *AttachmentUpdate {
|
||||
if v != nil {
|
||||
_u.SetDeletedBy(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearDeletedBy clears the value of the "deleted_by" field.
|
||||
func (_u *AttachmentUpdate) ClearDeletedBy() *AttachmentUpdate {
|
||||
_u.mutation.ClearDeletedBy()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_u *AttachmentUpdate) SetCreatedAt(v int64) *AttachmentUpdate {
|
||||
_u.mutation.ResetCreatedAt()
|
||||
@@ -218,6 +380,24 @@ func (_u *AttachmentUpdate) sqlSave(ctx context.Context) (_node int, err error)
|
||||
if value, ok := _u.mutation.FilePath(); ok {
|
||||
_spec.SetField(attachment.FieldFilePath, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.FileType(); ok {
|
||||
_spec.SetField(attachment.FieldFileType, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.FileTypeCleared() {
|
||||
_spec.ClearField(attachment.FieldFileType, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.FileExt(); ok {
|
||||
_spec.SetField(attachment.FieldFileExt, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.FileExtCleared() {
|
||||
_spec.ClearField(attachment.FieldFileExt, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.FileMd5(); ok {
|
||||
_spec.SetField(attachment.FieldFileMd5, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.FileMd5Cleared() {
|
||||
_spec.ClearField(attachment.FieldFileMd5, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.FileSize(); ok {
|
||||
_spec.SetField(attachment.FieldFileSize, field.TypeInt64, value)
|
||||
}
|
||||
@@ -236,6 +416,36 @@ func (_u *AttachmentUpdate) sqlSave(ctx context.Context) (_node int, err error)
|
||||
if _u.mutation.UploadedByCleared() {
|
||||
_spec.ClearField(attachment.FieldUploadedBy, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.Archived(); ok {
|
||||
_spec.SetField(attachment.FieldArchived, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.ArchivedAt(); ok {
|
||||
_spec.SetField(attachment.FieldArchivedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedArchivedAt(); ok {
|
||||
_spec.AddField(attachment.FieldArchivedAt, field.TypeInt64, value)
|
||||
}
|
||||
if _u.mutation.ArchivedAtCleared() {
|
||||
_spec.ClearField(attachment.FieldArchivedAt, field.TypeInt64)
|
||||
}
|
||||
if value, ok := _u.mutation.Deleted(); ok {
|
||||
_spec.SetField(attachment.FieldDeleted, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.DeletedAt(); ok {
|
||||
_spec.SetField(attachment.FieldDeletedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedDeletedAt(); ok {
|
||||
_spec.AddField(attachment.FieldDeletedAt, field.TypeInt64, value)
|
||||
}
|
||||
if _u.mutation.DeletedAtCleared() {
|
||||
_spec.ClearField(attachment.FieldDeletedAt, field.TypeInt64)
|
||||
}
|
||||
if value, ok := _u.mutation.DeletedBy(); ok {
|
||||
_spec.SetField(attachment.FieldDeletedBy, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.DeletedByCleared() {
|
||||
_spec.ClearField(attachment.FieldDeletedBy, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(attachment.FieldCreatedAt, field.TypeInt64, value)
|
||||
}
|
||||
@@ -318,6 +528,66 @@ func (_u *AttachmentUpdateOne) SetNillableFilePath(v *string) *AttachmentUpdateO
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFileType sets the "file_type" field.
|
||||
func (_u *AttachmentUpdateOne) SetFileType(v string) *AttachmentUpdateOne {
|
||||
_u.mutation.SetFileType(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableFileType sets the "file_type" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdateOne) SetNillableFileType(v *string) *AttachmentUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetFileType(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearFileType clears the value of the "file_type" field.
|
||||
func (_u *AttachmentUpdateOne) ClearFileType() *AttachmentUpdateOne {
|
||||
_u.mutation.ClearFileType()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFileExt sets the "file_ext" field.
|
||||
func (_u *AttachmentUpdateOne) SetFileExt(v string) *AttachmentUpdateOne {
|
||||
_u.mutation.SetFileExt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableFileExt sets the "file_ext" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdateOne) SetNillableFileExt(v *string) *AttachmentUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetFileExt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearFileExt clears the value of the "file_ext" field.
|
||||
func (_u *AttachmentUpdateOne) ClearFileExt() *AttachmentUpdateOne {
|
||||
_u.mutation.ClearFileExt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFileMd5 sets the "file_md5" field.
|
||||
func (_u *AttachmentUpdateOne) SetFileMd5(v string) *AttachmentUpdateOne {
|
||||
_u.mutation.SetFileMd5(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableFileMd5 sets the "file_md5" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdateOne) SetNillableFileMd5(v *string) *AttachmentUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetFileMd5(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearFileMd5 clears the value of the "file_md5" field.
|
||||
func (_u *AttachmentUpdateOne) ClearFileMd5() *AttachmentUpdateOne {
|
||||
_u.mutation.ClearFileMd5()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFileSize sets the "file_size" field.
|
||||
func (_u *AttachmentUpdateOne) SetFileSize(v int64) *AttachmentUpdateOne {
|
||||
_u.mutation.ResetFileSize()
|
||||
@@ -379,6 +649,108 @@ func (_u *AttachmentUpdateOne) ClearUploadedBy() *AttachmentUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetArchived sets the "archived" field.
|
||||
func (_u *AttachmentUpdateOne) SetArchived(v bool) *AttachmentUpdateOne {
|
||||
_u.mutation.SetArchived(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableArchived sets the "archived" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdateOne) SetNillableArchived(v *bool) *AttachmentUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetArchived(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetArchivedAt sets the "archived_at" field.
|
||||
func (_u *AttachmentUpdateOne) SetArchivedAt(v int64) *AttachmentUpdateOne {
|
||||
_u.mutation.ResetArchivedAt()
|
||||
_u.mutation.SetArchivedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableArchivedAt sets the "archived_at" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdateOne) SetNillableArchivedAt(v *int64) *AttachmentUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetArchivedAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddArchivedAt adds value to the "archived_at" field.
|
||||
func (_u *AttachmentUpdateOne) AddArchivedAt(v int64) *AttachmentUpdateOne {
|
||||
_u.mutation.AddArchivedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearArchivedAt clears the value of the "archived_at" field.
|
||||
func (_u *AttachmentUpdateOne) ClearArchivedAt() *AttachmentUpdateOne {
|
||||
_u.mutation.ClearArchivedAt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetDeleted sets the "deleted" field.
|
||||
func (_u *AttachmentUpdateOne) SetDeleted(v bool) *AttachmentUpdateOne {
|
||||
_u.mutation.SetDeleted(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableDeleted sets the "deleted" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdateOne) SetNillableDeleted(v *bool) *AttachmentUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetDeleted(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetDeletedAt sets the "deleted_at" field.
|
||||
func (_u *AttachmentUpdateOne) SetDeletedAt(v int64) *AttachmentUpdateOne {
|
||||
_u.mutation.ResetDeletedAt()
|
||||
_u.mutation.SetDeletedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdateOne) SetNillableDeletedAt(v *int64) *AttachmentUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetDeletedAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddDeletedAt adds value to the "deleted_at" field.
|
||||
func (_u *AttachmentUpdateOne) AddDeletedAt(v int64) *AttachmentUpdateOne {
|
||||
_u.mutation.AddDeletedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearDeletedAt clears the value of the "deleted_at" field.
|
||||
func (_u *AttachmentUpdateOne) ClearDeletedAt() *AttachmentUpdateOne {
|
||||
_u.mutation.ClearDeletedAt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetDeletedBy sets the "deleted_by" field.
|
||||
func (_u *AttachmentUpdateOne) SetDeletedBy(v string) *AttachmentUpdateOne {
|
||||
_u.mutation.SetDeletedBy(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.
|
||||
func (_u *AttachmentUpdateOne) SetNillableDeletedBy(v *string) *AttachmentUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetDeletedBy(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearDeletedBy clears the value of the "deleted_by" field.
|
||||
func (_u *AttachmentUpdateOne) ClearDeletedBy() *AttachmentUpdateOne {
|
||||
_u.mutation.ClearDeletedBy()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_u *AttachmentUpdateOne) SetCreatedAt(v int64) *AttachmentUpdateOne {
|
||||
_u.mutation.ResetCreatedAt()
|
||||
@@ -483,6 +855,24 @@ func (_u *AttachmentUpdateOne) sqlSave(ctx context.Context) (_node *Attachment,
|
||||
if value, ok := _u.mutation.FilePath(); ok {
|
||||
_spec.SetField(attachment.FieldFilePath, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.FileType(); ok {
|
||||
_spec.SetField(attachment.FieldFileType, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.FileTypeCleared() {
|
||||
_spec.ClearField(attachment.FieldFileType, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.FileExt(); ok {
|
||||
_spec.SetField(attachment.FieldFileExt, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.FileExtCleared() {
|
||||
_spec.ClearField(attachment.FieldFileExt, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.FileMd5(); ok {
|
||||
_spec.SetField(attachment.FieldFileMd5, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.FileMd5Cleared() {
|
||||
_spec.ClearField(attachment.FieldFileMd5, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.FileSize(); ok {
|
||||
_spec.SetField(attachment.FieldFileSize, field.TypeInt64, value)
|
||||
}
|
||||
@@ -501,6 +891,36 @@ func (_u *AttachmentUpdateOne) sqlSave(ctx context.Context) (_node *Attachment,
|
||||
if _u.mutation.UploadedByCleared() {
|
||||
_spec.ClearField(attachment.FieldUploadedBy, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.Archived(); ok {
|
||||
_spec.SetField(attachment.FieldArchived, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.ArchivedAt(); ok {
|
||||
_spec.SetField(attachment.FieldArchivedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedArchivedAt(); ok {
|
||||
_spec.AddField(attachment.FieldArchivedAt, field.TypeInt64, value)
|
||||
}
|
||||
if _u.mutation.ArchivedAtCleared() {
|
||||
_spec.ClearField(attachment.FieldArchivedAt, field.TypeInt64)
|
||||
}
|
||||
if value, ok := _u.mutation.Deleted(); ok {
|
||||
_spec.SetField(attachment.FieldDeleted, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.DeletedAt(); ok {
|
||||
_spec.SetField(attachment.FieldDeletedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedDeletedAt(); ok {
|
||||
_spec.AddField(attachment.FieldDeletedAt, field.TypeInt64, value)
|
||||
}
|
||||
if _u.mutation.DeletedAtCleared() {
|
||||
_spec.ClearField(attachment.FieldDeletedAt, field.TypeInt64)
|
||||
}
|
||||
if value, ok := _u.mutation.DeletedBy(); ok {
|
||||
_spec.SetField(attachment.FieldDeletedBy, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.DeletedByCleared() {
|
||||
_spec.ClearField(attachment.FieldDeletedBy, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(attachment.FieldCreatedAt, field.TypeInt64, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user