| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Entitys.MES.Position; |
| | | using Tiger.Business.MES.WorkAction; |
| | | using Tiger.Model.MES.Yada; |
| | | using System.Data; |
| | | |
| | | namespace Tiger.Business.MES.Transaction |
| | | { |
| | |
| | | { |
| | | IsPrintCustomerLabel = input.Options["IsPrintCustomerLabel"].ToBoolean(); |
| | | } |
| | | if (input.Options.ContainsKey("ShippingOrder")) |
| | | { |
| | | ShippingOrder = IsPrintCustomerLabel ? input.Options["ShippingOrder"].ToString() : ""; |
| | | } |
| | | |
| | | //if (input.Options.ContainsKey("ShippingOrder")) |
| | | //{ |
| | | // ShippingOrder = IsPrintCustomerLabel ? input.Options["ShippingOrder"].ToString() : ""; |
| | | //} |
| | | //PkgSubmit:手动结束包装,手动保存暂存的包装数据 |
| | | if (NodeCmd == "PkgSubmit") |
| | | { |
| | |
| | | //设置当前指令为正常产品过站 |
| | | NodeCmd = "NodeSubmit"; |
| | | |
| | | //获取出货状态 |
| | | DbClient db = Biz.DataSource["YadaU9C"].Client; |
| | | var ship = db.Queryable<mes_ShipList>().Where(q => q.MoDoc == CurBatch.WO.ORDER_NO && q.Status == 2 && SqlFunc.DateIsSame(q.BusinessDate, DateTime.Now)).First(); |
| | | if (ship.IsNullOrEmpty()) { IsPrintCustomerLabel = false; } else |
| | | { |
| | | SugarParameter[] pars = Biz.Db.Ado.GetParameters(new { BATCH = CurBatch.Batch.BATCH_NO, NodeIdOrName = curNode.NODE_NAME }); |
| | | var list = Biz.Db.Ado.UseStoredProcedure().GetDataTable("SP_MES_GET_NODE_BATCH_COUNT", pars).AsEnumerable().ToList(); |
| | | if (!list.IsNullOrEmpty()) |
| | | { |
| | | var batchCount = list.Where(q => q["ProdDate"].ToString() == "Whole").FirstOrDefault(); |
| | | IsPrintCustomerLabel = batchCount.IsNullOrEmpty() ? false : batchCount["WaitShipment"].ToInt32() >= ship.ShipQty ? false : true; |
| | | } |
| | | } |
| | | ShippingOrder = IsPrintCustomerLabel ? ship?.ShipDoc ?? "" : ""; |
| | | |
| | | //绑定条码到工单 |
| | | foreach (var wipSN in wipSNs) |
| | | { |
| | |
| | | wipSN.SEGMENT = curNode.SEGMENT; |
| | | wipSN.OPERATION_TIME = DateTime.Now; |
| | | wipSN.SHIPPING_ORDER = ShippingOrder; |
| | | wipSN.UNBIND_FLAG = "N"; |
| | | var curShiftPeriod = GetShiftPeriodForNow(); |
| | | if (!curShiftPeriod.IsNullOrEmpty()) |
| | | { |