1
dengjunjie
2025-03-18 9f225bb1f1e26d25c1652d3e1ec2a8f239f69615
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs
@@ -30,48 +30,45 @@
            _taskRepository = taskRepository;
            _routerService = routerService;
        }
        //static int i = 0;
        //static int i = 1;
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                //if (i < 1)
                //ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO()
                //{
                //    i++;
                //    ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO()
                //    {
                //        stationCode = "MDX01",
                //        traytype = 4,
                //        Barcode = "A0216",
                //        batchNo = "20250113T2",
                //    };
                //    var content = ProductionLineToWMSRequest(MaterielGroupDTO);
                //}
                //    stationCode = "MDX01",
                //    traytype = 4,
                //    Barcode = "25" + i.ToString("000000"),
                //    batchNo = "20250222T3",
                //};
                //var content = ProductionLineToWMSRequest(MaterielGroupDTO);
                //i++;
                #region MyRegion
                //OtherDevice ProductionLine = (OtherDevice)context.JobDetail.JobDataMap.Get("JobParams");
                //if (ProductionLine != null)
                //{
                //    var request = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.request);
                //    if (request == 1)
                //    {
                //        var traytype = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.trayType);
                //        //var content = Request(ProductionLine, traytype, ProductionLine.DeviceCode);
                //        if (traytype == 4)
                //        {
                //            var Barcode = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.trayBarcode);
                //            var batchNo = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.batchNo);
                //            ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO()
                //            {
                //                stationCode = ProductionLine.DeviceCode,
                //                traytype = traytype,
                //                Barcode = Barcode,
                //                batchNo = batchNo,
                //            };
                //            var content = ProductionLineToWMSRequest(MaterielGroupDTO);
                //            if (content.Status) ProductionLine.SetValue(ProductionLineDBName.Wrequest, 1);
                //        }
                //    }
                //}
                OtherDevice ProductionLine = (OtherDevice)context.JobDetail.JobDataMap.Get("JobParams");
                if (ProductionLine != null)
                {
                    var request = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.request);
                    if (request == 1)
                    {
                        var traytype = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.trayType);
                        //var content = Request(ProductionLine, traytype, ProductionLine.DeviceCode);
                        if (traytype == 4)
                        {
                            var Barcode = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.trayBarcode);
                            var batchNo = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.batchNo);
                            ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO()
                            {
                                stationCode = ProductionLine.DeviceCode,
                                traytype = traytype,
                                Barcode = Barcode,
                                batchNo = batchNo,
                            };
                            var content = ProductionLineToWMSRequest(MaterielGroupDTO);
                            if (content.Status) ProductionLine.SetValue(ProductionLineDBName.Wrequest, 1);
                        }
                    }
                }
                #endregion
                #region MyRegion
                //short[] shorts = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 };