feat(production): 新增排产支撑功能并移除手动报工页面
- 在main.go中更新排产物料需求注释说明,明确WMS与MES系统间交互方式 - 从前端help.js中移除手动报工(helpScan)相关帮助文档 - 更新工艺流程、绩效报表等页面帮助文档中的报工流程说明 - 在主布局中添加排产支撑菜单项并移除手动报工菜单项 - 新增ProducibleSupport.vue组件实现排产支撑页面功能 - 移除Scan.vue手动报工页面组件 - 更新相关帮助文档内容以匹配新的业务流程
This commit is contained in:
@@ -439,56 +439,6 @@ func (s *Service) Trace(ctx context.Context, sn string) (map[string]any, error)
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ListProcessRecords 报工记录列表(分页):直接查真实报工表 workpiece_process,
|
||||
// 手动报工与工位终端报工都在此可见,形成报工闭环(取代已废弃的 scan_record 查询)。
|
||||
func (s *Service) ListProcessRecords(ctx context.Context, sn, orderNo string, stationNo, page, pageSize int) ([]map[string]any, int, error) {
|
||||
q := s.ctx.EntClient.WorkpieceProcess.Query()
|
||||
if sn != "" {
|
||||
q = q.Where(workpieceprocess.SnEqualFold(sn))
|
||||
}
|
||||
if orderNo != "" {
|
||||
q = q.Where(workpieceprocess.OrderNoEqualFold(orderNo))
|
||||
}
|
||||
if stationNo > 0 {
|
||||
q = q.Where(workpieceprocess.StationNo(itoa(stationNo)))
|
||||
}
|
||||
total, err := q.Count(ctx)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
if page < 1 {
|
||||
page = 1
|
||||
}
|
||||
if pageSize < 1 {
|
||||
pageSize = 20
|
||||
}
|
||||
rows, err := q.Order(ent.Desc(workpieceprocess.FieldID)).
|
||||
Offset((page - 1) * pageSize).Limit(pageSize).All(ctx)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
list := make([]map[string]any, 0, len(rows))
|
||||
for _, r := range rows {
|
||||
ended := ""
|
||||
if r.EndedAt != nil {
|
||||
ended = r.EndedAt.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
list = append(list, map[string]any{
|
||||
"sn": r.Sn,
|
||||
"orderNo": r.OrderNo,
|
||||
"stationNo": r.StationNo,
|
||||
"processCode": r.ProcessCode,
|
||||
"processName": r.ProcessName,
|
||||
"status": r.Status,
|
||||
"result": r.Result,
|
||||
"operator": r.Operator,
|
||||
"durationSec": r.DurationSec,
|
||||
"endedAt": ended,
|
||||
})
|
||||
}
|
||||
return list, total, nil
|
||||
}
|
||||
|
||||
func (s *Service) ListWorkpieces(ctx context.Context, sn, orderNo string) ([]*ent.Workpiece, error) {
|
||||
q := s.ctx.EntClient.Workpiece.Query()
|
||||
if sn != "" {
|
||||
|
||||
Reference in New Issue
Block a user