| | |
| | | info.InputQty = CurOperInfo(input.Locale).InputQty; |
| | | action.Data.OperInfo = info; |
| | | } |
| | | else if (!IsFinishAllSteps) |
| | | else if (Steps.Any() && !IsFinishAllSteps) |
| | | { |
| | | action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale)); |
| | | } |
| | |
| | | //查找不到条码已绑定的工单 |
| | | else |
| | | { |
| | | //没有当前工单,则先选择工单后再扫描条码 |
| | | if (CurBatch.IsNullOrEmpty()) |
| | | var lastSn = wosns.OrderByDescending(q => q.SN.UPDATE_TIME).FirstOrDefault(); |
| | | if (!lastSn.IsNullOrEmpty()) |
| | | { |
| | | action.Data.ShortMsg = new("未选择工单", ShortMessage.Types.Error); |
| | | action.Data.ShortMsg = new($"产品{lastSn.SN.STATUS.GetEnumDesc<BIZ_MES_WO_SN.STATUSs>()}", ShortMessage.Types.Error); |
| | | action.Data.OperInfo = new(); |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"未选择工单,请先选择要生产的工单"); |
| | | action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotSelectOrderException"); |
| | | //action.LocaleMsg = new($"进站扫描错误,条码[{0}]{1}"); |
| | | action.LocaleMsg = new("MES.Transaction.TestNode.Submit.SnStatusError", input.SN, lastSn.SN.STATUS.GetEnumDesc<BIZ_MES_WO_SN.STATUSs>()); |
| | | } |
| | | //有当前工单且不是投入,则提示条码未投入生产,请先去首站扫描 |
| | | else |
| | | { |
| | | var lastSn = wosns.OrderByDescending(q => q.SN.UPDATE_TIME).FirstOrDefault(); |
| | | if (!lastSn.IsNullOrEmpty()) |
| | | //没有当前工单,则先选择工单后再扫描条码 |
| | | if (CurBatch.IsNullOrEmpty()) |
| | | { |
| | | action.Data.ShortMsg = new($"产品{lastSn.SN.STATUS.GetEnumDesc<BIZ_MES_WO_SN.STATUSs>()}", ShortMessage.Types.Error); |
| | | action.Data.ShortMsg = new("未选择工单", ShortMessage.Types.Error); |
| | | action.Data.OperInfo = new(); |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"进站扫描错误,条码[{0}]{1}", input.SN); |
| | | action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotInputException", input.SN); |
| | | //action.LocaleMsg = new($"未选择工单,请先选择要生产的工单"); |
| | | action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotSelectOrderException"); |
| | | } |
| | | //有当前工单且不是投入,则提示条码未投入生产,请先去首站扫描 |
| | | else |
| | | { |
| | | |
| | | action.Data.ShortMsg = new("未投入生产", ShortMessage.Types.Error); |
| | | action.Data.OperInfo = new(); |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"条码[{input.SN}]尚未投入生产,请先去首站扫描", input.SN); |
| | | action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotInputException", input.SN); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | CurWipSNHiss.Clear(); |
| | | foreach (var wipSN in wipSNs) |
| | | { |
| | | var his = new MES_WIP_HIS(wipSN, $"工单[{wipSN.WORK_ORDER}]条码[{wipSN.SN}]在岗位[{wipSN.POST_CODE}]过站工序[{wipSN.NODE_NAME}]成功"); |
| | | var his = new MES_WIP_HIS(wipSN, $"工单[{wipSN.WORK_ORDER}]条码[{wipSN.SN}]在岗位[{wipSN.POST_CODE}]过站工序[{wipSN.NODE_NAME}]成功(TransId: {TransID} )"); |
| | | wipSN.History.Add(his); |
| | | CurWipSNHiss.Add(his); |
| | | } |
| | |
| | | Action endAction = null; |
| | | |
| | | //如果当前条码已经走到流程终点则记录条码完工 |
| | | if (action.Data.OperInfo.IsReachedEndNode) |
| | | if (operInfo.IsReachedEndNode) |
| | | { |
| | | //更新工单条码明细信息 |
| | | var woSNs = CurBatch.WoSNs.Where(q => CurWipSNs.Any(w => q.WIP_ID == w.ID)).ToList(); |
| | |
| | | var wipHiss = new List<MES_WIP_HIS>(); |
| | | foreach (var wipSN in CurWipSNs) |
| | | { |
| | | var his = new MES_WIP_HIS(wipSN, $"工单[{wipSN.WORK_ORDER}]条码[{wipSN.SN}]在岗位[{wipSN.POST_CODE}]过站工序[{wipSN.NODE_NAME}]成功"); |
| | | var his = new MES_WIP_HIS(wipSN, $"工单[{wipSN.WORK_ORDER}]条码[{wipSN.SN}]在岗位[{wipSN.POST_CODE}]过站工序[{wipSN.NODE_NAME}]成功(TransId: {TransID} )"); |
| | | wipSN.History.Add(his); |
| | | wipHiss.Add(his); |
| | | } |
| | |
| | | } |
| | | |
| | | //保存数据库 |
| | | SaveStepsCommitActionToDB(); |
| | | SaveStepsCommitActionToDB(endAction); |
| | | |
| | | //保存成功,返回过站消息 |
| | | CurOperInfo(locale).InputQty += CurWipSNs.Count; |
| | |
| | | action.Data.ShortMsg = new(CurWipSNs.Any(q => q.DFT_FLAG == "Y") ? "不良过站" : "良品过站", ShortMessage.Types.Success); |
| | | //action.LocaleMsg = new($"工单[{CurWipSN.WORK_ORDER}]的条码[{CurWipSN.SN}]在岗位[{CurWipSN.POST_CODE}]工序[{CurWipSN.NODE_NAME}]过站成功,状态[{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]"); |
| | | action.LocaleMsg = new("MES.Transaction.TestNode.ScanSn.PassSuccess", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME, CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); |
| | | |
| | | |
| | | //如果当前条码已经完工,检查当前工单批次和工单是否完工 |
| | | if (action.Data.OperInfo.IsReachedEndNode) |
| | | { |
| | | CurBatch.CheckIsComplete(UserCode); |
| | | } |
| | | |
| | | //重置工序 |
| | | ResetNode(); |
| | | return action; |
| | |
| | | return action; |
| | | } |
| | | action.Data = CurBatch.GetNodeDefects(PostCode); |
| | | //action.Data = new List<DefectOutput> { new DefectOutput { DFTG_CODE = "111111"} }; |
| | | //action.Data = new List<DefectOutput> { new DefectOutput { DFTG_CODE = "222222" } }; |
| | | return action; |
| | | } |
| | | |