refactor: 重构产线工位与备料流程,移除冗余字段
1. 移除工单、工件、日排产中的冗余工位组合/接驳台字段 2. 新增工位接驳台编码字段与唯一约束,关联WMS接驳台主数据 3. 重构日排产为工位产量分配模式,替代原接驳台列表 4. 新增备料单工位级字段与分批出库支持 5. 移除定时同步可生产数量,改为WMS实时拉取接口 6. 过滤操作日志,排除登录/退出相关日志 7. 调整仪表盘工序展示逻辑为今日派工路线 8. 新增接驳台维护菜单与基础数据
This commit is contained in:
@@ -128,6 +128,62 @@ func (_c *MaterialRequestCreate) SetNillableTargetDock(v *string) *MaterialReque
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetStationNo sets the "stationNo" field.
|
||||
func (_c *MaterialRequestCreate) SetStationNo(v int) *MaterialRequestCreate {
|
||||
_c.mutation.SetStationNo(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableStationNo sets the "stationNo" field if the given value is not nil.
|
||||
func (_c *MaterialRequestCreate) SetNillableStationNo(v *int) *MaterialRequestCreate {
|
||||
if v != nil {
|
||||
_c.SetStationNo(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetProcessCode sets the "processCode" field.
|
||||
func (_c *MaterialRequestCreate) SetProcessCode(v int) *MaterialRequestCreate {
|
||||
_c.mutation.SetProcessCode(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableProcessCode sets the "processCode" field if the given value is not nil.
|
||||
func (_c *MaterialRequestCreate) SetNillableProcessCode(v *int) *MaterialRequestCreate {
|
||||
if v != nil {
|
||||
_c.SetProcessCode(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetSentQty sets the "sentQty" field.
|
||||
func (_c *MaterialRequestCreate) SetSentQty(v float64) *MaterialRequestCreate {
|
||||
_c.mutation.SetSentQty(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableSentQty sets the "sentQty" field if the given value is not nil.
|
||||
func (_c *MaterialRequestCreate) SetNillableSentQty(v *float64) *MaterialRequestCreate {
|
||||
if v != nil {
|
||||
_c.SetSentQty(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetBatchNo sets the "batchNo" field.
|
||||
func (_c *MaterialRequestCreate) SetBatchNo(v string) *MaterialRequestCreate {
|
||||
_c.mutation.SetBatchNo(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableBatchNo sets the "batchNo" field if the given value is not nil.
|
||||
func (_c *MaterialRequestCreate) SetNillableBatchNo(v *string) *MaterialRequestCreate {
|
||||
if v != nil {
|
||||
_c.SetBatchNo(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetOperator sets the "operator" field.
|
||||
func (_c *MaterialRequestCreate) SetOperator(v string) *MaterialRequestCreate {
|
||||
_c.mutation.SetOperator(v)
|
||||
@@ -235,6 +291,22 @@ func (_c *MaterialRequestCreate) defaults() {
|
||||
v := materialrequest.DefaultTargetDock
|
||||
_c.mutation.SetTargetDock(v)
|
||||
}
|
||||
if _, ok := _c.mutation.StationNo(); !ok {
|
||||
v := materialrequest.DefaultStationNo
|
||||
_c.mutation.SetStationNo(v)
|
||||
}
|
||||
if _, ok := _c.mutation.ProcessCode(); !ok {
|
||||
v := materialrequest.DefaultProcessCode
|
||||
_c.mutation.SetProcessCode(v)
|
||||
}
|
||||
if _, ok := _c.mutation.SentQty(); !ok {
|
||||
v := materialrequest.DefaultSentQty
|
||||
_c.mutation.SetSentQty(v)
|
||||
}
|
||||
if _, ok := _c.mutation.BatchNo(); !ok {
|
||||
v := materialrequest.DefaultBatchNo
|
||||
_c.mutation.SetBatchNo(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Operator(); !ok {
|
||||
v := materialrequest.DefaultOperator
|
||||
_c.mutation.SetOperator(v)
|
||||
@@ -326,6 +398,23 @@ func (_c *MaterialRequestCreate) check() error {
|
||||
return &ValidationError{Name: "targetDock", err: fmt.Errorf(`ent: validator failed for field "MaterialRequest.targetDock": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.StationNo(); !ok {
|
||||
return &ValidationError{Name: "stationNo", err: errors.New(`ent: missing required field "MaterialRequest.stationNo"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.ProcessCode(); !ok {
|
||||
return &ValidationError{Name: "processCode", err: errors.New(`ent: missing required field "MaterialRequest.processCode"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.SentQty(); !ok {
|
||||
return &ValidationError{Name: "sentQty", err: errors.New(`ent: missing required field "MaterialRequest.sentQty"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.BatchNo(); !ok {
|
||||
return &ValidationError{Name: "batchNo", err: errors.New(`ent: missing required field "MaterialRequest.batchNo"`)}
|
||||
}
|
||||
if v, ok := _c.mutation.BatchNo(); ok {
|
||||
if err := materialrequest.BatchNoValidator(v); err != nil {
|
||||
return &ValidationError{Name: "batchNo", err: fmt.Errorf(`ent: validator failed for field "MaterialRequest.batchNo": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.Operator(); !ok {
|
||||
return &ValidationError{Name: "operator", err: errors.New(`ent: missing required field "MaterialRequest.operator"`)}
|
||||
}
|
||||
@@ -414,6 +503,22 @@ func (_c *MaterialRequestCreate) createSpec() (*MaterialRequest, *sqlgraph.Creat
|
||||
_spec.SetField(materialrequest.FieldTargetDock, field.TypeString, value)
|
||||
_node.TargetDock = value
|
||||
}
|
||||
if value, ok := _c.mutation.StationNo(); ok {
|
||||
_spec.SetField(materialrequest.FieldStationNo, field.TypeInt, value)
|
||||
_node.StationNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.ProcessCode(); ok {
|
||||
_spec.SetField(materialrequest.FieldProcessCode, field.TypeInt, value)
|
||||
_node.ProcessCode = value
|
||||
}
|
||||
if value, ok := _c.mutation.SentQty(); ok {
|
||||
_spec.SetField(materialrequest.FieldSentQty, field.TypeFloat64, value)
|
||||
_node.SentQty = value
|
||||
}
|
||||
if value, ok := _c.mutation.BatchNo(); ok {
|
||||
_spec.SetField(materialrequest.FieldBatchNo, field.TypeString, value)
|
||||
_node.BatchNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.Operator(); ok {
|
||||
_spec.SetField(materialrequest.FieldOperator, field.TypeString, value)
|
||||
_node.Operator = value
|
||||
|
||||
Reference in New Issue
Block a user