refactor: 清理MES端本地product_type冗余代码,对齐WMS主数据架构

1.  移除MES端本地product_type实体、schema及相关CRUD代码,改为通过WMS内部API代理获取物料主数据
2.  更新物料管理粒度逻辑,新增"其他"类型(3)支持,同步更新入库校验规则
3.  修复前端物料选择、库存筛选等页面的类型判断逻辑,统一使用manage_mode区分管理类型
4.  清理静态资源文件冗余的样式代码,调整前端页面展示逻辑
5.  更新帮助文档,修正物料类型的说明描述
This commit is contained in:
SunYF
2026-09-22 07:41:40 +08:00
parent 12ca493c61
commit 932700ca65
84 changed files with 698 additions and 3955 deletions
+4 -5
View File
@@ -11,7 +11,6 @@ import (
"time"
"bj_power_mes/ent/dailyplan"
"bj_power_mes/ent/producttype"
"bj_power_mes/ent/workorder"
"bj_power_mes/internal/wmsclient"
)
@@ -100,8 +99,8 @@ func (s *Service) ComputeProducible(ctx context.Context) (*ProducibleResult, err
// 4) 产品名称映射(product_type 优先,work_order 兜底)
nameMap := map[string]string{}
if pts, e := s.ctx.EntClient.ProductType.Query().All(ctx); e == nil {
for _, p := range pts {
if rows, e := s.ctx.Wms.ProductTypes(ctx, ""); e == nil {
for _, p := range rows {
nameMap[p.Code] = p.Name
}
}
@@ -185,11 +184,11 @@ func (s *Service) dropInactiveProducts(ctx context.Context, chosen map[string][]
if len(chosen) == 0 {
return
}
pts, err := s.ctx.EntClient.ProductType.Query().Where(producttype.IsActiveEQ(false)).All(ctx)
rows, err := s.ctx.Wms.ProductTypes(ctx, "false")
if err != nil {
return
}
for _, p := range pts {
for _, p := range rows {
delete(chosen, p.Code)
}
}