From d0093b0350c908383c5867ba3b91fc14c686c7bf Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期六, 26 十月 2024 00:38:51 +0800 Subject: [PATCH] Merge branch 'master' into master_ben --- Tiger.Business.MES/WorkAction/PackageInputCheck.cs | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Tiger.Business.MES/WorkAction/PackageInputCheck.cs b/Tiger.Business.MES/WorkAction/PackageInputCheck.cs index 70117ae..bb135d0 100644 --- a/Tiger.Business.MES/WorkAction/PackageInputCheck.cs +++ b/Tiger.Business.MES/WorkAction/PackageInputCheck.cs @@ -24,10 +24,9 @@ public MES_WO_ACTION Setting { get; set; } #endregion public MES_CUST_SN FlowCSN { get; set; } - public BAS_LABEL_TEMP Label { get; set; } - public List<BAS_LABEL_PV> LabelPV { get; set; } public List<mes_MOPickList> MoPickList { get; set; } public BAS_ITEM_CUST CustInfo { get; set; } + public double U9Cost = 0; #endregion Propertys & Variables #region Functions @@ -43,10 +42,6 @@ NodeAct = nodeAct; Setting = setting; #endregion - - //鑾峰彇鎵撳嵃妯℃澘 - 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(); //鑾峰彇褰撳墠浜у搧鍦ㄥ綋鍓嶅鎴风殑鍏崇郴 CustInfo = Biz.Db.Queryable<BAS_ITEM_CUST>().Where(q => q.ITEM_ID == CurPosition.WorkBatch.WO.ItemInfo.ID && q.CUST_CODE == CurPosition.WorkBatch.WO.CUST_CODE).First(); @@ -107,6 +102,22 @@ } var wipSn = CurPosition.CurWipSNs.First(); + //鍒ゆ柇褰撳墠鏉$爜鏄惁鍦║9鎶曚骇 + var begin = DateTime.Now; + if (Biz.DataSource["YadaU9C"].Client.Queryable<mes_HisBoxBarCode>().Any(q => q.BarCode == wipSn.SN)) + { + CurStep.Message = Biz.L("鎶曟枡閿欒"); + CurStep.Status = StepStatus.Error; + action.Data.ShortMsg = new("鎶曟枡閿欒", ShortMessage.Types.Failed); + action.IsSuccessed = false; + //action.LocaleMsg = new($"鎶曟枡閿欒锛屾潯鐮乕{0}]宸茬粡鍦║9鏈夋姇浜ц褰曪紝涓嶅厑璁稿湪MES閲嶅鎶曞叆"); + action.LocaleMsg = new("MES.WorkAction.PackageInputCheck.U9HasHistory", wipSn.SN); + //閲嶇疆宸ュ簭鎿嶄綔 + CurPosition.ResetNode(); + return action; + } + U9Cost = (DateTime.Now - begin).TotalSeconds; + FlowCSN = Biz.Db.Queryable<MES_CUST_SN>().Where(q => q.FLOW_SN == wipSn.SN || q.CUST_SN == wipSn.SN).First(); //鎵句笉鍒扮敓浜ц褰曪紝璁や负鎵弿閿欒 if (FlowCSN.IsNullOrEmpty()) @@ -179,8 +190,8 @@ //鏇存柊鍘傚唴娴佺▼鐮� FlowCSN.CUST_CODE = CurPosition.WorkBatch.WO.CUST_CODE; - FlowCSN.WORK_ORDER = CurPosition.WorkBatch.WO.ORDER_NO; - FlowCSN.ITEM_CODE = CurPosition.WorkBatch.WO.ITEM_CODE; + FlowCSN.PKG_ORDER = CurPosition.WorkBatch.WO.ORDER_NO; + FlowCSN.PROD_CODE = CurPosition.WorkBatch.WO.ITEM_CODE; //璁板綍琛屼负鎿嶄綔璁板綍 var wipActs = new List<MES_WIP_ACT>(); @@ -234,10 +245,9 @@ PRD_CODE = wipSn.PRD_CODE, ACT_TYPE = NodeAct.ACT_TYPE, ACT_SN = wipSn.SN, - ACT_VALUE_1 = Label.LABEL_CODE, - ACT_VALUE_2 = Label.Variables.ToJson(), ACT_RESULT = "Y", - TRACE_INFO = $"鏉$爜[{wipSn.SN}]鍙互鍦ㄥ伐鍗昜{wipSn.WORK_ORDER}]鎶曟枡鐢熶骇", + ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(), + TRACE_INFO = $"鏉$爜[{wipSn.SN}]鍙互鍦ㄥ伐鍗昜{wipSn.WORK_ORDER}]鎶曟枡鐢熶骇锛屽叾涓璘9妫�鏌ヨ�楁椂{U9Cost:0.0000}绉�", }; wipActs.Add(wipAct); } -- Gitblit v1.9.3