| | |
| | | |
| | | order, err := service.NewTaskService().GetOrderByWorkOrderId(procedure.WorkOrderID) |
| | | if err != nil { |
| | | ctx.Fail(ecode.UnknownErr) |
| | | ctx.Fail(ecode.DBErr) |
| | | return |
| | | } |
| | | |
| | | processModel, err := service.NewTaskService().GetProcessParams(procedure, order) |
| | | if err != nil || processModel == nil || processModel.ParamsMap == nil { |
| | | ctx.FailWithMsg(ecode.ParamsErr, "请先配置工艺参数") |
| | | ctx.FailWithMsg(ecode.ParamsErr, "未获取到工艺参数,请在工艺模型库中上传!") |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if procedure.Status == model.ProcedureStatusProcessing { |
| | | ctx.FailWithMsg(ecode.ParamsErr, "该工序已开始生产") |
| | | ctx.Ok() |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | return nil |
| | | }) |
| | | ctx.FailWithMsg(ecode.NeedConfirmedErr, "糟糕,工艺下发失败。") |
| | | ctx.FailWithMsg(ecode.NeedConfirmedErr, "PLC请求失败,请检查PLC配置!") |
| | | return |
| | | } |
| | | if code != ecode.OK { |