refactor: 重构工艺工序相关命名与数据模型
1. 全局替换"工序"为"工艺"统一术语,包括页面文案、枚举、注释
2. 重构工单与工件工艺数据模型:
- 新增工艺组合表flow_material作为备料/齐套唯一源头
- 新增工位状态表station_state支持自主停单/恢复接单
- 移除station_process派工表,改用工单工艺组合作为路线唯一源头
- 替换processCode为flowId作为工艺关联标识
- 重构工件当前进度字段为currentStationNo
3. 删除冗余的静态备份资源文件
4. 调整物料选择组件默认启用仅显示激活物料
5. 优化工单创建/编辑逻辑,新增工艺组合校验与保存
This commit is contained in:
@@ -21,8 +21,9 @@ type ProductTypeReq struct {
|
||||
Code string `json:"code"`
|
||||
Spec string `json:"spec"`
|
||||
Unit string `json:"unit"`
|
||||
Category string `json:"category"`
|
||||
IsActive bool `json:"isActive"`
|
||||
Category string `json:"category"`
|
||||
ManageMode int `json:"manageMode"` // 1结构件(批次)/2电气件(SN);MES 成品只列这两个
|
||||
IsActive bool `json:"isActive"`
|
||||
}
|
||||
|
||||
func (s *Service) CreateProductType(ctx context.Context, req ProductTypeReq) error {
|
||||
@@ -39,7 +40,7 @@ func (s *Service) CreateProductType(ctx context.Context, req ProductTypeReq) err
|
||||
if strings.TrimSpace(req.Unit) == "" {
|
||||
return errors.New("单位为必填项")
|
||||
}
|
||||
if err := s.ctx.Wms.CreateProductType(ctx, req.Code, req.Name, req.Spec, req.Unit, req.Category, active); err != nil {
|
||||
if err := s.ctx.Wms.CreateProductType(ctx, req.Code, req.Name, req.Spec, req.Unit, req.Category, active, req.ManageMode); err != nil {
|
||||
return errors.New("WMS 不可达或拒绝写入(编码主数据以 WMS 为单一来源):" + err.Error())
|
||||
}
|
||||
return nil
|
||||
@@ -58,7 +59,7 @@ func (s *Service) UpdateProductType(ctx context.Context, req ProductTypeReq) err
|
||||
if strings.TrimSpace(req.Unit) == "" {
|
||||
return errors.New("单位为必填项")
|
||||
}
|
||||
if err := s.ctx.Wms.UpdateProductType(ctx, req.Id, req.Name, req.Spec, req.Unit, req.Category, req.IsActive); err != nil {
|
||||
if err := s.ctx.Wms.UpdateProductType(ctx, req.Id, req.Name, req.Spec, req.Unit, req.Category, req.IsActive, req.ManageMode); err != nil {
|
||||
return errors.New("WMS 不可达或拒绝写入:" + err.Error())
|
||||
}
|
||||
return nil
|
||||
@@ -87,8 +88,8 @@ func (s *Service) DeleteProductType(ctx context.Context, id int) error {
|
||||
|
||||
// ListProductTypes 全量列表(下拉/兼容形态,id asc 新建在底部)。
|
||||
// 纯 WMS 代理:WMS 不可达直接报错(不再降级本地缓存)。degraded 恒为 true(仅兼容前端字段)。
|
||||
func (s *Service) ListProductTypes(ctx context.Context) ([]wmsclient.ProductTypeRow, bool, error) {
|
||||
list, err := s.ctx.Wms.ProductTypes(ctx, "")
|
||||
func (s *Service) ListProductTypes(ctx context.Context, isActive string) ([]wmsclient.ProductTypeRow, bool, error) {
|
||||
list, err := s.ctx.Wms.ProductTypes(ctx, isActive)
|
||||
if err != nil {
|
||||
return nil, false, errors.New("WMS 不可达,无法读取成品档案:" + err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user