feat: 两库对等物料管理及产品工号贯通全流程
- 新增 MES 本地物料表及双向同步接口,WMS 物料变更自动同步 - 全流程新增产品工号字段,贯通入库/库存/出库/检验环节 - 工单管理支持多工单混产,移除单工单互斥限制 - 新增批次号/SN 字段支持质量检验联动 WMS 库存处置 - 修复权限规则,仅内置管理员账号不允许修改删除 - 工位终端新增 SN 扫码自动切换所属工单功能
This commit is contained in:
@@ -52,6 +52,8 @@ type Inventory struct {
|
||||
InboundNo string `json:"inboundNo,omitempty"`
|
||||
// 关联工单号(半成品/成品回流)
|
||||
OrderNo string `json:"orderNo,omitempty"`
|
||||
// 产品工号(贯穿库存,出库/检验/半成品带出展示)
|
||||
ProductWorkNo string `json:"productWorkNo,omitempty"`
|
||||
// 已完成工序(半成品用,如 135)
|
||||
CompletedProcess string `json:"completedProcess,omitempty"`
|
||||
// 归属类型 workorder/project/other
|
||||
@@ -88,7 +90,7 @@ func (*Inventory) scanValues(columns []string) ([]any, error) {
|
||||
switch columns[i] {
|
||||
case inventory.FieldID, inventory.FieldManageMode, inventory.FieldCategory, inventory.FieldQuantity, inventory.FieldLockedQty, inventory.FieldRecordedAt, inventory.FieldCreatedAt, inventory.FieldUpdatedAt:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case inventory.FieldMaterialCode, inventory.FieldMaterialName, inventory.FieldBatchNo, inventory.FieldSnCode, inventory.FieldQualityStatus, inventory.FieldZoneCode, inventory.FieldShelfNo, inventory.FieldLayerNo, inventory.FieldPositionNo, inventory.FieldStatus, inventory.FieldProductionDate, inventory.FieldSupplier, inventory.FieldInboundNo, inventory.FieldOrderNo, inventory.FieldCompletedProcess, inventory.FieldOwnershipType, inventory.FieldOwnershipNo, inventory.FieldProductStatus, inventory.FieldRelatedStandard, inventory.FieldTestRecordNo, inventory.FieldRecordedBy, inventory.FieldOutboundReason, inventory.FieldStocktakeNo, inventory.FieldRemark:
|
||||
case inventory.FieldMaterialCode, inventory.FieldMaterialName, inventory.FieldBatchNo, inventory.FieldSnCode, inventory.FieldQualityStatus, inventory.FieldZoneCode, inventory.FieldShelfNo, inventory.FieldLayerNo, inventory.FieldPositionNo, inventory.FieldStatus, inventory.FieldProductionDate, inventory.FieldSupplier, inventory.FieldInboundNo, inventory.FieldOrderNo, inventory.FieldProductWorkNo, inventory.FieldCompletedProcess, inventory.FieldOwnershipType, inventory.FieldOwnershipNo, inventory.FieldProductStatus, inventory.FieldRelatedStandard, inventory.FieldTestRecordNo, inventory.FieldRecordedBy, inventory.FieldOutboundReason, inventory.FieldStocktakeNo, inventory.FieldRemark:
|
||||
values[i] = new(sql.NullString)
|
||||
default:
|
||||
values[i] = new(sql.UnknownType)
|
||||
@@ -219,6 +221,12 @@ func (_m *Inventory) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
_m.OrderNo = value.String
|
||||
}
|
||||
case inventory.FieldProductWorkNo:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field product_work_no", values[i])
|
||||
} else if value.Valid {
|
||||
_m.ProductWorkNo = value.String
|
||||
}
|
||||
case inventory.FieldCompletedProcess:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field completed_process", values[i])
|
||||
@@ -387,6 +395,9 @@ func (_m *Inventory) String() string {
|
||||
builder.WriteString("order_no=")
|
||||
builder.WriteString(_m.OrderNo)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("product_work_no=")
|
||||
builder.WriteString(_m.ProductWorkNo)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("completed_process=")
|
||||
builder.WriteString(_m.CompletedProcess)
|
||||
builder.WriteString(", ")
|
||||
|
||||
Reference in New Issue
Block a user