Ejemplo n.º 1
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);
        }
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    = address[selectIndex];
            job.FULLCOUNT = item.FULLCOUNT;
            job.PILETYPE  = decimal.Parse(item.DXTYPE);
            job.TARGET    = AtsCellInService.getCellNoCode(((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.GetSeq() + "";

            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;
            WriteLog.GetLog().Write("储位明细信息状态:10 储位号:" + job.TARGET);
            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);
            searchTask();
            initText();
            MessageBox.Show("任务已下达");
            updateListBox(job.JOBID + "号任务已下达;入口地址:" + job.SOURCE);
            WriteLog.GetLog().Write(job.JOBID + "号任务已下达;入口地址:" + job.SOURCE);
        }