chore: 批量完成项目多模块迭代优化
1. 废弃半成品库存表并统一库存主表 2. 修复列表排序与搜索大小写不敏感问题 3. 新增用户最近登录时间、工单BOM名称字段 4. 完善角色管理、工位选择器功能 5. 增加拧紧数据补录、成品自动回流WMS能力 6. 统一导出时间范围校验规则 7. 丰富物料/备料单筛选条件 8. 调整菜单与权限命名适配产品型号业务
This commit is contained in:
@@ -36,17 +36,27 @@ func CreateInspectionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// ListInspectionsHandler GET /inspections?category=&operator=&from=&to=
|
||||
// ListInspectionsHandler GET /inspections?category=&operator=&from=&to=&page=&pageSize=
|
||||
// 返回 {list, total},后端真分页(created_at desc / id desc,最新置顶)
|
||||
func ListInspectionsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query()
|
||||
data, err := logic.New(svcCtx).ListInspections(r.Context(),
|
||||
q.Get("category"), q.Get("operator"), q.Get("from"), q.Get("to"))
|
||||
page := atoiDefault(q.Get("page"), 1)
|
||||
pageSize := atoiDefault(q.Get("pageSize"), 50)
|
||||
if page < 1 {
|
||||
page = 1
|
||||
}
|
||||
if pageSize < 1 || pageSize > 1000 {
|
||||
pageSize = 50
|
||||
}
|
||||
data, total, err := logic.New(svcCtx).ListInspectionsPaged(r.Context(),
|
||||
q.Get("category"), q.Get("operator"), q.Get("from"), q.Get("to"),
|
||||
q.Get("orderNo"), q.Get("stationNo"), page, pageSize)
|
||||
if err != nil {
|
||||
httpx.Fail(w, 2302, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, data)
|
||||
httpx.Ok(w, map[string]any{"list": data, "total": total})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user