feat&refactor: 2026-09-22 半成品业务模型重构与功能完善
- 重构半成品流转逻辑:进度权威源改为 workpiece.currentStationNo,新增 completedText 快照字段,废除 doneProcessCodes - 清理物料品类中半成品类型,存量数据幂等清理,调整物料管理方式文案为批次/序列号 - 新增日排产状态专用更新接口,修复工单工艺校验逻辑 - 新增物料档案代理接口、深路径文件下载接口 - 优化前端界面文案与工位选择逻辑,补充追溯页半成品流转展示 - 调整WMS端物料品类校验与入库接口契约 - 新增/更新数据库表结构与实体类代码
This commit is contained in:
@@ -46,6 +46,20 @@ func (_c *SemiFlowCreate) SetDoneProcessCodes(v []int) *SemiFlowCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCompletedText sets the "completedText" field.
|
||||
func (_c *SemiFlowCreate) SetCompletedText(v string) *SemiFlowCreate {
|
||||
_c.mutation.SetCompletedText(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableCompletedText sets the "completedText" field if the given value is not nil.
|
||||
func (_c *SemiFlowCreate) SetNillableCompletedText(v *string) *SemiFlowCreate {
|
||||
if v != nil {
|
||||
_c.SetCompletedText(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetAction sets the "action" field.
|
||||
func (_c *SemiFlowCreate) SetAction(v string) *SemiFlowCreate {
|
||||
_c.mutation.SetAction(v)
|
||||
@@ -147,6 +161,10 @@ func (_c *SemiFlowCreate) defaults() {
|
||||
v := semiflow.DefaultOrderNo
|
||||
_c.mutation.SetOrderNo(v)
|
||||
}
|
||||
if _, ok := _c.mutation.CompletedText(); !ok {
|
||||
v := semiflow.DefaultCompletedText
|
||||
_c.mutation.SetCompletedText(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Action(); !ok {
|
||||
v := semiflow.DefaultAction
|
||||
_c.mutation.SetAction(v)
|
||||
@@ -183,6 +201,14 @@ func (_c *SemiFlowCreate) check() error {
|
||||
return &ValidationError{Name: "orderNo", err: fmt.Errorf(`ent: validator failed for field "SemiFlow.orderNo": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.CompletedText(); !ok {
|
||||
return &ValidationError{Name: "completedText", err: errors.New(`ent: missing required field "SemiFlow.completedText"`)}
|
||||
}
|
||||
if v, ok := _c.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 _, ok := _c.mutation.Action(); !ok {
|
||||
return &ValidationError{Name: "action", err: errors.New(`ent: missing required field "SemiFlow.action"`)}
|
||||
}
|
||||
@@ -259,6 +285,10 @@ func (_c *SemiFlowCreate) createSpec() (*SemiFlow, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(semiflow.FieldDoneProcessCodes, field.TypeJSON, value)
|
||||
_node.DoneProcessCodes = value
|
||||
}
|
||||
if value, ok := _c.mutation.CompletedText(); ok {
|
||||
_spec.SetField(semiflow.FieldCompletedText, field.TypeString, value)
|
||||
_node.CompletedText = value
|
||||
}
|
||||
if value, ok := _c.mutation.Action(); ok {
|
||||
_spec.SetField(semiflow.FieldAction, field.TypeString, value)
|
||||
_node.Action = value
|
||||
|
||||
Reference in New Issue
Block a user