feat&refactor: 2026-09-22 半成品业务模型重构与功能完善
- 重构半成品流转逻辑:进度权威源改为 workpiece.currentStationNo,新增 completedText 快照字段,废除 doneProcessCodes - 清理物料品类中半成品类型,存量数据幂等清理,调整物料管理方式文案为批次/序列号 - 新增日排产状态专用更新接口,修复工单工艺校验逻辑 - 新增物料档案代理接口、深路径文件下载接口 - 优化前端界面文案与工位选择逻辑,补充追溯页半成品流转展示 - 调整WMS端物料品类校验与入库接口契约 - 新增/更新数据库表结构与实体类代码
This commit is contained in:
@@ -75,6 +75,20 @@ func (_u *SemiFlowUpdate) ClearDoneProcessCodes() *SemiFlowUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCompletedText sets the "completedText" field.
|
||||
func (_u *SemiFlowUpdate) SetCompletedText(v string) *SemiFlowUpdate {
|
||||
_u.mutation.SetCompletedText(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableCompletedText sets the "completedText" field if the given value is not nil.
|
||||
func (_u *SemiFlowUpdate) SetNillableCompletedText(v *string) *SemiFlowUpdate {
|
||||
if v != nil {
|
||||
_u.SetCompletedText(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetAction sets the "action" field.
|
||||
func (_u *SemiFlowUpdate) SetAction(v string) *SemiFlowUpdate {
|
||||
_u.mutation.SetAction(v)
|
||||
@@ -161,6 +175,11 @@ func (_u *SemiFlowUpdate) check() error {
|
||||
return &ValidationError{Name: "orderNo", err: fmt.Errorf(`ent: validator failed for field "SemiFlow.orderNo": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.CompletedText(); ok {
|
||||
if err := semiflow.CompletedTextValidator(v); err != nil {
|
||||
return &ValidationError{Name: "completedText", err: fmt.Errorf(`ent: validator failed for field "SemiFlow.completedText": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.Action(); ok {
|
||||
if err := semiflow.ActionValidator(v); err != nil {
|
||||
return &ValidationError{Name: "action", err: fmt.Errorf(`ent: validator failed for field "SemiFlow.action": %w`, err)}
|
||||
@@ -214,6 +233,9 @@ func (_u *SemiFlowUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if _u.mutation.DoneProcessCodesCleared() {
|
||||
_spec.ClearField(semiflow.FieldDoneProcessCodes, field.TypeJSON)
|
||||
}
|
||||
if value, ok := _u.mutation.CompletedText(); ok {
|
||||
_spec.SetField(semiflow.FieldCompletedText, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Action(); ok {
|
||||
_spec.SetField(semiflow.FieldAction, field.TypeString, value)
|
||||
}
|
||||
@@ -291,6 +313,20 @@ func (_u *SemiFlowUpdateOne) ClearDoneProcessCodes() *SemiFlowUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCompletedText sets the "completedText" field.
|
||||
func (_u *SemiFlowUpdateOne) SetCompletedText(v string) *SemiFlowUpdateOne {
|
||||
_u.mutation.SetCompletedText(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableCompletedText sets the "completedText" field if the given value is not nil.
|
||||
func (_u *SemiFlowUpdateOne) SetNillableCompletedText(v *string) *SemiFlowUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetCompletedText(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetAction sets the "action" field.
|
||||
func (_u *SemiFlowUpdateOne) SetAction(v string) *SemiFlowUpdateOne {
|
||||
_u.mutation.SetAction(v)
|
||||
@@ -390,6 +426,11 @@ func (_u *SemiFlowUpdateOne) check() error {
|
||||
return &ValidationError{Name: "orderNo", err: fmt.Errorf(`ent: validator failed for field "SemiFlow.orderNo": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.CompletedText(); ok {
|
||||
if err := semiflow.CompletedTextValidator(v); err != nil {
|
||||
return &ValidationError{Name: "completedText", err: fmt.Errorf(`ent: validator failed for field "SemiFlow.completedText": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.Action(); ok {
|
||||
if err := semiflow.ActionValidator(v); err != nil {
|
||||
return &ValidationError{Name: "action", err: fmt.Errorf(`ent: validator failed for field "SemiFlow.action": %w`, err)}
|
||||
@@ -460,6 +501,9 @@ func (_u *SemiFlowUpdateOne) sqlSave(ctx context.Context) (_node *SemiFlow, err
|
||||
if _u.mutation.DoneProcessCodesCleared() {
|
||||
_spec.ClearField(semiflow.FieldDoneProcessCodes, field.TypeJSON)
|
||||
}
|
||||
if value, ok := _u.mutation.CompletedText(); ok {
|
||||
_spec.SetField(semiflow.FieldCompletedText, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Action(); ok {
|
||||
_spec.SetField(semiflow.FieldAction, field.TypeString, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user