コード例 #1
0
        public long InsertPalettesAtAddresses(MachineTask completedMachineTask, ProductionNotification prodNotif)
        {
            PalletsAtAddress palletsAtAddress = new PalletsAtAddress
            {
                AddressId = 0,//
                ProductionNotificationId = completedMachineTask.ProductNotificationId,
                ProductId      = prodNotif.ProductId,
                DistanceToExit = 80000,
                AddressCode    = completedMachineTask.TargetAddress,
                PaletteBarcode = completedMachineTask.LoadInfo,
                BoxQuantity    = prodNotif.BoxQuantity,
                Lot            = prodNotif.Lot,
                EntryDate      = DateTime.Now,
                EntryReason    = "ProductionNotification",
                ReleaseDate    = null,
                ReleaseReason  = null,
                IsInside       = true
            };


            long identity;

            using (var conn = new SqlConnection(conStr))
            {
                conn.Open();
                identity = conn.Insert(palletsAtAddress);
                conn.Close();
            }
            return(identity);
        }
        public long InsertProductionNotification(ProductionNotification productionNotification)
        {
            long identity;

            using (var conn = new SqlConnection(conStr))
            {
                conn.Open();
                identity = conn.Insert(productionNotification);
                conn.Close();
            }
            return(identity);
        }
コード例 #3
0
        private static string SelectRelatedAppropiriateAddress(ProductionNotification item)
        {
            AddressData addressData = new AddressData();

            return(addressData.SelectRelatedAppropiriateAddress(item.ProductId));
        }
コード例 #4
0
        private static void CreatingTasks(ProductionNotification item)
        {
            List <MachineTask> machineTasks = new List <MachineTask>();

            machineTasks.Add(new MachineTask
            {
                TaskBatch     = item.Id,
                Sequence      = 1,
                MachineCode   = "ASRS_WH_IN",
                SourceType    = "ADDRESS",
                SourceAddress = asrsList.First(x => x.Location == "WH_IN").LastAddress, //adresi çek ve güncelle
                LoadInfo      = "",                                                     //üzerinde yük yok sadece yer değiştirecek, ilk adım, yinede barkod bilgisi yazılabilir
                TargetType    = "CONVEYOR",
                TargetAddress = "WH_IN_1",                                              //ilk adım için konveyor kodu.
                AssignUser    = "******",
                AssignReason  = "STANDART",
                AssignTime    = item.NotificationTime,
                StartTime     = null,
                EndTime       = null,
                IsCompleted   = false,
                ErrorCode     = ""
            });

            machineTasks.Add(new MachineTask
            {
                TaskBatch     = item.Id,
                Sequence      = 2,
                MachineCode   = "ASRS_WH_IN",
                SourceType    = "CONVEYOR",
                SourceAddress = "WH_IN_1",
                LoadInfo      = item.PaletteBarcode, //Üzerine alma işlemi
                TargetType    = "ASRS",
                TargetAddress = "ASRS_WH_IN",
                AssignUser    = "******",
                AssignReason  = "STANDART",
                AssignTime    = item.NotificationTime,
                StartTime     = null,
                EndTime       = null,
                IsCompleted   = false,
                ErrorCode     = ""
            });

            machineTasks.Add(new MachineTask
            {
                TaskBatch     = item.Id,
                Sequence      = 3,
                MachineCode   = "ASRS_WH_IN",
                SourceType    = "ASRS",
                SourceAddress = "ASRS_WH_IN",
                LoadInfo      = item.PaletteBarcode,
                TargetType    = "ADDRESS",
                TargetAddress = SelectRelatedAppropiriateAddress(item),
                AssignUser    = "******",
                AssignReason  = "STANDART",
                AssignTime    = item.NotificationTime,
                StartTime     = null,
                EndTime       = null,
                IsCompleted   = false,
                ErrorCode     = ""
            });

            //task insert
            MachineTasksData machineTasksData = new MachineTasksData();

            machineTasksData.InsertMachineTaskBatch(machineTasks);


            //asrs update
            Asrs asrsForUpdt = asrsList.First(x => x.Location == "WH_IN");

            asrsForUpdt.LastAddress = machineTasks.LastOrDefault().TargetAddress;
            log.Info("asrs son adresi  :  " + asrsForUpdt.LastAddress);
            UpdateAsrsLastAddress(asrsForUpdt);
        }