feat: 完成MES工位终端系统全量功能迭代
本次提交包含以下核心变更: 1. 新增按钮级权限控制框架与前端权限校验 2. 新增工位管理、工艺流程、巡检终端等核心业务模块 3. 完善用户体系,支持工位终端专属登录权限 4. 新增文件上传下载、报表查询等配套功能 5. 修复多系统兼容性与交互体验问题 6. 完成所有文档与配置项的规范化更新
This commit is contained in:
@@ -13,17 +13,45 @@ import (
|
||||
"bj_power_workstation/internal/svc"
|
||||
)
|
||||
|
||||
// taskCurrentHandler 代理 MES GET /api/internal/station/task?dockCode=。
|
||||
// taskCurrentHandler 代理 MES GET /api/internal/station/task?stationNo=。
|
||||
// 响应体原样透传(MES 已按 {code,message,data} 封装,不再二次包装)。
|
||||
func taskCurrentHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
dockCode := strings.TrimSpace(r.URL.Query().Get("dockCode"))
|
||||
if dockCode == "" {
|
||||
fail(w, http.StatusBadRequest, "缺少 dockCode 参数")
|
||||
stationNo := atoi(strings.TrimSpace(r.URL.Query().Get("stationNo")), 0)
|
||||
if stationNo <= 0 {
|
||||
fail(w, http.StatusBadRequest, "缺少 stationNo 参数")
|
||||
return
|
||||
}
|
||||
|
||||
body, _, err := ctx.Mes.Get("/api/internal/station/task", url.Values{"dockCode": {dockCode}})
|
||||
body, _, err := ctx.Mes.Get("/api/internal/station/task", url.Values{"stationNo": {strconv.Itoa(stationNo)}})
|
||||
if err != nil {
|
||||
fail(w, http.StatusBadGateway, "MES 服务不可达:"+errString(err))
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, _ = w.Write(body)
|
||||
}
|
||||
}
|
||||
|
||||
// workloadHandler 代理 MES GET /api/internal/station/workload?operator=&from=&to=(块6)。
|
||||
// 工位终端「我的工作量」仅查询当前登录人数据;MES 响应体原样透传。
|
||||
func workloadHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
operator := strings.TrimSpace(r.URL.Query().Get("operator"))
|
||||
from := strings.TrimSpace(r.URL.Query().Get("from"))
|
||||
to := strings.TrimSpace(r.URL.Query().Get("to"))
|
||||
params := url.Values{}
|
||||
if operator != "" {
|
||||
params.Set("operator", operator)
|
||||
}
|
||||
if from != "" {
|
||||
params.Set("from", from)
|
||||
}
|
||||
if to != "" {
|
||||
params.Set("to", to)
|
||||
}
|
||||
body, _, err := ctx.Mes.Get("/api/internal/station/workload", params)
|
||||
if err != nil {
|
||||
fail(w, http.StatusBadGateway, "MES 服务不可达:"+errString(err))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user