From f4f475fd3c0e066ad82cdc61707f0e8e19583a02 Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期四, 25 七月 2024 14:51:43 +0800 Subject: [PATCH] 进入工序时要增加判断过站是否按流程设置,增加非法过站防呆 增加生产不良记录用于记录发现的不良的管理 工序节点跟节点设置增加是否允许不良品进站的字段 --- Tiger.Business.MES/WorkAction/PrintLabel.cs | 49 ++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 40 insertions(+), 9 deletions(-) diff --git a/Tiger.Business.MES/WorkAction/PrintLabel.cs b/Tiger.Business.MES/WorkAction/PrintLabel.cs index fe2d3ea..9d869bf 100644 --- a/Tiger.Business.MES/WorkAction/PrintLabel.cs +++ b/Tiger.Business.MES/WorkAction/PrintLabel.cs @@ -26,19 +26,39 @@ #region Functions /// <summary> - /// 寮�濮嬫墽琛屽伐搴忚涓� + /// 鍒濆鍖栧伐搴忚涓� /// </summary> /// <returns></returns> - public ApiAction<SubmitOutput> Begin(IWorkStep curStep, IPosition position, MES_WO_NODE_ACT nodeAct, MES_WO_ACTION setting) + public void Init(IWorkStep curStep, IPosition position, MES_WO_NODE_ACT nodeAct, MES_WO_ACTION setting) { CurStep = curStep; CurPosition = position; NodeAct = nodeAct; Setting = setting; - var action = new ApiAction<SubmitOutput>(); Label = Biz.Db.Queryable<BAS_LABEL_TEMP>().Where(q => q.LABEL_CODE == setting.LABEL_CODE).IncludesAllFirstLayer().First(); LabelPV = Biz.Db.Queryable<BAS_LABEL_PV>().ToList(); + } + + /// <summary> + /// 鑾峰彇琛屼负寮�濮嬬殑鎻愮ず淇℃伅 + /// </summary> + /// <returns></returns> + public Locale GetBeginMsg() + { + var msg = new Locale("MES.WorkAction.PrintLabel.BeginMsg", CurPosition.CurWipSN.SN, Label.LABEL_CODE, Label.LABEL_NAME); + //var msg = new Locale($"寮�濮嬫墦鍗版潯鐮乕{CurPosition.CurWipSN.SN}]鐨勬爣绛綶{Label.LABEL_CODE}: {Label.LABEL_NAME}]"); + return msg; + } + + /// <summary> + /// 灏濊瘯寮�濮嬫墽琛屽伐搴忚涓� + /// </summary> + /// <returns></returns> + public ApiAction<SubmitOutput> TryBegin(SubmitInput input) + { + var action = new ApiAction<SubmitOutput>(); + foreach (var item in Label.Variables) { switch (item.VAR_TYPE.GetEnum<BAS_LABEL_VAR.VAR_TYPEs>()) @@ -58,10 +78,13 @@ break; } } - action.Data.StepActCode = nodeAct.Definition.ACT_CODE; action.Data.Data = Label; + + //濡傛灉鏍规嵁杈撳叆鍙互寮�濮嬫墽琛屽綋鍓嶈涓哄垯鏍囪涓烘垚鍔燂紝鍚﹀垯澶辫触 + action.IsSuccessed = true; return action; } + /// <summary> /// 宸ュ簭琛屼负鎻愪氦鏁版嵁 /// </summary> @@ -69,17 +92,22 @@ public ApiAction<SubmitOutput> Submit(SubmitInput input) { var action = new ApiAction<SubmitOutput>(); + //鎻愪氦鏁版嵁鎵ц鎴愬姛 if (input.Data.ToBoolean()) { action = End(); } + //鎻愪氦鏁版嵁鎵ц澶辫触 else { - //閲嶇疆褰撳墠宸ュ簭 - CurPosition.ResetSteps(); action.IsSuccessed = false; - //action.LocaleMsg = new($"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃澶辫触锛岃閲嶆柊鎵弿浜у搧鏉$爜", Label.LABEL_NAME); + //action.LocaleMsg = new($"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃澶辫触", Label.LABEL_NAME); action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintFail", Label.LABEL_NAME, Label.LABEL_CODE); + //濡傛灉琛屼负璁剧疆涓哄嚭閿欓渶瑕侀噸缃伐搴忔搷浣� + if (NodeAct.NEED_RESET == "Y") + { + CurPosition.ResetSteps(); + } } return action; } @@ -91,9 +119,12 @@ { var action = new ApiAction<SubmitOutput>(); + //璁板綍琛屼负鎿嶄綔璁板綍 var wipAct = new MES_WIP_ACT() { - HIS_ID = CurPosition.CurWipSN.HIS_ID, + AUTH_ORG = CurPosition.WorkBatch.WO.AUTH_ORG, + AUTH_PROD = CurPosition.CurLine.LINE_CODE, + HIS_ID = CurPosition.CurWipSNHis.ID, SN = CurPosition.CurWipSN.SN, STATUS = CurPosition.CurWipSN.STATUS, ITEM_CODE = CurPosition.CurWipSN.ITEM_CODE, @@ -150,7 +181,7 @@ case "GetSN": return CurPosition.CurWipSN.SN; case "GetBAS_ITEM": - return Biz.Db.Queryable<BAS_ITEM>().Where(q => q.ITEM_CODE == CurPosition.CurWipSN.ITEM_CODE).First()?.ToJson(); + return CurPosition.WorkBatch.Product.ToJson(); case "GetCustomer": return CurPosition.WorkBatch.Batch.ToJson(); default: -- Gitblit v1.9.3