feat: 完成产线MES系统全流程功能迭代与优化

本提交完成了多个核心模块的功能完善与业务对齐:
1. 工位终端:固定工位配置、移除自选工位逻辑、适配配置化工位号
2. MES核心:重构工位组合逻辑、新增工单/流程状态管理、补全报工/追溯逻辑
3. WMS客户端:新增修改密码功能、优化帮助弹窗逻辑
4. 文档与权限:补充完整操作手册、统一菜单名称与权限描述
5. 修复多业务校验:排产数量校验、工单状态校验、工位绑定规则
This commit is contained in:
SunYF
2026-08-31 12:58:28 +08:00
parent a3145a8bd6
commit ae4c292487
53 changed files with 1475 additions and 912 deletions
+23 -4
View File
@@ -8,11 +8,11 @@ import (
"bj_power_mes/internal/svc"
)
// ListProcessFlowsHandler GET /process-flows?processCode=
// ListProcessFlowsHandler GET /process-flows?stationNo=
func ListProcessFlowsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
code := atoiDefault(r.URL.Query().Get("processCode"), 0)
data, err := logic.New(svcCtx).ListFlows(r.Context(), code)
stationNo := atoiDefault(r.URL.Query().Get("stationNo"), 0)
data, err := logic.New(svcCtx).ListFlows(r.Context(), stationNo)
if err != nil {
httpx.Fail(w, 2201, err.Error())
return
@@ -21,7 +21,7 @@ func ListProcessFlowsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
}
// SaveProcessFlowHandler POST /process-flows(新建或更新工艺流程,含步骤模板
// SaveProcessFlowHandler POST /process-flows(新建或更新工艺流程,含工序步骤)
func SaveProcessFlowHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req logic.FlowReq
@@ -98,3 +98,22 @@ func SaveStationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
httpx.OkMessage(w, "工位绑定已保存", nil)
}
}
// SetFlowStatusHandler POST /process-flows/status(工艺流程启用/停用)
func SetFlowStatusHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req struct {
Id int `json:"id"`
Status string `json:"status"`
}
if err := httpx.ParseJSON(r, &req); err != nil {
httpx.BadRequest(w, "请求体解析失败")
return
}
if err := logic.New(svcCtx).SetFlowStatus(r.Context(), req.Id, req.Status, operator(r, "")); err != nil {
httpx.Fail(w, 2207, err.Error())
return
}
httpx.OkMessage(w, "操作成功", nil)
}
}