Ejemplo n.º 1
0
        // 发送堆垛机命令
        public void sendTask()
        {
            //tbCode.BeginInvoke(new UpdateTextBox(Uptb), i+"");
            //i++;

            T_WMS_INBOUND_LINE entity = InBoundLineService.GetItemByID(int.Parse(((List <String>)tbChooseName.Tag)[1].ToString()));
            decimal?           num    = 0;

            num = decimal.Parse(tbNum.Text);
            INF_JOBDOWNLOAD job = new INF_JOBDOWNLOAD();

            job.SOURCE     = address[CBAddress.SelectedIndex];
            job.PLANQTY    = num;
            job.JOBTYPE    = 1;//入库任务
            job.PRIORITY   = 50;
            job.CREATEDATE = DateTime.Now;
            job.BRANDID    = ((List <String>)tbChooseName.Tag)[0].ToString();
            job.TUTYPE     = 1;
            using (TransactionScope ts = new TransactionScope())
            {
                InfJobDownLoadService.InsertEntity(job);
                InBoundLineService.Update(entity.INBOUNDDETAILID, 0, num ?? 0);
                ts.Complete();
            }
            //if (entity.BOXQTY - entity.ABOXQTY > 30)
            //{
            //    num = 30;
            //}
            //else
            //{
            //    num = entity.BOXQTY - entity.ABOXQTY;
            //}

            //T_WMS_INOUTBOUND_TASK task = new T_WMS_INOUTBOUND_TASK();
            //task.SOURCEADD = "";
            //task.TARGETADD = "";
            //task.TASKTYPE = 10;
            //task.CIGARETTECODE = entity.CIGARETTECODE;
            //task.CIGARETTENAME = entity.CIGARETTENAME;
            //task.QTY = num;
            //task.INBOUNDLINEID = entity.INBOUNDDETAILID;
            //using (TransactionScope ts = new TransactionScope())
            //{
            //    InOutBoundTaskService.Insert(task);
            //    InBoundLineService.Update(entity.INBOUNDDETAILID, num ?? 0);
            //    ts.Complete();
            //}
            this.BeginInvoke(new SearchHanlder(search));
            searchTask();
        }
Ejemplo n.º 2
0
        public void sendTask()
        {
            //List<T_WMS_INBOUND_LINE> list = InBoundLineService.GetItem(inboundid);
            //if (list != null && list.Count > 0)
            //{
            //    using (TransactionScope ts = new TransactionScope())
            //    {
            //        foreach (var item in list)
            //        {
            //            INF_JOBDOWNLOAD job = new INF_JOBDOWNLOAD();
            //            CBAddress.BeginInvoke(new getIndex(getCBSelectIndex));
            //            job.SOURCE = address[selectIndex];
            //            job.PLANQTY = item.BOXQTY;
            //            job.JOBTYPE = 1;//入库任务
            //            job.PRIORITY = 50;
            //            job.CREATEDATE = DateTime.Now;
            //            job.BRANDID = decimal.Parse(item.CIGARETTECODE);
            //            job.TUTYPE = 1;

            //            InfJobDownLoadService.InsertEntity(job);
            //            InBoundLineService.Update(item.INBOUNDDETAILID, 0, item.BOXQTY??0);
            //        }
            //        InBoundService.Update(inboundid, "20");
            //        ts.Complete();
            //    }
            //}
            T_WMS_INBOUND_LINE entity = InBoundLineService.GetItemByID(int.Parse(((List <String>)tbChooseName.Tag)[0].ToString()));
            decimal?           num    = 0;

            num = decimal.Parse(tbNum.Text);
            // if (num > (entity.BOXQTY - entity.LOCKQTY))
            //{
            //    MessageBox.Show("任务数量超出入库单数量,请修正.");
            //    return;
            //}
            INF_JOBDOWNLOAD job = new INF_JOBDOWNLOAD();
            // CBAddress.BeginInvoke(new getIndex(getCBSelectIndex));
            T_WMS_ITEM item = ItemService.GetItemByBarCode(((List <String>)tbChooseName.Tag)[0].ToString());

            job.SOURCE    = "1217";// address[selectIndex];
            job.FULLCOUNT = item.FULLCOUNT;
            job.PILETYPE  = decimal.Parse(item.DXTYPE);
            job.TARGET    = AtsCellInService.getCellNo(((List <String>)tbChooseName.Tag)[0].ToString());//储位地址
            if (job.TARGET == "")
            {
                MessageBox.Show("获取储位信息失败");
                return;
            }
            job.PLANQTY    = num;
            job.JOBTYPE    = 20;//入库任务
            job.PRIORITY   = 50;
            job.CREATEDATE = DateTime.Now;
            job.BRANDID    = ((List <String>)tbChooseName.Tag)[0].ToString();
            job.TUTYPE     = 4;
            job.INPUTTYPE  = 10;
            job.INBOUNDNO  = int.Parse(((List <String>)tbChooseName.Tag)[1].ToString());
            String palletNo = RefRFIDPalletService.GetPallet(tbRfid.Text);

            if (palletNo == "E")
            {
                MessageBox.Show("该托盘已在使用,请确认Rfid是否输入正确");
                return;
            }
            job.BARCODE = palletNo;
            if (cbcDuo.Checked)
            {
                job.CDTYPE = 10;
            }
            else
            {
                job.CDTYPE = 0;
            }
            InfJobDownLoadService.InsertEntity(job); //插入任务
            InBoundLineService.Update(job.INBOUNDNO ?? 0, 0, job.PLANQTY ?? 0);
            T_WMS_ATSCELLINFO info = new T_WMS_ATSCELLINFO();

            info.PALLETNO = job.BARCODE;
            // info.DISMANTLE = 1;
            info.CELLNO     = job.TARGET;
            info.STATUS     = 10;//上架
            info.CREATETIME = DateTime.Now;
            info.INBOUNDID  = job.INBOUNDNO;

            info.DISMANTLE = 10;

            AtsCellInfoService.InsertAtsCellInfo(info);

            T_WMS_ATSCELLINFO_DETAIL detail = new T_WMS_ATSCELLINFO_DETAIL();

            detail.CIGARETTECODE = ItemService.GetItemByBarCode(job.BRANDID).ITEMNO;
            detail.CIGARETTENAME = ItemService.GetItemByBarCode(job.BRANDID).ITEMNAME;
            detail.BARCODE       = job.BRANDID;
            detail.QTY           = job.PLANQTY;
            detail.CELLNO        = info.CELLNO;
            AtsCellInfoDetailService.InsertAtsCellInfo(detail);
            MessageBox.Show("任务已下达");
            WriteLog.GetLog().Write(job.JOBID + "号任务已下达;入口地址:" + job.SOURCE);
            searchTask();
            initText();
        }
