feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"bj_power_mes/ent"
|
||||
"bj_power_mes/ent/permission"
|
||||
"bj_power_mes/ent/role"
|
||||
"bj_power_mes/ent/station"
|
||||
"bj_power_mes/ent/user"
|
||||
"bj_power_mes/ent/userstation"
|
||||
|
||||
@@ -204,8 +205,17 @@ func (s *Service) StationLogin(ctx context.Context, req StationLoginReq) (Statio
|
||||
}
|
||||
stations := s.UserStations(ctx, usr.ID)
|
||||
if len(stations) == 0 {
|
||||
for i := 1; i <= 12; i++ {
|
||||
stations = append(stations, i)
|
||||
// 未配置工位权限时兜底授权全部物理工位(不含 0/13 虚拟上下线位)
|
||||
if dbStations, e := s.ctx.EntClient.Station.Query().
|
||||
Where(station.StationTypeNEQ("OFFLINE"), station.Status("ENABLED")).All(ctx); e == nil {
|
||||
for _, st := range dbStations {
|
||||
stations = append(stations, st.StationNo)
|
||||
}
|
||||
}
|
||||
if len(stations) == 0 {
|
||||
for i := 1; i <= 12; i++ {
|
||||
stations = append(stations, i)
|
||||
}
|
||||
}
|
||||
}
|
||||
if req.StationNo > 0 {
|
||||
|
||||
Reference in New Issue
Block a user