feat: 新增产品工艺管理与工序审核功能
- 新增产品工艺(product_process)及明细(product_process_item)数据模型 - 新增工序审核开关(need_audit)与审核角色(audit_role)字段 - 新增待审核签字页面与路由 - 优化 WMS/MES 接口交互,增加业务错误处理与友好提示 - 补充库存过滤逻辑,避免返回已出库 SN 数据 - 调整默认查询时间范围为近一个月,优化用户体验
This commit is contained in:
@@ -105,7 +105,7 @@ func (s *Service) loadOrderUsage(ctx context.Context, orderNos []string) map[str
|
||||
// 两系统独立运行约束:未配置 WMS 或不可达时返回错误,由调用方(WMS)提示,绝不阻塞 MES。
|
||||
func (s *Service) ComputeProducible(ctx context.Context) (*ProducibleResult, error) {
|
||||
if s.ctx.Wms == nil || s.ctx.EntClient == nil {
|
||||
return nil, errors.New("未配置 WMS 地址,无法计算可生产数量")
|
||||
return nil, errors.New("未配置 WMS 服务地址,无法计算可生产数量;请在系统设置中填写 WMS 地址后重试")
|
||||
}
|
||||
today := time.Now().Format("2006-01-02")
|
||||
planQty, err := s.planOrdersBetween(ctx, today, addDays(today, 59))
|
||||
@@ -139,7 +139,8 @@ func (s *Service) ComputeProducible(ctx context.Context) (*ProducibleResult, err
|
||||
sort.Strings(codes)
|
||||
avail, err := s.ctx.Wms.StockAvailable(ctx, codes)
|
||||
if err != nil {
|
||||
return nil, errors.New("拉取 WMS 可用量失败: " + err.Error())
|
||||
// 业务友好提示:不把底层网络/连接技术细节返回给前端;详细错误由 EventLog 与框架日志捕获
|
||||
return nil, errors.New("无法获取 WMS 库存可用量(WMS 服务未启动或网络不可达),排产支撑暂不可用;请检查 WMS 服务状态或稍后重试")
|
||||
}
|
||||
|
||||
// 产品名称映射(本地成品档案优先=M6,工单快照兜底)
|
||||
|
||||
Reference in New Issue
Block a user