Ejemplo n.º 3
0
        // 发送堆垛机命令
        public void sendTask()
        {
            //List<T_WMS_INBOUND_LINE> list = InBoundLineService.GetItem(inboundid);
            //if (list != null && list.Count > 0)
            //{
            //    using (TransactionScope ts = new TransactionScope())
            //    {
            //        foreach (var item in list)
            //        {
            //            INF_JOBDOWNLOAD job = new INF_JOBDOWNLOAD();
            //            CBAddress.BeginInvoke(new getIndex(getCBSelectIndex));
            //            job.SOURCE = address[selectIndex];
            //            job.PLANQTY = item.BOXQTY;
            //            job.JOBTYPE = 1;//入库任务
            //            job.PRIORITY = 50;
            //            job.CREATEDATE = DateTime.Now;
            //            job.BRANDID = decimal.Parse(item.CIGARETTECODE);
            //            job.TUTYPE = 1;

            //            InfJobDownLoadService.InsertEntity(job);
            //            InBoundLineService.Update(item.INBOUNDDETAILID, 0, item.BOXQTY??0);
            //        }
            //        InBoundService.Update(inboundid, "20");
            //        ts.Complete();
            //    }
            //}
            T_WMS_INBOUND_LINE entity = InBoundLineService.GetItemByID(int.Parse(((List <String>)tbChooseName.Tag)[0].ToString()));
            decimal?           num    = 0;

            num = decimal.Parse(tbNum.Text);
            if (num > (entity.BOXQTY - entity.LOCKQTY))
            {
                MessageBox.Show("任务数量超出入库单数量,请修正.");
                return;
            }
            int itemCount = ItemService.GetItemCountByBarCode(((List <String>)tbChooseName.Tag)[1].ToString());

            if (itemCount > 1)
            {
                MessageBox.Show("存在重复的件码,请联系管理员!");
                return;
            }

            INF_JOBDOWNLOAD job  = new INF_JOBDOWNLOAD();
            T_WMS_ITEM      item = ItemService.GetItemByBarCode(((List <String>)tbChooseName.Tag)[1].ToString());

            CBAddress.BeginInvoke(new getIndex(getCBSelectIndex));
            job.SOURCE     = address[CBAddress.SelectedIndex];
            job.TARGET     = "A1";
            job.PLANQTY    = num;
            job.JOBTYPE    = 10;//码垛任务
            job.PRIORITY   = 50;
            job.CREATEDATE = DateTime.Now;
            job.FULLCOUNT  = item.FULLCOUNT;
            job.PILETYPE   = decimal.Parse(item.DXTYPE);
            job.BRANDID    = ((List <String>)tbChooseName.Tag)[1].ToString();
            job.TUTYPE     = 1;//件箱
            job.INPUTTYPE  = 10;
            job.INBOUNDNO  = int.Parse(((List <String>)tbChooseName.Tag)[0].ToString());
            if (InfJobDownLoadService.CheckJobExist(job.INBOUNDNO ?? 0))
            {
                MessageBox.Show("任务已存在");
                return;
            }
            using (TransactionScope ts = new TransactionScope())
            {
                InfJobDownLoadService.InsertEntity(job);
                ts.Complete();
            }
            this.BeginInvoke(new SearchHanlder(search));
            searchTask();
            initText();
            MessageBox.Show("任务已下达");
            updateListBox(job.JOBID + "号任务已下达;入口地址:" + job.SOURCE);
            WriteLog.GetLog().Write(job.JOBID + "号任务已下达;入口地址:" + job.SOURCE);
        }