feat: 完成多模块迭代更新
- 新增过程巡检按步骤上报、数量不符上报、工位退料功能 - 增加工单工程编号三级归属字段 - 新增物料安全库存与缺货预警 - 新增附件管理、退库单管理模块 - 优化生产看板展示逻辑与前端页面文案 - 清理冗余的工艺路线相关代码与备份文件
This commit is contained in:
@@ -116,23 +116,45 @@ func (_c *WorkOrderCreate) SetNillableProcessSeq(v *string) *WorkOrderCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetRouteId sets the "routeId" field.
|
||||
func (_c *WorkOrderCreate) SetRouteId(v int) *WorkOrderCreate {
|
||||
_c.mutation.SetRouteId(v)
|
||||
// SetContractNo sets the "contractNo" field.
|
||||
func (_c *WorkOrderCreate) SetContractNo(v string) *WorkOrderCreate {
|
||||
_c.mutation.SetContractNo(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableRouteId sets the "routeId" field if the given value is not nil.
|
||||
func (_c *WorkOrderCreate) SetNillableRouteId(v *int) *WorkOrderCreate {
|
||||
// SetNillableContractNo sets the "contractNo" field if the given value is not nil.
|
||||
func (_c *WorkOrderCreate) SetNillableContractNo(v *string) *WorkOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetRouteId(*v)
|
||||
_c.SetContractNo(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetRouteSnapshot sets the "routeSnapshot" field.
|
||||
func (_c *WorkOrderCreate) SetRouteSnapshot(v []map[string]interface{}) *WorkOrderCreate {
|
||||
_c.mutation.SetRouteSnapshot(v)
|
||||
// SetProjectNo sets the "projectNo" field.
|
||||
func (_c *WorkOrderCreate) SetProjectNo(v string) *WorkOrderCreate {
|
||||
_c.mutation.SetProjectNo(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableProjectNo sets the "projectNo" field if the given value is not nil.
|
||||
func (_c *WorkOrderCreate) SetNillableProjectNo(v *string) *WorkOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetProjectNo(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetProductSerial sets the "productSerial" field.
|
||||
func (_c *WorkOrderCreate) SetProductSerial(v string) *WorkOrderCreate {
|
||||
_c.mutation.SetProductSerial(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableProductSerial sets the "productSerial" field if the given value is not nil.
|
||||
func (_c *WorkOrderCreate) SetNillableProductSerial(v *string) *WorkOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetProductSerial(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -291,6 +313,18 @@ func (_c *WorkOrderCreate) defaults() {
|
||||
v := workorder.DefaultProcessSeq
|
||||
_c.mutation.SetProcessSeq(v)
|
||||
}
|
||||
if _, ok := _c.mutation.ContractNo(); !ok {
|
||||
v := workorder.DefaultContractNo
|
||||
_c.mutation.SetContractNo(v)
|
||||
}
|
||||
if _, ok := _c.mutation.ProjectNo(); !ok {
|
||||
v := workorder.DefaultProjectNo
|
||||
_c.mutation.SetProjectNo(v)
|
||||
}
|
||||
if _, ok := _c.mutation.ProductSerial(); !ok {
|
||||
v := workorder.DefaultProductSerial
|
||||
_c.mutation.SetProductSerial(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Status(); !ok {
|
||||
v := workorder.DefaultStatus
|
||||
_c.mutation.SetStatus(v)
|
||||
@@ -351,6 +385,30 @@ func (_c *WorkOrderCreate) check() error {
|
||||
return &ValidationError{Name: "processSeq", err: fmt.Errorf(`ent: validator failed for field "WorkOrder.processSeq": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.ContractNo(); !ok {
|
||||
return &ValidationError{Name: "contractNo", err: errors.New(`ent: missing required field "WorkOrder.contractNo"`)}
|
||||
}
|
||||
if v, ok := _c.mutation.ContractNo(); ok {
|
||||
if err := workorder.ContractNoValidator(v); err != nil {
|
||||
return &ValidationError{Name: "contractNo", err: fmt.Errorf(`ent: validator failed for field "WorkOrder.contractNo": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.ProjectNo(); !ok {
|
||||
return &ValidationError{Name: "projectNo", err: errors.New(`ent: missing required field "WorkOrder.projectNo"`)}
|
||||
}
|
||||
if v, ok := _c.mutation.ProjectNo(); ok {
|
||||
if err := workorder.ProjectNoValidator(v); err != nil {
|
||||
return &ValidationError{Name: "projectNo", err: fmt.Errorf(`ent: validator failed for field "WorkOrder.projectNo": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.ProductSerial(); !ok {
|
||||
return &ValidationError{Name: "productSerial", err: errors.New(`ent: missing required field "WorkOrder.productSerial"`)}
|
||||
}
|
||||
if v, ok := _c.mutation.ProductSerial(); ok {
|
||||
if err := workorder.ProductSerialValidator(v); err != nil {
|
||||
return &ValidationError{Name: "productSerial", err: fmt.Errorf(`ent: validator failed for field "WorkOrder.productSerial": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.Status(); !ok {
|
||||
return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "WorkOrder.status"`)}
|
||||
}
|
||||
@@ -431,13 +489,17 @@ func (_c *WorkOrderCreate) createSpec() (*WorkOrder, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(workorder.FieldProcessSeq, field.TypeString, value)
|
||||
_node.ProcessSeq = value
|
||||
}
|
||||
if value, ok := _c.mutation.RouteId(); ok {
|
||||
_spec.SetField(workorder.FieldRouteId, field.TypeInt, value)
|
||||
_node.RouteId = value
|
||||
if value, ok := _c.mutation.ContractNo(); ok {
|
||||
_spec.SetField(workorder.FieldContractNo, field.TypeString, value)
|
||||
_node.ContractNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.RouteSnapshot(); ok {
|
||||
_spec.SetField(workorder.FieldRouteSnapshot, field.TypeJSON, value)
|
||||
_node.RouteSnapshot = value
|
||||
if value, ok := _c.mutation.ProjectNo(); ok {
|
||||
_spec.SetField(workorder.FieldProjectNo, field.TypeString, value)
|
||||
_node.ProjectNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.ProductSerial(); ok {
|
||||
_spec.SetField(workorder.FieldProductSerial, field.TypeString, value)
|
||||
_node.ProductSerial = value
|
||||
}
|
||||
if value, ok := _c.mutation.Status(); ok {
|
||||
_spec.SetField(workorder.FieldStatus, field.TypeString, value)
|
||||
|
||||
Reference in New Issue
Block a user