chore: 批量完成项目多模块迭代优化

1. 废弃半成品库存表并统一库存主表
2. 修复列表排序与搜索大小写不敏感问题
3. 新增用户最近登录时间、工单BOM名称字段
4. 完善角色管理、工位选择器功能
5. 增加拧紧数据补录、成品自动回流WMS能力
6. 统一导出时间范围校验规则
7. 丰富物料/备料单筛选条件
8. 调整菜单与权限命名适配产品型号业务
This commit is contained in:
SunYF
2026-09-08 11:44:04 +08:00
parent 06689970e2
commit e852c7cd37
96 changed files with 4528 additions and 542 deletions
@@ -341,6 +341,12 @@ func deleteRoleHandler(ctx *svc.ServiceContext) http.HandlerFunc {
fail(w, http.StatusBadRequest, "内置角色不可删除: "+target.Code)
return
}
// 删除保护:角色仍被用户引用时禁删(按 role_id 引用 + 旧 role 编码字段双口径)
used, _ := ctx.EntClient.User.Query().Where(user.Or(user.RoleIDEQ(req.ID), user.RoleEQ(target.Code))).Count(ctx0())
if used > 0 {
fail(w, http.StatusConflict, "该角色仍被 "+strconv.Itoa(used)+" 个账号使用,请先在账号管理中调整这些账号的角色")
return
}
if err := ctx.EntClient.Role.DeleteOneID(req.ID).Exec(ctx0()); err != nil {
fail(w, http.StatusInternalServerError, err.Error())
return