| | |
| | | CustCSN = Biz.Db.Queryable<MES_CUST_SN>().Where(q => q.CUST_SN == input.Data).First(); |
| | | |
| | | var isOK = true; |
| | | //客户条码扫到厂内条码 |
| | | if (isOK && FlowCSN.FLOW_SN == input.Data) |
| | | { |
| | | CurStep.SetStatusMessage(StepStatus.Error, Biz.L("请扫描正确的客户标签")); |
| | | action.Data.ShortMsg = new("请扫描正确的客户标签", ShortMessage.Types.Failed); |
| | | action.IsSuccessed = isOK = false; |
| | | //action.LocaleMsg = new($"厂内条码[{0}]绑定客户条码[{1}]失败,厂内条码与客户条码不能一样,请扫描正确的客户标签"); |
| | | action.LocaleMsg = new("MES.WorkAction.ThreeInOne.TheSameSN", FlowCSN.FLOW_SN, input.Data); |
| | | } |
| | | //客户条码已绑定其他厂内条码 |
| | | if (!CustCSN.IsNullOrEmpty() && !CustCSN.FLOW_SN.IsNullOrEmpty() && CustCSN.FLOW_SN != FlowCSN.FLOW_SN) |
| | | if (isOK && !CustCSN.IsNullOrEmpty() && !CustCSN.FLOW_SN.IsNullOrEmpty() && CustCSN.FLOW_SN != FlowCSN.FLOW_SN) |
| | | { |
| | | CurStep.SetStatusMessage(StepStatus.Error, Biz.L("请扫描正确的客户标签")); |
| | | action.Data.ShortMsg = new("请扫描正确的客户标签", ShortMessage.Types.Failed); |
| | |
| | | action.LocaleMsg = new("MES.WorkAction.ThreeInOne.BindingOtherSN", CurPosition.CurWipSNs.First().SN, CustCSN.CUST_SN, CustCSN.FLOW_SN); |
| | | } |
| | | //客户条码不属于当前工单的客户 |
| | | if (!CustCSN.IsNullOrEmpty() && CustCSN.CUST_CODE.IsNullOrEmpty(CurPosition.WorkBatch.WO.CUST_CODE) != CurPosition.WorkBatch.WO.CUST_CODE) |
| | | if (isOK && !CustCSN.IsNullOrEmpty() && CustCSN.CUST_CODE.IsNullOrEmpty(CurPosition.WorkBatch.WO.CUST_CODE) != CurPosition.WorkBatch.WO.CUST_CODE) |
| | | { |
| | | CurStep.SetStatusMessage(StepStatus.Error, Biz.L("请扫描正确的客户标签")); |
| | | action.Data.ShortMsg = new("请扫描正确的客户标签", ShortMessage.Types.Failed); |
| | |
| | | action.LocaleMsg = new("MES.WorkAction.ThreeInOne.NotSameCustomer", CustCSN.CUST_SN, CustCSN.CUST_CODE, CurPosition.WorkBatch.WO.CUST_CODE); |
| | | } |
| | | //验证产品客户标签条码规则 |
| | | if (!CustInfo.RULE_CODE.IsNullOrEmpty() && !Biz.CodeRule[CustInfo.RULE_CODE].IsNullOrEmpty()) |
| | | if (isOK && !CustInfo.IsNullOrEmpty() && !CustInfo.RULE_CODE.IsNullOrEmpty() && !Biz.CodeRule[CustInfo.RULE_CODE].IsNullOrEmpty()) |
| | | { |
| | | var result = Biz.CodeRule[CustInfo.RULE_CODE].Verify(CustCSN.CUST_SN); |
| | | if (!result.IsSuccessed) |
| | |
| | | |
| | | //更新厂内流程码 |
| | | 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>(); |
| | |
| | | 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_VALUE_1 = Label?.LABEL_CODE, |
| | | ACT_VALUE_2 = Label?.Variables.ToJson(), |
| | | ACT_RESULT = "Y", |
| | | ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(), |
| | | TRACE_INFO = $"厂内条码[{FlowCSN.FLOW_SN}]绑定客户条码[{FlowCSN.CUST_SN}]成功", |
| | | }; |
| | | wipActs.Add(wipAct); |