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;
            //}
            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.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cbAddress.SelectedIndex == -1)
            {
                MessageBox.Show("请选择入口地址");
                return;
            }
            if (tbChooseName.Tag == null)
            {
                MessageBox.Show("请选择品牌");
                return;
            }
            if (tbRfid.Text == "")
            {
                MessageBox.Show("请输入Rfid");
                return;
            }
            INF_JOBDOWNLOAD job = new INF_JOBDOWNLOAD();

            job.SOURCE = address[cbAddress.SelectedIndex];
            job.TARGET = AtsCellInService.getCellNoCode(tbChooseName.Tag.ToString());//储位地址
            if (job.TARGET == "")
            {
                MessageBox.Show("获取储位信息失败");
                return;
            }
            job.PLANQTY    = int.Parse(tbNum.Text);
            job.JOBTYPE    = 30;//成品入库
            job.PRIORITY   = 50;
            job.CREATEDATE = DateTime.Now;
            job.BRANDID    = tbChooseName.Tag.ToString();
            job.TUTYPE     = 4;
            job.INPUTTYPE  = 10;
            String palletNo = RefRFIDPalletService.GetSeq() + "";// RefRFIDPalletService.GetPallet(tbRfid.Text);

            job.BARCODE = palletNo;
            if (palletNo == "E")
            {
                MessageBox.Show("该托盘已在使用,请确认Rfid是否输入正确");
                return;
            }
            if (cbcDuo.Checked)
            {
                job.CDTYPE = 10;
            }
            else
            {
                job.CDTYPE = 0;
            }

            //  InfJobDownLoadService.InsertEntity(job);
            using (TransactionScope ts = new TransactionScope())
            {
                InfJobDownLoadService.InsertEntity(job);

                //InBoundLineService.Update(entity.INBOUNDDETAILID, 0, num ?? 0);
                AtsCellService.UpdateAtsCell(job.TARGET, 30);//更新cellno状态
                T_WMS_ATSCELLINFO info = new T_WMS_ATSCELLINFO();
                info.PALLETNO   = palletNo;
                info.DISMANTLE  = 1;
                info.CELLNO     = job.TARGET;
                info.STATUS     = 10;//组盘
                info.CREATETIME = DateTime.Now;
                //info.INBOUNDID = inboundid;
                if (cbcDuo.Checked)
                {
                    info.DISMANTLE = 10;
                }
                else
                {
                    info.DISMANTLE = 0;
                }
                AtsCellInfoService.InsertAtsCellInfo(info);

                T_WMS_ATSCELLINFO_DETAIL detail = new T_WMS_ATSCELLINFO_DETAIL();
                detail.BARCODE       = tbChooseName.Tag.ToString();
                detail.CIGARETTECODE = ItemService.GetItemByBarCode(detail.BARCODE).ITEMNO;
                detail.CIGARETTENAME = tbChooseName.Text;
                detail.QTY           = decimal.Parse(tbNum.Text);
                detail.CELLNO        = info.CELLNO;

                AtsCellInfoDetailService.InsertAtsCellInfo(detail);
                ts.Complete();
                WriteLog.GetLog().Write("储位明细信息状态:10 储位号:" + job.TARGET);
            }
            //MessageBox.Show("入库完成");

            //InfJobDownLoadService.InsertEntity(job);
            //using (TransactionScope ts = new TransactionScope())
            //{
            //    InfJobDownLoadService.InsertEntity(job);

            //    //InBoundLineService.Update(entity.INBOUNDDETAILID, 0, num ?? 0);
            //    AtsCellService.UpdateAtsCell(job.TARGET,30);//更新cellno状态
            //    T_WMS_ATSCELLINFO info = new T_WMS_ATSCELLINFO();
            //    info.PALLETNO = palletNo;
            //    info.DISMANTLE = 1;
            //    info.CELLNO = job.TARGET;
            //    info.STATUS = 10;//组盘
            //    info.CREATETIME = DateTime.Now;
            //    //info.INBOUNDID = inboundid;
            //    if (cbcDuo.Checked)
            //    {
            //        info.DISMANTLE = 10;
            //    }
            //    else
            //    {
            //        info.DISMANTLE = 0;
            //    }
            //    AtsCellInfoService.InsertAtsCellInfo(info);

            //    T_WMS_ATSCELLINFO_DETAIL detail = new T_WMS_ATSCELLINFO_DETAIL();
            //    detail.CIGARETTECODE = tbChooseName.Tag.ToString();
            //    detail.CIGARETTENAME = tbChooseName.Text;
            //    detail.QTY = decimal.Parse(tbNum.Text);
            //    detail.PALLETNO = info.PALLETNO;
            //    AtsCellInfoDetailService.InsertAtsCellInfo(detail);
            //    ts.Complete();
            //}
            MessageBox.Show("任务已下达");
            updateListBox(job.JOBID + "号任务已下达;入口地址:" + job.SOURCE);
            WriteLog.GetLog().Write(job.JOBID + "号任务已下达;入口地址:" + job.SOURCE);
            tbChooseName.Text = "";
            tbChooseName.Tag  = null;
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (jobid != null && jobid != "0")
            {
                //InBound.INF_JOBFEEDBACK request = new InBound.INF_JOBFEEDBACK();
                ////request.ID = Guid.NewGuid().ToString("N");
                //request.JOBID = jobid;
                //request.FEEDBACKSTATUS = 99;
                //request.ERRORCODE = "OK";
                //request.ENTERDATE = DateTime.Now;
                ////  request.STATUS = 0;
                //InfFeedBackService.InsertEntity(request);


                //T_WMS_ATSCELLINFO cellInfo = AtsCellInfoService.CheckPalletExist(temptask.BARCODE);//检查托盘号是否存在
                //T_WMS_ATSCELLINFO_DETAIL detail = AtsCellInfoDetailService.GetDetail(cellInfo.CELLNO);
                //if (detail.REQUESTQTY == detail.QTY) //&& (cellInfo.DISMANTLE==0)
                //{
                //    INF_JOBDOWNLOAD task1 = new INF_JOBDOWNLOAD();
                //    task1.JOBID = dataEntity.ExecuteStoreQuery<decimal>("select s_inf_jobdownload.nextval from dual").First() + "";
                //    task1.ID = task1.JOBID;
                //    task1.BRANDID = temptask.BRANDID;
                //    task1.BARCODE = cellInfo.PALLETNO;
                //    task1.SOURCE = temptask.EQUIPMENTID;
                //    task1.PLANQTY = 1;
                //    task1.INPUTTYPE = 10;
                //    task1.JOBTYPE = 100;//空托盘回收任务
                //    task1.TARGET = "1422";//空托盘指定地址
                //    task1.TUTYPE = 2;
                //    task1.CREATEDATE = DateTime.Now;
                //    task1.PRIORITY = 50;
                //    dataEntity.INF_JOBDOWNLOAD.AddObject(task1);

                //}
                // INF_EQUIPMENTREQUEST request = InfEquipmentRequestService.GetEquipMentRequest(jobid);
                INF_JOBDOWNLOAD          download = InfJobDownLoadService.GetDetail(jobid);
                T_WMS_ATSCELLINFO        cellInfo = AtsCellInfoService.GetCellInfoByBarCode(download.BARCODE);
                T_WMS_ATSCELLINFO_DETAIL detail   = AtsCellInfoDetailService.GetDetail(cellInfo.CELLNO);

                using (TransactionScope ts = new TransactionScope())
                {
                    if (detail.REQUESTQTY != detail.QTY)
                    {
                        INF_JOBDOWNLOAD task1 = new INF_JOBDOWNLOAD();
                        // task1.JOBID = dataEntity.ExecuteStoreQuery<decimal>("select s_inf_jobdownload.nextval from dual").First() + "";
                        // task1.ID = task.JOBID;
                        task1.BRANDID    = detail.BARCODE;
                        task1.BARCODE    = cellInfo.PALLETNO;
                        task1.SOURCE     = "1415";
                        task1.PLANQTY    = detail.QTY - detail.REQUESTQTY;
                        task1.INPUTTYPE  = 10;
                        task1.JOBTYPE    = 40;//返库任务
                        task1.TARGET     = AtsCellInService.getCellNoCode(download.BRANDID + "");
                        task1.TUTYPE     = 4;
                        task1.PRIORITY   = 50;
                        task1.STATUS     = 0;
                        task1.CREATEDATE = DateTime.Now;
                        InfJobDownLoadService.InsertEntity(task1);

                        T_WMS_ATSCELLINFO info = new T_WMS_ATSCELLINFO();
                        info.PALLETNO = cellInfo.PALLETNO;
                        // info.DISMANTLE = 1;
                        info.CELLNO     = task1.TARGET;
                        info.STATUS     = 10;//组盘
                        info.CREATETIME = cellInfo.CREATETIME;
                        info.INBOUNDID  = cellInfo.INBOUNDID;
                        //task.TUTYPE = 4;
                        info.DISMANTLE = 0;

                        AtsCellInfoService.InsertAtsCellInfo(info);

                        T_WMS_ATSCELLINFO_DETAIL details = new T_WMS_ATSCELLINFO_DETAIL();
                        details.BARCODE = detail.BARCODE;
                        T_WMS_ITEM item = ItemService.GetItemByBarCode(details.BARCODE);
                        details.CIGARETTECODE = item.ITEMNO;
                        details.CIGARETTENAME = item.ITEMNAME;
                        details.QTY           = task1.PLANQTY;
                        details.CELLNO        = info.CELLNO;
                        AtsCellInfoDetailService.InsertAtsCellInfo(details);
                    }
                    AtsCellService.UpdateAtsCell(detail.CELLNO, 10);
                    AtsCellInfoService.delete(detail.CELLNO);
                    AtsCellInfoDetailService.delete(detail.CELLNO);
                    InfJobDownLoadService.UpdateJopDownLoad(jobid, 3);
                    //  InfEquipmentRequestService.UpdateEquipMentRequest(jobid, 1);
                    ts.Complete();
                }
                search();
            }
            else
            {
                MessageBox.Show("请选择记录");
            }
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cbAddress.SelectedIndex == -1)
            {
                MessageBox.Show("请选择入口地址");
                return;
            }
            if (tbChooseName.Tag == null)
            {
                MessageBox.Show("请选择品牌");
                return;
            }
            if (tbRfid.Text == "")
            {
                MessageBox.Show("请输入Rfid");
                return;
            }
            decimal fullCount = ItemService.GetItemByCode(cigaretteCode).FULLCOUNT ?? 0;

            if (decimal.Parse(tbNum.Text) > fullCount)
            {
                MessageBox.Show("入库数量不能大于满托盘数量");
                return;
            }
            using (TransactionScope ts = new TransactionScope())
            {
                INF_JOBDOWNLOAD job = new INF_JOBDOWNLOAD();

                job.SOURCE = address[cbAddress.SelectedIndex];
                job.TARGET = AtsCellInService.getCellNoCode(cigaretteCode);//储位地址
                if (job.TARGET == "")
                {
                    MessageBox.Show("获取储位信息失败,请联系管理员");
                    return;
                }
                job.PLANQTY    = int.Parse(tbNum.Text);
                job.JOBTYPE    = 42;//返库
                job.PRIORITY   = 50;
                job.CREATEDATE = DateTime.Now;
                job.BRANDID    = tbChooseName.Tag.ToString();
                job.TUTYPE     = 4;
                job.INPUTTYPE  = 10;
                job.TASKNO     = taskNo;
                //job.EXTATTR1 = dataGridView1.SelectedRows[0].Cells[4].Value.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);
                AtsCellService.UpdateAtsCell(job.TARGET, 30);

                T_WMS_ATSCELLINFO info = new T_WMS_ATSCELLINFO();
                info.PALLETNO = job.BARCODE;


                info.CELLNO     = job.TARGET;
                info.STATUS     = 10;//组盘
                info.CREATETIME = DateTime.Now;

                info.DISMANTLE = job.CDTYPE;

                AtsCellInfoService.InsertAtsCellInfo(info);
                AtsCellOutService.UpdateObjectThd(taskNo, job.PLANQTY ?? 0);
                T_WMS_ATSCELLINFO_DETAIL detail = new T_WMS_ATSCELLINFO_DETAIL();
                detail.BARCODE = job.BRANDID;

                T_WMS_ITEM item = ItemService.GetItemByBarCode(detail.BARCODE);

                detail.CIGARETTECODE = item.ITEMNO;
                detail.CIGARETTENAME = item.ITEMNAME;
                detail.QTY           = job.PLANQTY;
                detail.CELLNO        = info.CELLNO;
                AtsCellInfoDetailService.InsertAtsCellInfo(detail);
                ts.Complete();
                MessageBox.Show("入库任务下达完成");
            }
            search();
            tbChooseName.Text = "";
            tbChooseName.Tag  = null;
        }