コード例 #1
0
        /// <summary>
        /// 临时取物,需等待其他的车厅作业全部完成才允许添加
        /// </summary>
        /// <param name="iccode"></param>
        /// <param name="hall_ID"></param>
        /// <returns></returns>
        public int TempGetCar(string iccode, int hall_ID)
        {
            CICCard iccd = new CWICCard().SelectByUserCode(iccode);

            if (iccd == null)
            {
                return(109);
            }
            if (iccd.Status == CICCard.EnmICCardStatus.Disposed || iccd.Status == CICCard.EnmICCardStatus.Lost)
            {
                return(110);
            }
            CLocation lct = new CWLocation().SelectLctFromICCode(iccode);  //依存车卡号查询存车位

            if (lct == null)
            {
                return(101);
            }
            CSMG hall = new CWSMG().SelectSMG(hall_ID);

            if (hall.HallType != CSMG.EnmHallType.EnterorExit) //车厅类型
            {
                return(102);
            }
            if (!new CWSMG().CheckHallMode(hall.ID))    //判断车厅模式
            {
                return(103);
            }
            if (!new CWSMG().CheckAcceptNewCommand(hall.ID))  //车厅是否可接收新指令
            {
                return(104);
            }
            CMasterTask mtsk = new CWTask().GetMasterTaskFromICCode(iccode);

            if (mtsk != null)
            {
                return(105);    //该卡正在作业
            }
            int GetCarCount = new CWTask().GetMasterTaskNumOfHid(hall.ID, CMasterTask.EnmMasterTaskType.GetCar);

            if (GetCarCount > 0)
            {
                return(106);   //需待其他车厅的取车作业完成才允许添加
            }

            int rit = new CWTask().OTemp_GetCar(hall.ID, hall.Address, iccd, lct);

            return(rit);
        }
コード例 #2
0
        /// <summary>
        /// 临时卡取车-界面收费出车
        /// </summary>
        /// <param name="hallID">车厅号</param>
        /// <returns></returns>
        public int OCreateTempICcardGetCar(string iccode, out int hallID)
        {
            hallID = 0;
            CICCard iccd = new CWICCard().SelectByUserCode(iccode);

            if (iccd.Status == CICCard.EnmICCardStatus.Lost || iccd.Status == CICCard.EnmICCardStatus.Disposed)
            {
                return(107);
            }
            CLocation lct = new CWLocation().SelectLctFromICCode(iccode);  //依存车卡号查询车位

            if (lct == null)
            {
                return(101);  //该卡没有存车
            }
            CWSMG wsmg = new CWSMG();

            CSMG[] etvs  = wsmg.SelectSMGsOfType(CSMG.EnmSMGType.ETV);
            CSMG[] halls = wsmg.SelectSMGsCanGetCar(); //选择模式为进出、出车且可用的车厅集合

            CSMG etv;                                  //所选ETV
            CSMG hall;                                 //所选Hall

            //分配车厅、ETV
            new IEGBLL.AllocateETV.GetFeeOutAllocate().AllocateEtvAndHall(etvs, halls, lct, out etv, out hall);
            if (etv == null || hall == null)
            {
                return(102);   //没有可用的ETV或车厅
            }
            //车厅模式
            if (!wsmg.CheckHallMode(hall.ID))
            {
                return(103);
            }
            //ETV模式
            if (!wsmg.CheckEtvMode(etv.ID))
            {
                return(104);
            }
            CMasterTask mtsk = motsk.GetMasterTaskFromICCode(iccode);

            if (mtsk != null)
            {
                return(105); //当前卡号正在实行
            }
            int getCarCount = motsk.GetMTskCountFromHall(hall.ID, CMasterTask.EnmMasterTaskType.GetCar);

            if (getCarCount > CWData.MaxGetCarCount)
            {
                return(106); //当前作业已满
            }

            string mse = "收费出车- 分配ETV" + etv.ID + "  取车位:" + lct.Address + "  出车厅:" + hall.ID;

            new CWSException(mse, 0);

            string etvAddrs = wsmg.GetEtvCurrAddress(etv.ID);

            //生成作业
            motsk.OTempICcdGetCar(hall.ID, etv.ID, iccode, hall.Address, lct, etvAddrs);

            hallID = hall.ID;
            return(100);
        }
コード例 #3
0
        /// <summary>
        /// 手动指令创建
        /// </summary>
        public int CreateManageMasterTask(string frLct, string toLct, CMasterTask.EnmMasterTaskType mtskType, out int hallID)
        {
            try
            {
                hallID = 0;
                //int count = new CWTask().GetAllMasterTaskCount();
                //if (count > 0)
                //{
                //    return 101;  //只有库内无作业时才能允许建立手动作业
                //}

                CWLocation wlct = new CWLocation();
                CLocation  flct = wlct.SelectLctFromAddrs(frLct);
                CLocation  tlct = wlct.SelectLctFromAddrs(toLct);
                if (flct == null || tlct == null)
                {
                    return(102);  //请输入正确的源地址及目的地址
                }

                if (mtskType == CMasterTask.EnmMasterTaskType.Move || mtskType == CMasterTask.EnmMasterTaskType.Transpose)
                {
                    return(new CWTask().CreateManualTask(flct, tlct, null, mtskType));
                }
                else if (mtskType == CMasterTask.EnmMasterTaskType.GetCar)
                {
                    if (tlct.Type == CLocation.EnmLocationType.Hall)
                    {
                        CSMG hall = new CWSMG().SelectHallFromAddress(tlct.Address);
                        if (hall != null)
                        {
                            hallID = hall.ID - 10;
                            if (new CWSMG().CheckHallMode(hall.ID) == false)  //车厅为全自动
                            {
                                return(105);
                            }
                            if (hall.HallType == CSMG.EnmHallType.Exit || hall.HallType == CSMG.EnmHallType.EnterorExit)
                            {
                                return(new CWTask().CreateManualTask(flct, tlct, hall, mtskType));
                            }
                            else
                            {
                                return(104); //所选车厅不是出车厅
                            }
                        }
                        else
                        {
                            return(103);
                        }
                    }
                    else
                    {
                        return(103);  //目的地必须是车厅
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(0);
        }