服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-11-25 eb64567d5da7d6a5c80b7579b486234b89b0e6ee
Tiger.Business.MES/Transaction/YadaPacking.cs
@@ -11,6 +11,8 @@
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
{
@@ -64,10 +66,11 @@
                {
                    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")
                {
@@ -381,6 +384,21 @@
                    //设置当前指令为正常产品过站
                    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)
                    {
@@ -424,6 +442,7 @@
                        wipSN.SEGMENT = curNode.SEGMENT;
                        wipSN.OPERATION_TIME = DateTime.Now;
                        wipSN.SHIPPING_ORDER = ShippingOrder;
                        wipSN.UNBIND_FLAG = "N";
                        var curShiftPeriod = GetShiftPeriodForNow();
                        if (!curShiftPeriod.IsNullOrEmpty())
                        {