| | |
| | | else |
| | | { |
| | | var wosn = Biz.Db.Queryable<BIZ_MES_WO_BATCH, BIZ_MES_WO_SN>((q, s) => new JoinQueryInfos(JoinType.Inner, q.ORDER_NO == s.WORK_ORDER)) |
| | | .ByAuth(input.AuthOption) |
| | | .Where((q, s) => s.SN == input.SN && q.ACT_LINE == CurLine.LINE_CODE && (q.STATUS == BIZ_MES_WO_BATCH.STATUSs.Release.GetValue() || q.STATUS == BIZ_MES_WO_BATCH.STATUSs.Working.GetValue())) |
| | | .Select((q, s) => new { Batch = q, SN = s }).First(); |
| | | .ByAuth(input.AuthOption).Where((q, s) => s.SN == input.SN).Select((q, s) => new { Batch = q, SN = s }).First(); |
| | | |
| | | //查找到条码已绑定的工单 |
| | | if (!wosn.IsNullOrEmpty()) |
| | | { |
| | | if (CurBatch?.Batch?.ORDER_NO != wosn.Batch.ORDER_NO) |
| | | if (wosn.Batch.ACT_LINE != CurLine.LINE_CODE) |
| | | { |
| | | //条码已绑定的工单不等于当前工单则重新选择工单 |
| | | var result = await SelectOrder(new() { AuthOption = input.AuthOption, OrderNo = wosn.Batch.ORDER_NO }); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = result.IsSuccessed; |
| | | action.LocaleMsg = result.LocaleMsg; |
| | | return action; |
| | | } |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"条码[{0}]已在产线[{1}]投入生产,请在正确岗位扫描"); |
| | | action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotCorrectLine", input.SN, wosn.Batch.ACT_LINE); |
| | | return action; |
| | | } |
| | | else |
| | | { |
| | | if (CurBatch?.Batch?.ORDER_NO != wosn.Batch.ORDER_NO) |
| | | { |
| | | //条码已绑定的工单不等于当前工单则重新选择工单 |
| | | var result = await SelectOrder(new() { AuthOption = input.AuthOption, OrderNo = wosn.Batch.ORDER_NO }); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = result.IsSuccessed; |
| | | action.LocaleMsg = result.LocaleMsg; |
| | | return action; |
| | | } |
| | | } |
| | | //条码过站 |
| | | action = NodeSubmit(action, input); |
| | | return action; |
| | | } |
| | | //条码过站 |
| | | action = NodeSubmit(action, input); |
| | | return action; |
| | | } |
| | | //查找不到条码已绑定的工单 |
| | | else |
| | |
| | | try |
| | | { |
| | | var curNode = CurBatch.GetNode(PostCode); |
| | | //判断工单实时状态判断 |
| | | var woStatus = CurBatch.CheckStatus(); |
| | | //判断工单实时状态判断是否可以生产 |
| | | var woStatus = CurBatch.CheckCanProduce(curNode); |
| | | if (!woStatus.IsSuccessed) |
| | | { |
| | | return woStatus; |
| | |
| | | db.Storageable(woSN, UserCode).ExecuteCommand(); |
| | | db.Storageable(wipSN, UserCode).ExecuteCommand(); |
| | | db.Storageable(CurWipSNHis, UserCode).ExecuteCommand(); |
| | | } |
| | | //如果是投入站 |
| | | if (curNode.IS_INPUT == "Y") |
| | | { |
| | | db.Updateable<BIZ_MES_WO>().SetColumns(q => q.INPUT_QTY == q.INPUT_QTY + 1).Where(q => q.ORDER_NO == CurBatch.WO.ORDER_NO).ExecuteCommand(); |
| | | db.Updateable<BIZ_MES_WO_BATCH>().SetColumns(q => q.INPUT_QTY == q.INPUT_QTY + 1).Where(q => q.BATCH_NO == CurBatch.Batch.BATCH_NO).ExecuteCommand(); |
| | | } |
| | | //如果是产出站 |
| | | if (curNode.IS_OUTPUT == "Y") |
| | | { |
| | | db.Updateable<BIZ_MES_WO>().SetColumns(q => q.OUTPUT_QTY == q.OUTPUT_QTY + 1).Where(q => q.ORDER_NO == CurBatch.WO.ORDER_NO).ExecuteCommand(); |
| | | db.Updateable<BIZ_MES_WO_BATCH>().SetColumns(q => q.OUTPUT_QTY == q.OUTPUT_QTY + 1).Where(q => q.BATCH_NO == CurBatch.Batch.BATCH_NO).ExecuteCommand(); |
| | | } |
| | | } |
| | | }; |
| | | Steps.Add(curStep); |
| | | |