feat: 重构BOM架构,新增基础设置与虚拟工位管理功能
本次重构删除原有BOM物料清单表,改用工单工艺组合×工艺物料清单作为唯一用料来源;新增系统基础设置表支持WMS地址、日志保留天数等配置,新增虚拟工位作业管理后台接口与前端页签控制功能,同时优化工位号校验逻辑、事件日志自动清理与工单用料查询能力。
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"time"
|
||||
|
||||
"bj_power_mes/ent"
|
||||
"bj_power_mes/ent/bomitem"
|
||||
"bj_power_mes/ent/inspectionrecord"
|
||||
)
|
||||
|
||||
@@ -44,14 +43,14 @@ type InspectionReq struct {
|
||||
StepName string `json:"stepName"` // 工艺步骤名称
|
||||
MeasuredValue string `json:"measuredValue"` // 实测值
|
||||
// 质量检验(过程检/完工检/来料检)扩展字段
|
||||
ReportNo string `json:"reportNo"` // 报检单号
|
||||
MaterialCode string `json:"materialCode"` // 物料编码(图号)
|
||||
MaterialName string `json:"materialName"` // 物料名称
|
||||
Manufacturer string `json:"manufacturer"` // 生产厂家
|
||||
InspectionNo string `json:"inspectionNo"` // 检验单号
|
||||
AttachmentIds string `json:"attachmentIds"` // 附件ID,逗号分隔
|
||||
DisposalType string `json:"disposalType"` // 处置类型 退货/返修/退换
|
||||
DisposalRemark string `json:"disposalRemark"` // 处置说明
|
||||
ReportNo string `json:"reportNo"` // 报检单号
|
||||
MaterialCode string `json:"materialCode"` // 物料编码(图号)
|
||||
MaterialName string `json:"materialName"` // 物料名称
|
||||
Manufacturer string `json:"manufacturer"` // 生产厂家
|
||||
InspectionNo string `json:"inspectionNo"` // 检验单号
|
||||
AttachmentIds string `json:"attachmentIds"` // 附件ID,逗号分隔
|
||||
DisposalType string `json:"disposalType"` // 处置类型 退货/返修/退换
|
||||
DisposalRemark string `json:"disposalRemark"` // 处置说明
|
||||
}
|
||||
|
||||
// CreateInspection 提交巡检记录;ALARM 类型同时触发看板报警(SSE + 清缓存)
|
||||
@@ -231,18 +230,3 @@ func (s *Service) SetInspectionDisposal(ctx context.Context, id int, disposalTyp
|
||||
"质量检验处置 "+disposalType, map[string]any{"id": id, "remark": disposalRemark})
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryBomMaterial 按物料编码或名称/图号模糊检索 BOM 料信息(质量检验"选物料自动带出 BOM"用)
|
||||
func (s *Service) QueryBomMaterial(ctx context.Context, keyword string) ([]*ent.BomItem, error) {
|
||||
if keyword == "" {
|
||||
return []*ent.BomItem{}, nil
|
||||
}
|
||||
q := s.ctx.EntClient.BomItem.Query()
|
||||
q = q.Where(
|
||||
bomitem.Or(
|
||||
bomitem.MaterialCodeContainsFold(keyword),
|
||||
bomitem.MaterialNameContainsFold(keyword),
|
||||
),
|
||||
)
|
||||
return q.Order(ent.Asc(bomitem.FieldProductCode), ent.Asc(bomitem.FieldBomName), ent.Asc(bomitem.FieldID)).Limit(200).All(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user