feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段

- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统
- 为BomItem实体添加relatedStandard字段及相关CRUD方法
- 为InspectionRecord实体添加reportNo、materialCode、materialName等字段
- 更新ent schema确保新字段的验证和默认值设置
- 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
SunYF
2026-09-17 12:49:07 +08:00
parent b4b274301d
commit 1cc93795ce
191 changed files with 24504 additions and 1250 deletions
+3 -2
View File
@@ -206,8 +206,8 @@ type CallMaterialItem struct {
// CallMaterial 工位终端叫料:操作员选定接驳台(R1/R2)后生成备料需求,物料送达该接驳台。
// 规则(产线布局修正版):叫料/退料均由工位终端发起,日排产不发起;接驳台属 AGV 点位。
func (s *Service) CallMaterial(ctx context.Context, stationNo int, dock, orderNo, operator string, items []CallMaterialItem) (int, error) {
if stationNo < 1 || stationNo > 10 {
return 0, errors.New("工位 1~10 可发起叫料(11/12 为末端下料检测位,无终端无接驳台)")
if stationNo < 1 {
return 0, errors.New("工位号无效")
}
if dock == "" {
return 0, errors.New("请选择接驳台(R1/R2")
@@ -215,6 +215,7 @@ func (s *Service) CallMaterial(ctx context.Context, stationNo int, dock, orderNo
_, err := s.ctx.EntClient.LinePoint.Query().
Where(linepoint.PointType("DOCK"), linepoint.PointNo(dock), linepoint.StationNo(stationNo)).First(ctx)
if err != nil {
// 0/13 为 OFFLINE 虚拟上下线位,11/12 为末端无接驳台;一律按「无此接驳台」拒绝,不写死工位范围
return 0, errors.New("该工位无此接驳台:" + dock)
}
if len(items) == 0 {