dengjunjie
8 天以前 6d9829c889a826d39cbc911ef5d01825edd1bffc
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs
@@ -40,6 +40,7 @@
                OtherDevice ProductionLine = (OtherDevice)context.JobDetail.JobDataMap.Get("JobParams");
                if (ProductionLine != null)
                {
                    #region MyRegion
                    var request = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.request);
                    if (request == 1)
                    {
@@ -48,25 +49,33 @@
                        if (traytype == 4)
                        {
                            var Barcode = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.trayBarcode).Replace("\0", "");
                            var batchNo = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.batchNo).Replace("\0", "");
                            ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO()
                            if (string.IsNullOrEmpty(Barcode)) throw new Exception("产线申请托盘号为空!");
                            var task = _taskRepository.QueryFirst(x => x.PalletCode == Barcode);
                            if (task == null)
                            {
                                stationCode = ProductionLine.DeviceCode,
                                traytype = traytype,
                                Barcode = Barcode,
                                batchNo = batchNo,
                            };
                            var content = ProductionLineToWMSRequest(MaterielGroupDTO);
                            if (content.Status)
                                ProductionLine.SetValue(ProductionLineDBName.Wrequest, request);
                                var batchNo = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.batchNo).Replace("\0", "");
                                if (string.IsNullOrEmpty(batchNo)) throw new Exception("产线申请批号为空!");
                                WriteDebug($"{ProductionLine.DeviceName}申请入库", $"托盘号【{Barcode}】,批柜号【{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, request);
                            }
                        }
                    }
                    #endregion
                }
                #endregion
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(CommonProductionLineJob) + ":" + ex.ToString());
                //Console.Out.WriteLine(nameof(CommonProductionLineJob) + ":" + ex.ToString());
            }
            return Task.CompletedTask;
        }