feat: 完成客户第12条需求+多系统改造
1. 新增预警表添加工单号字段,支持按工单号检索预警 2. 添加工单过滤在制品/绩效报表/预警中心查询 3. 补全WMS台账字段口径与权限配置 4. 修复备料单与数量不符处理流程 5. 新增配送进度/库位联动/自动出库功能 6. 修复AGV配送状态更新逻辑 7. 优化退料与库存管理细节
This commit is contained in:
@@ -29,11 +29,15 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
"produce.processflow", "produce.station", "produce.performance", "produce.processcard",
|
||||
// 按钮级权限(块2)
|
||||
"produce.workorder:add", "produce.workorder:edit", "produce.workorder:delete",
|
||||
"produce.workorder:dailyplan", "produce.bom:edit", "produce.material:generate",
|
||||
"produce.workorder:dailyplan", "produce.bom:edit", "produce.material:generate", "produce.material:outbound",
|
||||
"produce.quality", "produce.quality:edit",
|
||||
"produce.plc:send", "produce.product:add", "produce.product:edit", "produce.product:delete",
|
||||
"produce.processflow:add", "produce.processflow:edit", "produce.processflow:delete",
|
||||
"produce.processflow:upload", "produce.station:edit", "produce.station:add", "produce.station:delete",
|
||||
// 预警中心 / 附件中心(含归档清理按钮)
|
||||
"sys.alert", "sys.attachment", "sys.attachment:manage",
|
||||
// 数量不符处理(上报在工位终端,处理在本页)
|
||||
"produce.qty", "produce.qty:handle",
|
||||
}
|
||||
} else if r.code == "INSPECTOR" {
|
||||
codes = []string{"produce.trace", "produce.wip", "produce.torque", "produce.performance", "sys.eventlog",
|
||||
@@ -71,6 +75,7 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
{"produce.dailyplan", "日排产", "MENU", "/daily-plan"},
|
||||
{"produce.bom", "产品物料清单", "MENU", "/bom"},
|
||||
{"produce.material", "备料单", "MENU", "/material-request"},
|
||||
{"produce.qty", "数量不符处理", "MENU", "/qty-report"},
|
||||
{"produce.plc", "工位组合下发", "MENU", "/plc-send"},
|
||||
{"produce.torque", "拧紧查询", "MENU", "/torque"},
|
||||
{"produce.processflow", "工艺流程", "MENU", "/process-flow"},
|
||||
@@ -86,6 +91,10 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
// sys.rbac(角色权限管理) 已拆分:账号管理 + 角色管理(对齐 WMS 系统管理菜单)
|
||||
{"sys.account", "账号管理", "MENU", "/account"},
|
||||
{"sys.role", "角色管理", "MENU", "/role"},
|
||||
// 预警中心 / 附件中心此前只有前端菜单码(MainLayout menuGroups)、权限表未登记,
|
||||
// 导致这两个菜单无法授权给任何角色(只有 SUPER_ADMIN 靠 roleCode 旁路可见),2026-09-19 补齐。
|
||||
{"sys.alert", "预警中心", "MENU", "/alert-center"},
|
||||
{"sys.attachment", "附件中心", "MENU", "/attachment"},
|
||||
}
|
||||
for _, m := range menus {
|
||||
if s.ctx.EntClient.Permission.Query().Where(permission.Code(m.code)).ExistX(ctx) {
|
||||
@@ -105,6 +114,8 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
{"produce.workorder:dailyplan", "工单-日排产", "BUTTON", "", "produce.workorder"},
|
||||
{"produce.bom:edit", "物料清单-维护", "BUTTON", "", "produce.bom"},
|
||||
{"produce.material:generate", "备料单-生成", "BUTTON", "", "produce.material"},
|
||||
{"produce.material:outbound", "备料单-自动出库", "BUTTON", "", "produce.material"},
|
||||
{"produce.qty:handle", "数量不符-处理", "BUTTON", "", "produce.qty"},
|
||||
{"produce.plc:send", "工位组合-下发", "BUTTON", "", "produce.plc"},
|
||||
{"produce.product:add", "物料档案-新增", "BUTTON", "", "produce.product"},
|
||||
{"produce.product:edit", "物料档案-编辑", "BUTTON", "", "produce.product"},
|
||||
@@ -130,6 +141,8 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
{"sys.inspect:alarm", "巡检-异常上报", "BUTTON", "", "sys.inspect"},
|
||||
{"sys.inspect:view", "巡检-记录查看", "BUTTON", "", "sys.inspect"},
|
||||
{"produce.quality:edit", "质量检验-录入/处置", "BUTTON", "", "produce.quality"},
|
||||
// 附件中心(对齐 WMS attachment:manage 口径):删除 + 归档清理
|
||||
{"sys.attachment:manage", "附件-删除/归档清理", "BUTTON", "", "sys.attachment"},
|
||||
}
|
||||
for _, b := range buttons {
|
||||
exist, err := s.ctx.EntClient.Permission.Query().Where(permission.Code(b.code)).Only(ctx)
|
||||
@@ -151,8 +164,8 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
// 3.3 工艺路线模块已整块删除(D1):清掉存量角色里的路线权限码与旧菜单/按钮定义行(幂等)
|
||||
migrateLegacyRoute(ctx, s)
|
||||
|
||||
// 3.4 MES「数量不符上报」菜单已下线(改为仅预警,明细由 WMS 处理):
|
||||
// 清掉存量角色里的 produce.qtyreport 权限码与旧菜单定义行(幂等)
|
||||
// 3.4 旧「数量不符上报」菜单(produce.qtyreport)已下线,改用 produce.qty(数量不符处理)。
|
||||
// 清掉存量角色里的旧码与旧菜单定义行(幂等);新菜单 produce.qty 在 1. 的 seedMenus 中定义。
|
||||
migrateLegacyQtyReport(ctx, s)
|
||||
|
||||
// 4. 初始化工位与默认工艺流程(工位绑定流程,流程承载步骤)
|
||||
@@ -288,8 +301,9 @@ func migrateLegacyRoute(ctx context.Context, s *Service) {
|
||||
}
|
||||
}
|
||||
|
||||
// migrateLegacyQtyReport 清理已下线的「数量不符上报」菜单(幂等,可重复执行):
|
||||
// MES 侧对数量不符只做预警(预警中心 + 右上角铃铛),不再提供独立菜单页;
|
||||
// migrateLegacyQtyReport 清理已下线的旧「数量不符上报」菜单码 produce.qtyreport(幂等,可重复执行):
|
||||
// 该码已被 produce.qty(数量不符处理,2026-09-19 归属 MES)替代 —— 只摘旧码,
|
||||
// 不动新码 produce.qty / produce.qty:handle。
|
||||
// 从存量角色的 permissionCodes 摘除 produce.qtyreport 并删除其权限定义行。
|
||||
func migrateLegacyQtyReport(ctx context.Context, s *Service) {
|
||||
roleList, _ := s.ctx.EntClient.Role.Query().All(ctx)
|
||||
|
||||
Reference in New Issue
Block a user